Browse Source

changed command test execution

remotes/origin/georg
KaffeeMaus 11 months ago
parent
commit
c12ef1337f
  1. 4
      src/main/c/Georg/tictactoe.c
  2. 2
      src/main/c/Georg/tictactoe.h
  3. 2
      src/test/c/Georg/test_tictactoe.c

4
src/main/c/Georg/tictactoe.c

@ -81,7 +81,7 @@ char* getUserInput(){
} }
int startMenu( int code ){ int startMenu( int code ){
if( code == 1 ){ // command test
if( code == -1 ){ // command test
return 1; return 1;
} }
@ -99,7 +99,7 @@ int startMenu( int code ){
} }
int startGame( int code ){ int startGame( int code ){
if( code == 1 ){ // command test
if( code == -1 ){ // command test
return 1; return 1;
} }

2
src/main/c/Georg/tictactoe.h

@ -8,7 +8,7 @@ struct ticTacToe{
}; };
// Typdefinition für einen Funktionszeiger // Typdefinition für einen Funktionszeiger
typedef int (*commandFunction)();
typedef int (*commandFunction)( int );
struct command{ struct command{
int id; int id;

2
src/test/c/Georg/test_tictactoe.c

@ -84,7 +84,7 @@ void test_createCommandlist(void){
size_t arraySize = sizeof(*commands) / sizeof(commands[0]); size_t arraySize = sizeof(*commands) / sizeof(commands[0]);
for (size_t i = 0; i < arraySize; i++) { for (size_t i = 0; i < arraySize; i++) {
TEST_ASSERT_EQUAL_INT( 1, commands[i].fun(1) );
TEST_ASSERT_EQUAL_INT( 1, commands[i].fun(-1) );
} }
} }

Loading…
Cancel
Save