Added Unit Tests

This commit is contained in:
2021-10-01 00:27:36 -07:00
parent c05c81d9d3
commit 88001e67f8
10 changed files with 271 additions and 454 deletions

6
test/CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
add_executable(tests ${SRCS})
target_link_libraries(tests game unity)
add_test(card tests)

27
test/poker2/card.c Normal file
View File

@ -0,0 +1,27 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include <unity.h>
#include <poker/card.h>
void setUp(void) {
}
void tearDown(void) {
}
void test_add_should_AddNumbersTogether(void) {
TEST_ASSERT_EQUAL_INT32(32, 16+16);
}
int main() {
UNITY_BEGIN();
RUN_TEST(test_add_should_AddNumbersTogether);
return UNITY_END();
}