ENGINE-398: Merge now compiles and tests pass. sync_and_key_reset
authorKrista Bennett <krista@pep-project.org>
Fri, 28 Sep 2018 10:07:05 +0200
branchsync_and_key_reset
changeset 2956e82181973f21
parent 2955 3b2500a15709
child 2957 9557662f7def
ENGINE-398: Merge now compiles and tests pass.
src/key_reset.c
src/message_api.c
src/pEpEngine.c
src/pEpEngine.h
test/include/KeyResetMessageTests.h
test/src/SuiteMaker.cc
test/src/engine_tests/KeyResetMessageTests.cc
test/src/util/test_util.cc
     1.1 --- a/src/key_reset.c	Thu Sep 27 17:34:45 2018 +0200
     1.2 +++ b/src/key_reset.c	Fri Sep 28 10:07:05 2018 +0200
     1.3 @@ -123,7 +123,7 @@
     1.4      pEp_identity* temp_ident = identity_dup(sender_id);
     1.5      if (!temp_ident) {
     1.6          status = PEP_OUT_OF_MEMORY;
     1.7 -        goto pep_free;
     1.8 +        goto pEp_free;
     1.9      }        
    1.10              
    1.11      char* rest = NULL;
    1.12 @@ -132,7 +132,7 @@
    1.13          old_fpr = strdup(p + 5);
    1.14      else {
    1.15          status = PEP_MALFORMED_KEY_RESET_MSG;
    1.16 -        goto pep_free;
    1.17 +        goto pEp_free;
    1.18      }
    1.19      
    1.20      bool own_key = false;
    1.21 @@ -142,13 +142,13 @@
    1.22          // Nope, no one can make us our own default. If we want to do that,
    1.23          // that's keysync, NOT key reset.
    1.24          status = PEP_ILLEGAL_VALUE;
    1.25 -        goto pep_free;
    1.26 +        goto pEp_free;
    1.27      }
    1.28              
    1.29      p = strtok_r(NULL, "\r\n", &rest); 
    1.30      if (strncmp(p, "NEW: ", 5) != 0  || EMPTYSTR(p + 5)) {
    1.31          status = PEP_MALFORMED_KEY_RESET_MSG;
    1.32 -        goto pep_free;
    1.33 +        goto pEp_free;
    1.34      }
    1.35  
    1.36      new_fpr = strdup(p + 5);
    1.37 @@ -156,15 +156,15 @@
    1.38      // Reset the original key
    1.39      status = key_reset(session, old_fpr, temp_ident);
    1.40      if (status != PEP_STATUS_OK)
    1.41 -        goto pep_free;
    1.42 +        goto pEp_free;
    1.43          
    1.44      status = find_keys(session, new_fpr, &keylist);
    1.45      if (status != PEP_STATUS_OK)
    1.46 -        goto pep_free;
    1.47 +        goto pEp_free;
    1.48          
    1.49      if (!keylist) {
    1.50          status = PEP_KEY_NOT_FOUND;
    1.51 -        goto pep_free;
    1.52 +        goto pEp_free;
    1.53      }
    1.54  
    1.55      // alright, we've checked as best we can. Let's set that baby.
    1.56 @@ -175,7 +175,7 @@
    1.57      status = set_identity(session, sender_id);
    1.58      
    1.59      sender_id->fpr = NULL; // ownership for free
    1.60 -pep_free:    
    1.61 +pEp_free:    
    1.62      free_stringlist(keylist);    
    1.63      free(old_fpr);
    1.64      free(new_fpr);
    1.65 @@ -241,17 +241,12 @@
    1.66      assert(old_fpr);
    1.67      assert(new_fpr);
    1.68      assert(session);
    1.69 -    assert(session->messageToSend || session->sync_session->messageToSend);
    1.70 +    assert(session->messageToSend);
    1.71      
    1.72      if (!session || !old_fpr || !new_fpr)
    1.73          return PEP_ILLEGAL_VALUE;
    1.74  
    1.75 -    messageToSend_t send_cb = send_cb = session->messageToSend;
    1.76 -    void* sync_obj = session->sync_obj;
    1.77 -    if (!send_cb) {
    1.78 -        send_cb = session->sync_session->messageToSend;
    1.79 -        sync_obj = session->sync_session->sync_obj;
    1.80 -    }
    1.81 +    messageToSend_t send_cb = session->messageToSend;
    1.82      if (!send_cb)
    1.83          return PEP_SYNC_NO_MESSAGE_SEND_CALLBACK;
    1.84          
    1.85 @@ -261,7 +256,7 @@
    1.86      PEP_STATUS status = get_last_contacted(session, &recent_contacts);
    1.87      
    1.88      if (status != PEP_STATUS_OK)
    1.89 -        goto pep_free;
    1.90 +        goto pEp_free;
    1.91                      
    1.92      identity_list* curr_id_ptr = recent_contacts;
    1.93  
    1.94 @@ -285,7 +280,7 @@
    1.95          bool contacted = false;
    1.96          status = has_key_reset_been_sent(session, user_id, old_fpr, &contacted);
    1.97          if (status != PEP_STATUS_OK)
    1.98 -            goto pep_free;
    1.99 +            goto pEp_free;
   1.100      
   1.101          if (contacted)
   1.102              continue;
   1.103 @@ -306,24 +301,24 @@
   1.104              
   1.105          if (status != PEP_STATUS_OK) {
   1.106              free(reset_msg);
   1.107 -            goto pep_free;
   1.108 +            goto pEp_free;
   1.109          }
   1.110          
   1.111          // insert into queue
   1.112 -        status = send_cb(sync_obj, reset_msg);
   1.113 +        status = send_cb(reset_msg);
   1.114  
   1.115          if (status != PEP_STATUS_OK) {
   1.116              free(reset_msg);
   1.117 -            goto pep_free;            
   1.118 +            goto pEp_free;            
   1.119          }
   1.120              
   1.121          // Put into notified DB
   1.122          status = set_reset_contact_notified(session, old_fpr, user_id);
   1.123          if (status != PEP_STATUS_OK)
   1.124 -            goto pep_free;            
   1.125 +            goto pEp_free;            
   1.126      }
   1.127      
   1.128 -pep_free:
   1.129 +pEp_free:
   1.130      free_identity_list(recent_contacts);
   1.131      return status;
   1.132  }
   1.133 @@ -355,7 +350,7 @@
   1.134          // Get list of own identities
   1.135          status = get_default_own_userid(session, &own_id);
   1.136          if (status != PEP_STATUS_OK)
   1.137 -            goto pep_free;
   1.138 +            goto pEp_free;
   1.139              
   1.140          if (EMPTYSTR(fpr_copy)) {
   1.141              status = get_all_keys_for_user(session, own_id, &keys);
   1.142 @@ -367,7 +362,7 @@
   1.143                          break;
   1.144                  }
   1.145              }
   1.146 -            goto pep_free;
   1.147 +            goto pEp_free;
   1.148          } // otherwise, we have a specific fpr to process
   1.149  
   1.150          // fpr_copy exists, so... let's go.
   1.151 @@ -385,7 +380,7 @@
   1.152                      break;                    
   1.153              }
   1.154          }
   1.155 -        goto pep_free;
   1.156 +        goto pEp_free;
   1.157      }
   1.158      else { // an identity was specified.       
   1.159          if (is_me(session, ident)) {            
   1.160 @@ -473,7 +468,7 @@
   1.161          }
   1.162      }
   1.163      
   1.164 -pep_free:
   1.165 +pEp_free:
   1.166      free(fpr_copy);
   1.167      free(own_id);
   1.168      free_identity_list(key_idents);
     2.1 --- a/src/message_api.c	Thu Sep 27 17:34:45 2018 +0200
     2.2 +++ b/src/message_api.c	Fri Sep 28 10:07:05 2018 +0200
     2.3 @@ -1763,7 +1763,7 @@
     2.4                  _status = bind_own_ident_with_contact_ident(session, src->from, _il->ident);
     2.5                  if (_status != PEP_STATUS_OK) {
     2.6                      status = PEP_UNKNOWN_DB_ERROR;
     2.7 -                    goto pep_error;
     2.8 +                    goto pEp_error;
     2.9                  }
    2.10      
    2.11              }
    2.12 @@ -3122,7 +3122,7 @@
    2.13                  replace_fpr = NULL;
    2.14                  break;
    2.15              default:    
    2.16 -                goto pep_free;    
    2.17 +                goto pEp_free;    
    2.18          }
    2.19      }
    2.20      
    2.21 @@ -3131,7 +3131,7 @@
    2.22          _the_list = NULL;
    2.23      }
    2.24              
    2.25 -pep_free:
    2.26 +pEp_free:
    2.27      free_stringpair_list(_the_list);
    2.28      return status;
    2.29  
    2.30 @@ -3402,7 +3402,7 @@
    2.31                                      // ?
    2.32                                      if (status != PEP_STATUS_OK) {
    2.33                                          free_message(inner_message);
    2.34 -                                        goto pep_error;
    2.35 +                                        goto pEp_error;
    2.36                                      }
    2.37      
    2.38                                      if (wrap_info) {
    2.39 @@ -3557,7 +3557,7 @@
    2.40      if (status != PEP_STATUS_OK) {
    2.41          // This should really never choke unless the DB is broken.
    2.42          status = PEP_UNKNOWN_DB_ERROR;
    2.43 -        goto pep_error;
    2.44 +        goto pEp_error;
    2.45      }
    2.46      
    2.47      stringpair_list_t* curr_pair_node;
    2.48 @@ -3580,35 +3580,30 @@
    2.49              // go on letting them use the wrong key until we mail them ourselves. (Spammers, etc)
    2.50              if (status != PEP_CANNOT_FIND_IDENTITY) {
    2.51                  if (status != PEP_STATUS_OK)
    2.52 -                    goto pep_error;
    2.53 +                    goto pEp_error;
    2.54                      
    2.55                  if (!reset_msg) {
    2.56                      status = PEP_OUT_OF_MEMORY;
    2.57 -                    goto pep_error;
    2.58 +                    goto pEp_error;
    2.59                  }
    2.60                  // insert into queue
    2.61 -                if (session->messageToSend) {
    2.62 -                    status = session->messageToSend(session->sync_obj, reset_msg);
    2.63 -                } 
    2.64 -                else if (session->sync_session->messageToSend) {
    2.65 -                    status = session->sync_session->messageToSend(session->sync_session->sync_obj, 
    2.66 -                                                                  reset_msg); 
    2.67 -                }
    2.68 -                else {
    2.69 +                if (session->messageToSend)
    2.70 +                    status = session->messageToSend(reset_msg);
    2.71 +                else
    2.72                      status = PEP_SYNC_NO_MESSAGE_SEND_CALLBACK;
    2.73 -                }
    2.74 +            
    2.75  
    2.76                  if (status == PEP_STATUS_OK) {    
    2.77                      // Put into notified DB
    2.78                      status = set_reset_contact_notified(session, curr_pair->key, msg->from->user_id);
    2.79                      if (status != PEP_STATUS_OK) // It's ok to barf because it's a DB problem??
    2.80 -                        goto pep_error;
    2.81 +                        goto pEp_error;
    2.82                  }
    2.83                  else {
    2.84                      // According to Volker, this would only be a fatal error, so...
    2.85                      free_message(reset_msg); // ??
    2.86                      reset_msg = NULL; // ??
    2.87 -                    goto pep_error;
    2.88 +                    goto pEp_error;
    2.89                  }
    2.90              }
    2.91          }
     3.1 --- a/src/pEpEngine.c	Thu Sep 27 17:34:45 2018 +0200
     3.2 +++ b/src/pEpEngine.c	Fri Sep 28 10:07:05 2018 +0200
     3.3 @@ -2767,7 +2767,7 @@
     3.4  
     3.5  
     3.6  // This ONLY sets the user flag. Must be called outside of a transaction.
     3.7 -PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user) {
     3.8 +DYNAMIC_API PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user) {
     3.9  
    3.10      assert(session);
    3.11      assert(user);
     4.1 --- a/src/pEpEngine.h	Thu Sep 27 17:34:45 2018 +0200
     4.2 +++ b/src/pEpEngine.h	Fri Sep 28 10:07:05 2018 +0200
     4.3 @@ -1330,7 +1330,7 @@
     4.4  PEP_STATUS refresh_userid_default_key(PEP_SESSION session, const char* user_id);
     4.5  
     4.6  // This ONLY sets the *user* flag, and creates a shell identity if necessary.
     4.7 -PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user);
     4.8 +DYNAMIC_API PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user);
     4.9  
    4.10  // returns true (by reference) if a person with this user_id exists; 
    4.11  // Also replaces aliased user_ids by defaults in identity.
     5.1 --- a/test/include/KeyResetMessageTests.h	Thu Sep 27 17:34:45 2018 +0200
     5.2 +++ b/test/include/KeyResetMessageTests.h	Fri Sep 28 10:07:05 2018 +0200
     5.3 @@ -6,7 +6,6 @@
     5.4  
     5.5  #include <string>
     5.6  #include "EngineTestIndividualSuite.h"
     5.7 -#include "sync.h"
     5.8  #include "pEpEngine.h"
     5.9  
    5.10  using namespace std;
    5.11 @@ -15,7 +14,9 @@
    5.12      public:
    5.13          KeyResetMessageTests(string test_suite, string test_home_dir);
    5.14          
    5.15 -        static PEP_STATUS message_send_callback(void *obj, message *msg);
    5.16 +        static PEP_STATUS message_send_callback(message *msg);
    5.17 +        
    5.18 +        static KeyResetMessageTests* fake_this;
    5.19          
    5.20          vector<message*> m_queue;
    5.21          
     6.1 --- a/test/src/SuiteMaker.cc	Thu Sep 27 17:34:45 2018 +0200
     6.2 +++ b/test/src/SuiteMaker.cc	Fri Sep 28 10:07:05 2018 +0200
     6.3 @@ -12,161 +12,165 @@
     6.4  #include "SuiteMaker.h"
     6.5  
     6.6  // Begin where we generate stuff
     6.7 +#include "DecorateTests.h"
     6.8 +#include "ReencryptPlusExtraKeysTests.h"
     6.9 +#include "BlacklistTests.h"
    6.10 +#include "AppleMailTests.h"
    6.11 +#include "MessageTwoPointOhTests.h"
    6.12 +#include "IdentityListTests.h"
    6.13 +#include "I18nTests.h"
    6.14 +#include "DecryptAttachPrivateKeyUntrustedTests.h"
    6.15 +#include "BCCTests.h"
    6.16 +#include "LeastColorGroupTests.h"
    6.17 +#include "BlacklistAcceptNewKeyTests.h"
    6.18 +#include "MessageApiTests.h"
    6.19 +#include "StringlistTests.h"
    6.20 +#include "StringpairListTests.h"
    6.21 +#include "TrustManipulationTests.h"
    6.22 +#include "SyncTests.h"
    6.23 +#include "EncryptAttachPrivateKeyTests.h"
    6.24 +#include "BloblistTests.h"
    6.25 +#include "KeyResetMessageTests.h"
    6.26 +#include "SequenceTests.h"
    6.27 +#include "TrustwordsTests.h"
    6.28 +#include "RevokeRegenAttachTests.h"
    6.29 +#include "EncryptMissingPrivateKeyTests.h"
    6.30 +#include "PepSubjectReceivedTests.h"
    6.31 +#include "KeyeditTests.h"
    6.32  #include "MapAsn1Tests.h"
    6.33 -#include "DecorateTests.h"
    6.34 -#include "EncryptMissingPrivateKeyTests.h"
    6.35 -#include "KeyeditTests.h"
    6.36 -#include "BlacklistAcceptNewKeyTests.h"
    6.37 -#include "DecryptAttachPrivateKeyUntrustedTests.h"
    6.38 -#include "AppleMailTests.h"
    6.39 +#include "PgpBinaryTests.h"
    6.40 +#include "DecryptAttachPrivateKeyTrustedTests.h"
    6.41 +#include "MessageNullFromTests.h"
    6.42 +#include "MimeTests.h"
    6.43 +#include "PgpListKeysTests.h"
    6.44 +#include "NewUpdateIdAndMyselfTests.h"
    6.45 +#include "EncryptForIdentityTests.h"
    6.46 +#include "CrashdumpTests.h"
    6.47  #include "CaseAndDotAddressTests.h"
    6.48 -#include "SequenceTests.h"
    6.49 -#include "BCCTests.h"
    6.50 -#include "MessageApiTests.h"
    6.51 -#include "I18nTests.h"
    6.52 -#include "CrashdumpTests.h"
    6.53 -#include "PgpBinaryTests.h"
    6.54 -#include "RevokeRegenAttachTests.h"
    6.55 -#include "BlacklistTests.h"
    6.56  #include "LeastCommonDenomColorTests.h"
    6.57 -#include "PepSubjectReceivedTests.h"
    6.58 -#include "StringpairListTests.h"
    6.59 -#include "PgpListKeysTests.h"
    6.60 -#include "ReencryptPlusExtraKeysTests.h"
    6.61 -#include "MimeTests.h"
    6.62 -#include "BloblistTests.h"
    6.63 -#include "NewUpdateIdAndMyselfTests.h"
    6.64 -#include "StringlistTests.h"
    6.65 -#include "LeastColorGroupTests.h"
    6.66  #include "ExternalRevokeTests.h"
    6.67 -#include "EncryptForIdentityTests.h"
    6.68 -#include "TrustwordsTests.h"
    6.69 -#include "TrustManipulationTests.h"
    6.70 -#include "MessageTwoPointOhTests.h"
    6.71 -#include "MessageNullFromTests.h"
    6.72 -#include "EncryptAttachPrivateKeyTests.h"
    6.73 -#include "DecryptAttachPrivateKeyTrustedTests.h"
    6.74 -#include "IdentityListTests.h"
    6.75 -#include "KeyResetMessageTests.h"
    6.76  #include "UserIDAliasTests.h"
    6.77  
    6.78  
    6.79  const char* SuiteMaker::all_suites[] = {
    6.80 +    "DecorateTests",
    6.81 +    "ReencryptPlusExtraKeysTests",
    6.82 +    "BlacklistTests",
    6.83 +    "AppleMailTests",
    6.84 +    "MessageTwoPointOhTests",
    6.85 +    "IdentityListTests",
    6.86 +    "I18nTests",
    6.87 +    "DecryptAttachPrivateKeyUntrustedTests",
    6.88 +    "BCCTests",
    6.89 +    "LeastColorGroupTests",
    6.90 +    "BlacklistAcceptNewKeyTests",
    6.91 +    "MessageApiTests",
    6.92 +    "StringlistTests",
    6.93 +    "StringpairListTests",
    6.94 +    "TrustManipulationTests",
    6.95 +    "SyncTests",
    6.96 +    "EncryptAttachPrivateKeyTests",
    6.97 +    "BloblistTests",
    6.98 +    "KeyResetMessageTests",
    6.99 +    "SequenceTests",
   6.100 +    "TrustwordsTests",
   6.101 +    "RevokeRegenAttachTests",
   6.102 +    "EncryptMissingPrivateKeyTests",
   6.103 +    "PepSubjectReceivedTests",
   6.104 +    "KeyeditTests",
   6.105      "MapAsn1Tests",
   6.106 -    "DecorateTests",
   6.107 -    "EncryptMissingPrivateKeyTests",
   6.108 -    "KeyeditTests",
   6.109 -    "BlacklistAcceptNewKeyTests",
   6.110 -    "DecryptAttachPrivateKeyUntrustedTests",
   6.111 -    "AppleMailTests",
   6.112 +    "PgpBinaryTests",
   6.113 +    "DecryptAttachPrivateKeyTrustedTests",
   6.114 +    "MessageNullFromTests",
   6.115 +    "MimeTests",
   6.116 +    "PgpListKeysTests",
   6.117 +    "NewUpdateIdAndMyselfTests",
   6.118 +    "EncryptForIdentityTests",
   6.119 +    "CrashdumpTests",
   6.120      "CaseAndDotAddressTests",
   6.121 -    "SequenceTests",
   6.122 -    "BCCTests",
   6.123 -    "MessageApiTests",
   6.124 -    "I18nTests",
   6.125 -    "CrashdumpTests",
   6.126 -    "PgpBinaryTests",
   6.127 -    "RevokeRegenAttachTests",
   6.128 -    "BlacklistTests",
   6.129      "LeastCommonDenomColorTests",
   6.130 -    "PepSubjectReceivedTests",
   6.131 -    "StringpairListTests",
   6.132 -    "PgpListKeysTests",
   6.133 -    "ReencryptPlusExtraKeysTests",
   6.134 -    "MimeTests",
   6.135 -    "BloblistTests",
   6.136 -    "NewUpdateIdAndMyselfTests",
   6.137 -    "StringlistTests",
   6.138 -    "LeastColorGroupTests",
   6.139      "ExternalRevokeTests",
   6.140 -    "EncryptForIdentityTests",
   6.141 -    "TrustwordsTests",
   6.142 -    "TrustManipulationTests",
   6.143 -    "MessageTwoPointOhTests",
   6.144 -    "MessageNullFromTests",
   6.145 -    "EncryptAttachPrivateKeyTests",
   6.146 -    "DecryptAttachPrivateKeyTrustedTests",
   6.147 -    "IdentityListTests",
   6.148 -    "KeyResetMessageTests",
   6.149      "UserIDAliasTests",
   6.150  };
   6.151  
   6.152  // This file is generated, so magic constants are ok.
   6.153 -int SuiteMaker::num_suites = 37;
   6.154 +int SuiteMaker::num_suites = 38;
   6.155  
   6.156  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   6.157 -    if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   6.158 -        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   6.159 -    else if (strcmp(test_class_name, "DecorateTests") == 0)
   6.160 +    if (strcmp(test_class_name, "DecorateTests") == 0)
   6.161          *test_suite = new DecorateTests(test_class_name, test_home);
   6.162 +    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   6.163 +        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   6.164 +    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   6.165 +        *test_suite = new BlacklistTests(test_class_name, test_home);
   6.166 +    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   6.167 +        *test_suite = new AppleMailTests(test_class_name, test_home);
   6.168 +    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   6.169 +        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   6.170 +    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   6.171 +        *test_suite = new IdentityListTests(test_class_name, test_home);
   6.172 +    else if (strcmp(test_class_name, "I18nTests") == 0)
   6.173 +        *test_suite = new I18nTests(test_class_name, test_home);
   6.174 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   6.175 +        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   6.176 +    else if (strcmp(test_class_name, "BCCTests") == 0)
   6.177 +        *test_suite = new BCCTests(test_class_name, test_home);
   6.178 +    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   6.179 +        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   6.180 +    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   6.181 +        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   6.182 +    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   6.183 +        *test_suite = new MessageApiTests(test_class_name, test_home);
   6.184 +    else if (strcmp(test_class_name, "StringlistTests") == 0)
   6.185 +        *test_suite = new StringlistTests(test_class_name, test_home);
   6.186 +    else if (strcmp(test_class_name, "StringpairListTests") == 0)
   6.187 +        *test_suite = new StringpairListTests(test_class_name, test_home);
   6.188 +    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   6.189 +        *test_suite = new TrustManipulationTests(test_class_name, test_home);
   6.190 +    else if (strcmp(test_class_name, "SyncTests") == 0)
   6.191 +        *test_suite = new SyncTests(test_class_name, test_home);
   6.192 +    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   6.193 +        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   6.194 +    else if (strcmp(test_class_name, "BloblistTests") == 0)
   6.195 +        *test_suite = new BloblistTests(test_class_name, test_home);
   6.196 +    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   6.197 +        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   6.198 +    else if (strcmp(test_class_name, "SequenceTests") == 0)
   6.199 +        *test_suite = new SequenceTests(test_class_name, test_home);
   6.200 +    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   6.201 +        *test_suite = new TrustwordsTests(test_class_name, test_home);
   6.202 +    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   6.203 +        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   6.204      else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   6.205          *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   6.206 +    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   6.207 +        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   6.208      else if (strcmp(test_class_name, "KeyeditTests") == 0)
   6.209          *test_suite = new KeyeditTests(test_class_name, test_home);
   6.210 -    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   6.211 -        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   6.212 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   6.213 -        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   6.214 -    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   6.215 -        *test_suite = new AppleMailTests(test_class_name, test_home);
   6.216 +    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   6.217 +        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   6.218 +    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   6.219 +        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   6.220 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   6.221 +        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   6.222 +    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   6.223 +        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   6.224 +    else if (strcmp(test_class_name, "MimeTests") == 0)
   6.225 +        *test_suite = new MimeTests(test_class_name, test_home);
   6.226 +    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   6.227 +        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   6.228 +    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   6.229 +        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   6.230 +    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   6.231 +        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   6.232 +    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   6.233 +        *test_suite = new CrashdumpTests(test_class_name, test_home);
   6.234      else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   6.235          *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   6.236 -    else if (strcmp(test_class_name, "SequenceTests") == 0)
   6.237 -        *test_suite = new SequenceTests(test_class_name, test_home);
   6.238 -    else if (strcmp(test_class_name, "BCCTests") == 0)
   6.239 -        *test_suite = new BCCTests(test_class_name, test_home);
   6.240 -    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   6.241 -        *test_suite = new MessageApiTests(test_class_name, test_home);
   6.242 -    else if (strcmp(test_class_name, "I18nTests") == 0)
   6.243 -        *test_suite = new I18nTests(test_class_name, test_home);
   6.244 -    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   6.245 -        *test_suite = new CrashdumpTests(test_class_name, test_home);
   6.246 -    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   6.247 -        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   6.248 -    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   6.249 -        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   6.250 -    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   6.251 -        *test_suite = new BlacklistTests(test_class_name, test_home);
   6.252      else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   6.253          *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   6.254 -    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   6.255 -        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   6.256 -    else if (strcmp(test_class_name, "StringpairListTests") == 0)
   6.257 -        *test_suite = new StringpairListTests(test_class_name, test_home);
   6.258 -    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   6.259 -        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   6.260 -    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   6.261 -        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   6.262 -    else if (strcmp(test_class_name, "MimeTests") == 0)
   6.263 -        *test_suite = new MimeTests(test_class_name, test_home);
   6.264 -    else if (strcmp(test_class_name, "BloblistTests") == 0)
   6.265 -        *test_suite = new BloblistTests(test_class_name, test_home);
   6.266 -    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   6.267 -        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   6.268 -    else if (strcmp(test_class_name, "StringlistTests") == 0)
   6.269 -        *test_suite = new StringlistTests(test_class_name, test_home);
   6.270 -    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   6.271 -        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   6.272      else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   6.273          *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   6.274 -    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   6.275 -        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   6.276 -    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   6.277 -        *test_suite = new TrustwordsTests(test_class_name, test_home);
   6.278 -    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   6.279 -        *test_suite = new TrustManipulationTests(test_class_name, test_home);
   6.280 -    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   6.281 -        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   6.282 -    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   6.283 -        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   6.284 -    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   6.285 -        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   6.286 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   6.287 -        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   6.288 -    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   6.289 -        *test_suite = new IdentityListTests(test_class_name, test_home);
   6.290 -    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   6.291 -        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   6.292      else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   6.293          *test_suite = new UserIDAliasTests(test_class_name, test_home);
   6.294  }
     7.1 --- a/test/src/engine_tests/KeyResetMessageTests.cc	Thu Sep 27 17:34:45 2018 +0200
     7.2 +++ b/test/src/engine_tests/KeyResetMessageTests.cc	Fri Sep 28 10:07:05 2018 +0200
     7.3 @@ -25,6 +25,8 @@
     7.4  const string KeyResetMessageTests::erin_user_id = "ErinErinErin";
     7.5  const string KeyResetMessageTests::fenris_user_id = "BadWolf";
     7.6  
     7.7 +KeyResetMessageTests* KeyResetMessageTests::fake_this = NULL;
     7.8 +
     7.9  KeyResetMessageTests::KeyResetMessageTests(string suitename, string test_home_dir) :
    7.10      EngineTestIndividualSuite::EngineTestIndividualSuite(suitename, test_home_dir) {
    7.11          
    7.12 @@ -40,10 +42,11 @@
    7.13                                                                        static_cast<Func>(&KeyResetMessageTests::check_receive_message_to_revoked_key_from_unknown)));
    7.14      add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("KeyResetMessageTests::check_receive_message_to_revoked_key_from_contact"),
    7.15                                                                        static_cast<Func>(&KeyResetMessageTests::check_receive_message_to_revoked_key_from_contact)));                                                                      
    7.16 +    fake_this = this;                                                                  
    7.17  }
    7.18  
    7.19 -PEP_STATUS KeyResetMessageTests::message_send_callback(void* obj, message* msg) {
    7.20 -    ((KeyResetMessageTests*)obj)->m_queue.push_back(msg);
    7.21 +PEP_STATUS KeyResetMessageTests::message_send_callback(message* msg) {
    7.22 +    fake_this->m_queue.push_back(msg);
    7.23      return PEP_STATUS_OK;    
    7.24  }
    7.25  
    7.26 @@ -153,7 +156,7 @@
    7.27          if (strcmp(curr_ident->ident->user_id, bob_user_id.c_str()) == 0)
    7.28              continue;
    7.29          
    7.30 -        status = set_as_pep_user(session, curr_ident->ident);
    7.31 +        status = set_as_pEp_user(session, curr_ident->ident);
    7.32          TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));
    7.33      }
    7.34      
    7.35 @@ -374,7 +377,7 @@
    7.36              new_identity("pep.test.alice@pep-project.org", NULL, "AliceOther", NULL));
    7.37      status = update_identity(session, send_idents->ident);
    7.38      TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));    
    7.39 -    status = set_as_pep_user(session, send_idents->ident);
    7.40 +    status = set_as_pEp_user(session, send_idents->ident);
    7.41                               
    7.42      message* outgoing_msg = new_message(PEP_dir_outgoing);
    7.43      TEST_ASSERT(outgoing_msg);
     8.1 --- a/test/src/util/test_util.cc	Thu Sep 27 17:34:45 2018 +0200
     8.2 +++ b/test/src/util/test_util.cc	Fri Sep 28 10:07:05 2018 +0200
     8.3 @@ -57,6 +57,7 @@
     8.4  pep_free:
     8.5      if (!ret_ident)
     8.6          free_identity(ident);
     8.7 +    return status;    
     8.8  }
     8.9  
    8.10