Browse Source

Benutzereingabe

remotes/origin/Kevin
Kevin Schellberg 11 months ago
parent
commit
1dabec56b2
  1. 4
      build/test/cache/defines_dependency.yml
  2. 59
      build/test/cache/test_quizduell.c
  3. 1
      build/test/dependencies/quizduell.d
  4. 5
      build/test/dependencies/test_quizduell.d
  5. BIN
      build/test/out/c/quizduell.o
  6. BIN
      build/test/out/c/test_quizduell.o
  7. BIN
      build/test/out/c/test_quizduell_runner.o
  8. BIN
      build/test/out/test_quizduell.out
  9. 59
      build/test/preprocess/files/test_quizduell.c
  10. 4
      build/test/preprocess/includes/test_quizduell.c
  11. 2
      build/test/results/test_casualQuiz.pass
  12. 12
      build/test/results/test_quizduell.pass
  13. 2
      build/test/results/test_timequiz.pass
  14. 2
      build/test/results/test_wwm.pass
  15. 36
      build/test/runners/test_quizduell_runner.c
  16. 3
      src/quizduell.c

4
build/test/cache/defines_dependency.yml

@ -1 +1,3 @@
--- {}
---
src/quizduell.c:
- TEST

59
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);
}

1
build/test/dependencies/quizduell.d

@ -0,0 +1 @@
build/test/out/c/quizduell.o: src/quizduell.c src/quizduell.h

5
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

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

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

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

BIN
build/test/out/test_quizduell.out

59
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);
}

4
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

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.030125300000008792
:time: 0.016023700000005192

12
build/test/results/test_quizduell.pass

@ -2,13 +2,17 @@
:source: :source:
:path: test :path: test
:file: test_quizduell.c :file: test_quizduell.c
:successes: []
:successes:
- :test: test_erstelleFrage
:line: 11
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 0
:passed: 0
:total: 1
:passed: 1
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.027771300000040355
:time: 0.029750499999977364

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.028294399999936104
:time: 0.016164499999945292

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.027808699999923192
:time: 0.01664180000000215

36
build/test/runners/test_quizduell_runner.c

@ -10,6 +10,7 @@ char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/ /*=======External Functions This Runner Calls=====*/
extern void setUp(void); extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_erstelleFrage(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -26,12 +27,6 @@ static void CMock_Destroy(void)
{ {
} }
/*=======Setup (stub)=====*/
void setUp(void) {}
/*=======Teardown (stub)=====*/
void tearDown(void) {}
/*=======Test Reset Options=====*/ /*=======Test Reset Options=====*/
void resetTest(void); void resetTest(void);
void resetTest(void) void resetTest(void)
@ -48,10 +43,39 @@ void verifyTest(void)
CMock_Verify(); 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=====*/ /*=======MAIN=====*/
int main(void) int main(void)
{ {
UnityBegin("test_quizduell.c"); UnityBegin("test_quizduell.c");
run_test(test_erstelleFrage, "test_erstelleFrage", 11);
return UnityEnd(); return UnityEnd();
} }

3
src/quizduell.c

@ -53,6 +53,9 @@ void quizduell() {
zeigeVerfuegbareKategorien(kategorien); zeigeVerfuegbareKategorien(kategorien);
printf("Your selection: ");
scanf("%s", auswahl);
return; return;
} }
Loading…
Cancel
Save