# HG changeset patch # User Mike Becker # Date 1730216860 -3600 # Node ID 8f6d6556380a73effb2f6f67129b50e627895cd0 # Parent 37e7f92de46be0c87d0d3210b09a0383dab630c7 remove dynamic arrays which are not supported by msvc 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[] = { diff -r 37e7f92de46b -r 8f6d6556380a tests/test_printf.c --- a/tests/test_printf.c Tue Oct 29 16:47:19 2024 +0100 +++ b/tests/test_printf.c Tue Oct 29 16:47:40 2024 +0100 @@ -179,8 +179,8 @@ const char *h = "Hello"; - int const specimen_count = 13; - cxmutstr r[specimen_count]; + cxmutstr r[13]; + size_t specimen_count = cx_nmemb(r); int specimen = 0; CX_TEST_DO {