Browse Source

Test checkline case not identical

remotes/origin/Ariana
fdai7775 11 months ago
parent
commit
3544322ef0
  1. 3
      src/main/c/GameTic_Tac_Toe/tictactoe.c
  2. 4
      src/main/c/GameTic_Tac_Toe/tictactoe.h
  3. 5
      src/main/c/main.c
  4. 2
      test/test_template.c
  5. 24
      test/test_tictactoe.c

3
src/main/c/GameTic_Tac_Toe/tictactoe.c

@ -119,7 +119,6 @@ void playGame() {
printGameResult(winner); printGameResult(winner);
} }
int main(){
void start_tictactoe(){
playGame(); playGame();
return 0;
} }

4
src/main/c/GameTic_Tac_Toe/tictactoe.h

@ -1,3 +1,7 @@
#ifndef TICTACTOE_H #ifndef TICTACTOE_H
#define TICTACTOE_H #define TICTACTOE_H
char checkLine(char a, char b, char c);
void start_tictactoe();
#endif

5
src/main/c/main.c

@ -3,6 +3,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "Template/game100.h" #include "Template/game100.h"
#include "GameTic_Tac_Toe/tictactoe.h"
int main(){ int main(){
bool running = true; bool running = true;
@ -34,7 +35,7 @@ int main(){
//start_game3(); //start_game3();
break; break;
case 4: case 4:
//start_game4();
start_tictactoe();
break; break;
case 100: case 100:
start_game100(); start_game100();
@ -49,4 +50,4 @@ int main(){
} }
} }
return 0; return 0;
}
}

2
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 TEST_ASSERT_EQUAL_INT(5, result);//5 / 6 + 5 = 5
} }
#endif // TEST
#endif // TEST

24
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
Loading…
Cancel
Save