David Moeller
11 months ago
82 changed files with 1611 additions and 297 deletions
-
9.vscode/settings.json
-
2build/release/dependencies/main.d
-
1build/release/dependencies/pong.d
-
BINbuild/release/out/c/main.o
-
BINbuild/release/out/c/pong.o
-
BINbuild/release/out/c/tictactoe.o
-
BINbuild/release/project.out
-
2build/test/cache/defines_dependency.yml
-
143build/test/cache/test_checkCollision.c
-
69build/test/cache/test_checkGameEnd.c
-
73build/test/cache/test_clearScreen.c
-
90build/test/cache/test_is_Valid_tile.c
-
83build/test/cache/test_playerInputMovement.c
-
51build/test/cache/test_pong.c
-
105build/test/cache/test_tictactoe.c
-
1build/test/dependencies/pong.d
-
4build/test/dependencies/test_checkCollision.d
-
4build/test/dependencies/test_checkCollision_runner.d
-
4build/test/dependencies/test_checkGameEnd.d
-
4build/test/dependencies/test_checkGameEnd_runner.d
-
4build/test/dependencies/test_clearScreen.d
-
4build/test/dependencies/test_clearScreen_runner.d
-
5build/test/dependencies/test_playerInputMovement.d
-
4build/test/dependencies/test_playerInputMovement_runner.d
-
4build/test/dependencies/test_pong.d
-
4build/test/dependencies/test_pong_runner.d
-
5build/test/dependencies/test_tictactoe.d
-
BINbuild/test/out/c/pong.o
-
BINbuild/test/out/c/test_checkCollision.o
-
BINbuild/test/out/c/test_checkCollision_runner.o
-
BINbuild/test/out/c/test_checkGameEnd.o
-
BINbuild/test/out/c/test_checkGameEnd_runner.o
-
BINbuild/test/out/c/test_clearScreen.o
-
BINbuild/test/out/c/test_clearScreen_runner.o
-
BINbuild/test/out/c/test_is_Valid_tile.o
-
BINbuild/test/out/c/test_is_Valid_tile_runner.o
-
BINbuild/test/out/c/test_playerInputMovement.o
-
BINbuild/test/out/c/test_playerInputMovement_runner.o
-
BINbuild/test/out/c/test_pong.o
-
BINbuild/test/out/c/test_pong_runner.o
-
BINbuild/test/out/c/test_tictactoe.o
-
BINbuild/test/out/c/test_tictactoe_runner.o
-
BINbuild/test/out/test_checkCollision.out
-
BINbuild/test/out/test_checkGameEnd.out
-
BINbuild/test/out/test_clearScreen.out
-
BINbuild/test/out/test_is_Valid_tile.out
-
BINbuild/test/out/test_playerInputMovement.out
-
BINbuild/test/out/test_pong.out
-
BINbuild/test/out/test_tictactoe.out
-
143build/test/preprocess/files/test_checkCollision.c
-
69build/test/preprocess/files/test_checkGameEnd.c
-
73build/test/preprocess/files/test_clearScreen.c
-
90build/test/preprocess/files/test_is_Valid_tile.c
-
83build/test/preprocess/files/test_playerInputMovement.c
-
51build/test/preprocess/files/test_pong.c
-
105build/test/preprocess/files/test_tictactoe.c
-
3build/test/preprocess/includes/test_checkCollision.c
-
3build/test/preprocess/includes/test_checkGameEnd.c
-
3build/test/preprocess/includes/test_clearScreen.c
-
3build/test/preprocess/includes/test_playerInputMovement.c
-
3build/test/preprocess/includes/test_pong.c
-
4build/test/preprocess/includes/test_tictactoe.c
-
2build/test/results/test_bomb_in_array.pass
-
18build/test/results/test_checkCollision.pass
-
18build/test/results/test_checkGameEnd.pass
-
19build/test/results/test_clearScreen.pass
-
2build/test/results/test_collision.pass
-
22build/test/results/test_is_Valid_tile.pass
-
2build/test/results/test_moving_snake.pass
-
2build/test/results/test_number_of_bombs.pass
-
2build/test/results/test_part_of_snake.pass
-
18build/test/results/test_playerInputMovement.pass
-
18build/test/results/test_pong.pass
-
2build/test/results/test_template.pass
-
14build/test/results/test_tictactoe.pass
-
81build/test/runners/test_checkCollision_runner.c
-
81build/test/runners/test_checkGameEnd_runner.c
-
81build/test/runners/test_clearScreen_runner.c
-
16build/test/runners/test_is_Valid_tile_runner.c
-
81build/test/runners/test_playerInputMovement_runner.c
-
81build/test/runners/test_pong_runner.c
-
40build/test/runners/test_tictactoe_runner.c
@ -0,0 +1,9 @@ |
|||
{ |
|||
"files.associations": { |
|||
"*.embeddedhtml": "html", |
|||
"unistd.h": "c", |
|||
"fcntl.h": "c", |
|||
"stdio.h": "c", |
|||
"types.h": "c" |
|||
} |
|||
} |
@ -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 |
@ -0,0 +1 @@ |
|||
build/release/out/c/pong.o: src/main/c/Pong/pong.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); |
|||
|
|||
} |
@ -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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1 @@ |
|||
build/test/out/c/pong.o: src/main/c/Pong/pong.c |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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); |
|||
|
|||
} |
@ -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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
|||
|
|||
} |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
|||
--- [] |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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(); |
|||
} |
@ -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(); |
|||
} |
@ -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(); |
|||
} |
@ -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(); |
|||
} |
@ -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(); |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue