Browse Source

Test detect not valid all directions

remotes/origin/David
David Moeller 11 months ago
parent
commit
d73c982cf1
  1. 28
      .vscode/tasks.json
  2. BIN
      build/artifacts/release/project.out
  3. 1
      build/release/dependencies/get_character.d
  4. 3
      build/release/dependencies/main.d
  5. 3
      build/release/dependencies/minesweeper_start.d
  6. 2
      build/release/dependencies/snake_start.d
  7. 1
      build/release/dependencies/tictactoe.d
  8. BIN
      build/release/out/c/get_character.o
  9. BIN
      build/release/out/c/main.o
  10. BIN
      build/release/out/c/minesweeper_start.o
  11. BIN
      build/release/out/c/snake_start.o
  12. BIN
      build/release/out/c/tictactoe.o
  13. BIN
      build/release/project.out
  14. 8
      build/test/cache/defines_dependency.yml
  15. 79
      build/test/cache/test_bomb_in_array.c
  16. 102
      build/test/cache/test_collision.c
  17. 205
      build/test/cache/test_is_Valid_tile.c
  18. 142
      build/test/cache/test_moving_snake.c
  19. 205
      build/test/cache/test_number_of_bombs.c
  20. 102
      build/test/cache/test_part_of_snake.c
  21. 105
      build/test/cache/test_tictactoe.c
  22. 1
      build/test/dependencies/get_character.d
  23. 3
      build/test/dependencies/minesweeper_start.d
  24. 2
      build/test/dependencies/snake_start.d
  25. 5
      build/test/dependencies/test_bomb_in_array.d
  26. 4
      build/test/dependencies/test_bomb_in_array_runner.d
  27. 4
      build/test/dependencies/test_collision.d
  28. 4
      build/test/dependencies/test_collision_runner.d
  29. 5
      build/test/dependencies/test_is_Valid_tile.d
  30. 4
      build/test/dependencies/test_is_Valid_tile_runner.d
  31. 5
      build/test/dependencies/test_moving_snake.d
  32. 4
      build/test/dependencies/test_moving_snake_runner.d
  33. 5
      build/test/dependencies/test_number_of_bombs.d
  34. 4
      build/test/dependencies/test_number_of_bombs_runner.d
  35. 5
      build/test/dependencies/test_part_of_snake.d
  36. 4
      build/test/dependencies/test_part_of_snake_runner.d
  37. 4
      build/test/dependencies/test_tictactoe.d
  38. 4
      build/test/dependencies/test_tictactoe_runner.d
  39. BIN
      build/test/out/c/get_character.o
  40. BIN
      build/test/out/c/minesweeper_start.o
  41. BIN
      build/test/out/c/snake_start.o
  42. BIN
      build/test/out/c/test_bomb_in_array.o
  43. BIN
      build/test/out/c/test_bomb_in_array_runner.o
  44. BIN
      build/test/out/c/test_collision.o
  45. BIN
      build/test/out/c/test_collision_runner.o
  46. BIN
      build/test/out/c/test_is_Valid_tile.o
  47. BIN
      build/test/out/c/test_is_Valid_tile_runner.o
  48. BIN
      build/test/out/c/test_moving_snake.o
  49. BIN
      build/test/out/c/test_moving_snake_runner.o
  50. BIN
      build/test/out/c/test_number_of_bombs.o
  51. BIN
      build/test/out/c/test_number_of_bombs_runner.o
  52. BIN
      build/test/out/c/test_part_of_snake.o
  53. BIN
      build/test/out/c/test_part_of_snake_runner.o
  54. BIN
      build/test/out/c/test_tictactoe_runner.o
  55. BIN
      build/test/out/test_bomb_in_array.out
  56. BIN
      build/test/out/test_collision.out
  57. BIN
      build/test/out/test_is_Valid_tile.out
  58. BIN
      build/test/out/test_moving_snake.out
  59. BIN
      build/test/out/test_number_of_bombs.out
  60. BIN
      build/test/out/test_part_of_snake.out
  61. 79
      build/test/preprocess/files/test_bomb_in_array.c
  62. 102
      build/test/preprocess/files/test_collision.c
  63. 205
      build/test/preprocess/files/test_is_Valid_tile.c
  64. 142
      build/test/preprocess/files/test_moving_snake.c
  65. 205
      build/test/preprocess/files/test_number_of_bombs.c
  66. 102
      build/test/preprocess/files/test_part_of_snake.c
  67. 105
      build/test/preprocess/files/test_tictactoe.c
  68. 3
      build/test/preprocess/includes/test_bomb_in_array.c
  69. 4
      build/test/preprocess/includes/test_collision.c
  70. 3
      build/test/preprocess/includes/test_is_Valid_tile.c
  71. 4
      build/test/preprocess/includes/test_moving_snake.c
  72. 3
      build/test/preprocess/includes/test_number_of_bombs.c
  73. 4
      build/test/preprocess/includes/test_part_of_snake.c
  74. 3
      build/test/preprocess/includes/test_tictactoe.c
  75. 22
      build/test/results/test_bomb_in_array.pass
  76. 26
      build/test/results/test_collision.pass
  77. 38
      build/test/results/test_is_Valid_tile.pass
  78. 30
      build/test/results/test_moving_snake.pass
  79. 34
      build/test/results/test_number_of_bombs.pass
  80. 26
      build/test/results/test_part_of_snake.pass
  81. 2
      build/test/results/test_template.pass
  82. 83
      build/test/runners/test_bomb_in_array_runner.c
  83. 85
      build/test/runners/test_collision_runner.c
  84. 91
      build/test/runners/test_is_Valid_tile_runner.c
  85. 87
      build/test/runners/test_moving_snake_runner.c
  86. 89
      build/test/runners/test_number_of_bombs_runner.c
  87. 85
      build/test/runners/test_part_of_snake_runner.c
  88. 85
      build/test/runners/test_tictactoe_runner.c
  89. 44
      test/Minesweeper/test_is_Valid_tile.c

28
.vscode/tasks.json

@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}

BIN
build/artifacts/release/project.out

1
build/release/dependencies/get_character.d

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

3
build/release/dependencies/main.d

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

3
build/release/dependencies/minesweeper_start.d

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

2
build/release/dependencies/snake_start.d

@ -0,0 +1,2 @@
build/release/out/c/snake_start.o: src/main/c/Snake/snake_start.c \
src/main/c/Snake/snake_start.h src/main/c/Snake/get_character.h

1
build/release/dependencies/tictactoe.d

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

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

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

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

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

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

BIN
build/release/project.out

8
build/test/cache/defines_dependency.yml

@ -1,3 +1,11 @@
---
src/main/c/Template/game100.c:
- TEST
src/main/c/Snake/snake_start.c:
- TEST
src/main/c/Snake/get_character.c:
- TEST
src/main/c/Minesweeper/minesweeper_start.c:
- TEST
src/main/c/GameTic_Tac_Toe/tictactoe.c:
- TEST

79
build/test/cache/test_bomb_in_array.c

@ -0,0 +1,79 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_bomb_in_array(void){
_Bool
result;
int array[] = {5, 9, 42, 6, 87, 95, 202, 13, 45 ,78};
int bomb = 42;
int length = 10;
result = array_contains_value(array, bomb, length);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(22)));}} while(0);
}
void test_bomb_not_in_array(void){
_Bool
result;
int array[] = {5, 9, 42, 6, 87, 95, 202, 13, 45 ,78};
int bomb = 0;
int length = 10;
result = array_contains_value(array, bomb, length);
do {if (!(result)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(37)));}} while(0);
}

102
build/test/cache/test_collision.c

@ -0,0 +1,102 @@
#include "src/main/c/Snake/get_character.h"
#include "src/main/c/Snake/snake_start.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_self_collision(void){
_Bool
result;
Snake snake = {1, 5, {6 + 16 * 6, 6 + 16 * 7, 7 + 16 * 7, 7 + 16 * 6, 6 + 16 * 6}};
result = check_if_dead(&snake);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(21)));}} while(0);
}
void test_no_collision(void){
_Bool
result;
Snake snake = initialize_snake();
result = check_if_dead(&snake);
do {if (!(result)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(34)));}} while(0);
}
void test_wall_collision(void){
_Bool
result;
Snake snake = {-1, 4, {0 + 16 * 6, 1 + 16 * 6, 2 + 16 * 6, 3 + 16 * 6}};
result = check_if_dead(&snake);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(47)));}} while(0);
}

205
build/test/cache/test_is_Valid_tile.c

@ -0,0 +1,205 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_detect_not_valid_tile_left(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 1;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_up(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 3;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(35), 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)(49), 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)(63), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 5;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(77), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 4;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(91), UNITY_DISPLAY_STYLE_INT);
}

142
build/test/cache/test_moving_snake.c

@ -0,0 +1,142 @@
#include "build/temp/../../src/main/c/Snake/get_character.h"
#include "build/temp/../../src/main/c/Snake/snake_start.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_moving_right(void){
_Bool
result;
Snake snake = {1, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {1, 3, {9 + 16 * 6, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(24)));}} while(0);
}
void test_moving_down(void){
_Bool
result;
Snake snake = {16, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {16, 3, {8 + 16 * 7, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(38)));}} while(0);
}
void test_moving_left(void){
_Bool
result;
Snake snake = {-1, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {-1, 3, {7 + 16 * 6, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(52)));}} while(0);
}
void test_moving_up(void){
_Bool
result;
Snake snake = {-16, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {-16, 3, {8 + 16 * 5, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(66)));}} while(0);
}

205
build/test/cache/test_number_of_bombs.c

@ -0,0 +1,205 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_no_bombs_placed_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
}
void test_searching_for_bombs_on_correct_tiles(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
board.bombs[0] = 0 + board.width * 3;
board.bombs[1] = 2 + board.width * 1;
board.bombs[2] = board.width - 1 + board.width * 1;
board.bombs[3] = 0 + board.width * (board.height - 1);
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(38), UNITY_DISPLAY_STYLE_INT);
}
void test_2_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
board.bombs[0] = 0 + board.width * 2;
board.bombs[1] = 1 + board.width * 1;
board.bombs[2] = board.width - 1 + board.width * 1;
board.bombs[3] = 0 + board.width * (board.height - 1);
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(55), UNITY_DISPLAY_STYLE_INT);
}
void test_5_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 1 + board.width * 0;
board.bombs[0] = 0 + board.width * 0;
board.bombs[1] = 2 + board.width * 0;
board.bombs[2] = 0 + board.width * 1;
board.bombs[3] = 1 + board.width * 1;
board.bombs[4] = 2 + board.width * 1;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((5)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT);
}
void test_8_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 7 + board.width * 7;
board.bombs[0] = 6 + board.width * 6;
board.bombs[1] = 7 + board.width * 6;
board.bombs[2] = 8 + board.width * 6;
board.bombs[3] = 6 + board.width * 7;
board.bombs[4] = 8 + board.width * 7;
board.bombs[5] = 6 + board.width * 8;
board.bombs[6] = 7 + board.width * 8;
board.bombs[7] = 8 + board.width * 8;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((8)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(94), UNITY_DISPLAY_STYLE_INT);
}

102
build/test/cache/test_part_of_snake.c

@ -0,0 +1,102 @@
#include "build/temp/../../src/main/c/Snake/get_character.h"
#include "build/temp/../../src/main/c/Snake/snake_start.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_find_head(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 8 * 16 + 8);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(20), UNITY_DISPLAY_STYLE_INT);
}
void test_get_correct_index(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 8 * 16 + 6);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_INT);
}
void test_snake_not_on_tile(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 6 * 16 + 6);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_INT);
}

105
build/test/cache/test_tictactoe.c

@ -0,0 +1,105 @@
#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/get_character.d

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

3
build/test/dependencies/minesweeper_start.d

@ -0,0 +1,3 @@
build/test/out/c/minesweeper_start.o: \
src/main/c/Minesweeper/minesweeper_start.c \
src/main/c/Minesweeper/minesweeper_start.h

2
build/test/dependencies/snake_start.d

@ -0,0 +1,2 @@
build/test/out/c/snake_start.o: src/main/c/Snake/snake_start.c \
src/main/c/Snake/snake_start.h src/main/c/Snake/get_character.h

5
build/test/dependencies/test_bomb_in_array.d

@ -0,0 +1,5 @@
build/test/out/c/test_bomb_in_array.o: \
test/Minesweeper/test_bomb_in_array.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 \
test/Minesweeper/../../src/main/c/Minesweeper/minesweeper_start.h

4
build/test/dependencies/test_bomb_in_array_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_bomb_in_array_runner.o: \
build/test/runners/test_bomb_in_array_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_collision.d

@ -0,0 +1,4 @@
build/test/out/c/test_collision.o: test/Snake/test_collision.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/Snake/snake_start.h src/main/c/Snake/get_character.h

4
build/test/dependencies/test_collision_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_collision_runner.o: \
build/test/runners/test_collision_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_is_Valid_tile.d

@ -0,0 +1,5 @@
build/test/out/c/test_is_Valid_tile.o: \
test/Minesweeper/test_is_Valid_tile.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 \
test/Minesweeper/../../src/main/c/Minesweeper/minesweeper_start.h

4
build/test/dependencies/test_is_Valid_tile_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_is_Valid_tile_runner.o: \
build/test/runners/test_is_Valid_tile_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_moving_snake.d

@ -0,0 +1,5 @@
build/test/out/c/test_moving_snake.o: test/Snake/test_moving_snake.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 \
test/Snake/../../src/main/c/Snake/snake_start.h \
test/Snake/../../src/main/c/Snake/get_character.h

4
build/test/dependencies/test_moving_snake_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_moving_snake_runner.o: \
build/test/runners/test_moving_snake_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_number_of_bombs.d

@ -0,0 +1,5 @@
build/test/out/c/test_number_of_bombs.o: \
test/Minesweeper/test_number_of_bombs.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 \
test/Minesweeper/../../src/main/c/Minesweeper/minesweeper_start.h

4
build/test/dependencies/test_number_of_bombs_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_number_of_bombs_runner.o: \
build/test/runners/test_number_of_bombs_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_part_of_snake.d

@ -0,0 +1,5 @@
build/test/out/c/test_part_of_snake.o: test/Snake/test_part_of_snake.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 \
test/Snake/../../src/main/c/Snake/snake_start.h \
test/Snake/../../src/main/c/Snake/get_character.h

4
build/test/dependencies/test_part_of_snake_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_part_of_snake_runner.o: \
build/test/runners/test_part_of_snake_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_tictactoe.d

@ -0,0 +1,4 @@
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

4
build/test/dependencies/test_tictactoe_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_tictactoe_runner.o: \
build/test/runners/test_tictactoe_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

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

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

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

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

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

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

BIN
build/test/out/c/test_collision_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_moving_snake.o

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

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

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

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

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

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

BIN
build/test/out/test_bomb_in_array.out

BIN
build/test/out/test_collision.out

BIN
build/test/out/test_is_Valid_tile.out

BIN
build/test/out/test_moving_snake.out

BIN
build/test/out/test_number_of_bombs.out

BIN
build/test/out/test_part_of_snake.out

79
build/test/preprocess/files/test_bomb_in_array.c

@ -0,0 +1,79 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_bomb_in_array(void){
_Bool
result;
int array[] = {5, 9, 42, 6, 87, 95, 202, 13, 45 ,78};
int bomb = 42;
int length = 10;
result = array_contains_value(array, bomb, length);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(22)));}} while(0);
}
void test_bomb_not_in_array(void){
_Bool
result;
int array[] = {5, 9, 42, 6, 87, 95, 202, 13, 45 ,78};
int bomb = 0;
int length = 10;
result = array_contains_value(array, bomb, length);
do {if (!(result)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(37)));}} while(0);
}

102
build/test/preprocess/files/test_collision.c

@ -0,0 +1,102 @@
#include "src/main/c/Snake/get_character.h"
#include "src/main/c/Snake/snake_start.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_self_collision(void){
_Bool
result;
Snake snake = {1, 5, {6 + 16 * 6, 6 + 16 * 7, 7 + 16 * 7, 7 + 16 * 6, 6 + 16 * 6}};
result = check_if_dead(&snake);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(21)));}} while(0);
}
void test_no_collision(void){
_Bool
result;
Snake snake = initialize_snake();
result = check_if_dead(&snake);
do {if (!(result)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(34)));}} while(0);
}
void test_wall_collision(void){
_Bool
result;
Snake snake = {-1, 4, {0 + 16 * 6, 1 + 16 * 6, 2 + 16 * 6, 3 + 16 * 6}};
result = check_if_dead(&snake);
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(47)));}} while(0);
}

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

@ -0,0 +1,205 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_detect_not_valid_tile_left(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 1;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_up(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 3;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(35), 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)(49), 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)(63), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_right(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 5;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(77), UNITY_DISPLAY_STYLE_INT);
}
void test_detect_not_valid_tile_down(void){
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 4;
int result;
result = is_Valid_tile(&board, tile, direction);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(91), UNITY_DISPLAY_STYLE_INT);
}

142
build/test/preprocess/files/test_moving_snake.c

@ -0,0 +1,142 @@
#include "build/temp/../../src/main/c/Snake/get_character.h"
#include "build/temp/../../src/main/c/Snake/snake_start.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_moving_right(void){
_Bool
result;
Snake snake = {1, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {1, 3, {9 + 16 * 6, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(24)));}} while(0);
}
void test_moving_down(void){
_Bool
result;
Snake snake = {16, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {16, 3, {8 + 16 * 7, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(38)));}} while(0);
}
void test_moving_left(void){
_Bool
result;
Snake snake = {-1, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {-1, 3, {7 + 16 * 6, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(52)));}} while(0);
}
void test_moving_up(void){
_Bool
result;
Snake snake = {-16, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}};
Snake expected = {-16, 3, {8 + 16 * 5, 8 + 16 * 6, 7 + 16 * 6}};
move_snake(&snake);
result = memcmp(&snake, &expected, sizeof(Snake)) == 0;
do {if ((result)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(66)));}} while(0);
}

205
build/test/preprocess/files/test_number_of_bombs.c

@ -0,0 +1,205 @@
#include "build/temp/../../src/main/c/Minesweeper/minesweeper_start.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_no_bombs_placed_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT);
}
void test_searching_for_bombs_on_correct_tiles(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
board.bombs[0] = 0 + board.width * 3;
board.bombs[1] = 2 + board.width * 1;
board.bombs[2] = board.width - 1 + board.width * 1;
board.bombs[3] = 0 + board.width * (board.height - 1);
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(38), UNITY_DISPLAY_STYLE_INT);
}
void test_2_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 0 + board.width * 1;
board.bombs[0] = 0 + board.width * 2;
board.bombs[1] = 1 + board.width * 1;
board.bombs[2] = board.width - 1 + board.width * 1;
board.bombs[3] = 0 + board.width * (board.height - 1);
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(55), UNITY_DISPLAY_STYLE_INT);
}
void test_5_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 1 + board.width * 0;
board.bombs[0] = 0 + board.width * 0;
board.bombs[1] = 2 + board.width * 0;
board.bombs[2] = 0 + board.width * 1;
board.bombs[3] = 1 + board.width * 1;
board.bombs[4] = 2 + board.width * 1;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((5)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT);
}
void test_8_bombs_around_tile(void){
int result;
Minesweeper_Board board = initialize_minesweeper();
int tile = 7 + board.width * 7;
board.bombs[0] = 6 + board.width * 6;
board.bombs[1] = 7 + board.width * 6;
board.bombs[2] = 8 + board.width * 6;
board.bombs[3] = 6 + board.width * 7;
board.bombs[4] = 8 + board.width * 7;
board.bombs[5] = 6 + board.width * 8;
board.bombs[6] = 7 + board.width * 8;
board.bombs[7] = 8 + board.width * 8;
result = number_of_bombs(&board, tile);
UnityAssertEqualNumber((UNITY_INT)((8)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(94), UNITY_DISPLAY_STYLE_INT);
}

102
build/test/preprocess/files/test_part_of_snake.c

@ -0,0 +1,102 @@
#include "build/temp/../../src/main/c/Snake/get_character.h"
#include "build/temp/../../src/main/c/Snake/snake_start.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_find_head(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 8 * 16 + 8);
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(20), UNITY_DISPLAY_STYLE_INT);
}
void test_get_correct_index(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 8 * 16 + 6);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_INT);
}
void test_snake_not_on_tile(void){
int result;
Snake snake = initialize_snake();
result = part_of_snake(&snake, 6 * 16 + 6);
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(46), UNITY_DISPLAY_STYLE_INT);
}

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

@ -0,0 +1,105 @@
#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_bomb_in_array.c

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- build/temp/../../src/main/c/Minesweeper/minesweeper_start.h

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

@ -0,0 +1,4 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/main/c/Snake/snake_start.h
- src/main/c/Snake/get_character.h

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

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- build/temp/../../src/main/c/Minesweeper/minesweeper_start.h

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

@ -0,0 +1,4 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- build/temp/../../src/main/c/Snake/snake_start.h
- build/temp/../../src/main/c/Snake/get_character.h

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

@ -0,0 +1,3 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- build/temp/../../src/main/c/Minesweeper/minesweeper_start.h

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

@ -0,0 +1,4 @@
---
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- build/temp/../../src/main/c/Snake/snake_start.h
- build/temp/../../src/main/c/Snake/get_character.h

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

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

22
build/test/results/test_bomb_in_array.pass

@ -0,0 +1,22 @@
---
:source:
:path: test/Minesweeper
:file: test_bomb_in_array.c
:successes:
- :test: test_bomb_in_array
:line: 11
:message: ''
:unity_test_time: 0
- :test: test_bomb_not_in_array
:line: 26
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 2
:passed: 2
:failed: 0
:ignored: 0
:stdout: []
:time: 0.00173795400041854

26
build/test/results/test_collision.pass

@ -0,0 +1,26 @@
---
:source:
:path: test/Snake
:file: test_collision.c
:successes:
- :test: test_self_collision
:line: 12
:message: ''
:unity_test_time: 0
- :test: test_no_collision
:line: 25
:message: ''
:unity_test_time: 0
- :test: test_wall_collision
:line: 38
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 3
:passed: 3
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0023196109978016466

38
build/test/results/test_is_Valid_tile.pass

@ -0,0 +1,38 @@
---
:source:
:path: test/Minesweeper
:file: test_is_Valid_tile.c
:successes:
- :test: test_detect_not_valid_tile_left
:line: 10
:message: ''
:unity_test_time: 0
- :test: test_detect_not_valid_tile_up
:line: 24
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_right
:line: 38
:message: ''
:unity_test_time: 0
- :test: test_detect_valid_tile_down
:line: 52
:message: ''
:unity_test_time: 0
- :test: test_detect_not_valid_tile_right
:line: 66
:message: ''
:unity_test_time: 0
- :test: test_detect_not_valid_tile_down
:line: 80
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 6
:passed: 6
:failed: 0
:ignored: 0
:stdout: []
:time: 0.002173025997763034

30
build/test/results/test_moving_snake.pass

@ -0,0 +1,30 @@
---
:source:
:path: test/Snake
:file: test_moving_snake.c
:successes:
- :test: test_moving_right
:line: 13
:message: ''
:unity_test_time: 0
- :test: test_moving_down
:line: 27
:message: ''
:unity_test_time: 0
- :test: test_moving_left
:line: 41
:message: ''
:unity_test_time: 0
- :test: test_moving_up
:line: 55
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 4
:passed: 4
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0014848970022285357

34
build/test/results/test_number_of_bombs.pass

@ -0,0 +1,34 @@
---
:source:
:path: test/Minesweeper
:file: test_number_of_bombs.c
:successes:
- :test: test_no_bombs_placed_around_tile
:line: 11
:message: ''
:unity_test_time: 0
- :test: test_searching_for_bombs_on_correct_tiles
:line: 24
:message: ''
:unity_test_time: 0
- :test: test_2_bombs_around_tile
:line: 41
:message: ''
:unity_test_time: 0
- :test: test_5_bombs_around_tile
:line: 58
:message: ''
:unity_test_time: 0
- :test: test_8_bombs_around_tile
:line: 76
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 5
:passed: 5
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0023246400014613755

26
build/test/results/test_part_of_snake.pass

@ -0,0 +1,26 @@
---
:source:
:path: test/Snake
:file: test_part_of_snake.c
:successes:
- :test: test_find_head
:line: 11
:message: ''
:unity_test_time: 0
- :test: test_get_correct_index
:line: 24
:message: ''
:unity_test_time: 0
- :test: test_snake_not_on_tile
:line: 37
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 3
:passed: 3
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0021876099999644794

2
build/test/results/test_template.pass

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

83
build/test/runners/test_bomb_in_array_runner.c

@ -0,0 +1,83 @@
/* 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_bomb_in_array(void);
extern void test_bomb_not_in_array(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_bomb_in_array.c");
run_test(test_bomb_in_array, "test_bomb_in_array", 11);
run_test(test_bomb_not_in_array, "test_bomb_not_in_array", 26);
return UnityEnd();
}

85
build/test/runners/test_collision_runner.c

@ -0,0 +1,85 @@
/* 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_self_collision(void);
extern void test_no_collision(void);
extern void test_wall_collision(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_collision.c");
run_test(test_self_collision, "test_self_collision", 12);
run_test(test_no_collision, "test_no_collision", 25);
run_test(test_wall_collision, "test_wall_collision", 38);
return UnityEnd();
}

91
build/test/runners/test_is_Valid_tile_runner.c

@ -0,0 +1,91 @@
/* 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_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);
/*=======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_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);
return UnityEnd();
}

87
build/test/runners/test_moving_snake_runner.c

@ -0,0 +1,87 @@
/* 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_moving_right(void);
extern void test_moving_down(void);
extern void test_moving_left(void);
extern void test_moving_up(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_moving_snake.c");
run_test(test_moving_right, "test_moving_right", 13);
run_test(test_moving_down, "test_moving_down", 27);
run_test(test_moving_left, "test_moving_left", 41);
run_test(test_moving_up, "test_moving_up", 55);
return UnityEnd();
}

89
build/test/runners/test_number_of_bombs_runner.c

@ -0,0 +1,89 @@
/* 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_no_bombs_placed_around_tile(void);
extern void test_searching_for_bombs_on_correct_tiles(void);
extern void test_2_bombs_around_tile(void);
extern void test_5_bombs_around_tile(void);
extern void test_8_bombs_around_tile(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_number_of_bombs.c");
run_test(test_no_bombs_placed_around_tile, "test_no_bombs_placed_around_tile", 11);
run_test(test_searching_for_bombs_on_correct_tiles, "test_searching_for_bombs_on_correct_tiles", 24);
run_test(test_2_bombs_around_tile, "test_2_bombs_around_tile", 41);
run_test(test_5_bombs_around_tile, "test_5_bombs_around_tile", 58);
run_test(test_8_bombs_around_tile, "test_8_bombs_around_tile", 76);
return UnityEnd();
}

85
build/test/runners/test_part_of_snake_runner.c

@ -0,0 +1,85 @@
/* 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_find_head(void);
extern void test_get_correct_index(void);
extern void test_snake_not_on_tile(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_part_of_snake.c");
run_test(test_find_head, "test_find_head", 11);
run_test(test_get_correct_index, "test_get_correct_index", 24);
run_test(test_snake_not_on_tile, "test_snake_not_on_tile", 37);
return UnityEnd();
}

85
build/test/runners/test_tictactoe_runner.c

@ -0,0 +1,85 @@
/* 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_if_not_identical(void);
extern void test_if_identical(void);
extern void test_checkLine_horizontalerGewinner(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_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();
}

44
test/Minesweeper/test_is_Valid_tile.c

@ -7,7 +7,7 @@ void setUp(void){}
void tearDown(void){}
void test_detect_not_valid_tile(void){
void test_detect_not_valid_tile_left(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
@ -21,6 +21,20 @@ void test_detect_not_valid_tile(void){
TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile
}
void test_detect_not_valid_tile_up(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = 0;
int direction = 3;
int result;
/* act */
result = is_Valid_tile(&board, tile, direction);
/* assert */
TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile
}
void test_detect_valid_tile_right(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
@ -49,4 +63,32 @@ void test_detect_valid_tile_down(void){
TEST_ASSERT_EQUAL_INT(0 + board.width, result);//not valid tile
}
void test_detect_not_valid_tile_right(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 5;
int result;
/* act */
result = is_Valid_tile(&board, tile, direction);
/* assert */
TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile
}
void test_detect_not_valid_tile_down(void){
/* arrange */
Minesweeper_Board board = initialize_minesweeper();
int tile = board.width * board.height - 1;
int direction = 4;
int result;
/* act */
result = is_Valid_tile(&board, tile, direction);
/* assert */
TEST_ASSERT_EQUAL_INT(-1, result);//not valid tile
}
#endif // TEST
Loading…
Cancel
Save