Test asserts sync
authorKrista Bennett <krista@pep-project.org>
Mon, 22 Oct 2018 10:40:15 +0200
branchsync
changeset 309739251f347500
parent 3096 89d9de21bc2a
child 3099 67f66e9a47fc
child 3100 1bd0c12ba841
Test asserts
test/src/SuiteMaker.cc
test/src/engine_tests/BlacklistTests.cc
     1.1 --- a/test/src/SuiteMaker.cc	Mon Oct 22 10:34:59 2018 +0200
     1.2 +++ b/test/src/SuiteMaker.cc	Mon Oct 22 10:40:15 2018 +0200
     1.3 @@ -12,175 +12,175 @@
     1.4  #include "SuiteMaker.h"
     1.5  
     1.6  // Begin where we generate stuff
     1.7 -#include "MimeTests.h"
     1.8 +#include "DecorateTests.h"
     1.9  #include "UserIdCollisionTests.h"
    1.10 +#include "ReencryptPlusExtraKeysTests.h"
    1.11 +#include "BlacklistTests.h"
    1.12 +#include "AppleMailTests.h"
    1.13 +#include "MessageTwoPointOhTests.h"
    1.14 +#include "IdentityListTests.h"
    1.15 +#include "I18nTests.h"
    1.16  #include "Engine463Tests.h"
    1.17 -#include "BloblistTests.h"
    1.18 -#include "NewUpdateIdAndMyselfTests.h"
    1.19 -#include "I18nTests.h"
    1.20 -#include "IdentityListTests.h"
    1.21 -#include "PgpBinaryTests.h"
    1.22 -#include "MessageNullFromTests.h"
    1.23 -#include "LeastCommonDenomColorTests.h"
    1.24 +#include "DecryptAttachPrivateKeyUntrustedTests.h"
    1.25 +#include "BCCTests.h"
    1.26 +#include "LeastColorGroupTests.h"
    1.27 +#include "BlacklistAcceptNewKeyTests.h"
    1.28 +#include "MessageApiTests.h"
    1.29  #include "StringlistTests.h"
    1.30 -#include "PgpListKeysTests.h"
    1.31 -#include "MessageApiTests.h"
    1.32 -#include "EncryptMissingPrivateKeyTests.h"
    1.33 -#include "CaseAndDotAddressTests.h"
    1.34 -#include "UserIDAliasTests.h"
    1.35 -#include "BCCTests.h"
    1.36 -#include "BlacklistAcceptNewKeyTests.h"
    1.37 -#include "DecryptAttachPrivateKeyUntrustedTests.h"
    1.38 -#include "BlacklistTests.h"
    1.39 -#include "RevokeRegenAttachTests.h"
    1.40 -#include "PepSubjectReceivedTests.h"
    1.41 -#include "SequenceTests.h"
    1.42 -#include "EncryptAttachPrivateKeyTests.h"
    1.43 -#include "ExternalRevokeTests.h"
    1.44 -#include "KeyeditTests.h"
    1.45 -#include "LeastColorGroupTests.h"
    1.46 -#include "DecryptAttachPrivateKeyTrustedTests.h"
    1.47 -#include "TrustwordsTests.h"
    1.48 -#include "ReencryptPlusExtraKeysTests.h"
    1.49 -#include "MapAsn1Tests.h"
    1.50 -#include "DecorateTests.h"
    1.51 -#include "MessageTwoPointOhTests.h"
    1.52 -#include "CrashdumpTests.h"
    1.53  #include "StringpairListTests.h"
    1.54 -#include "EncryptForIdentityTests.h"
    1.55 -#include "KeyResetMessageTests.h"
    1.56  #include "TrustManipulationTests.h"
    1.57  #include "SyncTests.h"
    1.58 -#include "AppleMailTests.h"
    1.59 +#include "EncryptAttachPrivateKeyTests.h"
    1.60 +#include "BloblistTests.h"
    1.61 +#include "KeyResetMessageTests.h"
    1.62 +#include "SequenceTests.h"
    1.63 +#include "TrustwordsTests.h"
    1.64 +#include "RevokeRegenAttachTests.h"
    1.65 +#include "EncryptMissingPrivateKeyTests.h"
    1.66 +#include "PepSubjectReceivedTests.h"
    1.67 +#include "KeyeditTests.h"
    1.68 +#include "MapAsn1Tests.h"
    1.69 +#include "PgpBinaryTests.h"
    1.70 +#include "DecryptAttachPrivateKeyTrustedTests.h"
    1.71 +#include "MessageNullFromTests.h"
    1.72 +#include "MimeTests.h"
    1.73 +#include "PgpListKeysTests.h"
    1.74 +#include "NewUpdateIdAndMyselfTests.h"
    1.75 +#include "EncryptForIdentityTests.h"
    1.76 +#include "CrashdumpTests.h"
    1.77 +#include "CaseAndDotAddressTests.h"
    1.78 +#include "LeastCommonDenomColorTests.h"
    1.79 +#include "ExternalRevokeTests.h"
    1.80 +#include "UserIDAliasTests.h"
    1.81  
    1.82  
    1.83  const char* SuiteMaker::all_suites[] = {
    1.84 -    "MimeTests",
    1.85 +    "DecorateTests",
    1.86      "UserIdCollisionTests",
    1.87 +    "ReencryptPlusExtraKeysTests",
    1.88 +    "BlacklistTests",
    1.89 +    "AppleMailTests",
    1.90 +    "MessageTwoPointOhTests",
    1.91 +    "IdentityListTests",
    1.92 +    "I18nTests",
    1.93      "Engine463Tests",
    1.94 -    "BloblistTests",
    1.95 -    "NewUpdateIdAndMyselfTests",
    1.96 -    "I18nTests",
    1.97 -    "IdentityListTests",
    1.98 -    "PgpBinaryTests",
    1.99 -    "MessageNullFromTests",
   1.100 -    "LeastCommonDenomColorTests",
   1.101 +    "DecryptAttachPrivateKeyUntrustedTests",
   1.102 +    "BCCTests",
   1.103 +    "LeastColorGroupTests",
   1.104 +    "BlacklistAcceptNewKeyTests",
   1.105 +    "MessageApiTests",
   1.106      "StringlistTests",
   1.107 -    "PgpListKeysTests",
   1.108 -    "MessageApiTests",
   1.109 -    "EncryptMissingPrivateKeyTests",
   1.110 -    "CaseAndDotAddressTests",
   1.111 -    "UserIDAliasTests",
   1.112 -    "BCCTests",
   1.113 -    "BlacklistAcceptNewKeyTests",
   1.114 -    "DecryptAttachPrivateKeyUntrustedTests",
   1.115 -    "BlacklistTests",
   1.116 -    "RevokeRegenAttachTests",
   1.117 -    "PepSubjectReceivedTests",
   1.118 -    "SequenceTests",
   1.119 -    "EncryptAttachPrivateKeyTests",
   1.120 -    "ExternalRevokeTests",
   1.121 -    "KeyeditTests",
   1.122 -    "LeastColorGroupTests",
   1.123 -    "DecryptAttachPrivateKeyTrustedTests",
   1.124 -    "TrustwordsTests",
   1.125 -    "ReencryptPlusExtraKeysTests",
   1.126 -    "MapAsn1Tests",
   1.127 -    "DecorateTests",
   1.128 -    "MessageTwoPointOhTests",
   1.129 -    "CrashdumpTests",
   1.130      "StringpairListTests",
   1.131 -    "EncryptForIdentityTests",
   1.132 -    "KeyResetMessageTests",
   1.133      "TrustManipulationTests",
   1.134      "SyncTests",
   1.135 -    "AppleMailTests",
   1.136 +    "EncryptAttachPrivateKeyTests",
   1.137 +    "BloblistTests",
   1.138 +    "KeyResetMessageTests",
   1.139 +    "SequenceTests",
   1.140 +    "TrustwordsTests",
   1.141 +    "RevokeRegenAttachTests",
   1.142 +    "EncryptMissingPrivateKeyTests",
   1.143 +    "PepSubjectReceivedTests",
   1.144 +    "KeyeditTests",
   1.145 +    "MapAsn1Tests",
   1.146 +    "PgpBinaryTests",
   1.147 +    "DecryptAttachPrivateKeyTrustedTests",
   1.148 +    "MessageNullFromTests",
   1.149 +    "MimeTests",
   1.150 +    "PgpListKeysTests",
   1.151 +    "NewUpdateIdAndMyselfTests",
   1.152 +    "EncryptForIdentityTests",
   1.153 +    "CrashdumpTests",
   1.154 +    "CaseAndDotAddressTests",
   1.155 +    "LeastCommonDenomColorTests",
   1.156 +    "ExternalRevokeTests",
   1.157 +    "UserIDAliasTests",
   1.158  };
   1.159  
   1.160  // This file is generated, so magic constants are ok.
   1.161  int SuiteMaker::num_suites = 40;
   1.162  
   1.163  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   1.164 -    if (strcmp(test_class_name, "MimeTests") == 0)
   1.165 -        *test_suite = new MimeTests(test_class_name, test_home);
   1.166 +    if (strcmp(test_class_name, "DecorateTests") == 0)
   1.167 +        *test_suite = new DecorateTests(test_class_name, test_home);
   1.168      else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   1.169          *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   1.170 +    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   1.171 +        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   1.172 +    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   1.173 +        *test_suite = new BlacklistTests(test_class_name, test_home);
   1.174 +    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   1.175 +        *test_suite = new AppleMailTests(test_class_name, test_home);
   1.176 +    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   1.177 +        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   1.178 +    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   1.179 +        *test_suite = new IdentityListTests(test_class_name, test_home);
   1.180 +    else if (strcmp(test_class_name, "I18nTests") == 0)
   1.181 +        *test_suite = new I18nTests(test_class_name, test_home);
   1.182      else if (strcmp(test_class_name, "Engine463Tests") == 0)
   1.183          *test_suite = new Engine463Tests(test_class_name, test_home);
   1.184 -    else if (strcmp(test_class_name, "BloblistTests") == 0)
   1.185 -        *test_suite = new BloblistTests(test_class_name, test_home);
   1.186 -    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   1.187 -        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   1.188 -    else if (strcmp(test_class_name, "I18nTests") == 0)
   1.189 -        *test_suite = new I18nTests(test_class_name, test_home);
   1.190 -    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   1.191 -        *test_suite = new IdentityListTests(test_class_name, test_home);
   1.192 -    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   1.193 -        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   1.194 -    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   1.195 -        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   1.196 -    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   1.197 -        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   1.198 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   1.199 +        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   1.200 +    else if (strcmp(test_class_name, "BCCTests") == 0)
   1.201 +        *test_suite = new BCCTests(test_class_name, test_home);
   1.202 +    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   1.203 +        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   1.204 +    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   1.205 +        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   1.206 +    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   1.207 +        *test_suite = new MessageApiTests(test_class_name, test_home);
   1.208      else if (strcmp(test_class_name, "StringlistTests") == 0)
   1.209          *test_suite = new StringlistTests(test_class_name, test_home);
   1.210 -    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   1.211 -        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   1.212 -    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   1.213 -        *test_suite = new MessageApiTests(test_class_name, test_home);
   1.214 -    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   1.215 -        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   1.216 -    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   1.217 -        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   1.218 -    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   1.219 -        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   1.220 -    else if (strcmp(test_class_name, "BCCTests") == 0)
   1.221 -        *test_suite = new BCCTests(test_class_name, test_home);
   1.222 -    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   1.223 -        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   1.224 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   1.225 -        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   1.226 -    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   1.227 -        *test_suite = new BlacklistTests(test_class_name, test_home);
   1.228 -    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   1.229 -        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   1.230 -    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   1.231 -        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   1.232 -    else if (strcmp(test_class_name, "SequenceTests") == 0)
   1.233 -        *test_suite = new SequenceTests(test_class_name, test_home);
   1.234 -    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   1.235 -        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   1.236 -    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   1.237 -        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   1.238 -    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   1.239 -        *test_suite = new KeyeditTests(test_class_name, test_home);
   1.240 -    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   1.241 -        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   1.242 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   1.243 -        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   1.244 -    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   1.245 -        *test_suite = new TrustwordsTests(test_class_name, test_home);
   1.246 -    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   1.247 -        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   1.248 -    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   1.249 -        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   1.250 -    else if (strcmp(test_class_name, "DecorateTests") == 0)
   1.251 -        *test_suite = new DecorateTests(test_class_name, test_home);
   1.252 -    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   1.253 -        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   1.254 -    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   1.255 -        *test_suite = new CrashdumpTests(test_class_name, test_home);
   1.256      else if (strcmp(test_class_name, "StringpairListTests") == 0)
   1.257          *test_suite = new StringpairListTests(test_class_name, test_home);
   1.258 -    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   1.259 -        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   1.260 -    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   1.261 -        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   1.262      else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   1.263          *test_suite = new TrustManipulationTests(test_class_name, test_home);
   1.264      else if (strcmp(test_class_name, "SyncTests") == 0)
   1.265          *test_suite = new SyncTests(test_class_name, test_home);
   1.266 -    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   1.267 -        *test_suite = new AppleMailTests(test_class_name, test_home);
   1.268 +    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   1.269 +        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   1.270 +    else if (strcmp(test_class_name, "BloblistTests") == 0)
   1.271 +        *test_suite = new BloblistTests(test_class_name, test_home);
   1.272 +    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   1.273 +        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   1.274 +    else if (strcmp(test_class_name, "SequenceTests") == 0)
   1.275 +        *test_suite = new SequenceTests(test_class_name, test_home);
   1.276 +    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   1.277 +        *test_suite = new TrustwordsTests(test_class_name, test_home);
   1.278 +    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   1.279 +        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   1.280 +    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   1.281 +        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   1.282 +    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   1.283 +        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   1.284 +    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   1.285 +        *test_suite = new KeyeditTests(test_class_name, test_home);
   1.286 +    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   1.287 +        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   1.288 +    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   1.289 +        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   1.290 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   1.291 +        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   1.292 +    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   1.293 +        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   1.294 +    else if (strcmp(test_class_name, "MimeTests") == 0)
   1.295 +        *test_suite = new MimeTests(test_class_name, test_home);
   1.296 +    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   1.297 +        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   1.298 +    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   1.299 +        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   1.300 +    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   1.301 +        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   1.302 +    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   1.303 +        *test_suite = new CrashdumpTests(test_class_name, test_home);
   1.304 +    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   1.305 +        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   1.306 +    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   1.307 +        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   1.308 +    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   1.309 +        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   1.310 +    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   1.311 +        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   1.312  }
   1.313  
   1.314  void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
     2.1 --- a/test/src/engine_tests/BlacklistTests.cc	Mon Oct 22 10:34:59 2018 +0200
     2.2 +++ b/test/src/engine_tests/BlacklistTests.cc	Mon Oct 22 10:40:15 2018 +0200
     2.3 @@ -144,15 +144,15 @@
     2.4      TEST_ASSERT_MSG((!(blacklisted_identity->fpr) || blacklisted_identity->fpr[0] == '\0'|| (strcmp(blacklisted_identity->fpr, bl_fpr_2) == 0)), "!(blacklisted_identity->fpr) || blacklisted_identity->fpr[0] == '\0'|| (strcmp(blacklisted_identity->fpr, bl_fpr_2) == 0)");
     2.5  
     2.6      pEp_identity *me = new_identity("alice@peptest.ch", NULL, "423", "Alice Miller");
     2.7 -    assert(me);
     2.8 +    TEST_ASSERT(me);
     2.9      PEP_STATUS status24 = myself(session, me);
    2.10      TEST_ASSERT_MSG((status24 == PEP_STATUS_OK), "myself: status24 == PEP_STATUS_OK");
    2.11  
    2.12      message *msg23 = new_message(PEP_dir_outgoing);
    2.13 -    assert(msg23);
    2.14 +    TEST_ASSERT(msg23);
    2.15      msg23->from = me;
    2.16      msg23->to = new_identity_list(identity_dup(blacklisted_identity));
    2.17 -    assert(msg23->to && msg23->to->ident);
    2.18 +    TEST_ASSERT(msg23->to && msg23->to->ident);
    2.19      PEP_rating rating23;
    2.20  
    2.21      cout << "testing outgoing_message_rating() with blacklisted key in to\n";