diff -r 37e7f92de46b -r 8f6d6556380a tests/test_iterator.c --- a/tests/test_iterator.c Tue Oct 29 16:47:19 2024 +0100 +++ b/tests/test_iterator.c Tue Oct 29 16:47:40 2024 +0100 @@ -31,8 +31,8 @@ #include "cx/iterator.h" CX_TEST(test_iterator_create) { - size_t size = 20; - unsigned array[size]; + unsigned array[20]; + size_t size = cx_nmemb(array); for (unsigned i = 0 ; i < size ; i++) array[i] = i; CxIterator iter = cxIterator(array, sizeof(unsigned), size); @@ -59,8 +59,8 @@ } CX_TEST(test_iterator_iterate) { - size_t size = 20; - unsigned array[size]; + unsigned array[20]; + size_t size = cx_nmemb(array); for (unsigned i = 0 ; i < size ; i++) array[i] = i; CxIterator iter = cxIterator(array, sizeof(unsigned), size); @@ -80,8 +80,8 @@ } CX_TEST(test_iterator_with_slow_remove) { - size_t size = 20; - unsigned array[size]; + unsigned array[20]; + size_t size = cx_nmemb(array); for (unsigned i = 0 ; i < size ; i++) array[i] = i; size_t elem_counts[] = { @@ -121,8 +121,8 @@ } CX_TEST(test_iterator_with_fast_remove) { - size_t size = 20; - unsigned array[size]; + unsigned array[20]; + size_t size = cx_nmemb(array); for (unsigned i = 0 ; i < size ; i++) array[i] = i; size_t elem_counts[] = {