From 844e7e997c920f6783e31924c941aed067eea98c Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Fri, 19 Aug 2022 16:48:00 +0400 Subject: test win32 --- source/test/programs/CMakeLists.txt | 2 +- source/test/programs/signals.c | 22 ---------------------- source/test/programs/signals.cpp | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 source/test/programs/signals.c create mode 100644 source/test/programs/signals.cpp (limited to 'source') diff --git a/source/test/programs/CMakeLists.txt b/source/test/programs/CMakeLists.txt index d6c7968..7decb0d 100644 --- a/source/test/programs/CMakeLists.txt +++ b/source/test/programs/CMakeLists.txt @@ -29,7 +29,7 @@ if(KIT_ENABLE_TESTING) # PROPERTIES # TIMEOUT "15") - add_executable(signals signals.c) + add_executable(signals signals.cpp) target_link_libraries(signals ${KIT_TEST_LIBRARY}) add_test( NAME signals_test diff --git a/source/test/programs/signals.c b/source/test/programs/signals.c deleted file mode 100644 index 7a9af25..0000000 --- a/source/test/programs/signals.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "../../kit_test/test.h" - -#include -#include - -TEST("abort") { - printf("** ABORT\n\n"); - abort(); -} - -TEST("invalid access") { - printf("** INVALID ACCESS\n\n"); - *(volatile int *) NULL = 42; -} - -int main(int argc, char **argv) { - printf(" %% run_tests\n\n"); - if (run_tests(argc, argv) != 1) - return 1; - - return 0; -} diff --git a/source/test/programs/signals.cpp b/source/test/programs/signals.cpp new file mode 100644 index 0000000..d468d83 --- /dev/null +++ b/source/test/programs/signals.cpp @@ -0,0 +1,22 @@ +#include "../../kit_test/test.h" + +#include +#include + +TEST("abort") { + printf("** ABORT\n\n"); + abort(); +} + +TEST("invalid access") { + printf("** INVALID ACCESS\n\n"); + *(volatile int *) nullptr = 42; +} + +int main(int argc, char **argv) { + printf(" %% run_tests\n\n"); + if (run_tests(argc, argv) != 1) + return 1; + + return 0; +} -- cgit v1.2.3