From 3544322ef024caf13a7ddf2ae4d1058f6fea20f9 Mon Sep 17 00:00:00 2001 From: fdai7775 Date: Fri, 2 Feb 2024 10:33:41 +0000 Subject: [PATCH] Test checkline case not identical --- src/main/c/GameTic_Tac_Toe/tictactoe.c | 3 +-- src/main/c/GameTic_Tac_Toe/tictactoe.h | 4 ++++ src/main/c/main.c | 5 +++-- test/test_template.c | 2 +- test/test_tictactoe.c | 24 ++++++++++++++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/main/c/GameTic_Tac_Toe/tictactoe.c b/src/main/c/GameTic_Tac_Toe/tictactoe.c index 443fe8d..be7be8a 100644 --- a/src/main/c/GameTic_Tac_Toe/tictactoe.c +++ b/src/main/c/GameTic_Tac_Toe/tictactoe.c @@ -119,7 +119,6 @@ void playGame() { printGameResult(winner); } -int main(){ +void start_tictactoe(){ playGame(); - return 0; } diff --git a/src/main/c/GameTic_Tac_Toe/tictactoe.h b/src/main/c/GameTic_Tac_Toe/tictactoe.h index 46e2404..a972d36 100644 --- a/src/main/c/GameTic_Tac_Toe/tictactoe.h +++ b/src/main/c/GameTic_Tac_Toe/tictactoe.h @@ -1,3 +1,7 @@ #ifndef TICTACTOE_H #define TICTACTOE_H +char checkLine(char a, char b, char c); +void start_tictactoe(); + +#endif diff --git a/src/main/c/main.c b/src/main/c/main.c index eaf0b17..aeb0490 100644 --- a/src/main/c/main.c +++ b/src/main/c/main.c @@ -3,6 +3,7 @@ #include #include "Template/game100.h" +#include "GameTic_Tac_Toe/tictactoe.h" int main(){ bool running = true; @@ -34,7 +35,7 @@ int main(){ //start_game3(); break; case 4: - //start_game4(); + start_tictactoe(); break; case 100: start_game100(); @@ -49,4 +50,4 @@ int main(){ } } return 0; -} \ No newline at end of file +} diff --git a/test/test_template.c b/test/test_template.c index a1b9ed4..4aba361 100644 --- a/test/test_template.c +++ b/test/test_template.c @@ -33,4 +33,4 @@ void test_ignore_rest_from_division(void){ TEST_ASSERT_EQUAL_INT(5, result);//5 / 6 + 5 = 5 } -#endif // TEST \ No newline at end of file +#endif // TEST diff --git a/test/test_tictactoe.c b/test/test_tictactoe.c index 8b13789..8c03320 100644 --- a/test/test_tictactoe.c +++ b/test/test_tictactoe.c @@ -1 +1,25 @@ +#ifdef TEST +#include "unity.h" +#include "tictactoe.h" + + +void setUp(void){ + //Wenn Funktion Vorraussetzungen braucht +} +void tearDown(void){ +} + + +void test_if_not_identical(void){ + /* arrange */ + char result; + char a = 'a', b = 'b', c = 'c'; + + result = checkLine(a, b, c); + + /* assert */ + TEST_ASSERT_EQUAL_CHAR(' ', result); +} + +#endif // TEST