Test stuff, committing to move to other branch sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 01 Apr 2019 16:42:59 +0200
branchsync
changeset 3425495866c118e7
parent 3422 09bec729847d
child 3426 a2dc6594b206
child 3430 5eda673f966c
child 3432 b8abbad4e091
Test stuff, committing to move to other branch
test/src/engine_tests/EnterLeaveDeviceGroupTests.cc
     1.1 --- a/test/src/engine_tests/EnterLeaveDeviceGroupTests.cc	Fri Mar 29 16:31:16 2019 +0100
     1.2 +++ b/test/src/engine_tests/EnterLeaveDeviceGroupTests.cc	Mon Apr 01 16:42:59 2019 +0200
     1.3 @@ -41,6 +41,7 @@
     1.4  
     1.5  void EnterLeaveDeviceGroupTests::check_enter_device_group_no_own() {    
     1.6      pEp_identity* alice_id = NULL;
     1.7 +    TEST_ASSERT(slurp_and_import_key(session, "test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc"));
     1.8      PEP_STATUS status = set_up_ident_from_scratch(session,
     1.9                                  "test_keys/priv/pep-test-alice-0x6FF00E97_priv.asc",
    1.10                                  "pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", 
    1.11 @@ -59,6 +60,7 @@
    1.12  
    1.13  void EnterLeaveDeviceGroupTests::check_enter_device_group_one_own_empty() {    
    1.14      pEp_identity* alice_id = NULL;
    1.15 +    TEST_ASSERT(slurp_and_import_key(session, "test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc"));    
    1.16      PEP_STATUS status = set_up_ident_from_scratch(session,
    1.17                                  "test_keys/priv/pep-test-alice-0x6FF00E97_priv.asc",
    1.18                                  "pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", 
    1.19 @@ -81,6 +83,27 @@
    1.20  }
    1.21  
    1.22  void EnterLeaveDeviceGroupTests::check_enter_device_group_one_own_one() {    
    1.23 +    pEp_identity* alice_id = NULL;
    1.24 +    TEST_ASSERT(slurp_and_import_key(session, "test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc"));    
    1.25 +    PEP_STATUS status = set_up_ident_from_scratch(session,
    1.26 +                                "test_keys/priv/pep-test-alice-0x6FF00E97_priv.asc",
    1.27 +                                "pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", 
    1.28 +                                "ALICE", "Alice in Wonderland", &alice_id, true
    1.29 +                        );    
    1.30 +
    1.31 +    TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));
    1.32 +    status = myself(session, alice_id);
    1.33 +
    1.34 +    TEST_ASSERT(alice_id->me);
    1.35 +    TEST_ASSERT(strcmp(alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);
    1.36 +    identity_list* ids_to_group = new_identity_list(alice_id);
    1.37 +    status = enter_device_group(session, ids_to_group);
    1.38 +    TEST_ASSERT_MSG(status == PEP_STATUS_OK, tl_status_string(status));
    1.39 +    
    1.40 +    status = myself(session, alice_id);
    1.41 +    TEST_ASSERT(status == PEP_STATUS_OK);    
    1.42 +    TEST_ASSERT_MSG(alice_id->flags & PEP_idf_devicegroup, tl_ident_flags_String(alice_id->flags).c_str());
    1.43 +                        
    1.44      TEST_ASSERT(true);
    1.45  }
    1.46