Browse Source

Unittest: test_3.c

main
fdai7033 2 years ago
parent
commit
3caeee4250
  1. 4
      .gitignore
  2. 5
      build-project-windows-mingw.bat
  3. 0
      build-project.sh
  4. 2
      src/main.c
  5. 8
      unittests/test_3.c
  6. 1
      unittests/test_main.c
  7. 1
      unittests/tests.h

4
.gitignore

@ -1,3 +1,3 @@
quiz-game.exe
unittests-exec.exe
quiz-game
unittests-exec
/.vscode /.vscode

5
build-project-windows-mingw.bat

@ -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

0
build-project.sh

2
src/main.c

@ -20,7 +20,7 @@ void startGame(int catCount, char* input, Category* categories)
{ {
for (int i = 0; i < lvlQuestions[level].size; i++) for (int i = 0; i < lvlQuestions[level].size; i++)
{ {
printf(lvlQuestions[level].questions[i].question);
printf("%s", lvlQuestions[level].questions[i].question);
printf(" "); printf(" ");
fgets(input, 256, stdin); fgets(input, 256, stdin);
input[strlen(input) - 1] = '\0'; input[strlen(input) - 1] = '\0';

8
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");
}

1
unittests/test_main.c

@ -6,4 +6,5 @@ int main()
{ {
test_1(); test_1();
test_2(); test_2();
test_3();
} }

1
unittests/tests.h

@ -7,3 +7,4 @@
void test_1(); void test_1();
void test_2(); void test_2();
void test_3();
Loading…
Cancel
Save