A couple of extra checks sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 02 May 2019 08:46:59 +0200
branchsync
changeset 360007d9a2af323f
parent 3599 603f364d3649
child 3602 65065c61bae9
child 3603 1546d058cd26
A couple of extra checks
test/src/engine_tests/ExportKeyTests.cc
     1.1 --- a/test/src/engine_tests/ExportKeyTests.cc	Thu May 02 08:44:50 2019 +0200
     1.2 +++ b/test/src/engine_tests/ExportKeyTests.cc	Thu May 02 08:46:59 2019 +0200
     1.3 @@ -55,6 +55,7 @@
     1.4      PEP_STATUS status = find_keys(session, "BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39", &keylist);
     1.5      TEST_ASSERT(keylist && keylist->value);
     1.6      TEST_ASSERT(strcmp(keylist->value, "BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39") == 0);
     1.7 +    free_stringlist(keylist);
     1.8  
     1.9      status = export_key(session, "BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39", 
    1.10                                     &keydata, &keysize);
    1.11 @@ -63,7 +64,6 @@
    1.12      TEST_ASSERT(keysize > 0);
    1.13      
    1.14      free(keydata);
    1.15 -    keydata = NULL;
    1.16  }
    1.17  
    1.18  void ExportKeyTests::check_export_key_secret_key() {
    1.19 @@ -87,12 +87,16 @@
    1.20      status = export_key(session, "BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39", 
    1.21                                     &keydata, &keysize);
    1.22      TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));
    1.23 +    TEST_ASSERT(keydata);
    1.24 +    TEST_ASSERT(keysize > 0);
    1.25 +
    1.26      free(keydata);
    1.27      keydata = NULL;
    1.28      keysize = 0;
    1.29      status = export_secret_key(session, "BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39", 
    1.30                                     &keydata, &keysize);
    1.31      TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));
    1.32 +
    1.33      free(keydata);
    1.34      TEST_ASSERT(true);
    1.35  }