diff --git a/build/test/cache/defines_dependency.yml b/build/test/cache/defines_dependency.yml index 2fbf0ff..3e29f85 100644 --- a/build/test/cache/defines_dependency.yml +++ b/build/test/cache/defines_dependency.yml @@ -1 +1,3 @@ ---- {} +--- +src/quizduell.c: +- TEST diff --git a/build/test/cache/test_quizduell.c b/build/test/cache/test_quizduell.c index e69de29..0bd6872 100644 --- a/build/test/cache/test_quizduell.c +++ b/build/test/cache/test_quizduell.c @@ -0,0 +1,59 @@ +#include "src/quizduell.h" +#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + +void setUp(void) {} + + + +void tearDown(void) {} + + + +void test_erstelleFrage(void) { + + QuizFrage testFrage = erstelleFrage("Testfrage", "AntwortA", "AntwortB", "AntwortC", "AntwortD", 'A'); + + + + UnityAssertEqualString((const char*)(("Testfrage")), (const char*)((testFrage.frage)), ( + + ((void *)0) + + ), (UNITY_UINT)(14)); + + UnityAssertEqualString((const char*)(("AntwortA")), (const char*)((testFrage.antwortA)), ( + + ((void *)0) + + ), (UNITY_UINT)(15)); + + UnityAssertEqualString((const char*)(("AntwortB")), (const char*)((testFrage.antwortB)), ( + + ((void *)0) + + ), (UNITY_UINT)(16)); + + UnityAssertEqualString((const char*)(("AntwortC")), (const char*)((testFrage.antwortC)), ( + + ((void *)0) + + ), (UNITY_UINT)(17)); + + UnityAssertEqualString((const char*)(("AntwortD")), (const char*)((testFrage.antwortD)), ( + + ((void *)0) + + ), (UNITY_UINT)(18)); + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('A')), (UNITY_INT)(UNITY_INT8 )((testFrage.korrekteAntwort)), ( + + ((void *)0) + + ), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_CHAR); + +} diff --git a/build/test/dependencies/quizduell.d b/build/test/dependencies/quizduell.d new file mode 100644 index 0000000..de79562 --- /dev/null +++ b/build/test/dependencies/quizduell.d @@ -0,0 +1 @@ +build/test/out/c/quizduell.o: src/quizduell.c src/quizduell.h diff --git a/build/test/dependencies/test_quizduell.d b/build/test/dependencies/test_quizduell.d index b2861de..7ee91aa 100644 --- a/build/test/dependencies/test_quizduell.d +++ b/build/test/dependencies/test_quizduell.d @@ -1 +1,4 @@ -build/test/out/c/test_quizduell.o: test/test_quizduell.c +build/test/out/c/test_quizduell.o: test/test_quizduell.c \ + C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ + C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ + src/quizduell.h diff --git a/build/test/out/c/quizduell.o b/build/test/out/c/quizduell.o new file mode 100644 index 0000000..0919ac3 Binary files /dev/null and b/build/test/out/c/quizduell.o differ diff --git a/build/test/out/c/test_quizduell.o b/build/test/out/c/test_quizduell.o index 90fbcaa..a00b4c1 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 41887ac..1c91b08 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 801da28..f0d9177 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 e69de29..0bd6872 100644 --- a/build/test/preprocess/files/test_quizduell.c +++ b/build/test/preprocess/files/test_quizduell.c @@ -0,0 +1,59 @@ +#include "src/quizduell.h" +#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + +void setUp(void) {} + + + +void tearDown(void) {} + + + +void test_erstelleFrage(void) { + + QuizFrage testFrage = erstelleFrage("Testfrage", "AntwortA", "AntwortB", "AntwortC", "AntwortD", 'A'); + + + + UnityAssertEqualString((const char*)(("Testfrage")), (const char*)((testFrage.frage)), ( + + ((void *)0) + + ), (UNITY_UINT)(14)); + + UnityAssertEqualString((const char*)(("AntwortA")), (const char*)((testFrage.antwortA)), ( + + ((void *)0) + + ), (UNITY_UINT)(15)); + + UnityAssertEqualString((const char*)(("AntwortB")), (const char*)((testFrage.antwortB)), ( + + ((void *)0) + + ), (UNITY_UINT)(16)); + + UnityAssertEqualString((const char*)(("AntwortC")), (const char*)((testFrage.antwortC)), ( + + ((void *)0) + + ), (UNITY_UINT)(17)); + + UnityAssertEqualString((const char*)(("AntwortD")), (const char*)((testFrage.antwortD)), ( + + ((void *)0) + + ), (UNITY_UINT)(18)); + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('A')), (UNITY_INT)(UNITY_INT8 )((testFrage.korrekteAntwort)), ( + + ((void *)0) + + ), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_CHAR); + +} diff --git a/build/test/preprocess/includes/test_quizduell.c b/build/test/preprocess/includes/test_quizduell.c index dcd024e..11ef2c0 100644 --- a/build/test/preprocess/includes/test_quizduell.c +++ b/build/test/preprocess/includes/test_quizduell.c @@ -1 +1,3 @@ ---- [] +--- +- C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h +- src/quizduell.h diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 0bc5efb..c2a7f76 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.030125300000008792 +:time: 0.016023700000005192 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index 8d3b1f2..6bdebc1 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -2,13 +2,17 @@ :source: :path: test :file: test_quizduell.c -:successes: [] +:successes: +- :test: test_erstelleFrage + :line: 11 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 0 - :passed: 0 + :total: 1 + :passed: 1 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.027771300000040355 +:time: 0.029750499999977364 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 54e9236..dec4f9d 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.028294399999936104 +:time: 0.016164499999945292 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index e1d9402..c4a08c4 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.027808699999923192 +:time: 0.01664180000000215 diff --git a/build/test/runners/test_quizduell_runner.c b/build/test/runners/test_quizduell_runner.c index a93b0e4..bd8394b 100644 --- a/build/test/runners/test_quizduell_runner.c +++ b/build/test/runners/test_quizduell_runner.c @@ -10,6 +10,7 @@ char* GlobalOrderError; /*=======External Functions This Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); +extern void test_erstelleFrage(void); /*=======Mock Management=====*/ @@ -26,12 +27,6 @@ static void CMock_Destroy(void) { } -/*=======Setup (stub)=====*/ -void setUp(void) {} - -/*=======Teardown (stub)=====*/ -void tearDown(void) {} - /*=======Test Reset Options=====*/ void resetTest(void); void resetTest(void) @@ -48,10 +43,39 @@ void verifyTest(void) CMock_Verify(); } +/*=======Test Runner Used To Run Each Test=====*/ +static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) +{ + Unity.CurrentTestName = name; + Unity.CurrentTestLineNumber = line_num; +#ifdef UNITY_USE_COMMAND_LINE_ARGS + if (!UnityTestMatches()) + return; +#endif + Unity.NumberOfTests++; + UNITY_CLR_DETAILS(); + UNITY_EXEC_TIME_START(); + CMock_Init(); + if (TEST_PROTECT()) + { + setUp(); + func(); + } + if (TEST_PROTECT()) + { + tearDown(); + CMock_Verify(); + } + CMock_Destroy(); + UNITY_EXEC_TIME_STOP(); + UnityConcludeTest(); +} + /*=======MAIN=====*/ int main(void) { UnityBegin("test_quizduell.c"); + run_test(test_erstelleFrage, "test_erstelleFrage", 11); return UnityEnd(); } diff --git a/src/quizduell.c b/src/quizduell.c index 5476c5a..7672658 100644 --- a/src/quizduell.c +++ b/src/quizduell.c @@ -53,6 +53,9 @@ void quizduell() { zeigeVerfuegbareKategorien(kategorien); + printf("Your selection: "); + scanf("%s", auswahl); + return; }