Browse Source

test stuff

neal-sequoia-update-staging
parent
commit
61e64b17eb
3 changed files with 17 additions and 3 deletions
  1. +9
    -3
      test/src/BareEncryptShellTest.cc
  2. +6
    -0
      test/src/test_util.cc
  3. +2
    -0
      test/src/test_util.h

+ 9
- 3
test/src/BareEncryptShellTest.cc View File

@ -6,6 +6,7 @@
#include "test_util.h"
#include "TestConstants.h"
#include "Engine.h"
#include "mime.h"
#include <gtest/gtest.h>
@ -92,8 +93,13 @@ namespace {
TEST_F(BareEncryptShellTest, check_bare_encrypt_shell) {
char* outmsg = NULL;
string inmsg = slurp(message_to_encrypt);
PEP_STATUS status = MIME_encrypt_message(session, inmsg.c_str(), inmsg.size(), NULL, &outmsg, PEP_enc_auto, 0);
string inmsg_str = slurp(message_to_encrypt);
message* inmsg = NULL;
message* outmsg = NULL;
mime_decode_message(inmsg_str.c_str(), inmsg_str.size(), &inmsg, NULL);
PEP_STATUS status = encrypt_message(session, inmsg, NULL, &outmsg, PEP_enc_auto, 0);
update_identity(session, inmsg->from);
ASSERT_OK;
cout << message_to_str(outmsg);
}

+ 6
- 0
test/src/test_util.cc View File

@ -464,6 +464,12 @@ bool slurp_message_and_import_key(PEP_SESSION session, const char* message_fname
return ok;
}
char* message_to_str(message* msg) {
char* retval = NULL;
mime_encode_message(msg, false, &retval, false);
return retval;
}
int util_delete_filepath(const char *filepath,
const struct stat *file_stat,
int ftw_info,


+ 2
- 0
test/src/test_util.h View File

@ -113,6 +113,8 @@ bool slurp_and_import_key(PEP_SESSION session, const char* key_filename);
bool slurp_message_and_import_key(PEP_SESSION session, const char* message_fname, std::string& message, const char* key_filename);
char* message_to_str(message* msg);
int util_delete_filepath(const char *filepath,
const struct stat *file_stat,
int ftw_info,


Loading…
Cancel
Save