Browse Source

Fehler in Funktionen gefixt

main
fdai7892 11 months ago
parent
commit
8fe1b16831
  1. 542
      build/test/cache/test_duellist_spielesammlung_projekt.c
  2. BIN
      build/test/out/c/duellist-spielesammlung-projekt.o
  3. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt.o
  4. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt_runner.o
  5. BIN
      build/test/out/test_duellist_spielesammlung_projekt.out
  6. 542
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  7. 204
      build/test/results/test_duellist_spielesammlung_projekt.pass
  8. 126
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  9. 973
      src/main/duellist-spielesammlung-projekt.c
  10. 58
      src/main/duellist-spielesammlung-projekt.h
  11. 207
      src/test/test_duellist_spielesammlung_projekt.c

542
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -14,8 +14,6 @@ void tearDown(void) {}
void test_coinflip_x_starts(void) {
@ -36,9 +34,9 @@ void test_coinflip_x_starts(void) {
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(18), UNITY_DISPLAY_STYLE_INT);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(20)));}} while(0);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(19)));}} while(0);
}
@ -64,9 +62,9 @@ void test_coinflip_o_starts(void) {
((void *)0)
), (UNITY_UINT)(31), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(30), UNITY_DISPLAY_STYLE_INT);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(32)));}} while(0);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(31)));}} while(0);
}
@ -98,7 +96,7 @@ void test_vertical_win(void) {
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(45), UNITY_DISPLAY_STYLE_INT);
}
@ -130,7 +128,7 @@ void test_horizontal_win(void) {
((void *)0)
), (UNITY_UINT)(60), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(59), UNITY_DISPLAY_STYLE_INT);
}
@ -160,7 +158,7 @@ void test_diagonal_win(void) {
((void *)0)
), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(72), UNITY_DISPLAY_STYLE_INT);
}
@ -192,13 +190,13 @@ void test_valid_move_and_switch(void) {
((void *)0)
), (UNITY_UINT)(87), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(86), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((PLAYER_O)), (UNITY_INT)((game.currentPlayer)), (
((void *)0)
), (UNITY_UINT)(88), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(87), UNITY_DISPLAY_STYLE_INT);
}
@ -232,7 +230,7 @@ void test_invalid_input(void) {
((void *)0)
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(102), UNITY_DISPLAY_STYLE_INT);
}
@ -264,7 +262,7 @@ void test_valid_input(void) {
((void *)0)
), (UNITY_UINT)(117), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(116), UNITY_DISPLAY_STYLE_INT);
}
@ -298,7 +296,7 @@ void test_invalid_input_negative_row(void) {
((void *)0)
), (UNITY_UINT)(132), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(131), UNITY_DISPLAY_STYLE_INT);
}
@ -330,7 +328,7 @@ void test_invalid_input_overflow_column(void) {
((void *)0)
), (UNITY_UINT)(146), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(145), UNITY_DISPLAY_STYLE_INT);
}
@ -362,7 +360,7 @@ void test_NumberOfMoves_returns_correct_number_of_moves(void) {
((void *)0)
), (UNITY_UINT)(160), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(159), UNITY_DISPLAY_STYLE_INT);
}
@ -390,7 +388,7 @@ void test_BoardFull_returns_false_when_board_is_not_full(void) {
do {if (!(boardFull)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(174)));}} while(0);
do {if (!(boardFull)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(173)));}} while(0);
}
@ -416,7 +414,7 @@ void test_BoardFull_returns_true_when_board_is_full(void) {
do {if ((boardFull)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(187)));}} while(0);
do {if ((boardFull)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(186)));}} while(0);
}
@ -446,7 +444,7 @@ void test_CurrentPlayer_returns_correct_player(void) {
((void *)0)
), (UNITY_UINT)(200), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(199), UNITY_DISPLAY_STYLE_INT);
}
@ -474,7 +472,7 @@ void test_FieldEmpty_returns_true_for_empty_field(void) {
((void *)0)
), (UNITY_UINT)(212), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(211), UNITY_DISPLAY_STYLE_INT);
}
@ -504,7 +502,7 @@ void test_FieldEmpty_returns_false_for_nonempty_field(void) {
((void *)0)
), (UNITY_UINT)(225), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(224), UNITY_DISPLAY_STYLE_INT);
}
@ -536,7 +534,7 @@ void test_calculate_mines_HeightWidthOne(void)
((void *)0)
), (UNITY_UINT)(239), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(238), UNITY_DISPLAY_STYLE_INT);
}
@ -568,7 +566,7 @@ void test_calculate_mines_WidthOne(void)
((void *)0)
), (UNITY_UINT)(253), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(252), UNITY_DISPLAY_STYLE_INT);
}
@ -600,7 +598,7 @@ void test_calculate_mines_NormalCase(void)
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(266), UNITY_DISPLAY_STYLE_INT);
}
@ -642,7 +640,7 @@ void test_end_check_AllUncovered_NoMines(void)
((void *)0)
), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(285), UNITY_DISPLAY_STYLE_INT);
}
@ -674,7 +672,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(300))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(299))));}} while(0);
for (int i = 0; i < height; i++) {
@ -682,7 +680,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(302))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(301))));}} while(0);
for (int j = 0; j < width; j++) {
@ -690,7 +688,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
), (UNITY_UINT)(304), UNITY_DISPLAY_STYLE_CHAR);
), (UNITY_UINT)(303), UNITY_DISPLAY_STYLE_CHAR);
}
@ -736,7 +734,7 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(325), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(324), UNITY_DISPLAY_STYLE_INT);
}
@ -768,7 +766,7 @@ void test_create_minefield_NegativeDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(339))));}} while(0);
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(338))));}} while(0);
}
@ -800,7 +798,7 @@ void test_calculate_mines_HeightZero(void)
((void *)0)
), (UNITY_UINT)(353), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(352), UNITY_DISPLAY_STYLE_INT);
}
@ -832,7 +830,7 @@ void test_calculate_mines_HeightWidthNumber(void)
((void *)0)
), (UNITY_UINT)(367), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(366), UNITY_DISPLAY_STYLE_INT);
}
@ -864,7 +862,7 @@ void test_calculate_mines_HeightWidthAgan(void)
((void *)0)
), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(380), UNITY_DISPLAY_STYLE_INT);
}
@ -896,7 +894,7 @@ void test_calculate_mines_HeightWidthRoundUp(void)
((void *)0)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(394), UNITY_DISPLAY_STYLE_INT);
}
@ -928,7 +926,7 @@ void test_calculate_mines_HeightWidthNoRound(void)
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(408), UNITY_DISPLAY_STYLE_INT);
}
@ -960,10 +958,12 @@ void test_calculate_mines_HeightWidthFinal(void)
((void *)0)
), (UNITY_UINT)(423), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(422), UNITY_DISPLAY_STYLE_INT);
}
void test_generateRandomNumber_withinValidRange(void)
{
@ -980,7 +980,7 @@ void test_generateRandomNumber_withinValidRange(void)
do {if ((result >= 1 && result <= 100)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(459)));}} while(0);
do {if ((result >= 1 && result <= 100)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(433)));}} while(0);
}
@ -1010,7 +1010,7 @@ void test_addition(void)
((void *)0)
), (UNITY_UINT)(472), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(446), UNITY_DISPLAY_STYLE_INT);
}
@ -1040,7 +1040,7 @@ void test_subtraction(void)
((void *)0)
), (UNITY_UINT)(485), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(459), UNITY_DISPLAY_STYLE_INT);
}
@ -1072,7 +1072,7 @@ void test_multiplication(void)
((void *)0)
), (UNITY_UINT)(499), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(473), UNITY_DISPLAY_STYLE_INT);
}
@ -1102,7 +1102,7 @@ void test_division(void)
((void *)0)
), (UNITY_UINT)(512), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(486), UNITY_DISPLAY_STYLE_INT);
}
@ -1132,7 +1132,7 @@ void test_division_byZero_returnsZero(void)
((void *)0)
), (UNITY_UINT)(525), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(499), UNITY_DISPLAY_STYLE_INT);
}
@ -1162,7 +1162,7 @@ void test_modulo(void)
((void *)0)
), (UNITY_UINT)(538), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(512), UNITY_DISPLAY_STYLE_INT);
}
@ -1192,7 +1192,7 @@ void test_compare_equalNumbers(void)
((void *)0)
), (UNITY_UINT)(551), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(525), UNITY_DISPLAY_STYLE_INT);
}
@ -1222,7 +1222,7 @@ void test_compare_aLessThanB(void)
((void *)0)
), (UNITY_UINT)(564), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(538), UNITY_DISPLAY_STYLE_INT);
}
@ -1252,7 +1252,7 @@ void test_compare_aGreaterThanB(void)
((void *)0)
), (UNITY_UINT)(577), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(551), UNITY_DISPLAY_STYLE_INT);
}
@ -1282,7 +1282,7 @@ void test_exponentiation(void)
((void *)0)
), (UNITY_UINT)(590), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(564), UNITY_DISPLAY_STYLE_INT);
}
@ -1312,7 +1312,7 @@ void test_exponentiation_negativeExponent(void)
((void *)0)
), (UNITY_UINT)(603), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(577), UNITY_DISPLAY_STYLE_INT);
}
@ -1340,7 +1340,7 @@ void test_squareRoot_validNumber(void)
((void *)0)
), (UNITY_UINT)(615), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(589), UNITY_DISPLAY_STYLE_INT);
}
@ -1368,7 +1368,7 @@ void test_squareRoot_negativeNumber(void)
((void *)0)
), (UNITY_UINT)(627), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(601), UNITY_DISPLAY_STYLE_INT);
}
@ -1488,4 +1488,446 @@ void test_getUserAnswer_invalidInput(void)
}
void test_bereichauswahl_gueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichauswahl(1);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(668), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichauswahl_ungueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichauswahl(7);
UnityAssertEqualNumber((UNITY_INT)((7)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(680), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichfalsch_gueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichfalsch(3);
UnityAssertEqualNumber((UNITY_INT)((3)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(692), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichfalsch_ungueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichfalsch(9);
UnityAssertEqualNumber((UNITY_INT)((9)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(704), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich1_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(717), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich1_falsche_antwort(void)
{
int falsche_antwort1 = 4;
int antwort1 = 0;
antwort1 = 4;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(730), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(743), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_falsche_antwort(void)
{
int falsche_antwort1 = 1;
int antwort1 = 0;
antwort1 = 1;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(756), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_gewinner_spieler1(void)
{
int ergebnis_spieler1_gewinnt = 4;
int ergebnis_spieler1 = 0;
ergebnis_spieler1 = 4;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler1_gewinnt)), (UNITY_INT)((ergebnis_spieler1)), (
((void *)0)
), (UNITY_UINT)(769), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_gewinner_spieler2(void)
{
int ergebnis_spieler2_gewinnt = 2;
int ergebnis_spieler2 = 0;
ergebnis_spieler2 = 2;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler2_gewinnt)), (UNITY_INT)((ergebnis_spieler2)), (
((void *)0)
), (UNITY_UINT)(782), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_richtige_antwort(void)
{
int richtige_antwort1 = 3;
int antwort1 = 0;
antwort1 = 3;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(795), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_falsche_antwort(void)
{
int falsche_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(808), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_gewinner_spieler1(void)
{
int ergebnis_spieler1_gewinnt = 1;
int ergebnis_spieler1 = 0;
ergebnis_spieler1 = 1;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler1_gewinnt)), (UNITY_INT)((ergebnis_spieler1)), (
((void *)0)
), (UNITY_UINT)(821), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_gewinner_spieler2(void)
{
int ergebnis_spieler2_gewinnt = 5;
int ergebnis_spieler2 = 0;
ergebnis_spieler2 = 5;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler2_gewinnt)), (UNITY_INT)((ergebnis_spieler2)), (
((void *)0)
), (UNITY_UINT)(834), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich5_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(847), UNITY_DISPLAY_STYLE_INT);
}

BIN
build/test/out/c/duellist-spielesammlung-projekt.o

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

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

BIN
build/test/out/test_duellist_spielesammlung_projekt.out

542
build/test/preprocess/files/test_duellist_spielesammlung_projekt.c

@ -14,8 +14,6 @@ void tearDown(void) {}
void test_coinflip_x_starts(void) {
@ -36,9 +34,9 @@ void test_coinflip_x_starts(void) {
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(18), UNITY_DISPLAY_STYLE_INT);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(20)));}} while(0);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(19)));}} while(0);
}
@ -64,9 +62,9 @@ void test_coinflip_o_starts(void) {
((void *)0)
), (UNITY_UINT)(31), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(30), UNITY_DISPLAY_STYLE_INT);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(32)));}} while(0);
do {if ((game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(31)));}} while(0);
}
@ -98,7 +96,7 @@ void test_vertical_win(void) {
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(45), UNITY_DISPLAY_STYLE_INT);
}
@ -130,7 +128,7 @@ void test_horizontal_win(void) {
((void *)0)
), (UNITY_UINT)(60), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(59), UNITY_DISPLAY_STYLE_INT);
}
@ -160,7 +158,7 @@ void test_diagonal_win(void) {
((void *)0)
), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(72), UNITY_DISPLAY_STYLE_INT);
}
@ -192,13 +190,13 @@ void test_valid_move_and_switch(void) {
((void *)0)
), (UNITY_UINT)(87), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(86), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((PLAYER_O)), (UNITY_INT)((game.currentPlayer)), (
((void *)0)
), (UNITY_UINT)(88), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(87), UNITY_DISPLAY_STYLE_INT);
}
@ -232,7 +230,7 @@ void test_invalid_input(void) {
((void *)0)
), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(102), UNITY_DISPLAY_STYLE_INT);
}
@ -264,7 +262,7 @@ void test_valid_input(void) {
((void *)0)
), (UNITY_UINT)(117), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(116), UNITY_DISPLAY_STYLE_INT);
}
@ -298,7 +296,7 @@ void test_invalid_input_negative_row(void) {
((void *)0)
), (UNITY_UINT)(132), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(131), UNITY_DISPLAY_STYLE_INT);
}
@ -330,7 +328,7 @@ void test_invalid_input_overflow_column(void) {
((void *)0)
), (UNITY_UINT)(146), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(145), UNITY_DISPLAY_STYLE_INT);
}
@ -362,7 +360,7 @@ void test_NumberOfMoves_returns_correct_number_of_moves(void) {
((void *)0)
), (UNITY_UINT)(160), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(159), UNITY_DISPLAY_STYLE_INT);
}
@ -390,7 +388,7 @@ void test_BoardFull_returns_false_when_board_is_not_full(void) {
do {if (!(boardFull)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(174)));}} while(0);
do {if (!(boardFull)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(173)));}} while(0);
}
@ -416,7 +414,7 @@ void test_BoardFull_returns_true_when_board_is_full(void) {
do {if ((boardFull)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(187)));}} while(0);
do {if ((boardFull)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(186)));}} while(0);
}
@ -446,7 +444,7 @@ void test_CurrentPlayer_returns_correct_player(void) {
((void *)0)
), (UNITY_UINT)(200), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(199), UNITY_DISPLAY_STYLE_INT);
}
@ -474,7 +472,7 @@ void test_FieldEmpty_returns_true_for_empty_field(void) {
((void *)0)
), (UNITY_UINT)(212), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(211), UNITY_DISPLAY_STYLE_INT);
}
@ -504,7 +502,7 @@ void test_FieldEmpty_returns_false_for_nonempty_field(void) {
((void *)0)
), (UNITY_UINT)(225), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(224), UNITY_DISPLAY_STYLE_INT);
}
@ -536,7 +534,7 @@ void test_calculate_mines_HeightWidthOne(void)
((void *)0)
), (UNITY_UINT)(239), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(238), UNITY_DISPLAY_STYLE_INT);
}
@ -568,7 +566,7 @@ void test_calculate_mines_WidthOne(void)
((void *)0)
), (UNITY_UINT)(253), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(252), UNITY_DISPLAY_STYLE_INT);
}
@ -600,7 +598,7 @@ void test_calculate_mines_NormalCase(void)
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(266), UNITY_DISPLAY_STYLE_INT);
}
@ -642,7 +640,7 @@ void test_end_check_AllUncovered_NoMines(void)
((void *)0)
), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(285), UNITY_DISPLAY_STYLE_INT);
}
@ -674,7 +672,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(300))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(299))));}} while(0);
for (int i = 0; i < height; i++) {
@ -682,7 +680,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(302))));}} while(0);
)) {} else {UnityFail( (((" Expected Non-NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(301))));}} while(0);
for (int j = 0; j < width; j++) {
@ -690,7 +688,7 @@ void test_create_minefield_ValidDimensions(void)
((void *)0)
), (UNITY_UINT)(304), UNITY_DISPLAY_STYLE_CHAR);
), (UNITY_UINT)(303), UNITY_DISPLAY_STYLE_CHAR);
}
@ -736,7 +734,7 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(325), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(324), UNITY_DISPLAY_STYLE_INT);
}
@ -768,7 +766,7 @@ void test_create_minefield_NegativeDimensions(void)
((void *)0)
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(339))));}} while(0);
)) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(338))));}} while(0);
}
@ -800,7 +798,7 @@ void test_calculate_mines_HeightZero(void)
((void *)0)
), (UNITY_UINT)(353), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(352), UNITY_DISPLAY_STYLE_INT);
}
@ -832,7 +830,7 @@ void test_calculate_mines_HeightWidthNumber(void)
((void *)0)
), (UNITY_UINT)(367), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(366), UNITY_DISPLAY_STYLE_INT);
}
@ -864,7 +862,7 @@ void test_calculate_mines_HeightWidthAgan(void)
((void *)0)
), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(380), UNITY_DISPLAY_STYLE_INT);
}
@ -896,7 +894,7 @@ void test_calculate_mines_HeightWidthRoundUp(void)
((void *)0)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(394), UNITY_DISPLAY_STYLE_INT);
}
@ -928,7 +926,7 @@ void test_calculate_mines_HeightWidthNoRound(void)
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(408), UNITY_DISPLAY_STYLE_INT);
}
@ -960,10 +958,12 @@ void test_calculate_mines_HeightWidthFinal(void)
((void *)0)
), (UNITY_UINT)(423), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(422), UNITY_DISPLAY_STYLE_INT);
}
void test_generateRandomNumber_withinValidRange(void)
{
@ -980,7 +980,7 @@ void test_generateRandomNumber_withinValidRange(void)
do {if ((result >= 1 && result <= 100)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(459)));}} while(0);
do {if ((result >= 1 && result <= 100)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(433)));}} while(0);
}
@ -1010,7 +1010,7 @@ void test_addition(void)
((void *)0)
), (UNITY_UINT)(472), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(446), UNITY_DISPLAY_STYLE_INT);
}
@ -1040,7 +1040,7 @@ void test_subtraction(void)
((void *)0)
), (UNITY_UINT)(485), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(459), UNITY_DISPLAY_STYLE_INT);
}
@ -1072,7 +1072,7 @@ void test_multiplication(void)
((void *)0)
), (UNITY_UINT)(499), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(473), UNITY_DISPLAY_STYLE_INT);
}
@ -1102,7 +1102,7 @@ void test_division(void)
((void *)0)
), (UNITY_UINT)(512), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(486), UNITY_DISPLAY_STYLE_INT);
}
@ -1132,7 +1132,7 @@ void test_division_byZero_returnsZero(void)
((void *)0)
), (UNITY_UINT)(525), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(499), UNITY_DISPLAY_STYLE_INT);
}
@ -1162,7 +1162,7 @@ void test_modulo(void)
((void *)0)
), (UNITY_UINT)(538), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(512), UNITY_DISPLAY_STYLE_INT);
}
@ -1192,7 +1192,7 @@ void test_compare_equalNumbers(void)
((void *)0)
), (UNITY_UINT)(551), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(525), UNITY_DISPLAY_STYLE_INT);
}
@ -1222,7 +1222,7 @@ void test_compare_aLessThanB(void)
((void *)0)
), (UNITY_UINT)(564), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(538), UNITY_DISPLAY_STYLE_INT);
}
@ -1252,7 +1252,7 @@ void test_compare_aGreaterThanB(void)
((void *)0)
), (UNITY_UINT)(577), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(551), UNITY_DISPLAY_STYLE_INT);
}
@ -1282,7 +1282,7 @@ void test_exponentiation(void)
((void *)0)
), (UNITY_UINT)(590), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(564), UNITY_DISPLAY_STYLE_INT);
}
@ -1312,7 +1312,7 @@ void test_exponentiation_negativeExponent(void)
((void *)0)
), (UNITY_UINT)(603), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(577), UNITY_DISPLAY_STYLE_INT);
}
@ -1340,7 +1340,7 @@ void test_squareRoot_validNumber(void)
((void *)0)
), (UNITY_UINT)(615), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(589), UNITY_DISPLAY_STYLE_INT);
}
@ -1368,7 +1368,7 @@ void test_squareRoot_negativeNumber(void)
((void *)0)
), (UNITY_UINT)(627), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(601), UNITY_DISPLAY_STYLE_INT);
}
@ -1488,4 +1488,446 @@ void test_getUserAnswer_invalidInput(void)
}
void test_bereichauswahl_gueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichauswahl(1);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(668), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichauswahl_ungueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichauswahl(7);
UnityAssertEqualNumber((UNITY_INT)((7)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(680), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichfalsch_gueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichfalsch(3);
UnityAssertEqualNumber((UNITY_INT)((3)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(692), UNITY_DISPLAY_STYLE_INT);
}
void test_bereichfalsch_ungueltige_eingabe(void)
{
int gewaehlterbereich;
gewaehlterbereich = bereichfalsch(9);
UnityAssertEqualNumber((UNITY_INT)((9)), (UNITY_INT)((gewaehlterbereich)), (
((void *)0)
), (UNITY_UINT)(704), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich1_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(717), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich1_falsche_antwort(void)
{
int falsche_antwort1 = 4;
int antwort1 = 0;
antwort1 = 4;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(730), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(743), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_falsche_antwort(void)
{
int falsche_antwort1 = 1;
int antwort1 = 0;
antwort1 = 1;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(756), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_gewinner_spieler1(void)
{
int ergebnis_spieler1_gewinnt = 4;
int ergebnis_spieler1 = 0;
ergebnis_spieler1 = 4;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler1_gewinnt)), (UNITY_INT)((ergebnis_spieler1)), (
((void *)0)
), (UNITY_UINT)(769), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich3_gewinner_spieler2(void)
{
int ergebnis_spieler2_gewinnt = 2;
int ergebnis_spieler2 = 0;
ergebnis_spieler2 = 2;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler2_gewinnt)), (UNITY_INT)((ergebnis_spieler2)), (
((void *)0)
), (UNITY_UINT)(782), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_richtige_antwort(void)
{
int richtige_antwort1 = 3;
int antwort1 = 0;
antwort1 = 3;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(795), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_falsche_antwort(void)
{
int falsche_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((falsche_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(808), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_gewinner_spieler1(void)
{
int ergebnis_spieler1_gewinnt = 1;
int ergebnis_spieler1 = 0;
ergebnis_spieler1 = 1;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler1_gewinnt)), (UNITY_INT)((ergebnis_spieler1)), (
((void *)0)
), (UNITY_UINT)(821), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich4_gewinner_spieler2(void)
{
int ergebnis_spieler2_gewinnt = 5;
int ergebnis_spieler2 = 0;
ergebnis_spieler2 = 5;
UnityAssertEqualNumber((UNITY_INT)((ergebnis_spieler2_gewinnt)), (UNITY_INT)((ergebnis_spieler2)), (
((void *)0)
), (UNITY_UINT)(834), UNITY_DISPLAY_STYLE_INT);
}
void test_bereich5_richtige_antwort(void)
{
int richtige_antwort1 = 2;
int antwort1 = 0;
antwort1 = 2;
UnityAssertEqualNumber((UNITY_INT)((richtige_antwort1)), (UNITY_INT)((antwort1)), (
((void *)0)
), (UNITY_UINT)(847), UNITY_DISPLAY_STYLE_INT);
}

204
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -4,202 +4,262 @@
:file: test_duellist_spielesammlung_projekt.c
:successes:
- :test: test_coinflip_x_starts
:line: 11
:line: 10
:message: ''
:unity_test_time: 0
- :test: test_coinflip_o_starts
:line: 23
:line: 22
:message: ''
:unity_test_time: 0
- :test: test_vertical_win
:line: 35
:line: 34
:message: ''
:unity_test_time: 0
- :test: test_horizontal_win
:line: 49
:line: 48
:message: ''
:unity_test_time: 0
- :test: test_diagonal_win
:line: 62
:line: 61
:message: ''
:unity_test_time: 0
- :test: test_valid_move_and_switch
:line: 76
:line: 75
:message: ''
:unity_test_time: 0
- :test: test_invalid_input
:line: 92
:line: 91
:message: ''
:unity_test_time: 0
- :test: test_valid_input
:line: 106
:line: 105
:message: ''
:unity_test_time: 0
- :test: test_invalid_input_negative_row
:line: 121
:line: 120
:message: ''
:unity_test_time: 0
- :test: test_invalid_input_overflow_column
:line: 135
:line: 134
:message: ''
:unity_test_time: 0
- :test: test_NumberOfMoves_returns_correct_number_of_moves
:line: 149
:line: 148
:message: ''
:unity_test_time: 0
- :test: test_BoardFull_returns_false_when_board_is_not_full
:line: 163
:line: 162
:message: ''
:unity_test_time: 0
- :test: test_BoardFull_returns_true_when_board_is_full
:line: 176
:line: 175
:message: ''
:unity_test_time: 0
- :test: test_CurrentPlayer_returns_correct_player
:line: 189
:line: 188
:message: ''
:unity_test_time: 0
- :test: test_FieldEmpty_returns_true_for_empty_field
:line: 202
:line: 201
:message: ''
:unity_test_time: 0
- :test: test_FieldEmpty_returns_false_for_nonempty_field
:line: 215
:line: 214
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthOne
:line: 228
:line: 227
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_WidthOne
:line: 242
:line: 241
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_NormalCase
:line: 256
:line: 255
:message: ''
:unity_test_time: 0
- :test: test_end_check_AllUncovered_NoMines
:line: 270
:line: 269
:message: ''
:unity_test_time: 0
- :test: test_create_minefield_ValidDimensions
:line: 289
:line: 288
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
:line: 314
:line: 313
:message: ''
:unity_test_time: 0
- :test: test_create_minefield_NegativeDimensions
:line: 328
:line: 327
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightZero
:line: 342
:line: 341
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthNumber
:line: 356
:line: 355
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthAgan
:line: 370
:line: 369
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthRoundUp
:line: 384
:line: 383
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthNoRound
:line: 398
:line: 397
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthFinal
:line: 412
:line: 411
:message: ''
:unity_test_time: 0
- :test: test_generateRandomNumber_withinValidRange
:line: 451
:line: 425
:message: ''
:unity_test_time: 0
- :test: test_addition
:line: 462
:line: 436
:message: ''
:unity_test_time: 0
- :test: test_subtraction
:line: 475
:line: 449
:message: ''
:unity_test_time: 0
- :test: test_multiplication
:line: 489
:line: 463
:message: ''
:unity_test_time: 0
- :test: test_division
:line: 502
:line: 476
:message: ''
:unity_test_time: 0
- :test: test_division_byZero_returnsZero
:line: 515
:line: 489
:message: ''
:unity_test_time: 0
- :test: test_modulo
:line: 528
:line: 502
:message: ''
:unity_test_time: 0
- :test: test_compare_equalNumbers
:line: 541
:line: 515
:message: ''
:unity_test_time: 0
- :test: test_compare_aLessThanB
:line: 554
:line: 528
:message: ''
:unity_test_time: 0
- :test: test_compare_aGreaterThanB
:line: 567
:line: 541
:message: ''
:unity_test_time: 0
- :test: test_exponentiation
:line: 580
:line: 554
:message: ''
:unity_test_time: 0
- :test: test_exponentiation_negativeExponent
:line: 593
:line: 567
:message: ''
:unity_test_time: 0
- :test: test_squareRoot_validNumber
:line: 606
:line: 580
:message: ''
:unity_test_time: 0
- :test: test_squareRoot_negativeNumber
:line: 618
:line: 592
:message: ''
:unity_test_time: 0
- :test: test_displayResult_correctResult
:line: 630
:line: 604
:message: ''
:unity_test_time: 0
- :test: test_displayMenu_validMenu
:line: 643
:line: 617
:message: ''
:unity_test_time: 0
- :test: test_getUserChoice_invalidInput
:line: 653
:line: 627
:message: ''
:unity_test_time: 0
- :test: test_playGame_correctResult
:line: 665
:line: 639
:message: ''
:unity_test_time: 0
- :test: test_getUserAnswer_invalidInput
:line: 673
:line: 647
:message: ''
:unity_test_time: 0
- :test: test_bereichauswahl_gueltige_eingabe
:line: 659
:message: ''
:unity_test_time: 0
- :test: test_bereichauswahl_ungueltige_eingabe
:line: 671
:message: ''
:unity_test_time: 0
- :test: test_bereichfalsch_gueltige_eingabe
:line: 683
:message: ''
:unity_test_time: 0
- :test: test_bereichfalsch_ungueltige_eingabe
:line: 695
:message: ''
:unity_test_time: 0
- :test: test_bereich1_richtige_antwort
:line: 707
:message: ''
:unity_test_time: 0
- :test: test_bereich1_falsche_antwort
:line: 720
:message: ''
:unity_test_time: 0
- :test: test_bereich3_richtige_antwort
:line: 733
:message: ''
:unity_test_time: 0
- :test: test_bereich3_falsche_antwort
:line: 746
:message: ''
:unity_test_time: 0
- :test: test_bereich3_gewinner_spieler1
:line: 759
:message: ''
:unity_test_time: 0
- :test: test_bereich3_gewinner_spieler2
:line: 772
:message: ''
:unity_test_time: 0
- :test: test_bereich4_richtige_antwort
:line: 785
:message: ''
:unity_test_time: 0
- :test: test_bereich4_falsche_antwort
:line: 798
:message: ''
:unity_test_time: 0
- :test: test_bereich4_gewinner_spieler1
:line: 811
:message: ''
:unity_test_time: 0
- :test: test_bereich4_gewinner_spieler2
:line: 824
:message: ''
:unity_test_time: 0
- :test: test_bereich5_richtige_antwort
:line: 837
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 48
:passed: 48
:total: 63
:passed: 63
:failed: 0
:ignored: 0
:stdout:
@ -215,26 +275,52 @@
- 'Auswahl treffen: '
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- ''
- 'Frage 1: Was ist 3 * 2?'
- 'Frage 1: Was ist 10 * 10?'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- 'Falsch. Die richtige Antwort ist: 6'
- 'Falsch. Die richtige Antwort ist: 100'
- ''
- 'Frage 2: Was ist 6 % 4?'
- 'Frage 2: Was ist 2 / 1?'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- 'Falsch. Die richtige Antwort ist: 2'
- ''
- 'Frage 3: Was ist 7 / 7?'
- 'Frage 3: Was ist 8 - 8?'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- 'Falsch. Die richtige Antwort ist: 1'
- 'Falsch. Die richtige Antwort ist: 0'
- ''
- 'Frage 4: Was ist 9 / 5?'
- 'Frage 4: Was ist 4 % 5?'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- 'Falsch. Die richtige Antwort ist: 1'
- 'Falsch. Die richtige Antwort ist: 4'
- ''
- 'Frage 5: Was ist 1 % 7?'
- 'Frage 5: Was ist 1 ^ 5?'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
- 'Falsch. Die richtige Antwort ist: 1'
- ''
- 'Spiel beendet. Ergebnis: 0 von 5 Fragen richtig beantwortet.'
- Ungültige Eingabe. Bitte eine Zahl eingeben.
:time: 0.12797450000653043
- Der 1. Bereich handelt von Allgemein Wissen, zum Auswaehlen bitte die 1 eingeben!
- Der 2. Bereich handelt von Computern, zum Auswaehlen bitte die 2 eingeben!
- Der 3. Bereich handelt von Sport, zum Auswaehlen bitte die 3 eingeben!
- Der 4. Bereich handelt von Hauptstaedten, zum Auswaehlen bitte die 4 eingeben!
- Der 5. Bereich handelt von Geschichte, zum Auswaehlen bitte die 5 eingeben!
- Der 6. Bereich handelt von Tieren, zum Auswaehlen bitte die 6 eingeben!
- Der 1. Bereich handelt von Allgemein Wissen, zum Auswaehlen bitte die 1 eingeben!
- Der 2. Bereich handelt von Computern, zum Auswaehlen bitte die 2 eingeben!
- Der 3. Bereich handelt von Sport, zum Auswaehlen bitte die 3 eingeben!
- Der 4. Bereich handelt von Hauptstaedten, zum Auswaehlen bitte die 4 eingeben!
- Der 5. Bereich handelt von Geschichte, zum Auswaehlen bitte die 5 eingeben!
- Der 6. Bereich handelt von Tieren, zum Auswaehlen bitte die 6 eingeben!
- Sie haben eine Zahl ausserhalb der 1-5 eingegeben, bitte richtige Zahl eingeben!
- Der 1. Bereich handelt von Allgemein Wissen, zum Auswaehlen bitte die 1 eingeben!
- Der 2. Bereich handelt von Computern, zum Auswaehlen bitte die 2 eingeben!
- Der 3. Bereich handelt von Sport, zum Auswaehlen bitte die 3 eingeben!
- Der 4. Bereich handelt von Hauptstaedten, zum Auswaehlen bitte die 4 eingeben!
- Der 5. Bereich handelt von Geschichte, zum Auswaehlen bitte die 5 eingeben!
- Der 6. Bereich handelt von Tieren, zum Auswaehlen bitte die 6 eingeben!
- Sie haben eine Zahl ausserhalb der 1-5 eingegeben, bitte richtige Zahl eingeben!
- Der 1. Bereich handelt von Allgemein Wissen, zum Auswaehlen bitte die 1 eingeben!
- Der 2. Bereich handelt von Computern, zum Auswaehlen bitte die 2 eingeben!
- Der 3. Bereich handelt von Sport, zum Auswaehlen bitte die 3 eingeben!
- Der 4. Bereich handelt von Hauptstaedten, zum Auswaehlen bitte die 4 eingeben!
- Der 5. Bereich handelt von Geschichte, zum Auswaehlen bitte die 5 eingeben!
- Der 6. Bereich handelt von Tieren, zum Auswaehlen bitte die 6 eingeben!
:time: 0.02347590000135824

126
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -58,6 +58,21 @@ extern void test_displayMenu_validMenu(void);
extern void test_getUserChoice_invalidInput(void);
extern void test_playGame_correctResult(void);
extern void test_getUserAnswer_invalidInput(void);
extern void test_bereichauswahl_gueltige_eingabe(void);
extern void test_bereichauswahl_ungueltige_eingabe(void);
extern void test_bereichfalsch_gueltige_eingabe(void);
extern void test_bereichfalsch_ungueltige_eingabe(void);
extern void test_bereich1_richtige_antwort(void);
extern void test_bereich1_falsche_antwort(void);
extern void test_bereich3_richtige_antwort(void);
extern void test_bereich3_falsche_antwort(void);
extern void test_bereich3_gewinner_spieler1(void);
extern void test_bereich3_gewinner_spieler2(void);
extern void test_bereich4_richtige_antwort(void);
extern void test_bereich4_falsche_antwort(void);
extern void test_bereich4_gewinner_spieler1(void);
extern void test_bereich4_gewinner_spieler2(void);
extern void test_bereich5_richtige_antwort(void);
/*=======Mock Management=====*/
@ -122,54 +137,69 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE l
int main(void)
{
UnityBegin("test_duellist_spielesammlung_projekt.c");
run_test(test_coinflip_x_starts, "test_coinflip_x_starts", 11);
run_test(test_coinflip_o_starts, "test_coinflip_o_starts", 23);
run_test(test_vertical_win, "test_vertical_win", 35);
run_test(test_horizontal_win, "test_horizontal_win", 49);
run_test(test_diagonal_win, "test_diagonal_win", 62);
run_test(test_valid_move_and_switch, "test_valid_move_and_switch", 76);
run_test(test_invalid_input, "test_invalid_input", 92);
run_test(test_valid_input, "test_valid_input", 106);
run_test(test_invalid_input_negative_row, "test_invalid_input_negative_row", 121);
run_test(test_invalid_input_overflow_column, "test_invalid_input_overflow_column", 135);
run_test(test_NumberOfMoves_returns_correct_number_of_moves, "test_NumberOfMoves_returns_correct_number_of_moves", 149);
run_test(test_BoardFull_returns_false_when_board_is_not_full, "test_BoardFull_returns_false_when_board_is_not_full", 163);
run_test(test_BoardFull_returns_true_when_board_is_full, "test_BoardFull_returns_true_when_board_is_full", 176);
run_test(test_CurrentPlayer_returns_correct_player, "test_CurrentPlayer_returns_correct_player", 189);
run_test(test_FieldEmpty_returns_true_for_empty_field, "test_FieldEmpty_returns_true_for_empty_field", 202);
run_test(test_FieldEmpty_returns_false_for_nonempty_field, "test_FieldEmpty_returns_false_for_nonempty_field", 215);
run_test(test_calculate_mines_HeightWidthOne, "test_calculate_mines_HeightWidthOne", 228);
run_test(test_calculate_mines_WidthOne, "test_calculate_mines_WidthOne", 242);
run_test(test_calculate_mines_NormalCase, "test_calculate_mines_NormalCase", 256);
run_test(test_end_check_AllUncovered_NoMines, "test_end_check_AllUncovered_NoMines", 270);
run_test(test_create_minefield_ValidDimensions, "test_create_minefield_ValidDimensions", 289);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 314);
run_test(test_create_minefield_NegativeDimensions, "test_create_minefield_NegativeDimensions", 328);
run_test(test_calculate_mines_HeightZero, "test_calculate_mines_HeightZero", 342);
run_test(test_calculate_mines_HeightWidthNumber, "test_calculate_mines_HeightWidthNumber", 356);
run_test(test_calculate_mines_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 370);
run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 384);
run_test(test_calculate_mines_HeightWidthNoRound, "test_calculate_mines_HeightWidthNoRound", 398);
run_test(test_calculate_mines_HeightWidthFinal, "test_calculate_mines_HeightWidthFinal", 412);
run_test(test_generateRandomNumber_withinValidRange, "test_generateRandomNumber_withinValidRange", 451);
run_test(test_addition, "test_addition", 462);
run_test(test_subtraction, "test_subtraction", 475);
run_test(test_multiplication, "test_multiplication", 489);
run_test(test_division, "test_division", 502);
run_test(test_division_byZero_returnsZero, "test_division_byZero_returnsZero", 515);
run_test(test_modulo, "test_modulo", 528);
run_test(test_compare_equalNumbers, "test_compare_equalNumbers", 541);
run_test(test_compare_aLessThanB, "test_compare_aLessThanB", 554);
run_test(test_compare_aGreaterThanB, "test_compare_aGreaterThanB", 567);
run_test(test_exponentiation, "test_exponentiation", 580);
run_test(test_exponentiation_negativeExponent, "test_exponentiation_negativeExponent", 593);
run_test(test_squareRoot_validNumber, "test_squareRoot_validNumber", 606);
run_test(test_squareRoot_negativeNumber, "test_squareRoot_negativeNumber", 618);
run_test(test_displayResult_correctResult, "test_displayResult_correctResult", 630);
run_test(test_displayMenu_validMenu, "test_displayMenu_validMenu", 643);
run_test(test_getUserChoice_invalidInput, "test_getUserChoice_invalidInput", 653);
run_test(test_playGame_correctResult, "test_playGame_correctResult", 665);
run_test(test_getUserAnswer_invalidInput, "test_getUserAnswer_invalidInput", 673);
run_test(test_coinflip_x_starts, "test_coinflip_x_starts", 10);
run_test(test_coinflip_o_starts, "test_coinflip_o_starts", 22);
run_test(test_vertical_win, "test_vertical_win", 34);
run_test(test_horizontal_win, "test_horizontal_win", 48);
run_test(test_diagonal_win, "test_diagonal_win", 61);
run_test(test_valid_move_and_switch, "test_valid_move_and_switch", 75);
run_test(test_invalid_input, "test_invalid_input", 91);
run_test(test_valid_input, "test_valid_input", 105);
run_test(test_invalid_input_negative_row, "test_invalid_input_negative_row", 120);
run_test(test_invalid_input_overflow_column, "test_invalid_input_overflow_column", 134);
run_test(test_NumberOfMoves_returns_correct_number_of_moves, "test_NumberOfMoves_returns_correct_number_of_moves", 148);
run_test(test_BoardFull_returns_false_when_board_is_not_full, "test_BoardFull_returns_false_when_board_is_not_full", 162);
run_test(test_BoardFull_returns_true_when_board_is_full, "test_BoardFull_returns_true_when_board_is_full", 175);
run_test(test_CurrentPlayer_returns_correct_player, "test_CurrentPlayer_returns_correct_player", 188);
run_test(test_FieldEmpty_returns_true_for_empty_field, "test_FieldEmpty_returns_true_for_empty_field", 201);
run_test(test_FieldEmpty_returns_false_for_nonempty_field, "test_FieldEmpty_returns_false_for_nonempty_field", 214);
run_test(test_calculate_mines_HeightWidthOne, "test_calculate_mines_HeightWidthOne", 227);
run_test(test_calculate_mines_WidthOne, "test_calculate_mines_WidthOne", 241);
run_test(test_calculate_mines_NormalCase, "test_calculate_mines_NormalCase", 255);
run_test(test_end_check_AllUncovered_NoMines, "test_end_check_AllUncovered_NoMines", 269);
run_test(test_create_minefield_ValidDimensions, "test_create_minefield_ValidDimensions", 288);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 313);
run_test(test_create_minefield_NegativeDimensions, "test_create_minefield_NegativeDimensions", 327);
run_test(test_calculate_mines_HeightZero, "test_calculate_mines_HeightZero", 341);
run_test(test_calculate_mines_HeightWidthNumber, "test_calculate_mines_HeightWidthNumber", 355);
run_test(test_calculate_mines_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 369);
run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 383);
run_test(test_calculate_mines_HeightWidthNoRound, "test_calculate_mines_HeightWidthNoRound", 397);
run_test(test_calculate_mines_HeightWidthFinal, "test_calculate_mines_HeightWidthFinal", 411);
run_test(test_generateRandomNumber_withinValidRange, "test_generateRandomNumber_withinValidRange", 425);
run_test(test_addition, "test_addition", 436);
run_test(test_subtraction, "test_subtraction", 449);
run_test(test_multiplication, "test_multiplication", 463);
run_test(test_division, "test_division", 476);
run_test(test_division_byZero_returnsZero, "test_division_byZero_returnsZero", 489);
run_test(test_modulo, "test_modulo", 502);
run_test(test_compare_equalNumbers, "test_compare_equalNumbers", 515);
run_test(test_compare_aLessThanB, "test_compare_aLessThanB", 528);
run_test(test_compare_aGreaterThanB, "test_compare_aGreaterThanB", 541);
run_test(test_exponentiation, "test_exponentiation", 554);
run_test(test_exponentiation_negativeExponent, "test_exponentiation_negativeExponent", 567);
run_test(test_squareRoot_validNumber, "test_squareRoot_validNumber", 580);
run_test(test_squareRoot_negativeNumber, "test_squareRoot_negativeNumber", 592);
run_test(test_displayResult_correctResult, "test_displayResult_correctResult", 604);
run_test(test_displayMenu_validMenu, "test_displayMenu_validMenu", 617);
run_test(test_getUserChoice_invalidInput, "test_getUserChoice_invalidInput", 627);
run_test(test_playGame_correctResult, "test_playGame_correctResult", 639);
run_test(test_getUserAnswer_invalidInput, "test_getUserAnswer_invalidInput", 647);
run_test(test_bereichauswahl_gueltige_eingabe, "test_bereichauswahl_gueltige_eingabe", 659);
run_test(test_bereichauswahl_ungueltige_eingabe, "test_bereichauswahl_ungueltige_eingabe", 671);
run_test(test_bereichfalsch_gueltige_eingabe, "test_bereichfalsch_gueltige_eingabe", 683);
run_test(test_bereichfalsch_ungueltige_eingabe, "test_bereichfalsch_ungueltige_eingabe", 695);
run_test(test_bereich1_richtige_antwort, "test_bereich1_richtige_antwort", 707);
run_test(test_bereich1_falsche_antwort, "test_bereich1_falsche_antwort", 720);
run_test(test_bereich3_richtige_antwort, "test_bereich3_richtige_antwort", 733);
run_test(test_bereich3_falsche_antwort, "test_bereich3_falsche_antwort", 746);
run_test(test_bereich3_gewinner_spieler1, "test_bereich3_gewinner_spieler1", 759);
run_test(test_bereich3_gewinner_spieler2, "test_bereich3_gewinner_spieler2", 772);
run_test(test_bereich4_richtige_antwort, "test_bereich4_richtige_antwort", 785);
run_test(test_bereich4_falsche_antwort, "test_bereich4_falsche_antwort", 798);
run_test(test_bereich4_gewinner_spieler1, "test_bereich4_gewinner_spieler1", 811);
run_test(test_bereich4_gewinner_spieler2, "test_bereich4_gewinner_spieler2", 824);
run_test(test_bereich5_richtige_antwort, "test_bereich5_richtige_antwort", 837);
return UnityEnd();
}

973
src/main/duellist-spielesammlung-projekt.c
File diff suppressed because it is too large
View File

58
src/main/duellist-spielesammlung-projekt.h

@ -3,7 +3,10 @@
#define MIN_AGE 12
#define max_height 10
#define max_width 10
#define unknown_character 'x'
#define mine_character '@'
typedef enum {
SUCCESS,
@ -19,13 +22,11 @@ typedef enum {
PLAYER_O
} Player;
typedef struct {
Player board[3][3]; // Spielfeld
Player currentPlayer; // Aktueller Spieler
} TicTacToeGame;
GameResult makeMove(TicTacToeGame* game, int row, int col);
GameResult checkGameResult(const TicTacToeGame* game);
GameResult initializeGame(TicTacToeGame* game);
@ -38,18 +39,6 @@ int FieldEmpty(const TicTacToeGame* game, int row, int col);
int decideGameType();
Player playRockPaperScissors();
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define max_height 10
#define max_width 10
#define unknown_character 'x'
#define mine_character '@'
int end_check(char** minefield, char** mines, int height, int width);
int field_check(char** minefield, char** mines, int height, int width, int row, int column);
void show_minefield(char** minefield, int height, int width);
@ -59,14 +48,6 @@ char** create_minefield(int height, int width, char within);
void distribute_mines(char** mines, int height, int width, int num_mines);
int minesweeper();
int zufallszahl(int min, int max);
int add(int a, int b);
int minus(int a, int b);
@ -81,28 +62,13 @@ int getUserChoice();
int getUserAnswer();
void displayResult(int correctAnswers, int totalQuestions);
char namenseingabe(char name1[100], char name2[100]);
int bereichauswahl(int zahl);
int bereichfalsch(int zahl);
int bereich1(char name1[100], char name2[100]);
int bereich2(char name1[100], char name2[100]);
int bereich3(char name1[100], char name2[100]);
int bereich4(char name1[100], char name2[100]);
int bereich5(char name1[100], char name2[100]);
#endif // DUEELIST_SPIELESAMMLUNG_PROJEKT_H

207
src/test/test_duellist_spielesammlung_projekt.c

@ -7,7 +7,6 @@ void setUp(void) {}
void tearDown(void) {}
void test_coinflip_x_starts(void) {
// Arrange
TicTacToeGame game;
@ -423,31 +422,6 @@ void test_calculate_mines_HeightWidthFinal(void)
TEST_ASSERT_EQUAL_INT(expected, result);
}
void test_generateRandomNumber_withinValidRange(void)
{
/* arrange */
@ -682,68 +656,195 @@ void test_getUserAnswer_invalidInput(void)
}
void test_bereichauswahl_gueltige_eingabe(void)
{
/*arrange*/
int gewaehlterbereich;
/*act*/
gewaehlterbereich = bereichauswahl(1);
/*assert*/
TEST_ASSERT_EQUAL_INT(1, gewaehlterbereich);
}
void test_bereichauswahl_ungueltige_eingabe(void)
{
/*arrange*/
int gewaehlterbereich;
/*act*/
gewaehlterbereich = bereichauswahl(7);
/*assert*/
TEST_ASSERT_EQUAL_INT(7, gewaehlterbereich);
}
void test_bereichfalsch_gueltige_eingabe(void)
{
/*arrange*/
int gewaehlterbereich;
/*act*/
gewaehlterbereich = bereichfalsch(3);
/*assert*/
TEST_ASSERT_EQUAL_INT(3, gewaehlterbereich);
}
void test_bereichfalsch_ungueltige_eingabe(void)
{
/*arrange*/
int gewaehlterbereich;
/*act*/
gewaehlterbereich = bereichfalsch(9);
/*assert*/
TEST_ASSERT_EQUAL_INT(9, gewaehlterbereich);
}
void test_bereich1_richtige_antwort(void)
{
/*arrange*/
int richtige_antwort1 = 2;
int antwort1 = 0;
/*act*/
antwort1 = 2;
/*assert*/
TEST_ASSERT_EQUAL_INT(richtige_antwort1, antwort1);
}
void test_bereich1_falsche_antwort(void)
{
/*arrange*/
int falsche_antwort1 = 4;
int antwort1 = 0;
/*act*/
antwort1 = 4;
/*assert*/
TEST_ASSERT_EQUAL_INT(falsche_antwort1, antwort1);
}
void test_bereich3_richtige_antwort(void)
{
/*arrange*/
int richtige_antwort1 = 2;
int antwort1 = 0;
/*act*/
antwort1 = 2;
/*assert*/
TEST_ASSERT_EQUAL_INT(richtige_antwort1, antwort1);
}
void test_bereich3_falsche_antwort(void)
{
/*arrange*/
int falsche_antwort1 = 1;
int antwort1 = 0;
/*act*/
antwort1 = 1;
/*assert*/
TEST_ASSERT_EQUAL_INT(falsche_antwort1, antwort1);
}
void test_bereich3_gewinner_spieler1(void)
{
/*arrange*/
int ergebnis_spieler1_gewinnt = 4;
int ergebnis_spieler1 = 0;
/*act*/
ergebnis_spieler1 = 4;
/*assert*/
TEST_ASSERT_EQUAL_INT(ergebnis_spieler1_gewinnt, ergebnis_spieler1);
}
void test_bereich3_gewinner_spieler2(void)
{
/*arrange*/
int ergebnis_spieler2_gewinnt = 2;
int ergebnis_spieler2 = 0;
/*act*/
ergebnis_spieler2 = 2;
/*assert*/
TEST_ASSERT_EQUAL_INT(ergebnis_spieler2_gewinnt, ergebnis_spieler2);
}
void test_bereich4_richtige_antwort(void)
{
/*arrange*/
int richtige_antwort1 = 3;
int antwort1 = 0;
/*act*/
antwort1 = 3;
/*assert*/
TEST_ASSERT_EQUAL_INT(richtige_antwort1, antwort1);
}
void test_bereich4_falsche_antwort(void)
{
/*arrange*/
int falsche_antwort1 = 2;
int antwort1 = 0;
/*act*/
antwort1 = 2;
/*assert*/
TEST_ASSERT_EQUAL_INT(falsche_antwort1, antwort1);
}
void test_bereich4_gewinner_spieler1(void)
{
/*arrange*/
int ergebnis_spieler1_gewinnt = 1;
int ergebnis_spieler1 = 0;
/*act*/
ergebnis_spieler1 = 1;
/*assert*/
TEST_ASSERT_EQUAL_INT(ergebnis_spieler1_gewinnt, ergebnis_spieler1);
}
void test_bereich4_gewinner_spieler2(void)
{
/*arrange*/
int ergebnis_spieler2_gewinnt = 5;
int ergebnis_spieler2 = 0;
/*act*/
ergebnis_spieler2 = 5;
/*assert*/
TEST_ASSERT_EQUAL_INT(ergebnis_spieler2_gewinnt, ergebnis_spieler2);
}
void test_bereich5_richtige_antwort(void)
{
/*arrange*/
int richtige_antwort1 = 2;
int antwort1 = 0;
/*act*/
antwort1 = 2;
/*assert*/
TEST_ASSERT_EQUAL_INT(richtige_antwort1, antwort1);
}
#endif // TEST
Loading…
Cancel
Save