Skip to content

Commit

Permalink
Splitting out tests
Browse files Browse the repository at this point in the history
  • Loading branch information
greenliquidlight committed Nov 18, 2023
1 parent 5e6a49a commit ef5b8a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/C_Callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,4 +35,4 @@ void runCallback(int number, char* buffer, size_t bufferSize)
{
snprintf(buffer, bufferSize, "No callback function set\n");
}
}
}
9 changes: 6 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
add_test(NAME self_test COMMAND self_test)
add_test(NAME C_Callback_test COMMAND C_Callback_test)

0 comments on commit ef5b8a2

Please sign in to comment.