Browse Source

Unittest 8 damit zähler hochgezählt werden können wenn beide bei 1

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

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

@ -222,4 +222,44 @@ void test_FzaehlernachAuswahl(void){
}
void test_FzaehlernachAuswahl_bei1(void){
_Bool
richtig =
1
;
int correct = 1;
int answered = 1;
int* correctP = &correct;
int* answeredP = &answered;
FzaehlernachAuswahl(richtig, answeredP, correctP);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((correct)), (
((void *)0)
), (UNITY_UINT)(93), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((answered)), (
((void *)0)
), (UNITY_UINT)(94), UNITY_DISPLAY_STYLE_INT);
} }

10
build/test/results/test_casualQuiz.pass

@ -31,11 +31,15 @@
:line: 73 :line: 73
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FzaehlernachAuswahl_bei1
:line: 85
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 7
:passed: 7
:total: 8
:passed: 8
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -49,4 +53,4 @@
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
- Wrong Input! - Wrong Input!
:time: 0.03667549998499453
:time: 0.03635380003834143

2
build/test/results/test_quizduell.pass

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

2
build/test/results/test_timequiz.pass

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

2
build/test/results/test_wwm.pass

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

2
build/test/runners/test_casualQuiz_runner.c

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

12
test/test_casualQuiz.c

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