Browse Source

Bauer Bewegungsabfrage hinzugefügt, Hendrik Voß

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

11
build/artifacts/test/report.xml

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

48
build/test/cache/test_Bauer.c

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

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

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

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

BIN
build/test/out/test_Bauer.out

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

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

10
build/test/results/test_Bauer.pass

@ -11,12 +11,16 @@
:line: 37 :line: 37
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_Bauer_Start_Bewegung
:line: 59
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 2
:passed: 2
:total: 3
:passed: 3
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 2.4077018999960274
:time: 1.2243709999602288

2
build/test/results/test_Input.pass

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

2
build/test/results/test_Moving.pass

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

2
build/test/results/test_Schachbrett.pass

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

2
build/test/runners/test_Bauer_runner.c

@ -12,6 +12,7 @@ extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_Bauer_X_Bewegung(void); extern void test_Bauer_X_Bewegung(void);
extern void test_Bauer_Y_Bewegung(void); extern void test_Bauer_Y_Bewegung(void);
extern void test_Bauer_Start_Bewegung(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -78,6 +79,7 @@ int main(void)
UnityBegin("test_Bauer.c"); UnityBegin("test_Bauer.c");
run_test(test_Bauer_X_Bewegung, "test_Bauer_X_Bewegung", 14); run_test(test_Bauer_X_Bewegung, "test_Bauer_X_Bewegung", 14);
run_test(test_Bauer_Y_Bewegung, "test_Bauer_Y_Bewegung", 37); run_test(test_Bauer_Y_Bewegung, "test_Bauer_Y_Bewegung", 37);
run_test(test_Bauer_Start_Bewegung, "test_Bauer_Start_Bewegung", 59);
return UnityEnd(); return UnityEnd();
} }

2
src/Bauer.c

@ -14,7 +14,7 @@ if(startX != endX){
return false; return false;
} }
if (player == PLAYER_WHITE){ if (player == PLAYER_WHITE){
if ((startY + 1 ) == endY){
if ((startY + 1 ) == endY|| ((startY == 1) && (startY + 2 == endY))){
return true; return true;
}else { }else {
return false; return false;

22
test/test_Bauer.c

@ -56,4 +56,26 @@ void test_Bauer_Y_Bewegung(void) {
free(brett); free(brett);
} }
void test_Bauer_Start_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 2;
int startY = 1;
int endX = 2;
int endY = 3;
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 #endif // TEST
Loading…
Cancel
Save