summaryrefslogtreecommitdiff
path: root/source/test/programs
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2022-12-29 07:51:16 +0100
committerMitya Selivanov <automainint@guattari.tech>2022-12-29 07:51:16 +0100
commit7e6b36bc2d332a3cb66b83116a393ac4728236d5 (patch)
tree4e7255b1237564f9682cb8e1b84a5bc0c0a4fbef /source/test/programs
parentf9df8ec356b1e18bf46c9a35bec78ed025107376 (diff)
downloadkit-7e6b36bc2d332a3cb66b83116a393ac4728236d5.zip
Improve C89/90 compat
Diffstat (limited to 'source/test/programs')
-rw-r--r--source/test/programs/CMakeLists.txt8
-rw-r--r--source/test/programs/too_many_assertions.c3
-rw-r--r--source/test/programs/too_many_tests.c3
3 files changed, 8 insertions, 6 deletions
diff --git a/source/test/programs/CMakeLists.txt b/source/test/programs/CMakeLists.txt
index bdaf89e..81332cf 100644
--- a/source/test/programs/CMakeLists.txt
+++ b/source/test/programs/CMakeLists.txt
@@ -6,7 +6,7 @@ project(
if(KIT_ENABLE_TESTING)
add_executable(too_many_tests too_many_tests.c)
- target_link_libraries(too_many_tests ${KIT_TEST_LIBRARY})
+ target_link_libraries(too_many_tests kit_test)
add_test(
NAME too_many_tests_test
COMMAND too_many_tests --quiet)
@@ -16,7 +16,7 @@ if(KIT_ENABLE_TESTING)
TIMEOUT "15")
add_executable(too_many_assertions too_many_assertions.c)
- target_link_libraries(too_many_assertions ${KIT_TEST_LIBRARY})
+ target_link_libraries(too_many_assertions kit_test)
add_test(
NAME too_many_assertions_test
COMMAND too_many_assertions --quiet)
@@ -26,7 +26,7 @@ if(KIT_ENABLE_TESTING)
TIMEOUT "15")
add_executable(cpp_example cpp_example.cpp)
- target_link_libraries(cpp_example ${KIT_TEST_LIBRARY})
+ target_link_libraries(cpp_example kit_test)
add_test(
NAME cpp_example_test
COMMAND cpp_example --quiet)
@@ -37,7 +37,7 @@ if(KIT_ENABLE_TESTING)
if(NOT MSVC)
add_executable(signals signals.cpp)
- target_link_libraries(signals ${KIT_TEST_LIBRARY})
+ target_link_libraries(signals kit_test)
add_test(
NAME signals_test
COMMAND signals --no-carriage-return)
diff --git a/source/test/programs/too_many_assertions.c b/source/test/programs/too_many_assertions.c
index 846970f..06b440b 100644
--- a/source/test/programs/too_many_assertions.c
+++ b/source/test/programs/too_many_assertions.c
@@ -1,7 +1,8 @@
#include "../../kit_test/test.h"
TEST("foo") {
- for (int i = 0; i <= KIT_TEST_ASSERTIONS_LIMIT; i++) REQUIRE(1);
+ int i;
+ for (i = 0; i <= KIT_TEST_ASSERTIONS_LIMIT; i++) REQUIRE(1);
}
int main(int argc, char **argv) {
diff --git a/source/test/programs/too_many_tests.c b/source/test/programs/too_many_tests.c
index bc7b543..ac1cbf7 100644
--- a/source/test/programs/too_many_tests.c
+++ b/source/test/programs/too_many_tests.c
@@ -3,7 +3,8 @@
void bar(int index, kit_test_report_fn report) { }
int main(int argc, char **argv) {
- for (int i = 0; i <= KIT_TESTS_SIZE_LIMIT; i++)
+ int i;
+ for (i = 0; i <= KIT_TESTS_SIZE_LIMIT; i++)
test_register("foo", __FILE__, bar);
if (run_tests(argc, argv) != 1)