diff --git a/build/test/cache/test_quizduell.c b/build/test/cache/test_quizduell.c index 22ae955..25a4bb9 100644 --- a/build/test/cache/test_quizduell.c +++ b/build/test/cache/test_quizduell.c @@ -259,3 +259,39 @@ void test_createCategory2WithQuestions(void) { 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); + +} diff --git a/build/test/out/c/test_quizduell.o b/build/test/out/c/test_quizduell.o index 8c2c0b2..6186864 100644 Binary files a/build/test/out/c/test_quizduell.o and b/build/test/out/c/test_quizduell.o differ diff --git a/build/test/out/c/test_quizduell_runner.o b/build/test/out/c/test_quizduell_runner.o index 984d908..eefeebb 100644 Binary files a/build/test/out/c/test_quizduell_runner.o and b/build/test/out/c/test_quizduell_runner.o differ diff --git a/build/test/out/test_quizduell.out b/build/test/out/test_quizduell.out index cef7df9..88638f7 100755 Binary files a/build/test/out/test_quizduell.out and b/build/test/out/test_quizduell.out differ diff --git a/build/test/preprocess/files/test_quizduell.c b/build/test/preprocess/files/test_quizduell.c index 22ae955..25a4bb9 100644 --- a/build/test/preprocess/files/test_quizduell.c +++ b/build/test/preprocess/files/test_quizduell.c @@ -259,3 +259,39 @@ void test_createCategory2WithQuestions(void) { 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); + +} diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index f596fdb..0aec465 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.017894000000524102 +:time: 0.01776380000046629 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index c9070e7..ac99bf1 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -19,12 +19,16 @@ :line: 65 :message: '' :unity_test_time: 0 +- :test: test_befreieKategorie + :line: 86 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 4 - :passed: 4 + :total: 5 + :passed: 5 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.03097669999988284 +:time: 0.030904999999620486 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 9132c70..4d602aa 100644 --- a/build/test/results/test_timequiz.pass +++ b/build/test/results/test_timequiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.01692929999990156 +:time: 0.016614099999060272 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index 2652f96..7fa146d 100644 --- a/build/test/results/test_wwm.pass +++ b/build/test/results/test_wwm.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.016848700000991812 +:time: 0.018228900000394788 diff --git a/build/test/runners/test_quizduell_runner.c b/build/test/runners/test_quizduell_runner.c index d86c5ed..c3b2715 100644 --- a/build/test/runners/test_quizduell_runner.c +++ b/build/test/runners/test_quizduell_runner.c @@ -14,6 +14,7 @@ extern void test_erstelleFrage(void); extern void test_CookingFragen(void); extern void test_MountainsFragen(void); extern void test_createCategory2WithQuestions(void); +extern void test_befreieKategorie(void); /*=======Mock Management=====*/ @@ -82,6 +83,7 @@ int main(void) run_test(test_CookingFragen, "test_CookingFragen", 22); run_test(test_MountainsFragen, "test_MountainsFragen", 44); run_test(test_createCategory2WithQuestions, "test_createCategory2WithQuestions", 65); + run_test(test_befreieKategorie, "test_befreieKategorie", 86); return UnityEnd(); } diff --git a/test/test_quizduell.c b/test/test_quizduell.c index a4b659b..f5b4701 100644 --- a/test/test_quizduell.c +++ b/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.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 \ No newline at end of file