tests/ucxtest.c

changeset 946
b428424c0214
parent 937
10123f4d5618
--- a/tests/ucxtest.c	Tue Oct 22 22:42:48 2024 +0200
+++ b/tests/ucxtest.c	Tue Oct 22 23:10:31 2024 +0200
@@ -26,6 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "cx/common.h"
 #include "cx/test.h"
 
 CxTestSuite *cx_test_suite_testing_allocator(void);
@@ -51,8 +52,8 @@
 
 #define run_tests(suite) cx_test_run_stdout(suite); success += (suite)->success; failure += (suite)->failure
 #define execute_test_suites(...) unsigned success = 0, failure = 0; CxTestSuite* test_suites[] = {__VA_ARGS__}; \
-    for (size_t i = 0; i < sizeof(test_suites)/sizeof(void*) ; i++) {run_tests(test_suites[i]);} (void)0
-#define free_test_suites for (size_t i = 0 ; i < sizeof(test_suites)/sizeof(void*) ; i++) {cx_test_suite_free(test_suites[i]);} (void)0
+    for (size_t i = 0; i < cx_nmemb(test_suites) ; i++) {run_tests(test_suites[i]);} (void)0
+#define free_test_suites for (size_t i = 0 ; i < cx_nmemb(test_suites) ; i++) {cx_test_suite_free(test_suites[i]);} (void)0
 
 int main(void) {
     printf("UCX Tests\n---------\n");

mercurial