Browse Source

Unittest Funktion win(Schlange nicht lang genug)

main
Jannis 2 years ago
parent
commit
510c5d5e20
  1. 46
      build/test/cache/test_Spiellogik.c
  2. BIN
      build/test/out/c/test_Spiellogik.o
  3. BIN
      build/test/out/c/test_Spiellogik_runner.o
  4. BIN
      build/test/out/test_Spiellogik.out
  5. 46
      build/test/preprocess/files/test_Spiellogik.c
  6. 36
      build/test/results/test_Spiellogik.pass
  7. 2
      build/test/results/test_Umgebung.pass
  8. 2
      build/test/results/test_test.pass
  9. 28
      build/test/runners/test_Spiellogik_runner.c
  10. 8
      test/test_Spiellogik.c

46
build/test/cache/test_Spiellogik.c

@ -62,6 +62,26 @@ void test_win_SchlangegroesseAusreichend(void){
void test_win_SchlangeNichtAusreichend(void){
int realU[20][20] = {0};
realU[15][5] = 15;
int result = win(realU);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(36), UNITY_DISPLAY_STYLE_INT);
}
void test_feldFrei_Verhalten_bei_belegtem_Feld(void){
int realU[20][20];
@ -76,7 +96,7 @@ void test_feldFrei_Verhalten_bei_belegtem_Feld(void){
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT);
}
@ -96,7 +116,7 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){
((void *)0)
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(51), UNITY_DISPLAY_STYLE_INT);
}
@ -122,7 +142,7 @@ void test_lose_up_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(54), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(62), UNITY_DISPLAY_STYLE_INT);
}
@ -146,7 +166,7 @@ void test_lose_up_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(64), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(72), UNITY_DISPLAY_STYLE_INT);
}
@ -170,7 +190,7 @@ void test_lose_up_Obererrand(void){
((void *)0)
), (UNITY_UINT)(74), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(82), UNITY_DISPLAY_STYLE_INT);
}
@ -194,7 +214,7 @@ void test_lose_down_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(84), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(92), UNITY_DISPLAY_STYLE_INT);
}
@ -220,7 +240,7 @@ void test_lose_down_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
}
@ -244,7 +264,7 @@ void test_lose_left_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(113), UNITY_DISPLAY_STYLE_INT);
}
@ -270,7 +290,7 @@ void test_lose_left_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(116), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(124), UNITY_DISPLAY_STYLE_INT);
}
@ -294,7 +314,7 @@ void test_lose_left_linkerRand(void){
((void *)0)
), (UNITY_UINT)(126), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(134), UNITY_DISPLAY_STYLE_INT);
}
@ -318,7 +338,7 @@ void test_lose_right_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(136), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(144), UNITY_DISPLAY_STYLE_INT);
}
@ -344,7 +364,7 @@ void test_lose_right_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(147), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(155), UNITY_DISPLAY_STYLE_INT);
}
@ -368,6 +388,6 @@ void test_lose_right_rechterRand(void){
((void *)0)
), (UNITY_UINT)(157), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(165), UNITY_DISPLAY_STYLE_INT);
}

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

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

BIN
build/test/out/test_Spiellogik.out

46
build/test/preprocess/files/test_Spiellogik.c

@ -62,6 +62,26 @@ void test_win_SchlangegroesseAusreichend(void){
void test_win_SchlangeNichtAusreichend(void){
int realU[20][20] = {0};
realU[15][5] = 15;
int result = win(realU);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(36), UNITY_DISPLAY_STYLE_INT);
}
void test_feldFrei_Verhalten_bei_belegtem_Feld(void){
int realU[20][20];
@ -76,7 +96,7 @@ void test_feldFrei_Verhalten_bei_belegtem_Feld(void){
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT);
}
@ -96,7 +116,7 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){
((void *)0)
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(51), UNITY_DISPLAY_STYLE_INT);
}
@ -122,7 +142,7 @@ void test_lose_up_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(54), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(62), UNITY_DISPLAY_STYLE_INT);
}
@ -146,7 +166,7 @@ void test_lose_up_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(64), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(72), UNITY_DISPLAY_STYLE_INT);
}
@ -170,7 +190,7 @@ void test_lose_up_Obererrand(void){
((void *)0)
), (UNITY_UINT)(74), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(82), UNITY_DISPLAY_STYLE_INT);
}
@ -194,7 +214,7 @@ void test_lose_down_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(84), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(92), UNITY_DISPLAY_STYLE_INT);
}
@ -220,7 +240,7 @@ void test_lose_down_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
}
@ -244,7 +264,7 @@ void test_lose_left_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(113), UNITY_DISPLAY_STYLE_INT);
}
@ -270,7 +290,7 @@ void test_lose_left_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(116), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(124), UNITY_DISPLAY_STYLE_INT);
}
@ -294,7 +314,7 @@ void test_lose_left_linkerRand(void){
((void *)0)
), (UNITY_UINT)(126), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(134), UNITY_DISPLAY_STYLE_INT);
}
@ -318,7 +338,7 @@ void test_lose_right_freiesFeld(void){
((void *)0)
), (UNITY_UINT)(136), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(144), UNITY_DISPLAY_STYLE_INT);
}
@ -344,7 +364,7 @@ void test_lose_right_belegtesFeld(void){
((void *)0)
), (UNITY_UINT)(147), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(155), UNITY_DISPLAY_STYLE_INT);
}
@ -368,6 +388,6 @@ void test_lose_right_rechterRand(void){
((void *)0)
), (UNITY_UINT)(157), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(165), UNITY_DISPLAY_STYLE_INT);
}

36
build/test/results/test_Spiellogik.pass

@ -11,64 +11,68 @@
:line: 22
:message: ''
:unity_test_time: 0
- :test: test_win_SchlangeNichtAusreichend
:line: 31
:message: ''
:unity_test_time: 0
- :test: test_feldFrei_Verhalten_bei_belegtem_Feld
:line: 30
:line: 38
:message: ''
:unity_test_time: 0
- :test: test_feldFrei_Verhalten_bei_freiem_Feld
:line: 38
:line: 46
:message: ''
:unity_test_time: 0
- :test: test_lose_up_freiesFeld
:line: 49
:line: 57
:message: ''
:unity_test_time: 0
- :test: test_lose_up_belegtesFeld
:line: 58
:line: 66
:message: ''
:unity_test_time: 0
- :test: test_lose_up_Obererrand
:line: 69
:line: 77
:message: ''
:unity_test_time: 0
- :test: test_lose_down_freiesFeld
:line: 79
:line: 87
:message: ''
:unity_test_time: 0
- :test: test_lose_down_belegtesFeld
:line: 89
:line: 97
:message: ''
:unity_test_time: 0
- :test: test_lose_left_freiesFeld
:line: 100
:line: 108
:message: ''
:unity_test_time: 0
- :test: test_lose_left_belegtesFeld
:line: 110
:line: 118
:message: ''
:unity_test_time: 0
- :test: test_lose_left_linkerRand
:line: 121
:line: 129
:message: ''
:unity_test_time: 0
- :test: test_lose_right_freiesFeld
:line: 131
:line: 139
:message: ''
:unity_test_time: 0
- :test: test_lose_right_belegtesFeld
:line: 141
:line: 149
:message: ''
:unity_test_time: 0
- :test: test_lose_right_rechterRand
:line: 152
:line: 160
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 15
:passed: 15
:total: 16
:passed: 16
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0010818149985425407
:time: 0.001048741998602054

2
build/test/results/test_Umgebung.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0012024529987684218
:time: 0.0011768759995902656

2
build/test/results/test_test.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.001348579000477912
:time: 0.0012329210003372282

28
build/test/runners/test_Spiellogik_runner.c

@ -12,6 +12,7 @@ extern void setUp(void);
extern void tearDown(void);
extern void test_test1(void);
extern void test_win_SchlangegroesseAusreichend(void);
extern void test_win_SchlangeNichtAusreichend(void);
extern void test_feldFrei_Verhalten_bei_belegtem_Feld(void);
extern void test_feldFrei_Verhalten_bei_freiem_Feld(void);
extern void test_lose_up_freiesFeld(void);
@ -91,19 +92,20 @@ int main(void)
UnityBegin("test_Spiellogik.c");
run_test(test_test1, "test_test1", 12);
run_test(test_win_SchlangegroesseAusreichend, "test_win_SchlangegroesseAusreichend", 22);
run_test(test_feldFrei_Verhalten_bei_belegtem_Feld, "test_feldFrei_Verhalten_bei_belegtem_Feld", 30);
run_test(test_feldFrei_Verhalten_bei_freiem_Feld, "test_feldFrei_Verhalten_bei_freiem_Feld", 38);
run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 49);
run_test(test_lose_up_belegtesFeld, "test_lose_up_belegtesFeld", 58);
run_test(test_lose_up_Obererrand, "test_lose_up_Obererrand", 69);
run_test(test_lose_down_freiesFeld, "test_lose_down_freiesFeld", 79);
run_test(test_lose_down_belegtesFeld, "test_lose_down_belegtesFeld", 89);
run_test(test_lose_left_freiesFeld, "test_lose_left_freiesFeld", 100);
run_test(test_lose_left_belegtesFeld, "test_lose_left_belegtesFeld", 110);
run_test(test_lose_left_linkerRand, "test_lose_left_linkerRand", 121);
run_test(test_lose_right_freiesFeld, "test_lose_right_freiesFeld", 131);
run_test(test_lose_right_belegtesFeld, "test_lose_right_belegtesFeld", 141);
run_test(test_lose_right_rechterRand, "test_lose_right_rechterRand", 152);
run_test(test_win_SchlangeNichtAusreichend, "test_win_SchlangeNichtAusreichend", 31);
run_test(test_feldFrei_Verhalten_bei_belegtem_Feld, "test_feldFrei_Verhalten_bei_belegtem_Feld", 38);
run_test(test_feldFrei_Verhalten_bei_freiem_Feld, "test_feldFrei_Verhalten_bei_freiem_Feld", 46);
run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 57);
run_test(test_lose_up_belegtesFeld, "test_lose_up_belegtesFeld", 66);
run_test(test_lose_up_Obererrand, "test_lose_up_Obererrand", 77);
run_test(test_lose_down_freiesFeld, "test_lose_down_freiesFeld", 87);
run_test(test_lose_down_belegtesFeld, "test_lose_down_belegtesFeld", 97);
run_test(test_lose_left_freiesFeld, "test_lose_left_freiesFeld", 108);
run_test(test_lose_left_belegtesFeld, "test_lose_left_belegtesFeld", 118);
run_test(test_lose_left_linkerRand, "test_lose_left_linkerRand", 129);
run_test(test_lose_right_freiesFeld, "test_lose_right_freiesFeld", 139);
run_test(test_lose_right_belegtesFeld, "test_lose_right_belegtesFeld", 149);
run_test(test_lose_right_rechterRand, "test_lose_right_rechterRand", 160);
return UnityEnd();
}

8
test/test_Spiellogik.c

@ -27,6 +27,14 @@ void test_win_SchlangegroesseAusreichend(void){
TEST_ASSERT_EQUAL_INT(1, result);
}
//Test Schlange nicht lang genug
void test_win_SchlangeNichtAusreichend(void){
int realU[N][N] = {0};
realU[15][5] = 15;
int result = win(realU);
TEST_ASSERT_EQUAL_INT(0, result);
}
void test_feldFrei_Verhalten_bei_belegtem_Feld(void){
int realU[N][N];
realU[11][12] = 1;

Loading…
Cancel
Save