diff options
Diffstat (limited to 'p11-kit/tests')
-rw-r--r-- | p11-kit/tests/test-deprecated.c | 6 | ||||
-rw-r--r-- | p11-kit/tests/test-uri.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/p11-kit/tests/test-deprecated.c b/p11-kit/tests/test-deprecated.c index 56f1941..c8b8001 100644 --- a/p11-kit/tests/test-deprecated.c +++ b/p11-kit/tests/test-deprecated.c @@ -376,8 +376,10 @@ test_threaded_initialization (void) module.C_Initialize = mock_C_Initialize__threaded_race; module.C_Finalize = mock_C_Finalize__threaded_race; + p11_mutex_lock (&race_mutex); initialization_count = 0; finalization_count = 0; + p11_mutex_unlock (&race_mutex); for (i = 0; i < num_threads; i++) { ret = p11_thread_create (&threads[i], initialization_thread, "thread-data"); @@ -404,8 +406,10 @@ test_threaded_initialization (void) } /* C_Initialize should have been called exactly once */ + p11_mutex_lock (&race_mutex); assert_num_eq (1, initialization_count); assert_num_eq (1, finalization_count); + p11_mutex_unlock (&race_mutex); assert (!mock_module_initialized ()); } @@ -478,7 +482,7 @@ test_load_and_initialize (void) assert (ret == 0); rv = p11_kit_finalize_module (module); - assert (ret == CKR_OK); + assert_num_eq (rv, CKR_OK); } int diff --git a/p11-kit/tests/test-uri.c b/p11-kit/tests/test-uri.c index b6de7ad..9b5b293 100644 --- a/p11-kit/tests/test-uri.c +++ b/p11-kit/tests/test-uri.c @@ -537,17 +537,20 @@ test_uri_build_with_attributes (void) at.pValue = "The Label"; at.ulValueLen = 9; ret = p11_kit_uri_set_attribute (uri, &at); + assert_num_eq (P11_KIT_URI_OK, ret); at.type = CKA_ID; at.pValue = "HELLO"; at.ulValueLen = 5; ret = p11_kit_uri_set_attribute (uri, &at); + assert_num_eq (P11_KIT_URI_OK, ret); klass = CKO_DATA; at.type = CKA_CLASS; at.pValue = &klass; at.ulValueLen = sizeof (klass); ret = p11_kit_uri_set_attribute (uri, &at); + assert_num_eq (P11_KIT_URI_OK, ret); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); |