aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/tests/test_runner.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-04-03 11:46:09 +0200
committerMartin Willi <martin@revosec.ch>2014-06-04 15:53:11 +0200
commit460adb5d0925f4af807b09434b771545d1f62b47 (patch)
tree12c6bec9eb811c715d079e82e50840b865ecdb96 /src/libstrongswan/tests/test_runner.c
parent5cd28cd25a009fd4d0d5b91b60e82cf7a661a169 (diff)
downloadstrongswan-460adb5d0925f4af807b09434b771545d1f62b47.tar.bz2
strongswan-460adb5d0925f4af807b09434b771545d1f62b47.tar.xz
unit-tests: Seed chunk_hash() only once, but before creating any hashtables
Due to the removal of pthread_once, we manually create the seed for chunk_hash(). With the new testable functions interface, this won't work for the hashtable initiated using __attribute__((constructor)). Enforce seeding before creating that hashtable.
Diffstat (limited to 'src/libstrongswan/tests/test_runner.c')
-rw-r--r--src/libstrongswan/tests/test_runner.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c
index 4684eb18d..63d79199f 100644
--- a/src/libstrongswan/tests/test_runner.c
+++ b/src/libstrongswan/tests/test_runner.c
@@ -44,6 +44,9 @@ void testable_functions_create()
{
if (!testable_functions)
{
+ /* as this is executed before chunk_hash() seed initialization used
+ * by hashtables, we enforce seeding it here. */
+ chunk_hash_seed();
testable_functions = hashtable_create(hashtable_hash_str,
hashtable_equals_str, 8);
}