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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user