diff --git a/build/test/cache/test_quizduell.c b/build/test/cache/test_quizduell.c index 0bd6872..2f553a6 100644 --- a/build/test/cache/test_quizduell.c +++ b/build/test/cache/test_quizduell.c @@ -57,3 +57,73 @@ void test_erstelleFrage(void) { ), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_CHAR); } + + + +void test_CookingFragen(void) { + + Kategorie kategorien[3]; + + + + kategorien[1].fragen = (QuizFrage*)malloc(3 * 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 = 3; + + kategorien[1].joker = 1; + + + + UnityAssertEqualString((const char*)(("Which Ingredient is used traditionally for Pesto?")), (const char*)((kategorien[1].fragen[0].frage)), ( + + ((void *)0) + + ), (UNITY_UINT)(34)); + + UnityAssertEqualString((const char*)(("Tomatoes")), (const char*)((kategorien[1].fragen[0].antwortA)), ( + + ((void *)0) + + ), (UNITY_UINT)(35)); + + UnityAssertEqualString((const char*)(("Basil")), (const char*)((kategorien[1].fragen[0].antwortB)), ( + + ((void *)0) + + ), (UNITY_UINT)(36)); + + UnityAssertEqualString((const char*)(("Spinach")), (const char*)((kategorien[1].fragen[0].antwortC)), ( + + ((void *)0) + + ), (UNITY_UINT)(37)); + + UnityAssertEqualString((const char*)(("Oregano")), (const char*)((kategorien[1].fragen[0].antwortD)), ( + + ((void *)0) + + ), (UNITY_UINT)(38)); + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('B')), (UNITY_INT)(UNITY_INT8 )((kategorien[1].fragen[0].korrekteAntwort)), ( + + ((void *)0) + + ), (UNITY_UINT)(39), UNITY_DISPLAY_STYLE_CHAR); + + + + + + free(kategorien[1].fragen); + +} diff --git a/build/test/out/c/test_quizduell.o b/build/test/out/c/test_quizduell.o index a00b4c1..187589e 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 1c91b08..a15810b 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 063255b..6667da4 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 0bd6872..2f553a6 100644 --- a/build/test/preprocess/files/test_quizduell.c +++ b/build/test/preprocess/files/test_quizduell.c @@ -57,3 +57,73 @@ void test_erstelleFrage(void) { ), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_CHAR); } + + + +void test_CookingFragen(void) { + + Kategorie kategorien[3]; + + + + kategorien[1].fragen = (QuizFrage*)malloc(3 * 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 = 3; + + kategorien[1].joker = 1; + + + + UnityAssertEqualString((const char*)(("Which Ingredient is used traditionally for Pesto?")), (const char*)((kategorien[1].fragen[0].frage)), ( + + ((void *)0) + + ), (UNITY_UINT)(34)); + + UnityAssertEqualString((const char*)(("Tomatoes")), (const char*)((kategorien[1].fragen[0].antwortA)), ( + + ((void *)0) + + ), (UNITY_UINT)(35)); + + UnityAssertEqualString((const char*)(("Basil")), (const char*)((kategorien[1].fragen[0].antwortB)), ( + + ((void *)0) + + ), (UNITY_UINT)(36)); + + UnityAssertEqualString((const char*)(("Spinach")), (const char*)((kategorien[1].fragen[0].antwortC)), ( + + ((void *)0) + + ), (UNITY_UINT)(37)); + + UnityAssertEqualString((const char*)(("Oregano")), (const char*)((kategorien[1].fragen[0].antwortD)), ( + + ((void *)0) + + ), (UNITY_UINT)(38)); + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('B')), (UNITY_INT)(UNITY_INT8 )((kategorien[1].fragen[0].korrekteAntwort)), ( + + ((void *)0) + + ), (UNITY_UINT)(39), UNITY_DISPLAY_STYLE_CHAR); + + + + + + free(kategorien[1].fragen); + +} diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index fd5d9e1..a7f3f9a 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.016859499999554828 +:time: 0.01786770000035176 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 97341cc..614e6e8 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -7,12 +7,16 @@ :line: 11 :message: '' :unity_test_time: 0 +- :test: test_CookingFragen + :line: 22 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 1 - :passed: 1 + :total: 2 + :passed: 2 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.01654910000070231 +:time: 0.03265889999966021 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 21426f5..914fec7 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.016376399998989655 +:time: 0.019886199999746168 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index 8437dac..ea9e6fa 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.01621040000100038 +:time: 0.01826220000111789 diff --git a/build/test/runners/test_quizduell_runner.c b/build/test/runners/test_quizduell_runner.c index bd8394b..14e5da2 100644 --- a/build/test/runners/test_quizduell_runner.c +++ b/build/test/runners/test_quizduell_runner.c @@ -11,6 +11,7 @@ char* GlobalOrderError; extern void setUp(void); extern void tearDown(void); extern void test_erstelleFrage(void); +extern void test_CookingFragen(void); /*=======Mock Management=====*/ @@ -76,6 +77,7 @@ int main(void) { UnityBegin("test_quizduell.c"); run_test(test_erstelleFrage, "test_erstelleFrage", 11); + run_test(test_CookingFragen, "test_CookingFragen", 22); return UnityEnd(); } diff --git a/test/test_quizduell.c b/test/test_quizduell.c index dc909a3..36e8d2d 100644 --- a/test/test_quizduell.c +++ b/test/test_quizduell.c @@ -41,5 +41,25 @@ void test_CookingFragen(void) { free(kategorien[1].fragen); } +void test_MountainsFragen(void) { + Kategorie kategorien[MAX_CATEGORIES]; + + kategorien[0].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); + + kategorien[0].fragen[0] = erstelleFrage("Whats the height of the Zugspitze?", "2482 Meter", "2867 Meter", "2962 Meter", "3173 Meter", 'C'); + kategorien[0].fragen[1] = erstelleFrage("In which Federal State is the Zugspitze?", "Bayern", "Baden-Wuerttemberg", "Hessen", "Thueringen", 'A'); + kategorien[0].fragen[2] = erstelleFrage("Which Mountain is the highest following after the Zugspitze?", "Grossglockner", "Watzmann", "Feldberg", "Meissner", 'B'); + kategorien[0].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; + kategorien[0].joker = 1; + + TEST_ASSERT_EQUAL_STRING("Whats the height of the Zugspitze?", kategorien[0].fragen[0].frage); + TEST_ASSERT_EQUAL_STRING("2482 Meter", kategorien[0].fragen[0].antwortA); + TEST_ASSERT_EQUAL_STRING("2867 Meter", kategorien[0].fragen[0].antwortB); + TEST_ASSERT_EQUAL_STRING("2962 Meter", kategorien[0].fragen[0].antwortC); + TEST_ASSERT_EQUAL_STRING("3173 Meter", kategorien[0].fragen[0].antwortD); + TEST_ASSERT_EQUAL_CHAR('C', kategorien[0].fragen[0].korrekteAntwort); + + free(kategorien[0].fragen); +} #endif //TEST \ No newline at end of file