Browse Source

Unittest 6 für eingabe außerhalb der antwortmöglichkeiten niedriger

remotes/origin/Florian
Florian Baeseler 11 months ago
parent
commit
5398d486f2
  1. 26
      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. 26
      build/test/preprocess/files/test_casualQuiz.c
  6. 13
      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. 6
      build/test/runners/test_casualQuiz_runner.c
  11. 10
      test/test_casualQuiz.c

26
build/test/cache/test_casualQuiz.c

@ -136,7 +136,7 @@ void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void){
} }
void test_FcheckaufRichtigkeit_incorrect_input(void){
void test_FcheckaufRichtigkeit_incorrect_input_higher(void){
int TESTeingabe = 5; int TESTeingabe = 5;
@ -159,3 +159,27 @@ void test_FcheckaufRichtigkeit_incorrect_input(void){
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(63)));}} while(0); )) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(63)));}} while(0);
} }
void test_FcheckaufRichtigkeit_incorrect_input_lower(void){
int TESTeingabe = -1;
int TESTindex = 0;
int TESTrichtige_antwort[]={3};
_Bool
testfall;
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
do {if ((testfall !=
1
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0);
}

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

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

BIN
build/test/out/test_casualQuiz.out

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

@ -136,7 +136,7 @@ void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void){
} }
void test_FcheckaufRichtigkeit_incorrect_input(void){
void test_FcheckaufRichtigkeit_incorrect_input_higher(void){
int TESTeingabe = 5; int TESTeingabe = 5;
@ -159,3 +159,27 @@ void test_FcheckaufRichtigkeit_incorrect_input(void){
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(63)));}} while(0); )) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(63)));}} while(0);
} }
void test_FcheckaufRichtigkeit_incorrect_input_lower(void){
int TESTeingabe = -1;
int TESTindex = 0;
int TESTrichtige_antwort[]={3};
_Bool
testfall;
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
do {if ((testfall !=
1
)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(71)));}} while(0);
}

13
build/test/results/test_casualQuiz.pass

@ -19,15 +19,19 @@
:line: 47 :line: 47
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FcheckaufRichtigkeit_incorrect_input
- :test: test_FcheckaufRichtigkeit_incorrect_input_higher
:line: 57 :line: 57
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_FcheckaufRichtigkeit_incorrect_input_lower
:line: 65
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 5
:passed: 5
:total: 6
:passed: 6
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -40,4 +44,5 @@
- Case 4 - Case 4
- Right Answer, well done. - Right Answer, well done.
- Wrong Input! - Wrong Input!
:time: 0.035433499986538664
- Wrong Input!
:time: 0.03493439999874681

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.014862199983326718
:time: 0.014303199975984171

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.014781000005314127
:time: 0.014138700003968552

2
build/test/results/test_wwm.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.013869599992176518
:time: 0.01387090000207536

6
build/test/runners/test_casualQuiz_runner.c

@ -14,7 +14,8 @@ extern void test_FcheckaufRichtigkeit_correct_answer_atIndex1(void);
extern void test_FcheckaufRichtigkeit_correct_answer_atIndex2(void); extern void test_FcheckaufRichtigkeit_correct_answer_atIndex2(void);
extern void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void); 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(void);
extern void test_FcheckaufRichtigkeit_incorrect_input_higher(void);
extern void test_FcheckaufRichtigkeit_incorrect_input_lower(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -83,7 +84,8 @@ int main(void)
run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex2, "test_FcheckaufRichtigkeit_correct_answer_atIndex2", 28); run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex2, "test_FcheckaufRichtigkeit_correct_answer_atIndex2", 28);
run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex3, "test_FcheckaufRichtigkeit_correct_answer_atIndex3", 38); run_test(test_FcheckaufRichtigkeit_correct_answer_atIndex3, "test_FcheckaufRichtigkeit_correct_answer_atIndex3", 38);
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, "test_FcheckaufRichtigkeit_incorrect_input", 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);
return UnityEnd(); return UnityEnd();
} }

10
test/test_casualQuiz.c

@ -54,7 +54,7 @@ void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void){
TEST_ASSERT_TRUE(testfall == true); TEST_ASSERT_TRUE(testfall == true);
} }
void test_FcheckaufRichtigkeit_incorrect_input(void){
void test_FcheckaufRichtigkeit_incorrect_input_higher(void){
int TESTeingabe = 5; int TESTeingabe = 5;
int TESTindex = 0; int TESTindex = 0;
int TESTrichtige_antwort[]={3}; int TESTrichtige_antwort[]={3};
@ -62,4 +62,12 @@ void test_FcheckaufRichtigkeit_incorrect_input(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_FcheckaufRichtigkeit_incorrect_input_lower(void){
int TESTeingabe = -1;
int TESTindex = 0;
int TESTrichtige_antwort[]={3};
bool testfall;
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
TEST_ASSERT_TRUE(testfall != true);
}
#endif //Test #endif //Test
Loading…
Cancel
Save