-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The commit Add support for randomizing test execution order in Unity breaks MSVC build because in build/test/test_dictionary_runner.c
an array is not initialized by a constant expression:
int number_of_tests = 6;
struct UnityRunTestParameters run_test_params_arr[number_of_tests];
Though this code may be...
valid in C99 and in C11, if variable length array (VLA) is supported by
your implementation (VLAs are optional in C11). However, it seems Visual
studio doesn't seem to support VLAs and expects a "constant expression"
for array size as in C89.
(cited from Can't create array with constant size ("expected constant expression”))
Possible fix:
index cc82cfc..1a983f0 100755
@@ -502,7 +502,7 @@ class UnityTestRunnerGenerator
end
end
output.puts
- output.puts(" int number_of_tests = #{count_tests(tests)};")
+ output.puts(" #define number_of_tests #{count_tests(tests)}")
output.puts(' struct UnityRunTestParameters run_test_params_arr[number_of_tests];')
output.puts
idx = 0
Metadata
Metadata
Assignees
Labels
No labels