Browse Source

Unittest 7 damit zähler hochgezählt werden können wenn beide bei 0

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
14d90800b2
  1. 40
      build/test/cache/test_casualQuiz.c
  2. BIN
      build/test/out/c/test_casualQuiz.o
  3. BIN
      build/test/out/c/test_casualQuiz_runner.o
  4. BIN
      build/test/out/test_casualQuiz.out
  5. BIN
      build/test/out/test_quizduell.out
  6. BIN
      build/test/out/test_timequiz.out
  7. BIN
      build/test/out/test_wwm.out
  8. 40
      build/test/preprocess/files/test_casualQuiz.c
  9. 10
      build/test/results/test_casualQuiz.pass
  10. 2
      build/test/results/test_quizduell.pass
  11. 2
      build/test/results/test_timequiz.pass
  12. 2
      build/test/results/test_wwm.pass
  13. 2
      build/test/runners/test_casualQuiz_runner.c
  14. 12
      test/test_casualQuiz.c

40
build/test/cache/test_casualQuiz.c

@ -183,3 +183,43 @@ void test_FcheckaufRichtigkeit_incorrect_input_lower(void){
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0); )) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0);
} }
void test_FzaehlernachAuswahl(void){
_Bool
richtig =
1
;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(81), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(82), UNITY_DISPLAY_STYLE_INT);
}

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

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

BIN
build/test/out/test_casualQuiz.out

BIN
build/test/out/test_quizduell.out

BIN
build/test/out/test_timequiz.out

BIN
build/test/out/test_wwm.out

40
build/test/preprocess/files/test_casualQuiz.c

@ -183,3 +183,43 @@ void test_FcheckaufRichtigkeit_incorrect_input_lower(void){
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0); )) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0);
} }
void test_FzaehlernachAuswahl(void){
_Bool
richtig =
1
;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(81), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(82), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_casualQuiz.pass

@ -27,11 +27,15 @@
:line: 65 :line: 65
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FzaehlernachAuswahl
:line: 73
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 6
:passed: 6
:total: 7
:passed: 7
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -45,4 +49,4 @@
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
- Wrong Input! - Wrong Input!
:time: 0.03563229998690076
:time: 0.03667549998499453

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01542800001334399
:time: 0.037954800005536526

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.015153000014834106
:time: 0.03327270000590943

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.014826200000243261
:time: 0.031949899974279106

2
build/test/runners/test_casualQuiz_runner.c

@ -16,6 +16,7 @@ extern void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void);
extern void test_FcheckaufRichtigkeit_correct_answer_atIndex4(void); extern void test_FcheckaufRichtigkeit_correct_answer_atIndex4(void);
extern void test_FcheckaufRichtigkeit_incorrect_input_higher(void); extern void test_FcheckaufRichtigkeit_incorrect_input_higher(void);
extern void test_FcheckaufRichtigkeit_incorrect_input_lower(void); extern void test_FcheckaufRichtigkeit_incorrect_input_lower(void);
extern void test_FzaehlernachAuswahl(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -86,6 +87,7 @@ int main(void)
run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex4, "test_FcheckaufRichtigkeit_correct_answer_atIndex4", 47); run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex4, "test_FcheckaufRichtigkeit_correct_answer_atIndex4", 47);
run_test(test_FcheckaufRichtigkeit_incorrect_input_higher, "test_FcheckaufRichtigkeit_incorrect_input_higher", 57); run_test(test_FcheckaufRichtigkeit_incorrect_input_higher, "test_FcheckaufRichtigkeit_incorrect_input_higher", 57);
run_test(test_FcheckaufRichtigkeit_incorrect_input_lower, "test_FcheckaufRichtigkeit_incorrect_input_lower", 65); run_test(test_FcheckaufRichtigkeit_incorrect_input_lower, "test_FcheckaufRichtigkeit_incorrect_input_lower", 65);
run_test(test_FzaehlernachAuswahl, "test_FzaehlernachAuswahl", 73);
return UnityEnd(); return UnityEnd();
} }

12
test/test_casualQuiz.c

@ -70,4 +70,16 @@ void test_FcheckaufRichtigkeit_incorrect_input_lower(void){
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex); testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
TEST_ASSERT_TRUE(testfall != true); TEST_ASSERT_TRUE(testfall != true);
} }
void test_FzaehlernachAuswahl(void){
bool richtig = true;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
TEST_ASSERT_EQUAL_INT(1, correct);
TEST_ASSERT_EQUAL_INT(1, answered);
}
#endif //Test #endif //Test
Loading…
Cancel
Save