summaryrefslogtreecommitdiff
path: root/p11-kit/tests/test-deprecated.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2014-08-08 17:18:10 +0200
committerStef Walter <stef@thewalter.net>2014-08-08 18:44:49 +0200
commit9cd9153a4d4cf78011d2a8f8c7a69aa8f3eda9f3 (patch)
treeded05597065f53de642c8cc9613cdb783a13dde6 /p11-kit/tests/test-deprecated.c
parenteb9d1fcc8e0adc38ff494af619db37013ff17cb9 (diff)
Fix mostly erroneous scanner warnings in tests
Diffstat (limited to 'p11-kit/tests/test-deprecated.c')
-rw-r--r--p11-kit/tests/test-deprecated.c6
1 files changed, 5 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