Browse Source

preperations merge

remotes/origin/David
David Moeller 11 months ago
parent
commit
442cded1c6
  1. 9
      .vscode/settings.json
  2. 2
      build/release/dependencies/main.d
  3. 1
      build/release/dependencies/pong.d
  4. BIN
      build/release/out/c/main.o
  5. BIN
      build/release/out/c/pong.o
  6. BIN
      build/release/out/c/tictactoe.o
  7. BIN
      build/release/project.out
  8. 2
      build/test/cache/defines_dependency.yml
  9. 143
      build/test/cache/test_checkCollision.c
  10. 69
      build/test/cache/test_checkGameEnd.c
  11. 73
      build/test/cache/test_clearScreen.c
  12. 90
      build/test/cache/test_is_Valid_tile.c
  13. 83
      build/test/cache/test_playerInputMovement.c
  14. 51
      build/test/cache/test_pong.c
  15. 105
      build/test/cache/test_tictactoe.c
  16. 1
      build/test/dependencies/pong.d
  17. 4
      build/test/dependencies/test_checkCollision.d
  18. 4
      build/test/dependencies/test_checkCollision_runner.d
  19. 4
      build/test/dependencies/test_checkGameEnd.d
  20. 4
      build/test/dependencies/test_checkGameEnd_runner.d
  21. 4
      build/test/dependencies/test_clearScreen.d
  22. 4
      build/test/dependencies/test_clearScreen_runner.d
  23. 5
      build/test/dependencies/test_playerInputMovement.d
  24. 4
      build/test/dependencies/test_playerInputMovement_runner.d
  25. 4
      build/test/dependencies/test_pong.d
  26. 4
      build/test/dependencies/test_pong_runner.d
  27. 5
      build/test/dependencies/test_tictactoe.d
  28. BIN
      build/test/out/c/pong.o
  29. BIN
      build/test/out/c/test_checkCollision.o
  30. BIN
      build/test/out/c/test_checkCollision_runner.o
  31. BIN
      build/test/out/c/test_checkGameEnd.o
  32. BIN
      build/test/out/c/test_checkGameEnd_runner.o
  33. BIN
      build/test/out/c/test_clearScreen.o
  34. BIN
      build/test/out/c/test_clearScreen_runner.o
  35. BIN
      build/test/out/c/test_is_Valid_tile.o
  36. BIN
      build/test/out/c/test_is_Valid_tile_runner.o
  37. BIN
      build/test/out/c/test_playerInputMovement.o
  38. BIN
      build/test/out/c/test_playerInputMovement_runner.o
  39. BIN
      build/test/out/c/test_pong.o
  40. BIN
      build/test/out/c/test_pong_runner.o
  41. BIN
      build/test/out/c/test_tictactoe.o
  42. BIN
      build/test/out/c/test_tictactoe_runner.o
  43. BIN
      build/test/out/test_checkCollision.out
  44. BIN
      build/test/out/test_checkGameEnd.out
  45. BIN
      build/test/out/test_clearScreen.out
  46. BIN
      build/test/out/test_is_Valid_tile.out
  47. BIN
      build/test/out/test_playerInputMovement.out
  48. BIN
      build/test/out/test_pong.out
  49. BIN
      build/test/out/test_tictactoe.out
  50. 143
      build/test/preprocess/files/test_checkCollision.c
  51. 69
      build/test/preprocess/files/test_checkGameEnd.c
  52. 73
      build/test/preprocess/files/test_clearScreen.c
  53. 90
      build/test/preprocess/files/test_is_Valid_tile.c
  54. 83
      build/test/preprocess/files/test_playerInputMovement.c
  55. 51
      build/test/preprocess/files/test_pong.c
  56. 105
      build/test/preprocess/files/test_tictactoe.c
  57. 3
      build/test/preprocess/includes/test_checkCollision.c
  58. 3
      build/test/preprocess/includes/test_checkGameEnd.c
  59. 3
      build/test/preprocess/includes/test_clearScreen.c
  60. 3
      build/test/preprocess/includes/test_playerInputMovement.c
  61. 3
      build/test/preprocess/includes/test_pong.c
  62. 4
      build/test/preprocess/includes/test_tictactoe.c
  63. 2
      build/test/results/test_bomb_in_array.pass
  64. 18
      build/test/results/test_checkCollision.pass
  65. 18
      build/test/results/test_checkGameEnd.pass
  66. 19
      build/test/results/test_clearScreen.pass
  67. 2
      build/test/results/test_collision.pass
  68. 22
      build/test/results/test_is_Valid_tile.pass
  69. 2
      build/test/results/test_moving_snake.pass
  70. 2
      build/test/results/test_number_of_bombs.pass
  71. 2
      build/test/results/test_part_of_snake.pass
  72. 18
      build/test/results/test_playerInputMovement.pass
  73. 18
      build/test/results/test_pong.pass
  74. 2
      build/test/results/test_template.pass
  75. 14
      build/test/results/test_tictactoe.pass
  76. 81
      build/test/runners/test_checkCollision_runner.c
  77. 81
      build/test/runners/test_checkGameEnd_runner.c
  78. 81
      build/test/runners/test_clearScreen_runner.c
  79. 16
      build/test/runners/test_is_Valid_tile_runner.c
  80. 81
      build/test/runners/test_playerInputMovement_runner.c
  81. 81
      build/test/runners/test_pong_runner.c
  82. 40
      build/test/runners/test_tictactoe_runner.c

9
.vscode/settings.json

@ -0,0 +1,9 @@
{
"files.associations": {
"*.embeddedhtml": "html",
"unistd.h": "c",
"fcntl.h": "c",
"stdio.h": "c",
"types.h": "c"
}
}

2
build/release/dependencies/main.d

@ -1,3 +1,3 @@
build/release/out/c/main.o: src/main/c/main.c \
src/main/c/Snake/snake_start.h \
src/main/c/Minesweeper/minesweeper_start.h
src/main/c/Minesweeper/minesweeper_start.h src/main/c/Pong/pong.h

1
build/release/dependencies/pong.d

@ -0,0 +1 @@
build/release/out/c/pong.o: src/main/c/Pong/pong.c

BIN
build/release/out/c/main.o

BIN
build/release/out/c/pong.o

BIN
build/release/out/c/tictactoe.o

BIN
build/release/project.out

2
build/test/cache/defines_dependency.yml

@ -9,3 +9,5 @@ src/main/c/Minesweeper/minesweeper_start.c:
- TEST
src/main/c/GameTic_Tac_Toe/tictactoe.c:
- TEST
src/main/c/Pong/pong.c:
- TEST

143
build/test/cache/test_checkCollision.c

@ -0,0 +1,143 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Ball;
typedef struct {
int x;
int y;
int width;
int height;
} Paddle;
void setUp(void){
}
void tearDown(void){
}
void test_checkCollision(void){
Ball ball = {10, 10, 1, 1};
Paddle paddle = {50, 10, 5, 10};
ball.x = 0;
int result1 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result1)), (
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
ball.x = 40 - 1;
int result2 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result2)), (
((void *)0)
), (UNITY_UINT)(39), UNITY_DISPLAY_STYLE_INT);
ball.x = 5;
ball.y = 0;
int result3 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result3)), (
((void *)0)
), (UNITY_UINT)(45), UNITY_DISPLAY_STYLE_INT);
ball.y = 20 - 1;
int result4 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result4)), (
((void *)0)
), (UNITY_UINT)(49), UNITY_DISPLAY_STYLE_INT);
ball.x = paddle.x - 1;
ball.y = paddle.y + 1;
int result5 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result5)), (
((void *)0)
), (UNITY_UINT)(55), UNITY_DISPLAY_STYLE_INT);
ball.x = paddle.x + 1;
ball.y = paddle.y + 1;
int result6 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result6)), (
((void *)0)
), (UNITY_UINT)(60), UNITY_DISPLAY_STYLE_INT);
}

69
build/test/cache/test_checkGameEnd.c

@ -0,0 +1,69 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_checkGameEnd(void){
int maxScore = 5;
int score1 = 4, score2 = 2;
int result = checkGameEnd(score1, score2, maxScore);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT);
score1 = 5;
result = checkGameEnd(score1, score2, maxScore);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_INT);
}

73
build/test/cache/test_clearScreen.c

@ -0,0 +1,73 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
char screen[20][40 +1];
void setUp(void){
}
void tearDown(void){
}
void test_clearScreen(void){
int i, j;
for (i = 0; i < 20; i++) {
for (j = 0; j < 40; j++) {
screen[i][j] = ' ';
}
screen[i][j] = '\0';
}
clearScreen();
for (i = 0; i < 20; i++) {
for (j = 0; j < 40; j++) {
UnityAssertEqualNumber((UNITY_INT)((' ')), (UNITY_INT)((screen[i][j])), (
((void *)0)
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_INT);
}
}
}

90
build/test/cache/test_is_Valid_tile.c

@ -22,7 +22,7 @@ void test_detect_not_valid_tile_left(void){
int tile = 0;
int direction = 1;
int direction = 2;
int result;
@ -78,13 +78,13 @@ void test_detect_not_valid_tile_up(void){
void test_detect_valid_tile_right(void){
void test_detect_not_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int tile = board.width * board.height - 1;
int direction = 5;
@ -100,7 +100,7 @@ void test_detect_valid_tile_right(void){
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
@ -110,13 +110,13 @@ void test_detect_valid_tile_right(void){
void test_detect_valid_tile_down(void){
void test_detect_not_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int tile = board.width * board.height - 1;
int direction = 4;
@ -132,7 +132,7 @@ void test_detect_valid_tile_down(void){
UnityAssertEqualNumber((UNITY_INT)((0 + board.width)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
@ -142,7 +142,7 @@ void test_detect_valid_tile_down(void){
void test_detect_not_valid_tile_right(void){
void test_detect_valid_tile_left(void){
@ -150,7 +150,7 @@ void test_detect_not_valid_tile_right(void){
int tile = board.width * board.height - 1;
int direction = 5;
int direction = 2;
int result;
@ -164,7 +164,7 @@ void test_detect_not_valid_tile_right(void){
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((board.width * board.height - 2)), (UNITY_INT)((result)), (
((void *)0)
@ -174,7 +174,7 @@ void test_detect_not_valid_tile_right(void){
void test_detect_not_valid_tile_down(void){
void test_detect_valid_tile_up(void){
@ -182,7 +182,7 @@ void test_detect_not_valid_tile_down(void){
int tile = board.width * board.height - 1;
int direction = 4;
int direction = 3;
int result;
@ -196,10 +196,74 @@ void test_detect_not_valid_tile_down(void){
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((board.width * (board.height - 1) - 1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(91), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 5;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 4;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((0 + board.width)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(119), UNITY_DISPLAY_STYLE_INT);
}

83
build/test/cache/test_playerInputMovement.c

@ -0,0 +1,83 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Paddle;
void setUp(void){
}
void tearDown(void){
}
void test_playerInputMovement(void){
int paddlePositionY = 10;
int userInput = -1;
int expectedY = paddlePositionY - 1;
processPlayerInput(&paddlePositionY, userInput);
UnityAssertEqualNumber((UNITY_INT)((expectedY)), (UNITY_INT)((paddlePositionY)), (
((void *)0)
), (UNITY_UINT)(27), UNITY_DISPLAY_STYLE_INT);
userInput = 1;
expectedY = paddlePositionY + 1;
processPlayerInput(&paddlePositionY, userInput);
UnityAssertEqualNumber((UNITY_INT)((expectedY)), (UNITY_INT)((paddlePositionY)), (
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
}

51
build/test/cache/test_pong.c

@ -0,0 +1,51 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_input_all_5(void){
int a = 4, b = 5;
resetScore( &a, &b );
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((a)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((b)), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_INT);
}

105
build/test/cache/test_tictactoe.c

@ -1,105 +0,0 @@
#include "src/main/c/GameTic_Tac_Toe/tictactoe.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_if_not_identical(void){
char result;
char a = 'a', b = 'b', c = 'c';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((' ')), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_CHAR);
}
void test_if_identical(void){
char result;
char a = 'a', b = 'a', c = 'a';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((a)), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(34), UNITY_DISPLAY_STYLE_CHAR);
}
void test_checkLine_horizontalerGewinner(void) {
char result;
char a = 'X', b = 'X', c = 'X';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('X')), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_CHAR);
}
}

1
build/test/dependencies/pong.d

@ -0,0 +1 @@
build/test/out/c/pong.o: src/main/c/Pong/pong.c

4
build/test/dependencies/test_checkCollision.d

@ -0,0 +1,4 @@
build/test/out/c/test_checkCollision.o: test/Pong/test_checkCollision.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/Pong/pong.h

4
build/test/dependencies/test_checkCollision_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_checkCollision_runner.o: \
build/test/runners/test_checkCollision_runner.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

4
build/test/dependencies/test_checkGameEnd.d

@ -0,0 +1,4 @@
build/test/out/c/test_checkGameEnd.o: test/Pong/test_checkGameEnd.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/Pong/pong.h

4
build/test/dependencies/test_checkGameEnd_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_checkGameEnd_runner.o: \
build/test/runners/test_checkGameEnd_runner.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

4
build/test/dependencies/test_clearScreen.d

@ -0,0 +1,4 @@
build/test/out/c/test_clearScreen.o: test/Pong/test_clearScreen.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/Pong/pong.h

4
build/test/dependencies/test_clearScreen_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_clearScreen_runner.o: \
build/test/runners/test_clearScreen_runner.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

5
build/test/dependencies/test_playerInputMovement.d

@ -0,0 +1,5 @@
build/test/out/c/test_playerInputMovement.o: \
test/Pong/test_playerInputMovement.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/Pong/pong.h

4
build/test/dependencies/test_playerInputMovement_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_playerInputMovement_runner.o: \
build/test/runners/test_playerInputMovement_runner.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

4
build/test/dependencies/test_pong.d

@ -0,0 +1,4 @@
build/test/out/c/test_pong.o: test/Pong/test_pong.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/Pong/pong.h

4
build/test/dependencies/test_pong_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_pong_runner.o: \
build/test/runners/test_pong_runner.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

5
build/test/dependencies/test_tictactoe.d

@ -1,4 +1 @@
build/test/out/c/test_tictactoe.o: test/test_tictactoe.c \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/main/c/GameTic_Tac_Toe/tictactoe.h
build/test/out/c/test_tictactoe.o: test/test_tictactoe.c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

BIN
build/test/out/test_checkCollision.out

BIN
build/test/out/test_checkGameEnd.out

BIN
build/test/out/test_clearScreen.out

BIN
build/test/out/test_is_Valid_tile.out

BIN
build/test/out/test_playerInputMovement.out

BIN
build/test/out/test_pong.out

BIN
build/test/out/test_tictactoe.out

143
build/test/preprocess/files/test_checkCollision.c

@ -0,0 +1,143 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Ball;
typedef struct {
int x;
int y;
int width;
int height;
} Paddle;
void setUp(void){
}
void tearDown(void){
}
void test_checkCollision(void){
Ball ball = {10, 10, 1, 1};
Paddle paddle = {50, 10, 5, 10};
ball.x = 0;
int result1 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result1)), (
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
ball.x = 40 - 1;
int result2 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result2)), (
((void *)0)
), (UNITY_UINT)(39), UNITY_DISPLAY_STYLE_INT);
ball.x = 5;
ball.y = 0;
int result3 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result3)), (
((void *)0)
), (UNITY_UINT)(45), UNITY_DISPLAY_STYLE_INT);
ball.y = 20 - 1;
int result4 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result4)), (
((void *)0)
), (UNITY_UINT)(49), UNITY_DISPLAY_STYLE_INT);
ball.x = paddle.x - 1;
ball.y = paddle.y + 1;
int result5 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result5)), (
((void *)0)
), (UNITY_UINT)(55), UNITY_DISPLAY_STYLE_INT);
ball.x = paddle.x + 1;
ball.y = paddle.y + 1;
int result6 = checkCollision(ball, paddle.y, paddle.y);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result6)), (
((void *)0)
), (UNITY_UINT)(60), UNITY_DISPLAY_STYLE_INT);
}

69
build/test/preprocess/files/test_checkGameEnd.c

@ -0,0 +1,69 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_checkGameEnd(void){
int maxScore = 5;
int score1 = 4, score2 = 2;
int result = checkGameEnd(score1, score2, maxScore);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT);
score1 = 5;
result = checkGameEnd(score1, score2, maxScore);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_INT);
}

73
build/test/preprocess/files/test_clearScreen.c

@ -0,0 +1,73 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
char screen[20][40 +1];
void setUp(void){
}
void tearDown(void){
}
void test_clearScreen(void){
int i, j;
for (i = 0; i < 20; i++) {
for (j = 0; j < 40; j++) {
screen[i][j] = ' ';
}
screen[i][j] = '\0';
}
clearScreen();
for (i = 0; i < 20; i++) {
for (j = 0; j < 40; j++) {
UnityAssertEqualNumber((UNITY_INT)((' ')), (UNITY_INT)((screen[i][j])), (
((void *)0)
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_INT);
}
}
}

90
build/test/preprocess/files/test_is_Valid_tile.c

@ -22,7 +22,7 @@ void test_detect_not_valid_tile_left(void){
int tile = 0;
int direction = 1;
int direction = 2;
int result;
@ -78,13 +78,13 @@ void test_detect_not_valid_tile_up(void){
void test_detect_valid_tile_right(void){
void test_detect_not_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int tile = board.width * board.height - 1;
int direction = 5;
@ -100,7 +100,7 @@ void test_detect_valid_tile_right(void){
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
@ -110,13 +110,13 @@ void test_detect_valid_tile_right(void){
void test_detect_valid_tile_down(void){
void test_detect_not_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int tile = board.width * board.height - 1;
int direction = 4;
@ -132,7 +132,7 @@ void test_detect_valid_tile_down(void){
UnityAssertEqualNumber((UNITY_INT)((0 + board.width)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
@ -142,7 +142,7 @@ void test_detect_valid_tile_down(void){
void test_detect_not_valid_tile_right(void){
void test_detect_valid_tile_left(void){
@ -150,7 +150,7 @@ void test_detect_not_valid_tile_right(void){
int tile = board.width * board.height - 1;
int direction = 5;
int direction = 2;
int result;
@ -164,7 +164,7 @@ void test_detect_not_valid_tile_right(void){
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((board.width * board.height - 2)), (UNITY_INT)((result)), (
((void *)0)
@ -174,7 +174,7 @@ void test_detect_not_valid_tile_right(void){
void test_detect_not_valid_tile_down(void){
void test_detect_valid_tile_up(void){
@ -182,7 +182,7 @@ void test_detect_not_valid_tile_down(void){
int tile = board.width * board.height - 1;
int direction = 4;
int direction = 3;
int result;
@ -196,10 +196,74 @@ void test_detect_not_valid_tile_down(void){
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
UnityAssertEqualNumber((UNITY_INT)((board.width * (board.height - 1) - 1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(91), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 5;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 4;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((0 + board.width)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(119), UNITY_DISPLAY_STYLE_INT);
}

83
build/test/preprocess/files/test_playerInputMovement.c

@ -0,0 +1,83 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Paddle;
void setUp(void){
}
void tearDown(void){
}
void test_playerInputMovement(void){
int paddlePositionY = 10;
int userInput = -1;
int expectedY = paddlePositionY - 1;
processPlayerInput(&paddlePositionY, userInput);
UnityAssertEqualNumber((UNITY_INT)((expectedY)), (UNITY_INT)((paddlePositionY)), (
((void *)0)
), (UNITY_UINT)(27), UNITY_DISPLAY_STYLE_INT);
userInput = 1;
expectedY = paddlePositionY + 1;
processPlayerInput(&paddlePositionY, userInput);
UnityAssertEqualNumber((UNITY_INT)((expectedY)), (UNITY_INT)((paddlePositionY)), (
((void *)0)
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT);
}

51
build/test/preprocess/files/test_pong.c

@ -0,0 +1,51 @@
#include "src/main/c/Pong/pong.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_input_all_5(void){
int a = 4, b = 5;
resetScore( &a, &b );
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((a)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((b)), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_INT);
}

105
build/test/preprocess/files/test_tictactoe.c

@ -1,105 +0,0 @@
#include "src/main/c/GameTic_Tac_Toe/tictactoe.h"
#include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_if_not_identical(void){
char result;
char a = 'a', b = 'b', c = 'c';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((' ')), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_CHAR);
}
void test_if_identical(void){
char result;
char a = 'a', b = 'a', c = 'a';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((a)), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(34), UNITY_DISPLAY_STYLE_CHAR);
}
void test_checkLine_horizontalerGewinner(void) {
char result;
char a = 'X', b = 'X', c = 'X';
result = checkLine(a, b, c);
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('X')), (UNITY_INT)(UNITY_INT8 )((result)), (
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_CHAR);
}
}

3
build/test/preprocess/includes/test_checkCollision.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Pong/pong.h

3
build/test/preprocess/includes/test_checkGameEnd.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Pong/pong.h

3
build/test/preprocess/includes/test_clearScreen.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Pong/pong.h

3
build/test/preprocess/includes/test_playerInputMovement.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Pong/pong.h

3
build/test/preprocess/includes/test_pong.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Pong/pong.h

4
build/test/preprocess/includes/test_tictactoe.c

@ -1,3 +1 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/GameTic_Tac_Toe/tictactoe.h
--- []

2
build/test/results/test_bomb_in_array.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.00173795400041854
:time: 0.0019388419968890958

18
build/test/results/test_checkCollision.pass

@ -0,0 +1,18 @@
---
:source:
:path: test/Pong
:file: test_checkCollision.c
:successes:
- :test: test_checkCollision
:line: 28
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0029658310013473965

18
build/test/results/test_checkGameEnd.pass

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

19
build/test/results/test_clearScreen.pass

@ -0,0 +1,19 @@
---
:source:
:path: test/Pong
:file: test_clearScreen.c
:successes:
- :test: test_clearScreen
:line: 17
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout:
- "\e[H\e[2J\e[3J"
:time: 0.0033668149990262464

2
build/test/results/test_collision.pass

@ -23,4 +23,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0023196109978016466
:time: 0.0019110120047116652

22
build/test/results/test_is_Valid_tile.pass

@ -11,28 +11,36 @@
:line: 24
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_right
- :test: test_detect_not_valid_tile_right
:line: 38
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_down
- :test: test_detect_not_valid_tile_down
:line: 52
:message: ''
:unity_test_time: 0
- :test: test_detect_not_valid_tile_right
- :test: test_detect_valid_tile_left
:line: 66
:message: ''
:unity_test_time: 0
- :test: test_detect_not_valid_tile_down
- :test: test_detect_valid_tile_up
:line: 80
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_right
:line: 94
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_down
:line: 108
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 6
:passed: 6
:total: 8
:passed: 8
:failed: 0
:ignored: 0
:stdout: []
:time: 0.002173025997763034
:time: 0.0018614720029290766

2
build/test/results/test_moving_snake.pass

@ -27,4 +27,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0014848970022285357
:time: 0.0017703789999359287

2
build/test/results/test_number_of_bombs.pass

@ -31,4 +31,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0023246400014613755
:time: 0.001969636003195774

2
build/test/results/test_part_of_snake.pass

@ -23,4 +23,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0021876099999644794
:time: 0.0018195759985246696

18
build/test/results/test_playerInputMovement.pass

@ -0,0 +1,18 @@
---
:source:
:path: test/Pong
:file: test_playerInputMovement.c
:successes:
- :test: test_playerInputMovement
:line: 20
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0020938829984515905

18
build/test/results/test_pong.pass

@ -0,0 +1,18 @@
---
:source:
:path: test/Pong
:file: test_pong.c
:successes:
- :test: test_input_all_5
:line: 13
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0018966770003316924

2
build/test/results/test_template.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.002167227001336869
:time: 0.002368312001635786

14
build/test/results/test_tictactoe.pass

@ -0,0 +1,14 @@
---
:source:
:path: test
:file: test_tictactoe.c
:successes: []
:failures: []
:ignores: []
:counts:
:total: 0
:passed: 0
:failed: 0
:ignored: 0
:stdout: []
:time: 0.001759689002938103

81
build/test/runners/test_checkCollision_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_checkCollision(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_checkCollision.c");
run_test(test_checkCollision, "test_checkCollision", 28);
return UnityEnd();
}

81
build/test/runners/test_checkGameEnd_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_checkGameEnd(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_checkGameEnd.c");
run_test(test_checkGameEnd, "test_checkGameEnd", 14);
return UnityEnd();
}

81
build/test/runners/test_clearScreen_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_clearScreen(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_clearScreen.c");
run_test(test_clearScreen, "test_clearScreen", 17);
return UnityEnd();
}

16
build/test/runners/test_is_Valid_tile_runner.c

@ -12,10 +12,12 @@ extern void setUp(void);
extern void tearDown(void);
extern void test_detect_not_valid_tile_left(void);
extern void test_detect_not_valid_tile_up(void);
extern void test_detect_valid_tile_right(void);
extern void test_detect_valid_tile_down(void);
extern void test_detect_not_valid_tile_right(void);
extern void test_detect_not_valid_tile_down(void);
extern void test_detect_valid_tile_left(void);
extern void test_detect_valid_tile_up(void);
extern void test_detect_valid_tile_right(void);
extern void test_detect_valid_tile_down(void);
/*=======Mock Management=====*/
@ -82,10 +84,12 @@ int main(void)
UnityBegin("test_is_Valid_tile.c");
run_test(test_detect_not_valid_tile_left, "test_detect_not_valid_tile_left", 10);
run_test(test_detect_not_valid_tile_up, "test_detect_not_valid_tile_up", 24);
run_test(test_detect_valid_tile_right, "test_detect_valid_tile_right", 38);
run_test(test_detect_valid_tile_down, "test_detect_valid_tile_down", 52);
run_test(test_detect_not_valid_tile_right, "test_detect_not_valid_tile_right", 66);
run_test(test_detect_not_valid_tile_down, "test_detect_not_valid_tile_down", 80);
run_test(test_detect_not_valid_tile_right, "test_detect_not_valid_tile_right", 38);
run_test(test_detect_not_valid_tile_down, "test_detect_not_valid_tile_down", 52);
run_test(test_detect_valid_tile_left, "test_detect_valid_tile_left", 66);
run_test(test_detect_valid_tile_up, "test_detect_valid_tile_up", 80);
run_test(test_detect_valid_tile_right, "test_detect_valid_tile_right", 94);
run_test(test_detect_valid_tile_down, "test_detect_valid_tile_down", 108);
return UnityEnd();
}

81
build/test/runners/test_playerInputMovement_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_playerInputMovement(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_playerInputMovement.c");
run_test(test_playerInputMovement, "test_playerInputMovement", 20);
return UnityEnd();
}

81
build/test/runners/test_pong_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_input_all_5(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_pong.c");
run_test(test_input_all_5, "test_input_all_5", 13);
return UnityEnd();
}

40
build/test/runners/test_tictactoe_runner.c

@ -10,9 +10,6 @@ char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/
extern void setUp(void);
extern void tearDown(void);
extern void test_if_not_identical(void);
extern void test_if_identical(void);
extern void test_checkLine_horizontalerGewinner(void);
/*=======Mock Management=====*/
@ -29,6 +26,12 @@ static void CMock_Destroy(void)
{
}
/*=======Setup (stub)=====*/
void setUp(void) {}
/*=======Teardown (stub)=====*/
void tearDown(void) {}
/*=======Test Reset Options=====*/
void resetTest(void);
void resetTest(void)
@ -45,41 +48,10 @@ 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_tictactoe.c");
run_test(test_if_not_identical, "test_if_not_identical", 14);
run_test(test_if_identical, "test_if_identical", 26);
run_test(test_checkLine_horizontalerGewinner, "test_checkLine_horizontalerGewinner", 37);
return UnityEnd();
}
Loading…
Cancel
Save