unit-tests: Change how hashtable for testable functions is created
Because GCC does not adhere to the priorities defined for constructors when building with --enable-monolithic (not sure if it was just luck that it worked in non-monolithic mode - anyway, it's not very portable) function registration would fail because the hashtable would not be created yet.
This commit is contained in:
@@ -51,7 +51,7 @@ void testable_function_register(char *name, void *fn);
|
||||
* @param fn function to register
|
||||
*/
|
||||
#define EXPORT_FUNCTION_FOR_TESTS(ns, fn) \
|
||||
static void testable_function_register_##fn() __attribute__ ((constructor(2000))); \
|
||||
static void testable_function_register_##fn() __attribute__ ((constructor)); \
|
||||
static void testable_function_register_##fn() \
|
||||
{ \
|
||||
testable_function_register(#ns "/" #fn, fn); \
|
||||
|
||||
Reference in New Issue
Block a user