From c12ef1337f5a11bfbbbbd4f65a8a1b98b41d28b4 Mon Sep 17 00:00:00 2001 From: KaffeeMaus Date: Fri, 26 Jan 2024 11:36:19 +0100 Subject: [PATCH] changed command test execution --- src/main/c/Georg/tictactoe.c | 4 ++-- src/main/c/Georg/tictactoe.h | 2 +- src/test/c/Georg/test_tictactoe.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index 9e12efe..ce02785 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/src/main/c/Georg/tictactoe.c @@ -81,7 +81,7 @@ char* getUserInput(){ } int startMenu( int code ){ - if( code == 1 ){ // command test + if( code == -1 ){ // command test return 1; } @@ -99,7 +99,7 @@ int startMenu( int code ){ } int startGame( int code ){ - if( code == 1 ){ // command test + if( code == -1 ){ // command test return 1; } diff --git a/src/main/c/Georg/tictactoe.h b/src/main/c/Georg/tictactoe.h index 0856e7b..b5f7ba9 100644 --- a/src/main/c/Georg/tictactoe.h +++ b/src/main/c/Georg/tictactoe.h @@ -8,7 +8,7 @@ struct ticTacToe{ }; // Typdefinition für einen Funktionszeiger -typedef int (*commandFunction)(); +typedef int (*commandFunction)( int ); struct command{ int id; diff --git a/src/test/c/Georg/test_tictactoe.c b/src/test/c/Georg/test_tictactoe.c index 849ed61..e45f18d 100644 --- a/src/test/c/Georg/test_tictactoe.c +++ b/src/test/c/Georg/test_tictactoe.c @@ -84,7 +84,7 @@ void test_createCommandlist(void){ size_t arraySize = sizeof(*commands) / sizeof(commands[0]); 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) ); } }