Browse Source

Unittest6

remotes/origin/Kevin
Kevin Schellberg 11 months ago
parent
commit
88d7dbb326
  1. 36
      build/test/cache/test_quizduell.c
  2. BIN
      build/test/out/c/test_quizduell.o
  3. BIN
      build/test/out/c/test_quizduell_runner.o
  4. BIN
      build/test/out/test_quizduell.out
  5. 36
      build/test/preprocess/files/test_quizduell.c
  6. 2
      build/test/results/test_casualQuiz.pass
  7. 10
      build/test/results/test_quizduell.pass
  8. 2
      build/test/results/test_timequiz.pass
  9. 2
      build/test/results/test_wwm.pass
  10. 2
      build/test/runners/test_quizduell_runner.c
  11. 5
      test/test_quizduell.c

36
build/test/cache/test_quizduell.c

@ -259,3 +259,39 @@ void test_createCategory2WithQuestions(void) {
free(kategorien[2].fragen); free(kategorien[2].fragen);
} }
void test_befreieKategorie(void) {
Kategorie testKategorie;
testKategorie.fragen = (QuizFrage*)malloc(3 * sizeof(QuizFrage));
testKategorie.anzahlFragen = 3;
testKategorie.joker = 1;
befreieKategorie(&testKategorie);
do {if ((((testKategorie.fragen)) ==
((void *)0)
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(94))));}} while(0);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((testKategorie.anzahlFragen)), (
((void *)0)
), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((testKategorie.joker)), (
((void *)0)
), (UNITY_UINT)(96), UNITY_DISPLAY_STYLE_INT);
}

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

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

BIN
build/test/out/test_quizduell.out

36
build/test/preprocess/files/test_quizduell.c

@ -259,3 +259,39 @@ void test_createCategory2WithQuestions(void) {
free(kategorien[2].fragen); free(kategorien[2].fragen);
} }
void test_befreieKategorie(void) {
Kategorie testKategorie;
testKategorie.fragen = (QuizFrage*)malloc(3 * sizeof(QuizFrage));
testKategorie.anzahlFragen = 3;
testKategorie.joker = 1;
befreieKategorie(&testKategorie);
do {if ((((testKategorie.fragen)) ==
((void *)0)
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(94))));}} while(0);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((testKategorie.anzahlFragen)), (
((void *)0)
), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((testKategorie.joker)), (
((void *)0)
), (UNITY_UINT)(96), UNITY_DISPLAY_STYLE_INT);
}

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.017894000000524102
:time: 0.01776380000046629

10
build/test/results/test_quizduell.pass

@ -19,12 +19,16 @@
:line: 65 :line: 65
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_befreieKategorie
:line: 86
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 4
:passed: 4
:total: 5
:passed: 5
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.03097669999988284
:time: 0.030904999999620486

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01692929999990156
:time: 0.016614099999060272

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.016848700000991812
:time: 0.018228900000394788

2
build/test/runners/test_quizduell_runner.c

@ -14,6 +14,7 @@ extern void test_erstelleFrage(void);
extern void test_CookingFragen(void); extern void test_CookingFragen(void);
extern void test_MountainsFragen(void); extern void test_MountainsFragen(void);
extern void test_createCategory2WithQuestions(void); extern void test_createCategory2WithQuestions(void);
extern void test_befreieKategorie(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -82,6 +83,7 @@ int main(void)
run_test(test_CookingFragen, "test_CookingFragen", 22); run_test(test_CookingFragen, "test_CookingFragen", 22);
run_test(test_MountainsFragen, "test_MountainsFragen", 44); run_test(test_MountainsFragen, "test_MountainsFragen", 44);
run_test(test_createCategory2WithQuestions, "test_createCategory2WithQuestions", 65); run_test(test_createCategory2WithQuestions, "test_createCategory2WithQuestions", 65);
run_test(test_befreieKategorie, "test_befreieKategorie", 86);
return UnityEnd(); return UnityEnd();
} }

5
test/test_quizduell.c

@ -95,5 +95,8 @@ void test_befreieKategorie(void) {
TEST_ASSERT_EQUAL_INT(0, testKategorie.anzahlFragen); TEST_ASSERT_EQUAL_INT(0, testKategorie.anzahlFragen);
TEST_ASSERT_EQUAL_INT(0, testKategorie.joker); TEST_ASSERT_EQUAL_INT(0, testKategorie.joker);
} }
void test_pruefeAntwort_CorrectAnswer(void) {
QuizFrage frage = erstelleFrage("Test Question", "Option A", "Option B", "Option C", "Option D", 'A');
TEST_ASSERT_EQUAL_INT(1, pruefeAntwort(frage, 'A'));
}
#endif //TEST #endif //TEST
Loading…
Cancel
Save