Browse Source

Unittest lose(up + belegtesFeld)

main
Jannis 2 years ago
parent
commit
301bf440cb
  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. 9
      test/test_Spiellogik.c

22
build/test/cache/test_Spiellogik.c

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

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

10
build/test/results/test_Spiellogik.pass

@ -19,12 +19,16 @@
:line: 36 :line: 36
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_lose_up_belegtesFeld
:line: 44
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 4
:passed: 4
:total: 5
:passed: 5
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0011183120000168856
:time: 0.003247212000133004

2
build/test/results/test_Umgebung.pass

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

2
build/test/results/test_test.pass

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

2
build/test/runners/test_Spiellogik_runner.c

@ -14,6 +14,7 @@ extern void test_test1(void);
extern void test_feldFrei_Verhalten_bei_belegtem_Feld(void); extern void test_feldFrei_Verhalten_bei_belegtem_Feld(void);
extern void test_feldFrei_Verhalten_bei_freiem_Feld(void); extern void test_feldFrei_Verhalten_bei_freiem_Feld(void);
extern void test_lose_up_freiesFeld(void); extern void test_lose_up_freiesFeld(void);
extern void test_lose_up_belegtesFeld(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -82,6 +83,7 @@ int main(void)
run_test(test_feldFrei_Verhalten_bei_belegtem_Feld, "test_feldFrei_Verhalten_bei_belegtem_Feld", 19); 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_feldFrei_Verhalten_bei_freiem_Feld, "test_feldFrei_Verhalten_bei_freiem_Feld", 27);
run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 36); run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 36);
run_test(test_lose_up_belegtesFeld, "test_lose_up_belegtesFeld", 44);
return UnityEnd(); return UnityEnd();
} }

9
test/test_Spiellogik.c

@ -40,3 +40,12 @@ void test_lose_up_freiesFeld(void){
TEST_ASSERT_EQUAL_INT(0, result); TEST_ASSERT_EQUAL_INT(0, result);
} }
void test_lose_up_belegtesFeld(void){
int realU[20][20] = { 0 };
realU[10][12] = 4;
realU[9][12] = 3;
int result = lose(realU, 'u');
TEST_ASSERT_EQUAL_INT(1, result);
}
Loading…
Cancel
Save