Browse Source

Unittest lose(right + belegtes Feld)

main
Jannis 2 years ago
parent
commit
ca58f9630e
  1. 44
      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. 44
      build/test/preprocess/files/test_Spiellogik.c
  6. 14
      build/test/results/test_Spiellogik.pass
  7. 2
      build/test/results/test_Umgebung.pass
  8. 2
      build/test/results/test_test.pass
  9. 4
      build/test/runners/test_Spiellogik_runner.c
  10. 9
      test/test_Spiellogik.c

44
build/test/cache/test_Spiellogik.c

@ -247,3 +247,47 @@ void test_lose_left_linkerRand(void){
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_right_freiesFeld(void){
int realU[20][20] = { 0 };
realU[5][12] = 4;
int result = lose(realU, 'r');
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(112), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_right_belegtesFeld(void){
int realU[20][20] = { 0 };
realU[5][12] = 4;
realU[5][13] = 3;
int result = lose(realU, 'r');
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(121), 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

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

@ -247,3 +247,47 @@ void test_lose_left_linkerRand(void){
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_right_freiesFeld(void){
int realU[20][20] = { 0 };
realU[5][12] = 4;
int result = lose(realU, 'r');
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(112), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_right_belegtesFeld(void){
int realU[20][20] = { 0 };
realU[5][12] = 4;
realU[5][13] = 3;
int result = lose(realU, 'r');
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(121), UNITY_DISPLAY_STYLE_INT);
}

14
build/test/results/test_Spiellogik.pass

@ -47,12 +47,20 @@
:line: 98
:message: ''
:unity_test_time: 0
- :test: test_lose_right_freiesFeld
:line: 107
:message: ''
:unity_test_time: 0
- :test: test_lose_right_belegtesFeld
:line: 115
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 11
:passed: 11
:total: 13
:passed: 13
:failed: 0
:ignored: 0
:stdout: []
:time: 0.001419748999978765
:time: 0.0014685070000268752

2
build/test/results/test_Umgebung.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0015369510001619346
:time: 0.001630110999030876

2
build/test/results/test_test.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0011366079997969791
:time: 0.0015618119996361202

4
build/test/runners/test_Spiellogik_runner.c

@ -21,6 +21,8 @@ extern void test_lose_down_belegtesFeld(void);
extern void test_lose_left_freiesFeld(void);
extern void test_lose_left_belegtesFeld(void);
extern void test_lose_left_linkerRand(void);
extern void test_lose_right_freiesFeld(void);
extern void test_lose_right_belegtesFeld(void);
/*=======Mock Management=====*/
@ -96,6 +98,8 @@ int main(void)
run_test(test_lose_left_freiesFeld, "test_lose_left_freiesFeld", 81);
run_test(test_lose_left_belegtesFeld, "test_lose_left_belegtesFeld", 89);
run_test(test_lose_left_linkerRand, "test_lose_left_linkerRand", 98);
run_test(test_lose_right_freiesFeld, "test_lose_right_freiesFeld", 107);
run_test(test_lose_right_belegtesFeld, "test_lose_right_belegtesFeld", 115);
return UnityEnd();
}

9
test/test_Spiellogik.c

@ -110,4 +110,13 @@ void test_lose_right_freiesFeld(void){
int result = lose(realU, 'r');
TEST_ASSERT_EQUAL_INT(0, result);
}
void test_lose_right_belegtesFeld(void){
int realU[20][20] = { 0 };
realU[5][12] = 4;
realU[5][13] = 3;
int result = lose(realU, 'r');
TEST_ASSERT_EQUAL_INT(1, result);
}
Loading…
Cancel
Save