Browse Source

Unittest 10 damit nur der answered zähler hochgezählt wird wenn beide bei 1

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
74e95075b4
  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

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

@ -302,4 +302,44 @@ void test_FzaehlernachAuswahl_falsch_bei_0(void){
}
void test_FzaehlernachAuswahl_falsch_bei_1(void){
_Bool
richtig =
0
;
int correct = 1;
int answered = 1;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(117), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(118), UNITY_DISPLAY_STYLE_INT);
} }

10
build/test/results/test_casualQuiz.pass

@ -39,11 +39,15 @@
:line: 97 :line: 97
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FzaehlernachAuswahl_falsch_bei_1
:line: 109
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 9
:passed: 9
:total: 10
:passed: 10
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -57,4 +61,4 @@
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
- Wrong Input! - Wrong Input!
:time: 0.035101499990560114
:time: 0.03535600000759587

2
build/test/results/test_quizduell.pass

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

2
build/test/results/test_timequiz.pass

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

2
build/test/results/test_wwm.pass

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

2
build/test/runners/test_casualQuiz_runner.c

@ -19,6 +19,7 @@ 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); extern void test_FzaehlernachAuswahl_falsch_bei_0(void);
extern void test_FzaehlernachAuswahl_falsch_bei_1(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -92,6 +93,7 @@ int main(void)
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); run_test(test_FzaehlernachAuswahl_falsch_bei_0, "test_FzaehlernachAuswahl_falsch_bei_0", 97);
run_test(test_FzaehlernachAuswahl_falsch_bei_1, "test_FzaehlernachAuswahl_falsch_bei_1", 109);
return UnityEnd(); return UnityEnd();
} }

12
test/test_casualQuiz.c

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