From 3caeee425015fb9bd22368dafbeec72b222cb083 Mon Sep 17 00:00:00 2001 From: fdai7033 Date: Tue, 31 Jan 2023 20:33:09 +0100 Subject: [PATCH] Unittest: test_3.c --- .gitignore | 4 ++-- build-project-windows-mingw.bat | 5 ----- build-project.sh | 0 src/main.c | 2 +- unittests/test_3.c | 8 ++++++++ unittests/test_main.c | 1 + unittests/tests.h | 3 ++- 7 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 build-project-windows-mingw.bat mode change 100644 => 100755 build-project.sh create mode 100644 unittests/test_3.c diff --git a/.gitignore b/.gitignore index ec50e8e..461193d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -quiz-game.exe -unittests-exec.exe +quiz-game +unittests-exec /.vscode \ No newline at end of file diff --git a/build-project-windows-mingw.bat b/build-project-windows-mingw.bat deleted file mode 100644 index 79b0b2d..0000000 --- a/build-project-windows-mingw.bat +++ /dev/null @@ -1,5 +0,0 @@ -gcc src/*.c -o quiz-game -gcc unittests/*.c src/functions.c -I src -o unittests-exec - -unittests-exec.exe -quiz-game.exe \ No newline at end of file diff --git a/build-project.sh b/build-project.sh old mode 100644 new mode 100755 diff --git a/src/main.c b/src/main.c index 4484d73..93a9592 100644 --- a/src/main.c +++ b/src/main.c @@ -20,7 +20,7 @@ void startGame(int catCount, char* input, Category* categories) { for (int i = 0; i < lvlQuestions[level].size; i++) { - printf(lvlQuestions[level].questions[i].question); + printf("%s", lvlQuestions[level].questions[i].question); printf(" "); fgets(input, 256, stdin); input[strlen(input) - 1] = '\0'; diff --git a/unittests/test_3.c b/unittests/test_3.c new file mode 100644 index 0000000..bb0b1e4 --- /dev/null +++ b/unittests/test_3.c @@ -0,0 +1,8 @@ +#include "tests.h" + +void test_3() +{ + printf("TEST 3 STARTET\n"); + assert(!compareStrings("567", "567")); + printf("TEST 3 ERFOLGREICH\n"); +} \ No newline at end of file diff --git a/unittests/test_main.c b/unittests/test_main.c index 8562ddc..7fff852 100644 --- a/unittests/test_main.c +++ b/unittests/test_main.c @@ -6,4 +6,5 @@ int main() { test_1(); test_2(); + test_3(); } \ No newline at end of file diff --git a/unittests/tests.h b/unittests/tests.h index 4df7f46..30f19d7 100644 --- a/unittests/tests.h +++ b/unittests/tests.h @@ -6,4 +6,5 @@ #include "functions.h" void test_1(); -void test_2(); \ No newline at end of file +void test_2(); +void test_3(); \ No newline at end of file