ENGINE-289: added tests for myself() default user_id aliases, fixed consts in signature, fixed blacklist test issue ENGINE-289
authorKrista Bennett <krista@pep-project.org>
Wed, 17 Jan 2018 12:23:44 +0100
branchENGINE-289
changeset 2401f5aa974726e1
parent 2399 09faff2e1f54
child 2402 6b3073104e07
ENGINE-289: added tests for myself() default user_id aliases, fixed consts in signature, fixed blacklist test issue
src/keymanagement.c
src/pEpEngine.c
src/pEpEngine.h
test/blacklist_test.cc
     1.1 --- a/src/keymanagement.c	Wed Jan 17 01:18:18 2018 +0100
     1.2 +++ b/src/keymanagement.c	Wed Jan 17 12:23:44 2018 +0100
     1.3 @@ -665,8 +665,8 @@
     1.4      // Revisit once I can talk to Volker
     1.5      if (identity->comm_type != PEP_ct_compromized &&
     1.6          identity->comm_type < PEP_ct_strong_but_unconfirmed)
     1.7 -    if (session->examine_identity)
     1.8 -        session->examine_identity(identity, session->examine_management);
     1.9 +        if (session->examine_identity)
    1.10 +            session->examine_identity(identity, session->examine_management);
    1.11  
    1.12      return ADD_TO_LOG(status);
    1.13  }
     2.1 --- a/src/pEpEngine.c	Wed Jan 17 01:18:18 2018 +0100
     2.2 +++ b/src/pEpEngine.c	Wed Jan 17 12:23:44 2018 +0100
     2.3 @@ -1498,7 +1498,7 @@
     2.4  
     2.5  DYNAMIC_API PEP_STATUS get_userid_alias_default(
     2.6          PEP_SESSION session, 
     2.7 -        char* alias_id,
     2.8 +        const char* alias_id,
     2.9          char** default_id) {
    2.10              
    2.11      assert(session);
    2.12 @@ -1541,8 +1541,8 @@
    2.13  
    2.14  DYNAMIC_API PEP_STATUS set_userid_alias (
    2.15          PEP_SESSION session, 
    2.16 -        char* default_id,
    2.17 -        char* alias_id) {
    2.18 +        const char* default_id,
    2.19 +        const char* alias_id) {
    2.20              
    2.21      int result;
    2.22  
     3.1 --- a/src/pEpEngine.h	Wed Jan 17 01:18:18 2018 +0100
     3.2 +++ b/src/pEpEngine.h	Wed Jan 17 12:23:44 2018 +0100
     3.3 @@ -646,7 +646,7 @@
     3.4  
     3.5  DYNAMIC_API PEP_STATUS get_userid_alias_default(
     3.6          PEP_SESSION session, 
     3.7 -        char* alias_id,
     3.8 +        const char* alias_id,
     3.9          char** default_id);
    3.10  
    3.11  // set_userid_alias() - set an alias to correspond to a default id
    3.12 @@ -662,8 +662,8 @@
    3.13  
    3.14  DYNAMIC_API PEP_STATUS set_userid_alias (
    3.15          PEP_SESSION session, 
    3.16 -        char* default_id,
    3.17 -        char* alias_id);
    3.18 +        const char* default_id,
    3.19 +        const char* alias_id);
    3.20  
    3.21  // set_device_group() - update own person's device group
    3.22  //
     4.1 --- a/test/blacklist_test.cc	Wed Jan 17 01:18:18 2018 +0100
     4.2 +++ b/test/blacklist_test.cc	Wed Jan 17 12:23:44 2018 +0100
     4.3 @@ -130,10 +130,11 @@
     4.4                                                         "Blacklist Keypair");
     4.5      PEP_STATUS status15 = update_identity(session, blacklisted_identity2);
     4.6  
     4.7 -    if (blacklisted_identity->fpr && strcmp(blacklisted_identity->fpr, bl_fpr_2) == 0)
     4.8 +    assert(blacklisted_identity2->fpr && strcmp(blacklisted_identity2->fpr, bl_fpr_2) == 0);
     4.9 +    if (blacklisted_identity2->fpr && strcmp(blacklisted_identity2->fpr, bl_fpr_2) == 0)
    4.10          cout << "blacklisted identity's fpr successfully replaced by the unblacklisted one" << endl;
    4.11 -    else
    4.12 -        cout << "blacklisted_identity->fpr should be " << bl_fpr_2 << " but is " << blacklisted_identity->fpr << endl;
    4.13 +    // else
    4.14 +    //     cout << "blacklisted_identity->fpr should be " << bl_fpr_2 << " but is " << blacklisted_identity->fpr << endl;
    4.15      
    4.16      PEP_STATUS status12 = blacklist_delete(session, bl_fpr_1);
    4.17      PEP_STATUS status13 = update_identity(session, blacklisted_identity);