Browse Source

Unittest2

remotes/origin/Kevin
Kevin Schellberg 11 months ago
parent
commit
99c5d6eb3a
  1. BIN
      build/test/out/c/quizduell.o
  2. BIN
      build/test/out/test_quizduell.out
  3. 2
      build/test/results/test_casualQuiz.pass
  4. 2
      build/test/results/test_quizduell.pass
  5. 2
      build/test/results/test_timequiz.pass
  6. 2
      build/test/results/test_wwm.pass
  7. 24
      test/test_quizduell.c

BIN
build/test/out/c/quizduell.o

BIN
build/test/out/test_quizduell.out

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.016042600000218954
:time: 0.016859499999554828

2
build/test/results/test_quizduell.pass

@ -15,4 +15,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.03114080000023023
:time: 0.01654910000070231

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01592659999960233
:time: 0.016376399998989655

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.015713100000084523
:time: 0.01621040000100038

24
test/test_quizduell.c

@ -18,4 +18,28 @@ void test_erstelleFrage(void) {
TEST_ASSERT_EQUAL_STRING("AntwortD", testFrage.antwortD); TEST_ASSERT_EQUAL_STRING("AntwortD", testFrage.antwortD);
TEST_ASSERT_EQUAL_CHAR('A', testFrage.korrekteAntwort); TEST_ASSERT_EQUAL_CHAR('A', testFrage.korrekteAntwort);
} }
void test_CookingFragen(void) {
Kategorie kategorien[MAX_CATEGORIES];
kategorien[1].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage));
kategorien[1].fragen[0] = erstelleFrage("Which Ingredient is used traditionally for Pesto?", "Tomatoes", "Basil", "Spinach", "Oregano", 'B');
kategorien[1].fragen[1] = erstelleFrage("Which meal is known for its usage of rice?", "Lasagna", "Sushi", "Pizza", "Hamburger", 'B');
kategorien[1].fragen[2] = erstelleFrage("Which color has a ripe banana?", "Red", "Green", "Yellow", "Orange", 'C');
kategorien[1].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY;
kategorien[1].joker = 1;
TEST_ASSERT_EQUAL_STRING("Which Ingredient is used traditionally for Pesto?", kategorien[1].fragen[0].frage);
TEST_ASSERT_EQUAL_STRING("Tomatoes", kategorien[1].fragen[0].antwortA);
TEST_ASSERT_EQUAL_STRING("Basil", kategorien[1].fragen[0].antwortB);
TEST_ASSERT_EQUAL_STRING("Spinach", kategorien[1].fragen[0].antwortC);
TEST_ASSERT_EQUAL_STRING("Oregano", kategorien[1].fragen[0].antwortD);
TEST_ASSERT_EQUAL_CHAR('B', kategorien[1].fragen[0].korrekteAntwort);
free(kategorien[1].fragen);
}
#endif //TEST #endif //TEST
Loading…
Cancel
Save