Browse Source

Bauern X Bewegung aussortiert, Luis Hahn

remotes/origin/Läufer-fertig,-Hendrik-Voß
Luis Hahn 11 months ago
parent
commit
31aae4365e
  1. 11
      build/artifacts/test/report.xml
  2. 2
      build/test/cache/defines_dependency.yml
  3. 67
      build/test/cache/test_Bauer.c
  4. 10
      build/test/cache/test_Moving.c
  5. 2
      build/test/dependencies/Bauer.d
  6. 2
      build/test/dependencies/Moving.d
  7. 4
      build/test/dependencies/test_Bauer.d
  8. 4
      build/test/dependencies/test_Bauer_runner.d
  9. BIN
      build/test/out/c/Bauer.o
  10. BIN
      build/test/out/c/Moving.o
  11. BIN
      build/test/out/c/test_Bauer.o
  12. BIN
      build/test/out/c/test_Bauer_runner.o
  13. BIN
      build/test/out/c/test_Moving_runner.o
  14. BIN
      build/test/out/test_Bauer.out
  15. BIN
      build/test/out/test_Moving.out
  16. 67
      build/test/preprocess/files/test_Bauer.c
  17. 10
      build/test/preprocess/files/test_Moving.c
  18. 5
      build/test/preprocess/includes/test_Bauer.c
  19. 18
      build/test/results/test_Bauer.pass
  20. 2
      build/test/results/test_Input.pass
  21. 6
      build/test/results/test_Moving.pass
  22. 2
      build/test/results/test_Schachbrett.pass
  23. 81
      build/test/runners/test_Bauer_runner.c
  24. 4
      build/test/runners/test_Moving_runner.c
  25. 7
      src/Bauer.c
  26. 3
      src/Bauer.h
  27. 4
      src/Moving.c
  28. 37
      test/test_Bauer.c

11
build/artifacts/test/report.xml

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

2
build/test/cache/defines_dependency.yml

@ -5,3 +5,5 @@ src/Schachbrett.c:
- TEST
src/Moving.c:
- TEST
src/Bauer.c:
- TEST

67
build/test/cache/test_Bauer.c

@ -0,0 +1,67 @@
#include "src/Bauer.h"
#include "src/Spieler.h"
#include "src/Schachbrett.h"
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void) {
}
void tearDown(void) {
}
void test_Bauer_X_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 2;
int endY = 1;
Player player = PLAYER_WHITE;
do {if ((((brett)) !=
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(24))));}} while(0);
do {if (!(istzugerlaubt_Bauer( brett, startX, startY, endX, endY, player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(27)));}} while(0);
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}

10
build/test/cache/test_Moving.c

@ -6,6 +6,8 @@
void setUp(void) {
}
@ -40,7 +42,7 @@ void test_Bauern_bewegen(void) {
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(22))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(23))));}} while(0);
@ -56,13 +58,13 @@ void test_Bauern_bewegen(void) {
((void *)0)
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(29), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((' ')), (UNITY_INT)((brett[1][0])), (
((void *)0)
), (UNITY_UINT)(29), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(30), UNITY_DISPLAY_STYLE_INT);
@ -100,7 +102,7 @@ void test_istzugerlaubt(void){
do {if (!(istzugerlaubt(brett,startX,startY,endX,endY,player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(48)));}} while(0);
do {if (!(istzugerlaubt(brett,startX,startY,endX,endY,player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(49)));}} while(0);
for (int i = 0; i < 8; i++) {

2
build/test/dependencies/Bauer.d

@ -0,0 +1,2 @@
build/test/out/c/Bauer.o: src/Bauer.c src/spieler.h src/Moving.h \
src/Bauer.h

2
build/test/dependencies/Moving.d

@ -1 +1 @@
build/test/out/c/Moving.o: src/Moving.c src/spieler.h
build/test/out/c/Moving.o: src/Moving.c src/spieler.h src/Bauer.h

4
build/test/dependencies/test_Bauer.d

@ -0,0 +1,4 @@
build/test/out/c/test_Bauer.o: test/test_Bauer.c \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/Schachbrett.h src/Spieler.h src/Bauer.h src/spieler.h

4
build/test/dependencies/test_Bauer_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_Bauer_runner.o: \
build/test/runners/test_Bauer_runner.c \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

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_runner.o

BIN
build/test/out/test_Bauer.out

BIN
build/test/out/test_Moving.out

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

@ -0,0 +1,67 @@
#include "src/Bauer.h"
#include "src/Spieler.h"
#include "src/Schachbrett.h"
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void) {
}
void tearDown(void) {
}
void test_Bauer_X_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 2;
int endY = 1;
Player player = PLAYER_WHITE;
do {if ((((brett)) !=
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(24))));}} while(0);
do {if (!(istzugerlaubt_Bauer( brett, startX, startY, endX, endY, player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(27)));}} while(0);
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}

10
build/test/preprocess/files/test_Moving.c

@ -6,6 +6,8 @@
void setUp(void) {
}
@ -40,7 +42,7 @@ void test_Bauern_bewegen(void) {
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(22))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(23))));}} while(0);
@ -56,13 +58,13 @@ void test_Bauern_bewegen(void) {
((void *)0)
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(29), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((' ')), (UNITY_INT)((brett[1][0])), (
((void *)0)
), (UNITY_UINT)(29), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(30), UNITY_DISPLAY_STYLE_INT);
@ -100,7 +102,7 @@ void test_istzugerlaubt(void){
do {if (!(istzugerlaubt(brett,startX,startY,endX,endY,player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(48)));}} while(0);
do {if (!(istzugerlaubt(brett,startX,startY,endX,endY,player))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(49)));}} while(0);
for (int i = 0; i < 8; i++) {

5
build/test/preprocess/includes/test_Bauer.c

@ -0,0 +1,5 @@
---
- C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h
- src/Schachbrett.h
- src/Spieler.h
- src/Bauer.h

18
build/test/results/test_Bauer.pass

@ -0,0 +1,18 @@
---
:source:
:path: test
:file: test_Bauer.c
:successes:
- :test: test_Bauer_X_Bewegung
:line: 14
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout: []
:time: 0.13611029996536672

2
build/test/results/test_Input.pass

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

6
build/test/results/test_Moving.pass

@ -4,11 +4,11 @@
:file: test_Moving.c
:successes:
- :test: test_Bauern_bewegen
:line: 13
:line: 14
:message: ''
:unity_test_time: 0
- :test: test_istzugerlaubt
:line: 38
:line: 39
:message: ''
:unity_test_time: 0
:failures: []
@ -27,4 +27,4 @@
- " "
- " p p p p p p p p "
- " r n b q k b n r "
:time: 0.029342600028030574
:time: 0.11075459996936843

2
build/test/results/test_Schachbrett.pass

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

81
build/test/runners/test_Bauer_runner.c

@ -0,0 +1,81 @@
/* AUTOGENERATED FILE. DO NOT EDIT. */
/*=======Automagically Detected Files To Include=====*/
#include "unity.h"
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/
extern void setUp(void);
extern void tearDown(void);
extern void test_Bauer_X_Bewegung(void);
/*=======Mock Management=====*/
static void CMock_Init(void)
{
GlobalExpectCount = 0;
GlobalVerifyOrder = 0;
GlobalOrderError = NULL;
}
static void CMock_Verify(void)
{
}
static void CMock_Destroy(void)
{
}
/*=======Test Reset Options=====*/
void resetTest(void);
void resetTest(void)
{
tearDown();
CMock_Verify();
CMock_Destroy();
CMock_Init();
setUp();
}
void verifyTest(void);
void verifyTest(void)
{
CMock_Verify();
}
/*=======Test Runner Used To Run Each Test=====*/
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
{
Unity.CurrentTestName = name;
Unity.CurrentTestLineNumber = line_num;
#ifdef UNITY_USE_COMMAND_LINE_ARGS
if (!UnityTestMatches())
return;
#endif
Unity.NumberOfTests++;
UNITY_CLR_DETAILS();
UNITY_EXEC_TIME_START();
CMock_Init();
if (TEST_PROTECT())
{
setUp();
func();
}
if (TEST_PROTECT())
{
tearDown();
CMock_Verify();
}
CMock_Destroy();
UNITY_EXEC_TIME_STOP();
UnityConcludeTest();
}
/*=======MAIN=====*/
int main(void)
{
UnityBegin("test_Bauer.c");
run_test(test_Bauer_X_Bewegung, "test_Bauer_X_Bewegung", 14);
return UnityEnd();
}

4
build/test/runners/test_Moving_runner.c

@ -76,8 +76,8 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE l
int main(void)
{
UnityBegin("test_Moving.c");
run_test(test_Bauern_bewegen, "test_Bauern_bewegen", 13);
run_test(test_istzugerlaubt, "test_istzugerlaubt", 38);
run_test(test_Bauern_bewegen, "test_Bauern_bewegen", 14);
run_test(test_istzugerlaubt, "test_istzugerlaubt", 39);
return UnityEnd();
}

7
src/Bauer.c

@ -3,10 +3,17 @@
#include <stdbool.h>
#include "spieler.h"
#include "Moving.h"
#include "Bauer.h"
bool istzugerlaubt_Bauer(char** Brett, int startX, int startY, int endX, int endY, Player player) {
//Bauern ZUG und Funktionen
//Wichtig extra Funktion EN Passaut
//Wichtig Bauernumwandlung
if(startX != endX){
return false;
}
return true;
}

3
src/Bauer.h

@ -1,6 +1,9 @@
#ifndef BAUER_H
#define BAUER_H
#include <stdbool.h>
#include "spieler.h"
bool istzugerlaubt_Bauer(char** Brett, int startX, int startY, int endX, int endY, Player player);
#endif // BAUER_H

4
src/Moving.c

@ -39,11 +39,11 @@ bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Pla
//Datei von König aufrufen
break;
case 'P':
if(istzugerlaubt_Bauer(Brett,startX,startY,endX,endY,player) == true){
/* if(istzugerlaubt_Bauer(Brett,startX,startY,endX,endY,player) == true){
return true;
}else{
return false;
}
}*/
break;
default:
break;

37
test/test_Bauer.c

@ -0,0 +1,37 @@
#ifdef TEST
#include "unity.h"
#include "Schachbrett.h"
#include "Spieler.h"
#include "Bauer.h"
#include <stdlib.h>
void setUp(void) {
}
void tearDown(void) {
}
void test_Bauer_X_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 1;
int startY = 1;
int endX = 2;
int endY = 1;
Player player = PLAYER_WHITE;
TEST_ASSERT_NOT_NULL(brett);
TEST_ASSERT_FALSE(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