Browse Source

Unittest 9 damit nur der answered zähler hochgezählt werden wird wenn beide bei 0

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
6c9dbc86f6
  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. 40
      build/test/preprocess/files/test_casualQuiz.c
  6. 10
      build/test/results/test_casualQuiz.pass
  7. 2
      build/test/results/test_quizduell.pass
  8. 2
      build/test/results/test_timequiz.pass
  9. 2
      build/test/results/test_wwm.pass
  10. 2
      build/test/runners/test_casualQuiz_runner.c
  11. 12
      test/test_casualQuiz.c

40
build/test/cache/test_casualQuiz.c

@ -262,4 +262,44 @@ void test_FzaehlernachAuswahl_bei1(void){
}
void test_FzaehlernachAuswahl_falsch_bei_0(void){
_Bool
richtig =
0
;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(106), 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

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

@ -262,4 +262,44 @@ void test_FzaehlernachAuswahl_bei1(void){
}
void test_FzaehlernachAuswahl_falsch_bei_0(void){
_Bool
richtig =
0
;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(106), UNITY_DISPLAY_STYLE_INT);
} }

10
build/test/results/test_casualQuiz.pass

@ -35,11 +35,15 @@
:line: 85 :line: 85
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FzaehlernachAuswahl_falsch_bei_0
:line: 97
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 8
:passed: 8
:total: 9
:passed: 9
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -53,4 +57,4 @@
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
- Wrong Input! - Wrong Input!
:time: 0.03635380003834143
:time: 0.035101499990560114

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01403949997620657
:time: 0.013820099993608892

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.01435820001643151
:time: 0.014337700034957379

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.013466000033076853
:time: 0.01380850002169609

2
build/test/runners/test_casualQuiz_runner.c

@ -18,6 +18,7 @@ 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); extern void test_FzaehlernachAuswahl(void);
extern void test_FzaehlernachAuswahl_bei1(void); extern void test_FzaehlernachAuswahl_bei1(void);
extern void test_FzaehlernachAuswahl_falsch_bei_0(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -90,6 +91,7 @@ int main(void)
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); run_test(test_FzaehlernachAuswahl, "test_FzaehlernachAuswahl", 73);
run_test(test_FzaehlernachAuswahl_bei1, "test_FzaehlernachAuswahl_bei1", 85); run_test(test_FzaehlernachAuswahl_bei1, "test_FzaehlernachAuswahl_bei1", 85);
run_test(test_FzaehlernachAuswahl_falsch_bei_0, "test_FzaehlernachAuswahl_falsch_bei_0", 97);
return UnityEnd(); return UnityEnd();
} }

12
test/test_casualQuiz.c

@ -93,5 +93,17 @@ void test_FzaehlernachAuswahl_bei1(void){
TEST_ASSERT_EQUAL_INT(2, correct); TEST_ASSERT_EQUAL_INT(2, correct);
TEST_ASSERT_EQUAL_INT(2, answered); TEST_ASSERT_EQUAL_INT(2, answered);
}
void test_FzaehlernachAuswahl_falsch_bei_0(void){
bool richtig = false;
int correct = 0;
int answered = 0;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
TEST_ASSERT_EQUAL_INT(0, correct);
TEST_ASSERT_EQUAL_INT(1, answered);
} }
#endif //Test #endif //Test
Loading…
Cancel
Save