ENGINE-511: fixed file uris for decrypt_in_pieces krista-netpgp-sync
authorKrista Bennett <krista@pep.foundation>
Wed, 06 Feb 2019 18:21:04 +0100
branchkrista-netpgp-sync
changeset 3276c0b3430f1f1d
parent 3275 605b7535a148
ENGINE-511: fixed file uris for decrypt_in_pieces
src/message_api.c
test/Makefile
test/include/TestConstants.h
test/src/EngineTestIndividualSuite.cc
test/src/EngineTestSessionSuite.cc
test/src/EngineTestSuite.cc
test/src/SuiteMaker.cc
test/src/TestDriver.cc
test/src/engine_tests/AppleMailTests.cc
test/src/engine_tests/BCCTests.cc
test/src/engine_tests/BlacklistAcceptNewKeyTests.cc
test/src/engine_tests/BlacklistTests.cc
test/src/engine_tests/BloblistTests.cc
test/src/engine_tests/CaseAndDotAddressTests.cc
test/src/engine_tests/CheckRenewedExpiredKeyTrustStatusTests.cc
test/src/engine_tests/CrashdumpTests.cc
test/src/engine_tests/DecorateTests.cc
test/src/engine_tests/DecryptAttachPrivateKeyTrustedTests.cc
test/src/engine_tests/DecryptAttachPrivateKeyUntrustedTests.cc
test/src/engine_tests/EncryptAttachPrivateKeyTests.cc
test/src/engine_tests/EncryptForIdentityTests.cc
test/src/engine_tests/EncryptMissingPrivateKeyTests.cc
test/src/engine_tests/Engine358Tests.cc
test/src/engine_tests/Engine463Tests.cc
test/src/engine_tests/ExpiredSubkeyTests.cc
test/src/engine_tests/ExternalRevokeTests.cc
test/src/engine_tests/HeaderKeyImportTests.cc
test/src/engine_tests/I18nTests.cc
test/src/engine_tests/IdentityListTests.cc
test/src/engine_tests/KeyAttachmentTests.cc
test/src/engine_tests/KeyResetMessageTests.cc
test/src/engine_tests/KeyeditTests.cc
test/src/engine_tests/LeastColorGroupTests.cc
test/src/engine_tests/LeastCommonDenomColorTests.cc
test/src/engine_tests/MapAsn1Tests.cc
test/src/engine_tests/MessageApiTests.cc
test/src/engine_tests/MessageNullFromTests.cc
test/src/engine_tests/MessageTwoPointOhTests.cc
test/src/engine_tests/MimeTests.cc
test/src/engine_tests/NewUpdateIdAndMyselfTests.cc
test/src/engine_tests/PepSubjectReceivedTests.cc
test/src/engine_tests/PgpBinaryTests.cc
test/src/engine_tests/PgpListKeysTests.cc
test/src/engine_tests/ReencryptPlusExtraKeysTests.cc
test/src/engine_tests/RevokeRegenAttachTests.cc
test/src/engine_tests/SequenceTests.cc
test/src/engine_tests/SignOnlyTests.cc
test/src/engine_tests/SimpleBodyNotAltTests.cc
test/src/engine_tests/StringlistTests.cc
test/src/engine_tests/StringpairListTests.cc
test/src/engine_tests/SubkeyRatingEvalTests.cc
test/src/engine_tests/SyncTests.cc
test/src/engine_tests/TrustManipulationTests.cc
test/src/engine_tests/TrustwordsTests.cc
test/src/engine_tests/UserIDAliasTests.cc
test/src/engine_tests/UserIdCollisionTests.cc
test/src/pEpTestOutput.cc
test/src/pEpTestStatic.cc
test/src/util/test_util.cc
     1.1 --- a/src/message_api.c	Wed Feb 06 14:58:03 2019 +0100
     1.2 +++ b/src/message_api.c	Wed Feb 06 18:21:04 2019 +0100
     1.3 @@ -10,6 +10,7 @@
     1.4  #include "baseprotocol.h"
     1.5  #include "KeySync_fsm.h"
     1.6  #include "base64.h"
     1.7 +#include "resource_id.h"
     1.8  
     1.9  #include <assert.h>
    1.10  #include <string.h>
    1.11 @@ -267,14 +268,6 @@
    1.12          return uri + 3;
    1.13  }
    1.14  
    1.15 -// static bool is_file_uri(char* str) {
    1.16 -//     return(strncmp(str, "file://", 7) == 0);
    1.17 -// }
    1.18 -
    1.19 -static bool is_cid_uri(const char* str) {
    1.20 -    return(strncmp(str, "cid://", 6) == 0);
    1.21 -}
    1.22 -
    1.23  static bool string_equality(const char *s1, const char *s2)
    1.24  {
    1.25      if (s1 == NULL || s2 == NULL)
    1.26 @@ -2846,6 +2839,15 @@
    1.27                                          
    1.28              free_stringlist(_keylist);
    1.29  
    1.30 +            char* filename_uri = NULL;
    1.31 +
    1.32 +            bool has_uri_prefix = (pgp_filename ? (is_file_uri(pgp_filename) || is_cid_uri(pgp_filename)) :
    1.33 +                                                  (_s->filename ? (is_file_uri(_s->filename) || is_cid_uri(_s->filename)) :
    1.34 +                                                                  false
    1.35 +                                                  )
    1.36 +                                  );
    1.37 +            
    1.38 +
    1.39              if (ptext) {
    1.40                  if (is_encrypted_html_attachment(_s)) {
    1.41                      msg->longmsg_formatted = ptext;
    1.42 @@ -2854,9 +2856,14 @@
    1.43                  else {
    1.44                      static const char * const mime_type = "application/octet-stream";                    
    1.45                      if (pgp_filename) {
    1.46 +                        if (!has_uri_prefix)
    1.47 +                            filename_uri = build_uri("file", pgp_filename);
    1.48 +
    1.49                          _m = bloblist_add(_m, ptext, psize, mime_type,
    1.50 -                             pgp_filename);
    1.51 -                        free(pgp_filename);                        
    1.52 +                             (filename_uri ? filename_uri : pgp_filename));
    1.53 +
    1.54 +                        free(pgp_filename);
    1.55 +                        free(filename_uri);
    1.56                          if (_m == NULL)
    1.57                              return PEP_OUT_OF_MEMORY;
    1.58                      }
    1.59 @@ -2866,9 +2873,13 @@
    1.60                          if (filename == NULL)
    1.61                              return PEP_OUT_OF_MEMORY;
    1.62  
    1.63 +                        if (!has_uri_prefix)
    1.64 +                            filename_uri = build_uri("file", filename);
    1.65 +
    1.66                          _m = bloblist_add(_m, ptext, psize, mime_type,
    1.67 -                            filename);
    1.68 +                             (filename_uri ? filename_uri : filename));
    1.69                          free(filename);
    1.70 +                        free(filename_uri);
    1.71                          if (_m == NULL)
    1.72                              return PEP_OUT_OF_MEMORY;
    1.73                      }
    1.74 @@ -2884,7 +2895,12 @@
    1.75                  if (copy == NULL)
    1.76                      return PEP_OUT_OF_MEMORY;
    1.77                  memcpy(copy, _s->value, _s->size);
    1.78 -                _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
    1.79 +
    1.80 +                if (!has_uri_prefix && _s->filename)
    1.81 +                    filename_uri = build_uri("file", _s->filename);
    1.82 +
    1.83 +                _m = bloblist_add(_m, copy, _s->size, _s->mime_type, 
    1.84 +                        (filename_uri ? filename_uri : _s->filename));
    1.85                  if (_m == NULL)
    1.86                      return PEP_OUT_OF_MEMORY;
    1.87              }
    1.88 @@ -2895,7 +2911,13 @@
    1.89              if (copy == NULL)
    1.90                  return PEP_OUT_OF_MEMORY;
    1.91              memcpy(copy, _s->value, _s->size);
    1.92 -            _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
    1.93 +
    1.94 +            char* filename_uri = NULL;
    1.95 +
    1.96 +            _m = bloblist_add(_m, copy, _s->size, _s->mime_type, 
    1.97 +                    ((_s->filename && !(is_file_uri(_s->filename) || is_cid_uri(_s->filename))) ?
    1.98 +                         (filename_uri = build_uri("file", _s->filename)) : _s->filename));
    1.99 +            free(filename_uri);
   1.100              if (_m == NULL)
   1.101                  return PEP_OUT_OF_MEMORY;
   1.102          }
     2.1 --- a/test/Makefile	Wed Feb 06 14:58:03 2019 +0100
     2.2 +++ b/test/Makefile	Wed Feb 06 18:21:04 2019 +0100
     2.3 @@ -20,8 +20,6 @@
     2.4  INC_DIRS := ./include /usr/local/include ../src ../sync ../asn.1
     2.5  INC_FLAGS := $(addprefix -I,$(INC_DIRS)) $(GPGME_INC) $(CPPUNIT_INC)
     2.6  
     2.7 -LDFLAGS += -L/usr/local/lib -L$HOME/lib
     2.8 -
     2.9  CFLAGS += -Wno-deprecated
    2.10  CXXFLAGS += -Wno-deprecated
    2.11  CFLAGS:=$(filter-out -Wall,$(CFLAGS))
    2.12 @@ -128,7 +126,7 @@
    2.13  
    2.14  .PHONY: test
    2.15  test: all
    2.16 -	ulimit -n 20000; $(TEST_DEBUGGER) ./$(TARGET)
    2.17 +	$(TEST_DEBUGGER) ./$(TARGET)
    2.18  
    2.19  .PHONY: clean
    2.20  clean:
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/include/TestConstants.h	Wed Feb 06 18:21:04 2019 +0100
     3.3 @@ -0,0 +1,12 @@
     3.4 +#ifndef TEST_CONSTANTS_H
     3.5 +#define TEST_CONSTANTS_H
     3.6 +
     3.7 +#ifndef USE_NETPGP
     3.8 +#define PEP_TEST_KEY_IMPORT_SUCCESS PEP_KEY_IMPORTED
     3.9 +#define PEP_TEST_NO_KEY_IMPORT PEP_NO_KEY_IMPORTED
    3.10 +#else
    3.11 +#define PEP_TEST_KEY_IMPORT_SUCCESS PEP_KEY_IMPORT_STATUS_UNKNOWN
    3.12 +#define PEP_TEST_NO_KEY_IMPORT PEP_KEY_IMPORT_STATUS_UNKNOWN
    3.13 +#endif
    3.14 +
    3.15 +#endif
     4.1 --- a/test/src/EngineTestIndividualSuite.cc	Wed Feb 06 14:58:03 2019 +0100
     4.2 +++ b/test/src/EngineTestIndividualSuite.cc	Wed Feb 06 18:21:04 2019 +0100
     4.3 @@ -1,3 +1,4 @@
     4.4 +#include "TestConstants.h"
     4.5  #include <cpptest.h>
     4.6  #include <cpptest-suite.h>
     4.7  #include <cpptest-textoutput.h>
     4.8 @@ -27,4 +28,4 @@
     4.9  void EngineTestIndividualSuite::tear_down() {
    4.10      restore_full_env();
    4.11      EngineTestSuite::tear_down();
    4.12 -}
    4.13 \ No newline at end of file
    4.14 +}
     5.1 --- a/test/src/EngineTestSessionSuite.cc	Wed Feb 06 14:58:03 2019 +0100
     5.2 +++ b/test/src/EngineTestSessionSuite.cc	Wed Feb 06 18:21:04 2019 +0100
     5.3 @@ -1,4 +1,5 @@
     5.4  #include <cpptest.h>
     5.5 +#include "TestConstants.h"
     5.6  #include <cpptest-suite.h>
     5.7  #include <cpptest-textoutput.h>
     5.8  #include <stdlib.h>
     6.1 --- a/test/src/EngineTestSuite.cc	Wed Feb 06 14:58:03 2019 +0100
     6.2 +++ b/test/src/EngineTestSuite.cc	Wed Feb 06 18:21:04 2019 +0100
     6.3 @@ -20,6 +20,7 @@
     6.4  #include "EngineTestSuite.h"
     6.5  #include "pEpTestStatic.h"
     6.6  #include <algorithm>
     6.7 +#include "TestConstants.h"
     6.8  
     6.9  using namespace std;
    6.10  
     7.1 --- a/test/src/SuiteMaker.cc	Wed Feb 06 14:58:03 2019 +0100
     7.2 +++ b/test/src/SuiteMaker.cc	Wed Feb 06 18:21:04 2019 +0100
     7.3 @@ -12,211 +12,215 @@
     7.4  #include "SuiteMaker.h"
     7.5  
     7.6  // Begin where we generate stuff
     7.7 +#include "LeastCommonDenomColorTests.h"
     7.8 +#include "PgpBinaryTests.h"
     7.9 +#include "I18nTests.h"
    7.10 +#include "TrustManipulationTests.h"
    7.11 +#include "KeyResetMessageTests.h"
    7.12 +#include "SyncTests.h"
    7.13  #include "MimeTests.h"
    7.14 +#include "BlacklistTests.h"
    7.15 +#include "UserIdCollisionTests.h"
    7.16 +#include "CaseAndDotAddressTests.h"
    7.17 +#include "DecryptAttachPrivateKeyTrustedTests.h"
    7.18 +#include "NetPGPPlaygroundTests.h"
    7.19 +#include "BlacklistAcceptNewKeyTests.h"
    7.20 +#include "EncryptForIdentityTests.h"
    7.21 +#include "LeastColorGroupTests.h"
    7.22 +#include "MessageNullFromTests.h"
    7.23 +#include "DecryptAttachPrivateKeyUntrustedTests.h"
    7.24 +#include "BCCTests.h"
    7.25 +#include "StringpairListTests.h"
    7.26 +#include "EncryptAttachPrivateKeyTests.h"
    7.27  #include "ExpiredSubkeyTests.h"
    7.28 -#include "UserIdCollisionTests.h"
    7.29 -#include "Engine463Tests.h"
    7.30 -#include "BloblistTests.h"
    7.31 -#include "NewUpdateIdAndMyselfTests.h"
    7.32 -#include "I18nTests.h"
    7.33 -#include "IdentityListTests.h"
    7.34 -#include "PgpBinaryTests.h"
    7.35 -#include "SubkeyRatingEvalTests.h"
    7.36 -#include "MessageNullFromTests.h"
    7.37 -#include "LeastCommonDenomColorTests.h"
    7.38 -#include "StringlistTests.h"
    7.39 -#include "PgpListKeysTests.h"
    7.40 -#include "MessageApiTests.h"
    7.41 -#include "EncryptMissingPrivateKeyTests.h"
    7.42 -#include "CaseAndDotAddressTests.h"
    7.43 -#include "UserIDAliasTests.h"
    7.44 -#include "SignOnlyTests.h"
    7.45 -#include "BCCTests.h"
    7.46 -#include "Engine358Tests.h"
    7.47 -#include "BlacklistAcceptNewKeyTests.h"
    7.48 -#include "DecryptAttachPrivateKeyUntrustedTests.h"
    7.49 -#include "ReturnMistrustFprTests.h"
    7.50 -#include "BlacklistTests.h"
    7.51 -#include "RevokeRegenAttachTests.h"
    7.52 -#include "PepSubjectReceivedTests.h"
    7.53 -#include "SequenceTests.h"
    7.54 -#include "HeaderKeyImportTests.h"
    7.55 -#include "EncryptAttachPrivateKeyTests.h"
    7.56 -#include "ExternalRevokeTests.h"
    7.57 -#include "KeyeditTests.h"
    7.58 -#include "LeastColorGroupTests.h"
    7.59 -#include "DecryptAttachPrivateKeyTrustedTests.h"
    7.60  #include "CheckRenewedExpiredKeyTrustStatusTests.h"
    7.61  #include "TrustwordsTests.h"
    7.62 +#include "Engine358Tests.h"
    7.63 +#include "ReturnMistrustFprTests.h"
    7.64 +#include "DecorateTests.h"
    7.65 +#include "EncryptMissingPrivateKeyTests.h"
    7.66 +#include "SignOnlyTests.h"
    7.67 +#include "KeyeditTests.h"
    7.68 +#include "IdentityListTests.h"
    7.69 +#include "ReencryptPlusExtraKeysTests.h"
    7.70 +#include "Engine463Tests.h"
    7.71 +#include "SubkeyRatingEvalTests.h"
    7.72  #include "SimpleBodyNotAltTests.h"
    7.73 -#include "ReencryptPlusExtraKeysTests.h"
    7.74 +#include "AppleMailTests.h"
    7.75 +#include "MessageTwoPointOhTests.h"
    7.76 +#include "HeaderKeyImportTests.h"
    7.77 +#include "SequenceTests.h"
    7.78 +#include "PgpListKeysTests.h"
    7.79 +#include "NewUpdateIdAndMyselfTests.h"
    7.80 +#include "ExternalRevokeTests.h"
    7.81 +#include "CrashdumpTests.h"
    7.82 +#include "MessageApiTests.h"
    7.83 +#include "BloblistTests.h"
    7.84 +#include "RevokeRegenAttachTests.h"
    7.85 +#include "UserIDAliasTests.h"
    7.86 +#include "StringlistTests.h"
    7.87 +#include "KeyAttachmentTests.h"
    7.88 +#include "PepSubjectReceivedTests.h"
    7.89  #include "MapAsn1Tests.h"
    7.90 -#include "DecorateTests.h"
    7.91 -#include "MessageTwoPointOhTests.h"
    7.92 -#include "CrashdumpTests.h"
    7.93 -#include "StringpairListTests.h"
    7.94 -#include "EncryptForIdentityTests.h"
    7.95 -#include "KeyResetMessageTests.h"
    7.96 -#include "KeyAttachmentTests.h"
    7.97 -#include "TrustManipulationTests.h"
    7.98 -#include "SyncTests.h"
    7.99 -#include "AppleMailTests.h"
   7.100  
   7.101  
   7.102  const char* SuiteMaker::all_suites[] = {
   7.103 +    "LeastCommonDenomColorTests",
   7.104 +    "PgpBinaryTests",
   7.105 +    "I18nTests",
   7.106 +    "TrustManipulationTests",
   7.107 +    "KeyResetMessageTests",
   7.108 +    "SyncTests",
   7.109      "MimeTests",
   7.110 +    "BlacklistTests",
   7.111 +    "UserIdCollisionTests",
   7.112 +    "CaseAndDotAddressTests",
   7.113 +    "DecryptAttachPrivateKeyTrustedTests",
   7.114 +    "NetPGPPlaygroundTests",
   7.115 +    "BlacklistAcceptNewKeyTests",
   7.116 +    "EncryptForIdentityTests",
   7.117 +    "LeastColorGroupTests",
   7.118 +    "MessageNullFromTests",
   7.119 +    "DecryptAttachPrivateKeyUntrustedTests",
   7.120 +    "BCCTests",
   7.121 +    "StringpairListTests",
   7.122 +    "EncryptAttachPrivateKeyTests",
   7.123      "ExpiredSubkeyTests",
   7.124 -    "UserIdCollisionTests",
   7.125 -    "Engine463Tests",
   7.126 -    "BloblistTests",
   7.127 -    "NewUpdateIdAndMyselfTests",
   7.128 -    "I18nTests",
   7.129 -    "IdentityListTests",
   7.130 -    "PgpBinaryTests",
   7.131 -    "SubkeyRatingEvalTests",
   7.132 -    "MessageNullFromTests",
   7.133 -    "LeastCommonDenomColorTests",
   7.134 -    "StringlistTests",
   7.135 -    "PgpListKeysTests",
   7.136 -    "MessageApiTests",
   7.137 -    "EncryptMissingPrivateKeyTests",
   7.138 -    "CaseAndDotAddressTests",
   7.139 -    "UserIDAliasTests",
   7.140 -    "SignOnlyTests",
   7.141 -    "BCCTests",
   7.142 -    "Engine358Tests",
   7.143 -    "BlacklistAcceptNewKeyTests",
   7.144 -    "DecryptAttachPrivateKeyUntrustedTests",
   7.145 -    "ReturnMistrustFprTests",
   7.146 -    "BlacklistTests",
   7.147 -    "RevokeRegenAttachTests",
   7.148 -    "PepSubjectReceivedTests",
   7.149 -    "SequenceTests",
   7.150 -    "HeaderKeyImportTests",
   7.151 -    "EncryptAttachPrivateKeyTests",
   7.152 -    "ExternalRevokeTests",
   7.153 -    "KeyeditTests",
   7.154 -    "LeastColorGroupTests",
   7.155 -    "DecryptAttachPrivateKeyTrustedTests",
   7.156      "CheckRenewedExpiredKeyTrustStatusTests",
   7.157      "TrustwordsTests",
   7.158 +    "Engine358Tests",
   7.159 +    "ReturnMistrustFprTests",
   7.160 +    "DecorateTests",
   7.161 +    "EncryptMissingPrivateKeyTests",
   7.162 +    "SignOnlyTests",
   7.163 +    "KeyeditTests",
   7.164 +    "IdentityListTests",
   7.165 +    "ReencryptPlusExtraKeysTests",
   7.166 +    "Engine463Tests",
   7.167 +    "SubkeyRatingEvalTests",
   7.168      "SimpleBodyNotAltTests",
   7.169 -    "ReencryptPlusExtraKeysTests",
   7.170 +    "AppleMailTests",
   7.171 +    "MessageTwoPointOhTests",
   7.172 +    "HeaderKeyImportTests",
   7.173 +    "SequenceTests",
   7.174 +    "PgpListKeysTests",
   7.175 +    "NewUpdateIdAndMyselfTests",
   7.176 +    "ExternalRevokeTests",
   7.177 +    "CrashdumpTests",
   7.178 +    "MessageApiTests",
   7.179 +    "BloblistTests",
   7.180 +    "RevokeRegenAttachTests",
   7.181 +    "UserIDAliasTests",
   7.182 +    "StringlistTests",
   7.183 +    "KeyAttachmentTests",
   7.184 +    "PepSubjectReceivedTests",
   7.185      "MapAsn1Tests",
   7.186 -    "DecorateTests",
   7.187 -    "MessageTwoPointOhTests",
   7.188 -    "CrashdumpTests",
   7.189 -    "StringpairListTests",
   7.190 -    "EncryptForIdentityTests",
   7.191 -    "KeyResetMessageTests",
   7.192 -    "KeyAttachmentTests",
   7.193 -    "TrustManipulationTests",
   7.194 -    "SyncTests",
   7.195 -    "AppleMailTests",
   7.196  };
   7.197  
   7.198  // This file is generated, so magic constants are ok.
   7.199 -int SuiteMaker::num_suites = 49;
   7.200 +int SuiteMaker::num_suites = 50;
   7.201  
   7.202  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   7.203 -    if (strcmp(test_class_name, "MimeTests") == 0)
   7.204 +    if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   7.205 +        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   7.206 +    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   7.207 +        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   7.208 +    else if (strcmp(test_class_name, "I18nTests") == 0)
   7.209 +        *test_suite = new I18nTests(test_class_name, test_home);
   7.210 +    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   7.211 +        *test_suite = new TrustManipulationTests(test_class_name, test_home);
   7.212 +    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   7.213 +        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   7.214 +    else if (strcmp(test_class_name, "SyncTests") == 0)
   7.215 +        *test_suite = new SyncTests(test_class_name, test_home);
   7.216 +    else if (strcmp(test_class_name, "MimeTests") == 0)
   7.217          *test_suite = new MimeTests(test_class_name, test_home);
   7.218 +    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   7.219 +        *test_suite = new BlacklistTests(test_class_name, test_home);
   7.220 +    else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   7.221 +        *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   7.222 +    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   7.223 +        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   7.224 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   7.225 +        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   7.226 +    else if (strcmp(test_class_name, "NetPGPPlaygroundTests") == 0)
   7.227 +        *test_suite = new NetPGPPlaygroundTests(test_class_name, test_home);
   7.228 +    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   7.229 +        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   7.230 +    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   7.231 +        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   7.232 +    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   7.233 +        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   7.234 +    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   7.235 +        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   7.236 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   7.237 +        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   7.238 +    else if (strcmp(test_class_name, "BCCTests") == 0)
   7.239 +        *test_suite = new BCCTests(test_class_name, test_home);
   7.240 +    else if (strcmp(test_class_name, "StringpairListTests") == 0)
   7.241 +        *test_suite = new StringpairListTests(test_class_name, test_home);
   7.242 +    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   7.243 +        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   7.244      else if (strcmp(test_class_name, "ExpiredSubkeyTests") == 0)
   7.245          *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
   7.246 -    else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   7.247 -        *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   7.248 -    else if (strcmp(test_class_name, "Engine463Tests") == 0)
   7.249 -        *test_suite = new Engine463Tests(test_class_name, test_home);
   7.250 -    else if (strcmp(test_class_name, "BloblistTests") == 0)
   7.251 -        *test_suite = new BloblistTests(test_class_name, test_home);
   7.252 -    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   7.253 -        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   7.254 -    else if (strcmp(test_class_name, "I18nTests") == 0)
   7.255 -        *test_suite = new I18nTests(test_class_name, test_home);
   7.256 -    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   7.257 -        *test_suite = new IdentityListTests(test_class_name, test_home);
   7.258 -    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   7.259 -        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   7.260 -    else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
   7.261 -        *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
   7.262 -    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   7.263 -        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   7.264 -    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   7.265 -        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   7.266 -    else if (strcmp(test_class_name, "StringlistTests") == 0)
   7.267 -        *test_suite = new StringlistTests(test_class_name, test_home);
   7.268 -    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   7.269 -        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   7.270 -    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   7.271 -        *test_suite = new MessageApiTests(test_class_name, test_home);
   7.272 -    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   7.273 -        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   7.274 -    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   7.275 -        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   7.276 -    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   7.277 -        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   7.278 -    else if (strcmp(test_class_name, "SignOnlyTests") == 0)
   7.279 -        *test_suite = new SignOnlyTests(test_class_name, test_home);
   7.280 -    else if (strcmp(test_class_name, "BCCTests") == 0)
   7.281 -        *test_suite = new BCCTests(test_class_name, test_home);
   7.282 -    else if (strcmp(test_class_name, "Engine358Tests") == 0)
   7.283 -        *test_suite = new Engine358Tests(test_class_name, test_home);
   7.284 -    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   7.285 -        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   7.286 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   7.287 -        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   7.288 -    else if (strcmp(test_class_name, "ReturnMistrustFprTests") == 0)
   7.289 -        *test_suite = new ReturnMistrustFprTests(test_class_name, test_home);
   7.290 -    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   7.291 -        *test_suite = new BlacklistTests(test_class_name, test_home);
   7.292 -    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   7.293 -        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   7.294 -    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   7.295 -        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   7.296 -    else if (strcmp(test_class_name, "SequenceTests") == 0)
   7.297 -        *test_suite = new SequenceTests(test_class_name, test_home);
   7.298 -    else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
   7.299 -        *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
   7.300 -    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   7.301 -        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   7.302 -    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   7.303 -        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   7.304 -    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   7.305 -        *test_suite = new KeyeditTests(test_class_name, test_home);
   7.306 -    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   7.307 -        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   7.308 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   7.309 -        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   7.310      else if (strcmp(test_class_name, "CheckRenewedExpiredKeyTrustStatusTests") == 0)
   7.311          *test_suite = new CheckRenewedExpiredKeyTrustStatusTests(test_class_name, test_home);
   7.312      else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   7.313          *test_suite = new TrustwordsTests(test_class_name, test_home);
   7.314 +    else if (strcmp(test_class_name, "Engine358Tests") == 0)
   7.315 +        *test_suite = new Engine358Tests(test_class_name, test_home);
   7.316 +    else if (strcmp(test_class_name, "ReturnMistrustFprTests") == 0)
   7.317 +        *test_suite = new ReturnMistrustFprTests(test_class_name, test_home);
   7.318 +    else if (strcmp(test_class_name, "DecorateTests") == 0)
   7.319 +        *test_suite = new DecorateTests(test_class_name, test_home);
   7.320 +    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   7.321 +        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   7.322 +    else if (strcmp(test_class_name, "SignOnlyTests") == 0)
   7.323 +        *test_suite = new SignOnlyTests(test_class_name, test_home);
   7.324 +    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   7.325 +        *test_suite = new KeyeditTests(test_class_name, test_home);
   7.326 +    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   7.327 +        *test_suite = new IdentityListTests(test_class_name, test_home);
   7.328 +    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   7.329 +        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   7.330 +    else if (strcmp(test_class_name, "Engine463Tests") == 0)
   7.331 +        *test_suite = new Engine463Tests(test_class_name, test_home);
   7.332 +    else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
   7.333 +        *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
   7.334      else if (strcmp(test_class_name, "SimpleBodyNotAltTests") == 0)
   7.335          *test_suite = new SimpleBodyNotAltTests(test_class_name, test_home);
   7.336 -    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   7.337 -        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   7.338 +    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   7.339 +        *test_suite = new AppleMailTests(test_class_name, test_home);
   7.340 +    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   7.341 +        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   7.342 +    else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
   7.343 +        *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
   7.344 +    else if (strcmp(test_class_name, "SequenceTests") == 0)
   7.345 +        *test_suite = new SequenceTests(test_class_name, test_home);
   7.346 +    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   7.347 +        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   7.348 +    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   7.349 +        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   7.350 +    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   7.351 +        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   7.352 +    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   7.353 +        *test_suite = new CrashdumpTests(test_class_name, test_home);
   7.354 +    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   7.355 +        *test_suite = new MessageApiTests(test_class_name, test_home);
   7.356 +    else if (strcmp(test_class_name, "BloblistTests") == 0)
   7.357 +        *test_suite = new BloblistTests(test_class_name, test_home);
   7.358 +    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   7.359 +        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   7.360 +    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   7.361 +        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   7.362 +    else if (strcmp(test_class_name, "StringlistTests") == 0)
   7.363 +        *test_suite = new StringlistTests(test_class_name, test_home);
   7.364 +    else if (strcmp(test_class_name, "KeyAttachmentTests") == 0)
   7.365 +        *test_suite = new KeyAttachmentTests(test_class_name, test_home);
   7.366 +    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   7.367 +        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   7.368      else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   7.369          *test_suite = new MapAsn1Tests(test_class_name, test_home);
   7.370 -    else if (strcmp(test_class_name, "DecorateTests") == 0)
   7.371 -        *test_suite = new DecorateTests(test_class_name, test_home);
   7.372 -    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   7.373 -        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   7.374 -    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   7.375 -        *test_suite = new CrashdumpTests(test_class_name, test_home);
   7.376 -    else if (strcmp(test_class_name, "StringpairListTests") == 0)
   7.377 -        *test_suite = new StringpairListTests(test_class_name, test_home);
   7.378 -    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   7.379 -        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   7.380 -    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   7.381 -        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   7.382 -    else if (strcmp(test_class_name, "KeyAttachmentTests") == 0)
   7.383 -        *test_suite = new KeyAttachmentTests(test_class_name, test_home);
   7.384 -    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   7.385 -        *test_suite = new TrustManipulationTests(test_class_name, test_home);
   7.386 -    else if (strcmp(test_class_name, "SyncTests") == 0)
   7.387 -        *test_suite = new SyncTests(test_class_name, test_home);
   7.388 -    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   7.389 -        *test_suite = new AppleMailTests(test_class_name, test_home);
   7.390  }
   7.391  
   7.392  void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
     8.1 --- a/test/src/TestDriver.cc	Wed Feb 06 14:58:03 2019 +0100
     8.2 +++ b/test/src/TestDriver.cc	Wed Feb 06 18:21:04 2019 +0100
     8.3 @@ -3,6 +3,7 @@
     8.4  #include <cpptest-suite.h>
     8.5  #include <cpptest-output.h>
     8.6  #include "pEpTestOutput.h"
     8.7 +#include "TestConstants.h"
     8.8  
     8.9  #include <string>
    8.10  #include <vector>
     9.1 --- a/test/src/engine_tests/AppleMailTests.cc	Wed Feb 06 14:58:03 2019 +0100
     9.2 +++ b/test/src/engine_tests/AppleMailTests.cc	Wed Feb 06 18:21:04 2019 +0100
     9.3 @@ -18,6 +18,7 @@
     9.4  #include "message_api.h"
     9.5  #include "mime.h"
     9.6  #include "test_util.h" // for slurp()
     9.7 +#include "TestConstants.h"
     9.8  
     9.9  #include "EngineTestSuite.h"
    9.10  #include "EngineTestIndividualSuite.h"
    10.1 --- a/test/src/engine_tests/BCCTests.cc	Wed Feb 06 14:58:03 2019 +0100
    10.2 +++ b/test/src/engine_tests/BCCTests.cc	Wed Feb 06 18:21:04 2019 +0100
    10.3 @@ -8,6 +8,7 @@
    10.4  
    10.5  #include "pEpEngine.h"
    10.6  #include "message_api.h"
    10.7 +#include "TestConstants.h"
    10.8  
    10.9  #include <cpptest.h>
   10.10  #include "test_util.h"
   10.11 @@ -26,18 +27,18 @@
   10.12      EngineTestIndividualSuite::setup();
   10.13      string keystr = slurp("test_keys/priv/bcc_test_dude_0-0x1CCCFC41_priv.asc");
   10.14      PEP_STATUS status = import_key(session, keystr.c_str(), keystr.size(), NULL);
   10.15 -    assert(status == PEP_KEY_IMPORTED);    
   10.16 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);    
   10.17      pEp_identity * me = new_identity("bcc_test_dude_0@darthmama.cool", "0AE9AA3E320595CF93296BDFA155AC491CCCFC41", PEP_OWN_USERID, "BCC Test Sender");    
   10.18      status = set_own_key(session, me, "0AE9AA3E320595CF93296BDFA155AC491CCCFC41");
   10.19      keystr = slurp("test_keys/pub/bcc_test_dude_0-0x1CCCFC41_pub.asc");
   10.20      status = import_key(session, keystr.c_str(), keystr.size(), NULL);
   10.21 -    assert(status == PEP_KEY_IMPORTED);
   10.22 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   10.23      keystr = slurp("test_keys/pub/bcc_test_dude_1-0xDAC746BE_pub.asc");
   10.24      status = import_key(session, keystr.c_str(), keystr.size(), NULL);
   10.25 -    assert(status == PEP_KEY_IMPORTED);
   10.26 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   10.27      keystr = slurp("test_keys/pub/bcc_test_dude_2-0x53CECCF7_pub.asc");
   10.28      status = import_key(session, keystr.c_str(), keystr.size(), NULL);
   10.29 -    assert(status == PEP_KEY_IMPORTED);    
   10.30 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);    
   10.31  }
   10.32  
   10.33  void BCCTests::check_single_BCC() {
    11.1 --- a/test/src/engine_tests/BlacklistAcceptNewKeyTests.cc	Wed Feb 06 14:58:03 2019 +0100
    11.2 +++ b/test/src/engine_tests/BlacklistAcceptNewKeyTests.cc	Wed Feb 06 18:21:04 2019 +0100
    11.3 @@ -7,6 +7,7 @@
    11.4  #include <cpptest.h>
    11.5  
    11.6  #include "test_util.h"
    11.7 +#include "TestConstants.h"
    11.8  
    11.9  #include "pEpEngine.h"
   11.10  #include "blacklist.h"
    12.1 --- a/test/src/engine_tests/BlacklistTests.cc	Wed Feb 06 14:58:03 2019 +0100
    12.2 +++ b/test/src/engine_tests/BlacklistTests.cc	Wed Feb 06 18:21:04 2019 +0100
    12.3 @@ -27,6 +27,7 @@
    12.4  #include "blacklist.h"
    12.5  #include "keymanagement.h"
    12.6  #include "test_util.h"
    12.7 +#include "TestConstants.h"
    12.8  
    12.9  #include "EngineTestSessionSuite.h"
   12.10  #include "BlacklistTests.h"
    13.1 --- a/test/src/engine_tests/BloblistTests.cc	Wed Feb 06 14:58:03 2019 +0100
    13.2 +++ b/test/src/engine_tests/BloblistTests.cc	Wed Feb 06 18:21:04 2019 +0100
    13.3 @@ -9,6 +9,7 @@
    13.4  #include <assert.h>
    13.5  
    13.6  #include "bloblist.h"
    13.7 +#include "TestConstants.h"
    13.8  
    13.9  #include "EngineTestSuite.h"
   13.10  #include "BloblistTests.h"
    14.1 --- a/test/src/engine_tests/CaseAndDotAddressTests.cc	Wed Feb 06 14:58:03 2019 +0100
    14.2 +++ b/test/src/engine_tests/CaseAndDotAddressTests.cc	Wed Feb 06 18:21:04 2019 +0100
    14.3 @@ -10,6 +10,7 @@
    14.4  #include "mime.h"
    14.5  #include "message_api.h"
    14.6  #include "test_util.h"
    14.7 +#include "TestConstants.h"
    14.8  
    14.9  #include "EngineTestSuite.h"
   14.10  #include "EngineTestSessionSuite.h"
   14.11 @@ -36,7 +37,7 @@
   14.12      const char* alice_email_case_and_dot = "PE.p.teS.t.ALICE@pep-project.OrG";
   14.13  
   14.14      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   14.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   14.16 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   14.17  
   14.18      pEp_identity * alice_id = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", user_id, "Alice Test");
   14.19  
    15.1 --- a/test/src/engine_tests/CheckRenewedExpiredKeyTrustStatusTests.cc	Wed Feb 06 14:58:03 2019 +0100
    15.2 +++ b/test/src/engine_tests/CheckRenewedExpiredKeyTrustStatusTests.cc	Wed Feb 06 18:21:04 2019 +0100
    15.3 @@ -1,6 +1,7 @@
    15.4  // This file is under GNU General Public License 3.0
    15.5  // see LICENSE.txt
    15.6  
    15.7 +#include "TestConstants.h"
    15.8  #include <stdlib.h>
    15.9  #include <string>
   15.10  #include <cstring>
    16.1 --- a/test/src/engine_tests/CrashdumpTests.cc	Wed Feb 06 14:58:03 2019 +0100
    16.2 +++ b/test/src/engine_tests/CrashdumpTests.cc	Wed Feb 06 18:21:04 2019 +0100
    16.3 @@ -1,6 +1,7 @@
    16.4  // This file is under GNU General Public License 3.0
    16.5  // see LICENSE.txt
    16.6  
    16.7 +#include "TestConstants.h"
    16.8  #include <stdlib.h>
    16.9  #include <string>
   16.10  
    17.1 --- a/test/src/engine_tests/DecorateTests.cc	Wed Feb 06 14:58:03 2019 +0100
    17.2 +++ b/test/src/engine_tests/DecorateTests.cc	Wed Feb 06 18:21:04 2019 +0100
    17.3 @@ -1,6 +1,7 @@
    17.4  // This file is under GNU General Public License 3.0
    17.5  // see LICENSE.txt
    17.6  
    17.7 +#include "TestConstants.h"
    17.8  #include <cpptest.h>
    17.9  #include <cpptest-suite.h>
   17.10  #include <cpptest-textoutput.h>
   17.11 @@ -35,9 +36,9 @@
   17.12      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   17.13      PEP_STATUS statuspriv = import_key(session, alice_priv_key.c_str(), alice_priv_key.length(), NULL);
   17.14      PEP_STATUS statusbob = import_key(session, bob_pub_key.c_str(), bob_pub_key.length(), NULL);
   17.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   17.16 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   17.17 -    TEST_ASSERT_MSG((statusbob == PEP_KEY_IMPORTED), "statusbob == PEP_STATUS_OK");
   17.18 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   17.19 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   17.20 +    TEST_ASSERT_MSG((statusbob == PEP_TEST_KEY_IMPORT_SUCCESS), "statusbob == PEP_STATUS_OK");
   17.21  
   17.22      cout << "creating message…\n";
   17.23      pEp_identity* alice = new_identity("pep.test.alice@pep-project.org", NULL, PEP_OWN_USERID, "Alice Test");
    18.1 --- a/test/src/engine_tests/DecryptAttachPrivateKeyTrustedTests.cc	Wed Feb 06 14:58:03 2019 +0100
    18.2 +++ b/test/src/engine_tests/DecryptAttachPrivateKeyTrustedTests.cc	Wed Feb 06 18:21:04 2019 +0100
    18.3 @@ -3,6 +3,7 @@
    18.4  
    18.5  // FIXME: the private key tests should be combined
    18.6  
    18.7 +#include "TestConstants.h"
    18.8  #include <stdlib.h>
    18.9  #include <string>
   18.10  #include <cstring>
   18.11 @@ -45,11 +46,11 @@
   18.12      // 13A9F97964A2B52520CAA40E51BCA783C065A213    
   18.13      input_key = slurp("test_keys/pub/priv-key-import-test-main_0-0xC065A213_pub.asc");
   18.14      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   18.15 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   18.16 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   18.17  
   18.18      input_key = slurp("test_keys/priv/priv-key-import-test-main_0-0xC065A213_priv.asc");
   18.19      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   18.20 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   18.21 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   18.22  
   18.23      // ensure there's no private key - doesn't work in automated tests, sadly. Uncommon when running script manually.
   18.24      bool has_priv = false;
   18.25 @@ -58,7 +59,7 @@
   18.26      // 8AB616A3BD51DEF714B5E688EFFB540C3276D2E5
   18.27      input_key = slurp("test_keys/pub/priv-key-import-test-main_0-0x3276D2E5_pub.asc");
   18.28      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   18.29 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   18.30 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   18.31  
   18.32      
   18.33      cout << "Setting up own identity with default key " << fpr_main_me << endl;
    19.1 --- a/test/src/engine_tests/DecryptAttachPrivateKeyUntrustedTests.cc	Wed Feb 06 14:58:03 2019 +0100
    19.2 +++ b/test/src/engine_tests/DecryptAttachPrivateKeyUntrustedTests.cc	Wed Feb 06 18:21:04 2019 +0100
    19.3 @@ -2,6 +2,7 @@
    19.4  // see LICENSE.txt
    19.5  
    19.6  #include <stdlib.h>
    19.7 +#include "TestConstants.h"
    19.8  #include <string>
    19.9  #include <cstring>
   19.10  #include <cpptest.h>
   19.11 @@ -44,11 +45,11 @@
   19.12      // 13A9F97964A2B52520CAA40E51BCA783C065A213    
   19.13      input_key = slurp("test_keys/pub/priv-key-import-test-main_0-0xC065A213_pub.asc");
   19.14      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   19.15 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), "status == PEP_STATUS_OK");
   19.16 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), "status == PEP_STATUS_OK");
   19.17  
   19.18      input_key = slurp("test_keys/priv/priv-key-import-test-main_0-0xC065A213_priv.asc");
   19.19      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   19.20 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), "status == PEP_STATUS_OK");
   19.21 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), "status == PEP_STATUS_OK");
   19.22  
   19.23      // ensure there's no private key - doesn't work in automated tests, sadly. Uncommon when running script manually.
   19.24      bool has_priv = false;
   19.25 @@ -64,7 +65,7 @@
   19.26      // 8AB616A3BD51DEF714B5E688EFFB540C3276D2E5
   19.27      input_key = slurp("test_keys/pub/priv-key-import-test-main_0-0x3276D2E5_pub.asc");
   19.28      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   19.29 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), "status == PEP_STATUS_OK");
   19.30 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), "status == PEP_STATUS_OK");
   19.31  
   19.32      
   19.33      cout << "Setting up own identity with default key " << fpr_main_me << endl;
    20.1 --- a/test/src/engine_tests/EncryptAttachPrivateKeyTests.cc	Wed Feb 06 14:58:03 2019 +0100
    20.2 +++ b/test/src/engine_tests/EncryptAttachPrivateKeyTests.cc	Wed Feb 06 18:21:04 2019 +0100
    20.3 @@ -2,6 +2,7 @@
    20.4  // see LICENSE.txt
    20.5  
    20.6  #include <stdlib.h>
    20.7 +#include "TestConstants.h"
    20.8  #include <string>
    20.9  #include <cstring>
   20.10  #include <cpptest.h>
   20.11 @@ -56,35 +57,35 @@
   20.12      // 8AB616A3BD51DEF714B5E688EFFB540C3276D2E5
   20.13      input_key = slurp("test_keys/pub/priv-key-import-test-main_0-0x3276D2E5_pub.asc");
   20.14      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.15 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.16 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.17  
   20.18      input_key = slurp("test_keys/priv/priv-key-import-test-main_0-0x3276D2E5_priv.asc");
   20.19      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.20 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.21 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.22          
   20.23      // key with same address and user_id (initially untrusted, then trusted)
   20.24      // 359DD8AC87D1F5E4304D08338D7185F180C8CD87
   20.25      input_key = slurp("test_keys/pub/priv-key-import-test-main_1-0x80C8CD87_pub.asc");
   20.26      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.27 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.28 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.29  
   20.30      // key with same address and to have different (non-aliased) user_id (initially untrusted, then trusted)
   20.31      // B044B83639E292283A3F6E14C2E64B520B74809C
   20.32      input_key = slurp("test_keys/pub/priv-key-import-test-main_2-0x0B74809C_pub.asc");
   20.33      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.34 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.35 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.36  
   20.37      // key with different address to have same user_id (initially untrusted, then trusted)
   20.38      // C52911EBA0D34B0F549594A15A7A363BD11252C9
   20.39      input_key = slurp("test_keys/pub/priv-key-import-test-other_0-0xD11252C9_pub.asc");
   20.40      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.41 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.42 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.43          
   20.44      // key with different address to have different user_id (initially untrusted, then trusted)
   20.45      // 567212EFB8A3A76B1D32B9565F45BEA9C785F20A
   20.46      input_key = slurp("test_keys/pub/priv-key-import-test-other_1-0xC785F20A_pub.asc");
   20.47      status = import_key(session, input_key.c_str(), input_key.length(), NULL);
   20.48 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));
   20.49 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));
   20.50      cout << "Done!" << endl << endl;
   20.51      
   20.52      cout << "Setting up own identity with default key " << fpr_main_me << endl;
    21.1 --- a/test/src/engine_tests/EncryptForIdentityTests.cc	Wed Feb 06 14:58:03 2019 +0100
    21.2 +++ b/test/src/engine_tests/EncryptForIdentityTests.cc	Wed Feb 06 18:21:04 2019 +0100
    21.3 @@ -2,6 +2,7 @@
    21.4  // see LICENSE.txt
    21.5  
    21.6  #include <stdlib.h>
    21.7 +#include "TestConstants.h"
    21.8  #include <unistd.h>
    21.9  #include <string>
   21.10  #include <cstring>
   21.11 @@ -37,13 +38,13 @@
   21.12  
   21.13      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   21.14      PEP_STATUS statuspriv = import_key(session, alice_priv_key.c_str(), alice_priv_key.length(), NULL);
   21.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   21.16 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   21.17 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   21.18 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   21.19      
   21.20      statuspub = import_key(session, gabrielle_pub_key.c_str(), gabrielle_pub_key.length(), NULL);
   21.21 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   21.22 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   21.23      statuspub = import_key(session, bella_pub_key.c_str(), bella_pub_key.length(), NULL);
   21.24 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   21.25 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   21.26  
   21.27      const char* alice_fpr = "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97";
   21.28      const char* gabrielle_fpr = "906C9B8349954E82C5623C3C8C541BD4E203586C";
    22.1 --- a/test/src/engine_tests/EncryptMissingPrivateKeyTests.cc	Wed Feb 06 14:58:03 2019 +0100
    22.2 +++ b/test/src/engine_tests/EncryptMissingPrivateKeyTests.cc	Wed Feb 06 18:21:04 2019 +0100
    22.3 @@ -1,6 +1,7 @@
    22.4  // This file is under GNU General Public License 3.0
    22.5  // see LICENSE.txt
    22.6  
    22.7 +#include "TestConstants.h"
    22.8  #include <stdlib.h>
    22.9  #include <iostream>
   22.10  #include <fstream>
   22.11 @@ -34,7 +35,7 @@
   22.12      EngineTestSessionSuite::setup();
   22.13      string recip_key = slurp("test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
   22.14      PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
   22.15 -    assert(status == PEP_KEY_IMPORTED);
   22.16 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   22.17  }
   22.18  
   22.19  void EncryptMissingPrivateKeyTests::check_encrypt_missing_private_key() {
    23.1 --- a/test/src/engine_tests/Engine358Tests.cc	Wed Feb 06 14:58:03 2019 +0100
    23.2 +++ b/test/src/engine_tests/Engine358Tests.cc	Wed Feb 06 18:21:04 2019 +0100
    23.3 @@ -1,6 +1,7 @@
    23.4  // This file is under GNU General Public License 3.0
    23.5  // see LICENSE.txt
    23.6  
    23.7 +#include "TestConstants.h"
    23.8  #include <stdlib.h>
    23.9  #include <string>
   23.10  #include <cstring>
    24.1 --- a/test/src/engine_tests/Engine463Tests.cc	Wed Feb 06 14:58:03 2019 +0100
    24.2 +++ b/test/src/engine_tests/Engine463Tests.cc	Wed Feb 06 18:21:04 2019 +0100
    24.3 @@ -1,6 +1,7 @@
    24.4  // This file is under GNU General Public License 3.0
    24.5  // see LICENSE.txt
    24.6  
    24.7 +#include "TestConstants.h"
    24.8  #include <stdlib.h>
    24.9  #include <string>
   24.10  
   24.11 @@ -31,9 +32,9 @@
   24.12      const string fake_schleuder_key = slurp("test_keys/pub/fake-schleuder.asc");
   24.13      
   24.14      PEP_STATUS status = import_key(session, claudio_keys.c_str(), claudio_keys.length(), NULL);
   24.15 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));    
   24.16 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));    
   24.17      status = import_key(session, fake_schleuder_key.c_str(), fake_schleuder_key.length(), NULL);
   24.18 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));    
   24.19 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));    
   24.20  
   24.21      // Ok, bring in message, decrypt, and see what happens.
   24.22      const string msg = slurp("test_mails/notfound-alt.msg");
   24.23 @@ -54,9 +55,9 @@
   24.24      const string fake_schleuder_key = slurp("test_keys/pub/fake-schleuder.asc");
   24.25      
   24.26      PEP_STATUS status = import_key(session, claudio_keys.c_str(), claudio_keys.length(), NULL);
   24.27 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));    
   24.28 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));    
   24.29      status = import_key(session, fake_schleuder_key.c_str(), fake_schleuder_key.length(), NULL);
   24.30 -    TEST_ASSERT_MSG((status == PEP_KEY_IMPORTED), tl_status_string(status));    
   24.31 +    TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), tl_status_string(status));    
   24.32  
   24.33      pEp_identity* own_ident = new_identity("claudio+engine-463@pep.foundation", "A039BC60E43E0DFDDC9DE8663B48C38325210C88", PEP_OWN_USERID, "Not Actually Claudio");
   24.34      status = set_own_key(session, own_ident, "A039BC60E43E0DFDDC9DE8663B48C38325210C88");
    25.1 --- a/test/src/engine_tests/ExpiredSubkeyTests.cc	Wed Feb 06 14:58:03 2019 +0100
    25.2 +++ b/test/src/engine_tests/ExpiredSubkeyTests.cc	Wed Feb 06 18:21:04 2019 +0100
    25.3 @@ -1,6 +1,7 @@
    25.4  // This file is under GNU General Public License 3.0
    25.5  // see LICENSE.txt
    25.6  
    25.7 +#include "TestConstants.h"
    25.8  #include <stdlib.h>
    25.9  #include <string>
   25.10  #include <cpptest.h>
    26.1 --- a/test/src/engine_tests/ExternalRevokeTests.cc	Wed Feb 06 14:58:03 2019 +0100
    26.2 +++ b/test/src/engine_tests/ExternalRevokeTests.cc	Wed Feb 06 18:21:04 2019 +0100
    26.3 @@ -1,6 +1,7 @@
    26.4  // This file is under GNU General Public License 3.0
    26.5  // see LICENSE.txt
    26.6  
    26.7 +#include "TestConstants.h"
    26.8  #include <stdlib.h>
    26.9  #include <string>
   26.10  #include <cstring>
   26.11 @@ -41,8 +42,8 @@
   26.12      
   26.13      PEP_STATUS statuspub = import_key(session, fenris_pub_key.c_str(), fenris_pub_key.length(), NULL);
   26.14      PEP_STATUS statuspriv = import_key(session, fenris_priv_key.c_str(), fenris_priv_key.length(), NULL);
   26.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   26.16 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   26.17 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   26.18 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   26.19  
   26.20      // Create sender ID
   26.21      
    27.1 --- a/test/src/engine_tests/HeaderKeyImportTests.cc	Wed Feb 06 14:58:03 2019 +0100
    27.2 +++ b/test/src/engine_tests/HeaderKeyImportTests.cc	Wed Feb 06 18:21:04 2019 +0100
    27.3 @@ -1,6 +1,7 @@
    27.4  // This file is under GNU General Public License 3.0
    27.5  // see LICENSE.txt
    27.6  
    27.7 +#include "TestConstants.h"
    27.8  #include <stdlib.h>
    27.9  #include <string>
   27.10  #include <cstring>
    28.1 --- a/test/src/engine_tests/I18nTests.cc	Wed Feb 06 14:58:03 2019 +0100
    28.2 +++ b/test/src/engine_tests/I18nTests.cc	Wed Feb 06 18:21:04 2019 +0100
    28.3 @@ -1,6 +1,7 @@
    28.4  // This file is under GNU General Public License 3.0
    28.5  // see LICENSE.txt
    28.6  
    28.7 +#include "TestConstants.h"
    28.8  #include <stdlib.h>
    28.9  #include <string>
   28.10  #include <iostream>
    29.1 --- a/test/src/engine_tests/IdentityListTests.cc	Wed Feb 06 14:58:03 2019 +0100
    29.2 +++ b/test/src/engine_tests/IdentityListTests.cc	Wed Feb 06 18:21:04 2019 +0100
    29.3 @@ -1,6 +1,7 @@
    29.4  // This file is under GNU General Public License 3.0
    29.5  // see LICENSE.txt
    29.6  
    29.7 +#include "TestConstants.h"
    29.8  #include <stdlib.h>
    29.9  #include <string>
   29.10  #include <cstring>
    30.1 --- a/test/src/engine_tests/KeyAttachmentTests.cc	Wed Feb 06 14:58:03 2019 +0100
    30.2 +++ b/test/src/engine_tests/KeyAttachmentTests.cc	Wed Feb 06 18:21:04 2019 +0100
    30.3 @@ -1,6 +1,7 @@
    30.4  // This file is under GNU General Public License 3.0
    30.5  // see LICENSE.txt
    30.6  
    30.7 +#include "TestConstants.h"
    30.8  #include <stdlib.h>
    30.9  #include <string>
   30.10  #include <cstring>
   30.11 @@ -105,7 +106,7 @@
   30.12      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.13      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.14      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.15 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.16 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.17      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.18      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.19      free_message(enc_msg);
   30.20 @@ -131,7 +132,7 @@
   30.21      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.22      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.23      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.24 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.25 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.26      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.27      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.28      free_message(enc_msg);
   30.29 @@ -157,7 +158,7 @@
   30.30      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.31      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.32      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.33 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "cheese.txt") == 0, dec_msg->attachments->filename);    
   30.34 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://cheese.txt") == 0, dec_msg->attachments->filename);    
   30.35      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.36      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.37      free_message(enc_msg);
   30.38 @@ -183,7 +184,7 @@
   30.39      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.40      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.41      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.42 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "cheese.txt") == 0, dec_msg->attachments->filename);    
   30.43 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://cheese.txt") == 0, dec_msg->attachments->filename);    
   30.44      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.45      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.46      free_message(enc_msg);
   30.47 @@ -233,7 +234,7 @@
   30.48      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.49      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.50      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.51 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.52 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://cheese.txt.gpg") == 0, dec_msg->attachments->filename);    
   30.53      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.54      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.55      free_message(enc_msg);
   30.56 @@ -259,7 +260,7 @@
   30.57      TEST_ASSERT_MSG(dec_msg->attachments->next == NULL, "Decryption left attachments it should have deleted.");    
   30.58      TEST_ASSERT_MSG(dec_msg->attachments->filename, "Attachment doesn't have a filename");
   30.59      // TODO: is there a missing update to resource IDs in decrypt in parts?
   30.60 -    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "barky.txt") == 0, dec_msg->attachments->filename);    
   30.61 +    TEST_ASSERT_MSG(strcmp(dec_msg->attachments->filename, "file://barky.txt") == 0, dec_msg->attachments->filename);    
   30.62      TEST_ASSERT_MSG(dec_msg->attachments->mime_type, "Attachment doesn't have a mime type");
   30.63      TEST_ASSERT_MSG(strcmp(dec_msg->attachments->mime_type, "application/octet-stream") == 0, dec_msg->attachments->mime_type);    
   30.64      free_message(enc_msg);
   30.65 @@ -290,13 +291,13 @@
   30.66      // pair is filename, mime_type 
   30.67      vector<pair<string,string>> v =
   30.68          {
   30.69 -            {"barky.txt","application/octet-stream"}, 
   30.70 -            {"this_is_not_a_key_or_encrypted.asc","application/octet-stream"},
   30.71 -            {"this_is_not_a_key_or_encrypted.gpg","application/octet-stream"},
   30.72 -            {"CC_BY-SA.txt","application/octet-stream"}, 
   30.73 -            {"Makefile","application/octet-stream"}, 
   30.74 -            {"LICENSE.txt","application/octet-stream"}, 
   30.75 -            {"README.md","application/octet-stream"}, 
   30.76 +            {"file://barky.txt","application/octet-stream"}, 
   30.77 +            {"file://this_is_not_a_key_or_encrypted.asc","application/octet-stream"},
   30.78 +            {"file://this_is_not_a_key_or_encrypted.gpg","application/octet-stream"},
   30.79 +            {"file://CC_BY-SA.txt","application/octet-stream"}, 
   30.80 +            {"file://Makefile","application/octet-stream"}, 
   30.81 +            {"file://LICENSE.txt","application/octet-stream"}, 
   30.82 +            {"file://README.md","application/octet-stream"}, 
   30.83          };
   30.84                               
   30.85      bloblist_t* curr_att = dec_msg->attachments;
    31.1 --- a/test/src/engine_tests/KeyResetMessageTests.cc	Wed Feb 06 14:58:03 2019 +0100
    31.2 +++ b/test/src/engine_tests/KeyResetMessageTests.cc	Wed Feb 06 18:21:04 2019 +0100
    31.3 @@ -1,6 +1,7 @@
    31.4  // This file is under GNU General Public License 3.0
    31.5  // see LICENSE.txt
    31.6  
    31.7 +#include "TestConstants.h"
    31.8  #include <stdlib.h>
    31.9  #include <string>
   31.10  #include <vector>
   31.11 @@ -64,7 +65,7 @@
   31.12      // Setup own identity
   31.13      PEP_STATUS status = read_file_and_import_key(session,
   31.14                  "test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc");
   31.15 -    assert(status == PEP_KEY_IMPORTED);
   31.16 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   31.17      status = set_up_ident_from_scratch(session,
   31.18                  "test_keys/priv/pep-test-alice-0x6FF00E97_priv.asc",
   31.19                  "pep.test.alice@pep-project.org", alice_fpr, 
   31.20 @@ -111,7 +112,7 @@
   31.21  void KeyResetMessageTests::receive_setup() {
   31.22      PEP_STATUS status = read_file_and_import_key(session,
   31.23                  "test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");  
   31.24 -    assert(status == PEP_KEY_IMPORTED);
   31.25 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   31.26      status = set_up_ident_from_scratch(session,
   31.27                  "test_keys/priv/pep-test-bob-0xC9C2EE39_priv.asc",  
   31.28                  "pep.test.bob@pep-project.org", bob_fpr, 
    32.1 --- a/test/src/engine_tests/KeyeditTests.cc	Wed Feb 06 14:58:03 2019 +0100
    32.2 +++ b/test/src/engine_tests/KeyeditTests.cc	Wed Feb 06 18:21:04 2019 +0100
    32.3 @@ -1,6 +1,7 @@
    32.4  // This file is under GNU General Public License 3.0
    32.5  // see LICENSE.txt
    32.6  
    32.7 +#include "TestConstants.h"
    32.8  #include <stdlib.h>
    32.9  #include <string>
   32.10  #include <iostream>
    33.1 --- a/test/src/engine_tests/LeastColorGroupTests.cc	Wed Feb 06 14:58:03 2019 +0100
    33.2 +++ b/test/src/engine_tests/LeastColorGroupTests.cc	Wed Feb 06 18:21:04 2019 +0100
    33.3 @@ -2,6 +2,7 @@
    33.4  // see LICENSE.txt
    33.5  
    33.6  #include <stdlib.h>
    33.7 +#include "TestConstants.h"
    33.8  #include <string>
    33.9  #include <iostream>
   33.10  #include <vector>
   33.11 @@ -41,7 +42,7 @@
   33.12          cout << "\t read keyfile \"" << name << "\"..." << std::endl;
   33.13          const string keytextkey = slurp(name);
   33.14          PEP_STATUS statuskey = import_key(session, keytextkey.c_str(), keytextkey.length(), NULL);
   33.15 -        TEST_ASSERT_MSG((statuskey == PEP_KEY_IMPORTED), "statuskey == PEP_STATUS_OK");
   33.16 +        TEST_ASSERT_MSG((statuskey == PEP_TEST_KEY_IMPORT_SUCCESS), "statuskey == PEP_STATUS_OK");
   33.17      }
   33.18      
   33.19      cout << "\t read keyfile mailfile \"" << mailfile << "\"..." << std::endl;
    34.1 --- a/test/src/engine_tests/LeastCommonDenomColorTests.cc	Wed Feb 06 14:58:03 2019 +0100
    34.2 +++ b/test/src/engine_tests/LeastCommonDenomColorTests.cc	Wed Feb 06 18:21:04 2019 +0100
    34.3 @@ -2,6 +2,7 @@
    34.4  // see LICENSE.txt
    34.5  
    34.6  #include <stdlib.h>
    34.7 +#include "TestConstants.h"
    34.8  #include <iostream>
    34.9  #include <fstream>
   34.10  #include <string>
    35.1 --- a/test/src/engine_tests/MapAsn1Tests.cc	Wed Feb 06 14:58:03 2019 +0100
    35.2 +++ b/test/src/engine_tests/MapAsn1Tests.cc	Wed Feb 06 18:21:04 2019 +0100
    35.3 @@ -2,6 +2,7 @@
    35.4  // see LICENSE.txt
    35.5  
    35.6  #include <stdlib.h>
    35.7 +#include "TestConstants.h"
    35.8  #include <iostream>
    35.9  #include <string>
   35.10  #include <cstring>
    36.1 --- a/test/src/engine_tests/MessageApiTests.cc	Wed Feb 06 14:58:03 2019 +0100
    36.2 +++ b/test/src/engine_tests/MessageApiTests.cc	Wed Feb 06 18:21:04 2019 +0100
    36.3 @@ -2,6 +2,7 @@
    36.4  // see LICENSE.txt
    36.5  
    36.6  #include <stdlib.h>
    36.7 +#include "TestConstants.h"
    36.8  #include <string>
    36.9  #include <cstring>
   36.10  #include <iostream>
   36.11 @@ -32,11 +33,11 @@
   36.12      const string bob_pub_key = slurp("test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
   36.13  
   36.14      PEP_STATUS status0 = import_key(session, alice_pub_key.c_str(), alice_pub_key.size(), NULL);
   36.15 -    TEST_ASSERT_MSG((status0 == PEP_KEY_IMPORTED), "status0 == PEP_STATUS_OK");
   36.16 +    TEST_ASSERT_MSG((status0 == PEP_TEST_KEY_IMPORT_SUCCESS), "status0 == PEP_STATUS_OK");
   36.17      status0 = import_key(session, alice_priv_key.c_str(), alice_priv_key.size(), NULL);
   36.18 -    TEST_ASSERT_MSG((status0 == PEP_KEY_IMPORTED), "status0 == PEP_STATUS_OK");
   36.19 +    TEST_ASSERT_MSG((status0 == PEP_TEST_KEY_IMPORT_SUCCESS), "status0 == PEP_STATUS_OK");
   36.20      status0 = import_key(session, bob_pub_key.c_str(), bob_pub_key.size(), NULL);
   36.21 -    TEST_ASSERT_MSG((status0 == PEP_KEY_IMPORTED), "status0 == PEP_STATUS_OK");
   36.22 +    TEST_ASSERT_MSG((status0 == PEP_TEST_KEY_IMPORT_SUCCESS), "status0 == PEP_STATUS_OK");
   36.23      // message_api test code
   36.24  
   36.25      cout << "creating message…\n";
    37.1 --- a/test/src/engine_tests/MessageNullFromTests.cc	Wed Feb 06 14:58:03 2019 +0100
    37.2 +++ b/test/src/engine_tests/MessageNullFromTests.cc	Wed Feb 06 18:21:04 2019 +0100
    37.3 @@ -2,6 +2,7 @@
    37.4  // see LICENSE.txt
    37.5  
    37.6  #include <stdlib.h>
    37.7 +#include "TestConstants.h"
    37.8  #include <string>
    37.9  
   37.10  #include <assert.h>
   37.11 @@ -29,16 +30,16 @@
   37.12  void MessageNullFromTests::import_alice_pub() {
   37.13      const string alice_pub_key = slurp("test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc");
   37.14      PEP_STATUS status = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   37.15 -    assert(status == PEP_KEY_IMPORTED);
   37.16 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   37.17  }
   37.18  
   37.19  void MessageNullFromTests::import_bob_pair_and_set_own() {
   37.20      const string bob_pub_key = slurp("test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
   37.21      const string bob_priv_key = slurp("test_keys/priv/pep-test-bob-0xC9C2EE39_priv.asc");
   37.22      PEP_STATUS status = import_key(session, bob_pub_key.c_str(), bob_pub_key.length(), NULL);
   37.23 -    assert(status == PEP_KEY_IMPORTED);
   37.24 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   37.25      status = import_key(session, bob_priv_key.c_str(), bob_priv_key.length(), NULL);
   37.26 -    assert(status == PEP_KEY_IMPORTED);
   37.27 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   37.28  }
   37.29  
   37.30  void MessageNullFromTests::setup() {
    38.1 --- a/test/src/engine_tests/MessageTwoPointOhTests.cc	Wed Feb 06 14:58:03 2019 +0100
    38.2 +++ b/test/src/engine_tests/MessageTwoPointOhTests.cc	Wed Feb 06 18:21:04 2019 +0100
    38.3 @@ -2,6 +2,7 @@
    38.4  // see LICENSE.txt
    38.5  
    38.6  #include <stdlib.h>
    38.7 +#include "TestConstants.h"
    38.8  #include <string>
    38.9  #include <cstring>
   38.10  #include <iostream>
   38.11 @@ -39,12 +40,12 @@
   38.12  
   38.13      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   38.14      PEP_STATUS statuspriv = import_key(session, alice_priv_key.c_str(), alice_priv_key.length(), NULL);
   38.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   38.16 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   38.17 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   38.18 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   38.19      statuspub = import_key(session, carol_pub_key.c_str(), carol_pub_key.length(), NULL);
   38.20      statuspriv = import_key(session, carol_priv_key.c_str(), carol_priv_key.length(), NULL);
   38.21 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   38.22 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   38.23 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   38.24 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   38.25  
   38.26      cout << "creating message…\n";
   38.27      pEp_identity* alice = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", PEP_OWN_USERID, "Alice Test");
    39.1 --- a/test/src/engine_tests/MimeTests.cc	Wed Feb 06 14:58:03 2019 +0100
    39.2 +++ b/test/src/engine_tests/MimeTests.cc	Wed Feb 06 18:21:04 2019 +0100
    39.3 @@ -2,6 +2,7 @@
    39.4  // see LICENSE.txt
    39.5  
    39.6  #include <stdlib.h>
    39.7 +#include "TestConstants.h"
    39.8  #include <string>
    39.9  #include <cstring>
   39.10  #include <iostream>
    40.1 --- a/test/src/engine_tests/NewUpdateIdAndMyselfTests.cc	Wed Feb 06 14:58:03 2019 +0100
    40.2 +++ b/test/src/engine_tests/NewUpdateIdAndMyselfTests.cc	Wed Feb 06 18:21:04 2019 +0100
    40.3 @@ -6,6 +6,7 @@
    40.4  #include <iostream>
    40.5  #include <fstream>
    40.6  #include <cstring> // for strcmp()
    40.7 +#include "TestConstants.h"
    40.8  
    40.9  #include "pEpEngine.h"
   40.10  #include "message_api.h"
   40.11 @@ -195,7 +196,7 @@
   40.12      const string alex_pub_key = slurp("test_keys/pub/pep.test.alexander-0x26B54E4E_pub.asc");
   40.13      
   40.14      PEP_STATUS statuspub = import_key(session, alex_pub_key.c_str(), alex_pub_key.length(), NULL);
   40.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   40.16 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   40.17  
   40.18      pEp_identity* alex = new_identity(alex_address, alex_fpr, alex_userid, alex_username);
   40.19  
   40.20 @@ -353,7 +354,7 @@
   40.21      const string bella_pub_key = slurp("test_keys/pub/pep.test.bella-0xAF516AAE_pub.asc");
   40.22      
   40.23      statuspub = import_key(session, bella_pub_key.c_str(), bella_pub_key.length(), NULL);
   40.24 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   40.25 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   40.26  
   40.27      pEp_identity* bella = new_identity(bella_address, bella_fpr, bella_userid, bella_username);
   40.28      
   40.29 @@ -460,7 +461,7 @@
   40.30      const string bernd_pub_key = slurp("test_keys/pub/bernd.das.brot-0xCAFAA422_pub.asc");
   40.31      
   40.32      statuspub = import_key(session, bernd_pub_key.c_str(), bernd_pub_key.length(), NULL);
   40.33 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   40.34 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   40.35  
   40.36      pEp_identity* bernd = new_identity(bernd_address, bernd_fpr, bernd_userid, bernd_username);
   40.37      
    41.1 --- a/test/src/engine_tests/PepSubjectReceivedTests.cc	Wed Feb 06 14:58:03 2019 +0100
    41.2 +++ b/test/src/engine_tests/PepSubjectReceivedTests.cc	Wed Feb 06 18:21:04 2019 +0100
    41.3 @@ -1,6 +1,7 @@
    41.4  // This file is under GNU General Public License 3.0
    41.5  // see LICENSE.txt
    41.6  
    41.7 +#include "TestConstants.h"
    41.8  #include <stdlib.h>
    41.9  #include <string>
   41.10  #include <iostream>
    42.1 --- a/test/src/engine_tests/PgpBinaryTests.cc	Wed Feb 06 14:58:03 2019 +0100
    42.2 +++ b/test/src/engine_tests/PgpBinaryTests.cc	Wed Feb 06 18:21:04 2019 +0100
    42.3 @@ -2,6 +2,7 @@
    42.4  // see LICENSE.txt
    42.5  
    42.6  #include <stdlib.h>
    42.7 +#include "TestConstants.h"
    42.8  #include <string>
    42.9  #include <iostream>
   42.10  
    43.1 --- a/test/src/engine_tests/PgpListKeysTests.cc	Wed Feb 06 14:58:03 2019 +0100
    43.2 +++ b/test/src/engine_tests/PgpListKeysTests.cc	Wed Feb 06 18:21:04 2019 +0100
    43.3 @@ -2,6 +2,7 @@
    43.4  // see LICENSE.txt
    43.5  
    43.6  #include <stdlib.h>
    43.7 +#include "TestConstants.h"
    43.8  #include <string>
    43.9  #include <iostream>
   43.10  
    44.1 --- a/test/src/engine_tests/ReencryptPlusExtraKeysTests.cc	Wed Feb 06 14:58:03 2019 +0100
    44.2 +++ b/test/src/engine_tests/ReencryptPlusExtraKeysTests.cc	Wed Feb 06 18:21:04 2019 +0100
    44.3 @@ -2,6 +2,7 @@
    44.4  // see LICENSE.txt
    44.5  
    44.6  #include <stdlib.h>
    44.7 +#include "TestConstants.h"
    44.8  #include <cstring>
    44.9  #include <iostream>
   44.10  #include <fstream>
   44.11 @@ -52,24 +53,24 @@
   44.12      const string pub_extra_key_1 = slurp("test_keys/pub/reencrypt_extra_keys_1-0x8B026AEC_pub.asc");
   44.13  
   44.14      status = import_key(session, own_recip_pub_key.c_str(), own_recip_pub_key.length(), NULL);
   44.15 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import own recipient public key.");
   44.16 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import own recipient public key.");
   44.17      status = import_key(session, own_recip_priv_key.c_str(), own_recip_priv_key.length(), NULL);
   44.18 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import own recipient private key.");    
   44.19 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import own recipient private key.");    
   44.20      status = import_key(session, own_recip_2_pub_key.c_str(), own_recip_2_pub_key.length(), NULL);
   44.21 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import own second recipient public key.");
   44.22 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import own second recipient public key.");
   44.23      status = import_key(session, own_recip_2_priv_key.c_str(), own_recip_2_priv_key.length(), NULL);
   44.24 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import own second recipient public key.");
   44.25 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import own second recipient public key.");
   44.26      
   44.27      status = import_key(session, sender_pub_key.c_str(), sender_pub_key.length(), NULL);
   44.28 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import own sender public key.");
   44.29 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import own sender public key.");
   44.30      status = import_key(session, recip_2_pub_key.c_str(), recip_2_pub_key.length(), NULL);
   44.31 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to second recipient public key.");
   44.32 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to second recipient public key.");
   44.33      status = import_key(session, recip_0_pub_key.c_str(), recip_0_pub_key.length(), NULL);
   44.34 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import zeroth recipient public key.");
   44.35 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import zeroth recipient public key.");
   44.36      status = import_key(session, pub_extra_key_0.c_str(), pub_extra_key_0.length(), NULL);
   44.37 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import first extra public key.");
   44.38 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import first extra public key.");
   44.39      status = import_key(session, pub_extra_key_1.c_str(), pub_extra_key_1.length(), NULL);
   44.40 -    TEST_ASSERT_MSG(status == PEP_KEY_IMPORTED, "Failed to import second extra public key.");
   44.41 +    TEST_ASSERT_MSG(status == PEP_TEST_KEY_IMPORT_SUCCESS, "Failed to import second extra public key.");
   44.42  
   44.43      cout << "Keys imported." << endl;
   44.44  
    45.1 --- a/test/src/engine_tests/RevokeRegenAttachTests.cc	Wed Feb 06 14:58:03 2019 +0100
    45.2 +++ b/test/src/engine_tests/RevokeRegenAttachTests.cc	Wed Feb 06 18:21:04 2019 +0100
    45.3 @@ -1,6 +1,7 @@
    45.4  // This file is under GNU General Public License 3.0
    45.5  // see LICENSE.txt
    45.6  
    45.7 +#include "TestConstants.h"
    45.8  #include <stdlib.h>
    45.9  #include <string>
   45.10  #include <cstring>
   45.11 @@ -32,7 +33,7 @@
   45.12      EngineTestSessionSuite::setup();
   45.13      string recip_key = slurp("test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc");
   45.14      PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
   45.15 -    assert(status == PEP_KEY_IMPORTED);
   45.16 +    assert(status == PEP_TEST_KEY_IMPORT_SUCCESS);
   45.17  }
   45.18  
   45.19  
    46.1 --- a/test/src/engine_tests/SequenceTests.cc	Wed Feb 06 14:58:03 2019 +0100
    46.2 +++ b/test/src/engine_tests/SequenceTests.cc	Wed Feb 06 18:21:04 2019 +0100
    46.3 @@ -1,6 +1,7 @@
    46.4  // This file is under GNU General Public License 3.0
    46.5  // see LICENSE.txt
    46.6  
    46.7 +#include "TestConstants.h"
    46.8  #include <iostream>
    46.9  #include <string>
   46.10  #include <cstring> // for std::strdup()
    47.1 --- a/test/src/engine_tests/SignOnlyTests.cc	Wed Feb 06 14:58:03 2019 +0100
    47.2 +++ b/test/src/engine_tests/SignOnlyTests.cc	Wed Feb 06 18:21:04 2019 +0100
    47.3 @@ -1,6 +1,7 @@
    47.4  // This file is under GNU General Public License 3.0
    47.5  // see LICENSE.txt
    47.6  
    47.7 +#include "TestConstants.h"
    47.8  #include <stdlib.h>
    47.9  #include <string>
   47.10  #include <cstring>
    48.1 --- a/test/src/engine_tests/SimpleBodyNotAltTests.cc	Wed Feb 06 14:58:03 2019 +0100
    48.2 +++ b/test/src/engine_tests/SimpleBodyNotAltTests.cc	Wed Feb 06 18:21:04 2019 +0100
    48.3 @@ -1,6 +1,7 @@
    48.4  // This file is under GNU General Public License 3.0
    48.5  // see LICENSE.txt
    48.6  
    48.7 +#include "TestConstants.h"
    48.8  #include <stdlib.h>
    48.9  #include <string>
   48.10  #include <cstring>
    49.1 --- a/test/src/engine_tests/StringlistTests.cc	Wed Feb 06 14:58:03 2019 +0100
    49.2 +++ b/test/src/engine_tests/StringlistTests.cc	Wed Feb 06 18:21:04 2019 +0100
    49.3 @@ -1,6 +1,7 @@
    49.4  // This file is under GNU General Public License 3.0
    49.5  // see LICENSE.txt
    49.6  
    49.7 +#include "TestConstants.h"
    49.8  #include <stdlib.h>
    49.9  #include <string.h>
   49.10  #include "platform.h"
    50.1 --- a/test/src/engine_tests/StringpairListTests.cc	Wed Feb 06 14:58:03 2019 +0100
    50.2 +++ b/test/src/engine_tests/StringpairListTests.cc	Wed Feb 06 18:21:04 2019 +0100
    50.3 @@ -1,6 +1,7 @@
    50.4  // This file is under GNU General Public License 3.0
    50.5  // see LICENSE.txt
    50.6  
    50.7 +#include "TestConstants.h"
    50.8  #include <stdlib.h>
    50.9  #include <string.h>
   50.10  #include "platform.h"
    51.1 --- a/test/src/engine_tests/SubkeyRatingEvalTests.cc	Wed Feb 06 14:58:03 2019 +0100
    51.2 +++ b/test/src/engine_tests/SubkeyRatingEvalTests.cc	Wed Feb 06 18:21:04 2019 +0100
    51.3 @@ -1,6 +1,7 @@
    51.4  // This file is under GNU General Public License 3.0
    51.5  // see LICENSE.txt
    51.6  
    51.7 +#include "TestConstants.h"
    51.8  #include <stdlib.h>
    51.9  #include <string>
   51.10  
    52.1 --- a/test/src/engine_tests/SyncTests.cc	Wed Feb 06 14:58:03 2019 +0100
    52.2 +++ b/test/src/engine_tests/SyncTests.cc	Wed Feb 06 18:21:04 2019 +0100
    52.3 @@ -1,6 +1,7 @@
    52.4  // This file is under GNU General Public License 3.0
    52.5  // see LICENSE.txt
    52.6  
    52.7 +#include "TestConstants.h"
    52.8  #include <stdlib.h>
    52.9  #include <string>
   52.10  
    53.1 --- a/test/src/engine_tests/TrustManipulationTests.cc	Wed Feb 06 14:58:03 2019 +0100
    53.2 +++ b/test/src/engine_tests/TrustManipulationTests.cc	Wed Feb 06 18:21:04 2019 +0100
    53.3 @@ -1,6 +1,7 @@
    53.4  // This file is under GNU General Public License 3.0
    53.5  // see LICENSE.txt
    53.6  
    53.7 +#include "TestConstants.h"
    53.8  #include <stdlib.h>
    53.9  #include <string.h>
   53.10  #include <time.h>
    54.1 --- a/test/src/engine_tests/TrustwordsTests.cc	Wed Feb 06 14:58:03 2019 +0100
    54.2 +++ b/test/src/engine_tests/TrustwordsTests.cc	Wed Feb 06 18:21:04 2019 +0100
    54.3 @@ -1,6 +1,7 @@
    54.4  // This file is under GNU General Public License 3.0
    54.5  // see LICENSE.txt
    54.6  
    54.7 +#include "TestConstants.h"
    54.8  #include <iostream>
    54.9  #include <string>
   54.10  #include "pEpEngine.h"
    55.1 --- a/test/src/engine_tests/UserIDAliasTests.cc	Wed Feb 06 14:58:03 2019 +0100
    55.2 +++ b/test/src/engine_tests/UserIDAliasTests.cc	Wed Feb 06 18:21:04 2019 +0100
    55.3 @@ -1,6 +1,7 @@
    55.4  // This file is under GNU General Public License 3.0
    55.5  // see LICENSE.txt
    55.6  
    55.7 +#include "TestConstants.h"
    55.8  #include <iostream>
    55.9  #include <iostream>
   55.10  #include <fstream>
   55.11 @@ -33,8 +34,8 @@
   55.12      
   55.13      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
   55.14      PEP_STATUS statuspriv = import_key(session, alice_priv_key.c_str(), alice_priv_key.length(), NULL);
   55.15 -    TEST_ASSERT_MSG((statuspub == PEP_KEY_IMPORTED), "statuspub == PEP_STATUS_OK");
   55.16 -    TEST_ASSERT_MSG((statuspriv == PEP_KEY_IMPORTED), "statuspriv == PEP_STATUS_OK");
   55.17 +    TEST_ASSERT_MSG((statuspub == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspub == PEP_STATUS_OK");
   55.18 +    TEST_ASSERT_MSG((statuspriv == PEP_TEST_KEY_IMPORT_SUCCESS), "statuspriv == PEP_STATUS_OK");
   55.19  
   55.20      pEp_identity* alice = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", PEP_OWN_USERID, "Alice Test");
   55.21  
    56.1 --- a/test/src/engine_tests/UserIdCollisionTests.cc	Wed Feb 06 14:58:03 2019 +0100
    56.2 +++ b/test/src/engine_tests/UserIdCollisionTests.cc	Wed Feb 06 18:21:04 2019 +0100
    56.3 @@ -1,6 +1,7 @@
    56.4  // This file is under GNU General Public License 3.0
    56.5  // see LICENSE.txt
    56.6  
    56.7 +#include "TestConstants.h"
    56.8  #include <stdlib.h>
    56.9  #include <string>
   56.10  #include <cstring>
    57.1 --- a/test/src/pEpTestOutput.cc	Wed Feb 06 14:58:03 2019 +0100
    57.2 +++ b/test/src/pEpTestOutput.cc	Wed Feb 06 18:21:04 2019 +0100
    57.3 @@ -6,6 +6,7 @@
    57.4  #include <cstring>
    57.5  #include <utility>
    57.6  
    57.7 +#include "TestConstants.h"
    57.8  #include "pEpTestOutput.h"
    57.9  using namespace std;
   57.10  
    58.1 --- a/test/src/pEpTestStatic.cc	Wed Feb 06 14:58:03 2019 +0100
    58.2 +++ b/test/src/pEpTestStatic.cc	Wed Feb 06 18:21:04 2019 +0100
    58.3 @@ -4,6 +4,7 @@
    58.4  #include "pEpTestStatic.h"
    58.5  #include <math.h>
    58.6  #include <string>
    58.7 +#include "TestConstants.h"
    58.8  
    58.9  using namespace std;
   58.10  
    59.1 --- a/test/src/util/test_util.cc	Wed Feb 06 14:58:03 2019 +0100
    59.2 +++ b/test/src/util/test_util.cc	Wed Feb 06 18:21:04 2019 +0100
    59.3 @@ -3,6 +3,7 @@
    59.4  #include "pEp_internal.h"
    59.5  #include "message_api.h"
    59.6  #include "test_util.h"
    59.7 +#include "TestConstants.h"
    59.8  
    59.9  #include <fstream>
   59.10  #include <sstream>
   59.11 @@ -31,7 +32,7 @@
   59.12                                       pEp_identity** ret_ident,
   59.13                                       bool is_priv) {
   59.14      PEP_STATUS status = read_file_and_import_key(session,key_fname);
   59.15 -    if (status != PEP_KEY_IMPORTED)
   59.16 +    if (status != PEP_TEST_KEY_IMPORT_SUCCESS)
   59.17          return status;
   59.18      else
   59.19          status = PEP_STATUS_OK;
   59.20 @@ -382,7 +383,7 @@
   59.21  
   59.22  bool slurp_and_import_key(PEP_SESSION session, const char* key_filename) {
   59.23      std::string keyfile = slurp(key_filename);
   59.24 -    if (import_key(session, keyfile.c_str(), keyfile.size(), NULL) != PEP_KEY_IMPORTED)
   59.25 +    if (import_key(session, keyfile.c_str(), keyfile.size(), NULL) != PEP_TEST_KEY_IMPORT_SUCCESS)
   59.26          return false;
   59.27      return true;
   59.28  }