Browse Source

Unittest Funktion feldFrei

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

20
build/test/cache/test_Spiellogik.c

@ -33,3 +33,23 @@ void test_test1(void){
), (UNITY_UINT)(16), UNITY_DISPLAY_STYLE_INT);
}
void test_feldFrei(void){
int realU[20][20];
realU[11][12] = 1;
int result = feldFrei( realU, 11,12);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(24), 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

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

@ -33,3 +33,23 @@ void test_test1(void){
), (UNITY_UINT)(16), UNITY_DISPLAY_STYLE_INT);
}
void test_feldFrei(void){
int realU[20][20];
realU[11][12] = 1;
int result = feldFrei( realU, 11,12);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(24), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_Spiellogik.pass

@ -7,12 +7,16 @@
:line: 12
:message: ''
:unity_test_time: 0
- :test: test_feldFrei
:line: 19
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:total: 2
:passed: 2
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0014955760002521856
:time: 0.001353542999822821

2
build/test/results/test_test.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0015436290000252484
:time: 0.0018875850000767969

2
build/test/runners/test_Spiellogik_runner.c

@ -11,6 +11,7 @@ char* GlobalOrderError;
extern void setUp(void);
extern void tearDown(void);
extern void test_test1(void);
extern void test_feldFrei(void);
/*=======Mock Management=====*/
@ -76,6 +77,7 @@ int main(void)
{
UnityBegin("test_Spiellogik.c");
run_test(test_test1, "test_test1", 12);
run_test(test_feldFrei, "test_feldFrei", 19);
return UnityEnd();
}

3
src/Spiellogik.h

@ -1,8 +1,9 @@
#include "unity.h"
#ifndef PROBE_H
#define PROBE_H
#define N 20
int probe(int input);
int feldFrei(int realU[N][N], int ii, int jj);
#endif

8
test/test_Spiellogik.c

@ -14,4 +14,12 @@ void test_test1(void){
int result = probe(2);
TEST_ASSERT_EQUAL_INT(2, result);
}
void test_feldFrei(void){
int realU[N][N];
realU[11][12] = 1;
int result = feldFrei( realU, 11,12);
TEST_ASSERT_EQUAL_INT(0 , result);
}
Loading…
Cancel
Save