Browse Source

Unittest lose(Up + freiesFeld)

main
Jannis 2 years ago
parent
commit
d06b3c4a3b
  1. 22
      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. 22
      build/test/preprocess/files/test_Spiellogik.c
  6. 10
      build/test/results/test_Spiellogik.pass
  7. 2
      build/test/results/test_Umgebung.pass
  8. 2
      build/test/results/test_test.pass
  9. 2
      build/test/runners/test_Spiellogik_runner.c
  10. 1
      src/Spiellogik.h
  11. 9
      test/test_Spiellogik.c

22
build/test/cache/test_Spiellogik.c

@ -73,3 +73,25 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){
), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_up_freiesFeld(void){
int realU[20][20] = { 0 };
realU[10][12] = 4;
int result = lose(realU, 'u');
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(41), 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

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

@ -73,3 +73,25 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){
), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT);
}
void test_lose_up_freiesFeld(void){
int realU[20][20] = { 0 };
realU[10][12] = 4;
int result = lose(realU, 'u');
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_Spiellogik.pass

@ -15,12 +15,16 @@
:line: 27
:message: ''
:unity_test_time: 0
- :test: test_lose_up_freiesFeld
:line: 36
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 3
:passed: 3
:total: 4
:passed: 4
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0012968020000698743
:time: 0.0011183120000168856

2
build/test/results/test_Umgebung.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0011922139997295744
:time: 0.0011495720000311849

2
build/test/results/test_test.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.002588016000117932
:time: 0.0012508869999692251

2
build/test/runners/test_Spiellogik_runner.c

@ -13,6 +13,7 @@ extern void tearDown(void);
extern void test_test1(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);
/*=======Mock Management=====*/
@ -80,6 +81,7 @@ int main(void)
run_test(test_test1, "test_test1", 12);
run_test(test_feldFrei_Verhalten_bei_belegtem_Feld, "test_feldFrei_Verhalten_bei_belegtem_Feld", 19);
run_test(test_feldFrei_Verhalten_bei_freiem_Feld, "test_feldFrei_Verhalten_bei_freiem_Feld", 27);
run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 36);
return UnityEnd();
}

1
src/Spiellogik.h

@ -5,5 +5,6 @@
int probe(int input);
int feldFrei(int realU[N][N], int ii, int jj);
int lose(int realU[N][N], char richtung);
#endif

9
test/test_Spiellogik.c

@ -31,3 +31,12 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){
TEST_ASSERT_EQUAL_INT(1, result);
}
//Tests zur Bewegung nach oben
void test_lose_up_freiesFeld(void){
int realU[20][20] = { 0 };
realU[10][12] = 4;
int result = lose(realU, 'u');
TEST_ASSERT_EQUAL_INT(0, result);
}
Loading…
Cancel
Save