diff --git a/build/test/cache/test_timequiz.c b/build/test/cache/test_timequiz.c index cb30133..8809219 100644 --- a/build/test/cache/test_timequiz.c +++ b/build/test/cache/test_timequiz.c @@ -45,3 +45,31 @@ void test_getRandomQuestionIndex(void) { do {if ((index >= 0 && index < totalQuestions)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(24)));}} while(0); } + + + +void test_displayQuestion(void) { + + char* question = "Test Question"; + + char* answers[] = {"A", "B", "C", "D"}; + + int correctIndex = 0; + + printf("\nExpected Output:\n"); + + printf("Question: %s\n", question); + + for (int i = 0; i < 4; i++) { + + printf("%d. %s\n", i + 1, answers[i]); + + } + + printf("\n"); + + printf("Actual Output:\n"); + + displayQuestion(question, answers, correctIndex); + +} diff --git a/build/test/out/c/test_timequiz.o b/build/test/out/c/test_timequiz.o index 6cb41f6..f8234ce 100644 Binary files a/build/test/out/c/test_timequiz.o and b/build/test/out/c/test_timequiz.o differ diff --git a/build/test/out/c/test_timequiz_runner.o b/build/test/out/c/test_timequiz_runner.o index 00aa4a8..1699294 100644 Binary files a/build/test/out/c/test_timequiz_runner.o and b/build/test/out/c/test_timequiz_runner.o differ diff --git a/build/test/out/c/timequiz.o b/build/test/out/c/timequiz.o index 85f7ee5..c71585b 100644 Binary files a/build/test/out/c/timequiz.o and b/build/test/out/c/timequiz.o differ diff --git a/build/test/out/test_timequiz.out b/build/test/out/test_timequiz.out index f9f8630..fa6fec4 100755 Binary files a/build/test/out/test_timequiz.out and b/build/test/out/test_timequiz.out differ diff --git a/build/test/preprocess/files/test_timequiz.c b/build/test/preprocess/files/test_timequiz.c index cb30133..8809219 100644 --- a/build/test/preprocess/files/test_timequiz.c +++ b/build/test/preprocess/files/test_timequiz.c @@ -45,3 +45,31 @@ void test_getRandomQuestionIndex(void) { do {if ((index >= 0 && index < totalQuestions)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(24)));}} while(0); } + + + +void test_displayQuestion(void) { + + char* question = "Test Question"; + + char* answers[] = {"A", "B", "C", "D"}; + + int correctIndex = 0; + + printf("\nExpected Output:\n"); + + printf("Question: %s\n", question); + + for (int i = 0; i < 4; i++) { + + printf("%d. %s\n", i + 1, answers[i]); + + } + + printf("\n"); + + printf("Actual Output:\n"); + + displayQuestion(question, answers, correctIndex); + +} diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 1766bda..d81470f 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.014249100000597537 +:time: 0.01952290000008361 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index e93e0e3..43b9769 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0164414000000761 +:time: 0.016257900000709924 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 74ad0af..90c0fdb 100644 --- a/build/test/results/test_timequiz.pass +++ b/build/test/results/test_timequiz.pass @@ -7,12 +7,31 @@ :line: 16 :message: '' :unity_test_time: 0 +- :test: test_displayQuestion + :line: 27 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 1 - :passed: 1 + :total: 2 + :passed: 2 :failed: 0 :ignored: 0 -:stdout: [] -:time: 0.02380760000050941 +:stdout: +- '' +- 'Expected Output:' +- 'Question: Test Question' +- 1. A +- 2. B +- 3. C +- 4. D +- '' +- 'Actual Output:' +- '' +- 'Question: Test Question' +- 1. A +- 2. B +- 3. C +- 4. D +:time: 0.03188090000003285 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index a34f8fa..efd65ac 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.014939400000002934 +:time: 0.016452499999104475 diff --git a/build/test/runners/test_timequiz_runner.c b/build/test/runners/test_timequiz_runner.c index bd1bc90..0779822 100644 --- a/build/test/runners/test_timequiz_runner.c +++ b/build/test/runners/test_timequiz_runner.c @@ -11,6 +11,7 @@ char* GlobalOrderError; extern void setUp(void); extern void tearDown(void); extern void test_getRandomQuestionIndex(void); +extern void test_displayQuestion(void); /*=======Mock Management=====*/ @@ -76,6 +77,7 @@ int main(void) { UnityBegin("test_timequiz.c"); run_test(test_getRandomQuestionIndex, "test_getRandomQuestionIndex", 16); + run_test(test_displayQuestion, "test_displayQuestion", 27); return UnityEnd(); } diff --git a/test/test_timequiz.c b/test/test_timequiz.c index 7eb6cab..3199b75 100644 --- a/test/test_timequiz.c +++ b/test/test_timequiz.c @@ -24,4 +24,18 @@ void test_getRandomQuestionIndex(void) { TEST_ASSERT_TRUE(index >= 0 && index < totalQuestions); } +void test_displayQuestion(void) { + char* question = "Test Question"; + char* answers[] = {"A", "B", "C", "D"}; + int correctIndex = 0; + printf("\nExpected Output:\n"); + printf("Question: %s\n", question); + for (int i = 0; i < 4; i++) { + printf("%d. %s\n", i + 1, answers[i]); + } + printf("\n"); + printf("Actual Output:\n"); + displayQuestion(question, answers, correctIndex); +} + #endif //TEST