Browse Source

Y-Bewegung des Bauern, Hendrik Voß

remotes/origin/Läufer-fertig,-Hendrik-Voß
Hendrik Voß 11 months ago
parent
commit
a384424a0d
  1. 11
      build/artifacts/test/report.xml
  2. 50
      build/test/cache/test_Bauer.c
  3. BIN
      build/test/out/c/Bauer.o
  4. BIN
      build/test/out/c/Moving.o
  5. BIN
      build/test/out/c/test_Bauer.o
  6. BIN
      build/test/out/c/test_Bauer_runner.o
  7. BIN
      build/test/out/c/test_Moving.o
  8. BIN
      build/test/out/c/test_Moving_runner.o
  9. BIN
      build/test/out/test_Bauer.out
  10. BIN
      build/test/out/test_Moving.out
  11. 50
      build/test/preprocess/files/test_Bauer.c
  12. 10
      build/test/results/test_Bauer.pass
  13. 2
      build/test/results/test_Input.pass
  14. 2
      build/test/results/test_Moving.pass
  15. 2
      build/test/results/test_Schachbrett.pass
  16. 2
      build/test/runners/test_Bauer_runner.c
  17. 8
      src/Bauer.c
  18. 22
      test/test_Bauer.c

11
build/artifacts/test/report.xml

@ -6,21 +6,24 @@
<Name>test/test_Bauer.c::test_Bauer_X_Bewegung</Name>
</Test>
<Test id="2">
<Name>test/test_Input.c::test_getUserInput</Name>
<Name>test/test_Bauer.c::test_Bauer_Y_Bewegung</Name>
</Test>
<Test id="3">
<Name>test/test_Moving.c::test_Bauern_bewegen</Name>
<Name>test/test_Input.c::test_getUserInput</Name>
</Test>
<Test id="4">
<Name>test/test_Moving.c::test_istzugerlaubt</Name>
<Name>test/test_Moving.c::test_Bauern_bewegen</Name>
</Test>
<Test id="5">
<Name>test/test_Moving.c::test_istzugerlaubt</Name>
</Test>
<Test id="6">
<Name>test/test_Schachbrett.c::test_Schachbrett_erstellen</Name>
</Test>
</SuccessfulTests>
<IgnoredTests/>
<Statistics>
<Tests>5</Tests>
<Tests>6</Tests>
<Ignores>0</Ignores>
<FailuresTotal>0</FailuresTotal>
<Errors>0</Errors>

50
build/test/cache/test_Bauer.c

@ -56,6 +56,56 @@ void test_Bauer_X_Bewegung(void) {
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}
void test_Bauer_Y_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 1;
int endY = 2;
Player player = PLAYER_WHITE;
do {if ((((brett)) !=
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(47))));}} while(0);
do {if ((istzugerlaubt_Bauer( brett, startX, startY, endX, endY, player))) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(50)));}} while(0);
for (int i = 0; i < 8; i++) {
free(brett[i]);

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

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

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

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

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

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

BIN
build/test/out/test_Bauer.out

BIN
build/test/out/test_Moving.out

50
build/test/preprocess/files/test_Bauer.c

@ -56,6 +56,56 @@ void test_Bauer_X_Bewegung(void) {
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}
void test_Bauer_Y_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 1;
int endY = 2;
Player player = PLAYER_WHITE;
do {if ((((brett)) !=
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(47))));}} while(0);
do {if ((istzugerlaubt_Bauer( brett, startX, startY, endX, endY, player))) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(50)));}} while(0);
for (int i = 0; i < 8; i++) {
free(brett[i]);

10
build/test/results/test_Bauer.pass

@ -7,12 +7,16 @@
:line: 14
:message: ''
:unity_test_time: 0
- :test: test_Bauer_Y_Bewegung
:line: 37
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:total: 2
:passed: 2
:failed: 0
:ignored: 0
:stdout: []
:time: 0.13611029996536672
:time: 2.4077018999960274

2
build/test/results/test_Input.pass

@ -16,4 +16,4 @@
:ignored: 0
:stdout:
- "-> "
:time: 0.04568029998335987
:time: 0.2119827000424266

2
build/test/results/test_Moving.pass

@ -27,4 +27,4 @@
- " "
- " p p p p p p p p "
- " r n b q k b n r "
:time: 0.11075459996936843
:time: 1.9541468999814242

2
build/test/results/test_Schachbrett.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.038021700049284846
:time: 0.24673879996407777

2
build/test/runners/test_Bauer_runner.c

@ -11,6 +11,7 @@ char* GlobalOrderError;
extern void setUp(void);
extern void tearDown(void);
extern void test_Bauer_X_Bewegung(void);
extern void test_Bauer_Y_Bewegung(void);
/*=======Mock Management=====*/
@ -76,6 +77,7 @@ int main(void)
{
UnityBegin("test_Bauer.c");
run_test(test_Bauer_X_Bewegung, "test_Bauer_X_Bewegung", 14);
run_test(test_Bauer_Y_Bewegung, "test_Bauer_Y_Bewegung", 37);
return UnityEnd();
}

8
src/Bauer.c

@ -13,6 +13,14 @@ bool istzugerlaubt_Bauer(char** Brett, int startX, int startY, int endX, int end
if(startX != endX){
return false;
}
if (player == PLAYER_WHITE){
if ((startY + 1 ) == endY){
return true;
}else {
return false;
}
}
return true;
}

22
test/test_Bauer.c

@ -34,4 +34,26 @@ void test_Bauer_X_Bewegung(void) {
}
void test_Bauer_Y_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 1;
int endY = 2;
Player player = PLAYER_WHITE;
TEST_ASSERT_NOT_NULL(brett);
TEST_ASSERT_TRUE(istzugerlaubt_Bauer( brett, startX, startY, endX, endY, player));
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}
#endif // TEST
Loading…
Cancel
Save