|
818 | 818 | item->prev = item; \
|
819 | 819 | return; \
|
820 | 820 | } \
|
821 |
| - if (__constructor_order == _CONSTRUCTOR_ORDER_FORWARD) { \ |
| 821 | + if (__constructor_order_forward) { \ |
822 | 822 | item->next = NULL; \
|
823 | 823 | item->prev = head->prev; \
|
824 | 824 | item->prev->next = item; \
|
@@ -882,9 +882,7 @@ struct __test_xfail {
|
882 | 882 | }
|
883 | 883 |
|
884 | 884 | static struct __fixture_metadata *__fixture_list = &_fixture_global;
|
885 |
| -static int __constructor_order; |
886 |
| - |
887 |
| -#define _CONSTRUCTOR_ORDER_FORWARD 1 |
| 885 | +static bool __constructor_order_forward; |
888 | 886 |
|
889 | 887 | static inline void __register_fixture(struct __fixture_metadata *f)
|
890 | 888 | {
|
@@ -935,7 +933,7 @@ static inline bool __test_passed(struct __test_metadata *metadata)
|
935 | 933 | * list so tests are run in source declaration order.
|
936 | 934 | * https://gcc.gnu.org/onlinedocs/gccint/Initialization.html
|
937 | 935 | * However, it seems not all toolchains do this correctly, so use
|
938 |
| - * __constructor_order to detect which direction is called first |
| 936 | + * __constructor_order_foward to detect which direction is called first |
939 | 937 | * and adjust list building logic to get things running in the right
|
940 | 938 | * direction.
|
941 | 939 | */
|
@@ -1330,7 +1328,7 @@ static int test_harness_run(int argc, char **argv)
|
1330 | 1328 |
|
1331 | 1329 | static void __attribute__((constructor)) __constructor_order_first(void)
|
1332 | 1330 | {
|
1333 |
| - __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; |
| 1331 | + __constructor_order_forward = true; |
1334 | 1332 | }
|
1335 | 1333 |
|
1336 | 1334 | #endif /* __KSELFTEST_HARNESS_H */
|
0 commit comments