From ef5b8a2768d65d0895fc77232dfd3e04a13c28b0 Mon Sep 17 00:00:00 2001 From: Amber Date: Sat, 18 Nov 2023 17:01:55 -0500 Subject: [PATCH] Splitting out tests --- src/C_Callback.c | 4 ++-- tests/CMakeLists.txt | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/C_Callback.c b/src/C_Callback.c index 971ab43..055adfd 100644 --- a/src/C_Callback.c +++ b/src/C_Callback.c @@ -15,7 +15,7 @@ void printNumberInDec(int number, char* buffer, size_t bufferSize) // Prints a number to a string in hex void printNumberInHex(int number, char* buffer, size_t bufferSize) { - snprintf(buffer, bufferSize, "Number: 0x%x\n", number); + snprintf(buffer, bufferSize, "Number: 0x%X\n", number); } // Function that takes a function pointer as an argument and @@ -35,4 +35,4 @@ void runCallback(int number, char* buffer, size_t bufferSize) { snprintf(buffer, bufferSize, "No callback function set\n"); } -} \ No newline at end of file +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 060824f..ac3c242 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,7 +10,10 @@ FetchContent_Declare( FetchContent_MakeAvailable(googletest) -add_executable(self_test self_test.cpp test_C_Callback.cpp) -target_link_libraries(self_test gtest_main C_Callback) +add_executable(self_test self_test.cpp) +add_executable(C_Callback_test test_C_Callback.cpp) +target_link_libraries(self_test gtest_main) +target_link_libraries(C_Callback_test gtest_main C_Callback) -add_test(NAME self_test COMMAND self_test) \ No newline at end of file +add_test(NAME self_test COMMAND self_test) +add_test(NAME C_Callback_test COMMAND C_Callback_test)