Ulriche Nguefack
11 months ago
218 changed files with 11 additions and 5851 deletions
-
BINbuild/artifacts/release/project.out
-
276build/release/cache/input.yml
-
1build/release/dependencies/Hallo_Welt.d
-
1build/release/dependencies/add_student.d
-
1build/release/dependencies/add_subject.d
-
0build/release/dependencies/force_build
-
1build/release/dependencies/game100.d
-
1build/release/dependencies/get_character.d
-
3build/release/dependencies/main.d
-
3build/release/dependencies/minesweeper_start.d
-
1build/release/dependencies/modify_student.d
-
1build/release/dependencies/modify_subject.d
-
1build/release/dependencies/pong.d
-
1build/release/dependencies/show_statistics.d
-
2build/release/dependencies/snake_start.d
-
5build/release/dependencies/testRunnerGenerator.d
-
3build/release/dependencies/testRunnerGeneratorSmall.d
-
5build/release/dependencies/testRunnerGeneratorWithMocks.d
-
5build/release/dependencies/testsample_cmd.d
-
1build/release/dependencies/tictactoe.d
-
1build/release/dependencies/top.d
-
BINbuild/release/out/c/Hallo_Welt.o
-
BINbuild/release/out/c/add_student.o
-
BINbuild/release/out/c/add_subject.o
-
BINbuild/release/out/c/game100.o
-
BINbuild/release/out/c/get_character.o
-
BINbuild/release/out/c/main.o
-
BINbuild/release/out/c/minesweeper_start.o
-
BINbuild/release/out/c/modify_student.o
-
BINbuild/release/out/c/modify_subject.o
-
BINbuild/release/out/c/pong.o
-
BINbuild/release/out/c/show_statistics.o
-
BINbuild/release/out/c/snake_start.o
-
BINbuild/release/out/c/testRunnerGenerator.o
-
BINbuild/release/out/c/testRunnerGeneratorSmall.o
-
BINbuild/release/out/c/testRunnerGeneratorWithMocks.o
-
BINbuild/release/out/c/testsample_cmd.o
-
BINbuild/release/out/c/tictactoe.o
-
BINbuild/release/out/c/top.o
-
14build/test/cache/defines_dependency.yml
-
79build/test/cache/test_add.c
-
79build/test/cache/test_bomb_in_array.c
-
143build/test/cache/test_checkCollision.c
-
69build/test/cache/test_checkGameEnd.c
-
73build/test/cache/test_clearScreen.c
-
102build/test/cache/test_collision.c
-
269build/test/cache/test_is_Valid_tile.c
-
142build/test/cache/test_moving_snake.c
-
205build/test/cache/test_number_of_bombs.c
-
102build/test/cache/test_part_of_snake.c
-
83build/test/cache/test_playerInputMovement.c
-
51build/test/cache/test_pong.c
-
73build/test/cache/test_template.c
-
0build/test/cache/test_tictactoe.c
-
10build/test/dependencies/cmock.d
-
0build/test/dependencies/force_build
-
1build/test/dependencies/game100.d
-
1build/test/dependencies/get_character.d
-
3build/test/dependencies/minesweeper_start.d
-
1build/test/dependencies/pong.d
-
2build/test/dependencies/snake_start.d
-
4build/test/dependencies/test_add.d
-
3build/test/dependencies/test_add_runner.d
-
5build/test/dependencies/test_bomb_in_array.d
-
4build/test/dependencies/test_bomb_in_array_runner.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
-
4build/test/dependencies/test_collision.d
-
4build/test/dependencies/test_collision_runner.d
-
5build/test/dependencies/test_is_Valid_tile.d
-
4build/test/dependencies/test_is_Valid_tile_runner.d
-
5build/test/dependencies/test_moving_snake.d
-
4build/test/dependencies/test_moving_snake_runner.d
-
5build/test/dependencies/test_number_of_bombs.d
-
4build/test/dependencies/test_number_of_bombs_runner.d
-
5build/test/dependencies/test_part_of_snake.d
-
4build/test/dependencies/test_part_of_snake_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
-
4build/test/dependencies/test_template.d
-
4build/test/dependencies/test_template_runner.d
-
1build/test/dependencies/test_tictactoe.d
-
4build/test/dependencies/test_tictactoe_runner.d
-
6build/test/dependencies/unity.d
-
BINbuild/test/out/c/cmock.o
-
BINbuild/test/out/c/game100.o
-
BINbuild/test/out/c/get_character.o
-
BINbuild/test/out/c/minesweeper_start.o
-
BINbuild/test/out/c/pong.o
-
BINbuild/test/out/c/snake_start.o
-
BINbuild/test/out/c/test_add.o
-
BINbuild/test/out/c/test_add_runner.o
-
BINbuild/test/out/c/test_bomb_in_array.o
-
BINbuild/test/out/c/test_bomb_in_array_runner.o
@ -1,276 +0,0 @@ |
|||
--- |
|||
:project: |
|||
:use_exceptions: false |
|||
:use_mocks: true |
|||
:compile_threads: 1 |
|||
:test_threads: 1 |
|||
:use_test_preprocessor: true |
|||
:use_preprocessor_directives: false |
|||
:use_deep_dependencies: false |
|||
:generate_deep_dependencies: true |
|||
:auto_link_deep_dependencies: false |
|||
:test_file_prefix: test_ |
|||
:options_paths: [] |
|||
:release_build: true |
|||
:use_auxiliary_dependencies: true |
|||
:build_root: build |
|||
:which_ceedling: gem |
|||
:ceedling_version: 0.31.1 |
|||
:default_tasks: |
|||
- test:all |
|||
:release_build: |
|||
:use_assembly: false |
|||
:artifacts: [] |
|||
:paths: |
|||
:test: |
|||
- "+:test/**" |
|||
- "-:test/support" |
|||
:source: |
|||
- src/** |
|||
:support: |
|||
- test/support |
|||
:include: [] |
|||
:libraries: [] |
|||
:test_toolchain_include: [] |
|||
:release_toolchain_include: [] |
|||
:files: |
|||
:test: [] |
|||
:source: [] |
|||
:assembly: [] |
|||
:support: [] |
|||
:include: [] |
|||
:environment: |
|||
- :rake_columns: '120' |
|||
:defines: |
|||
:test: |
|||
- &1 [] |
|||
- TEST |
|||
:test_preprocess: |
|||
- *1 |
|||
- TEST |
|||
:release: [] |
|||
:release_preprocess: [] |
|||
:use_test_definition: false |
|||
:common: [] |
|||
:libraries: |
|||
:flag: "-l${1}" |
|||
:path_flag: "-L ${1}" |
|||
:test: [] |
|||
:test_preprocess: [] |
|||
:release: [] |
|||
:release_preprocess: [] |
|||
:placement: :end |
|||
:system: [] |
|||
:flags: {} |
|||
:extension: |
|||
:header: ".h" |
|||
:source: ".c" |
|||
:assembly: ".s" |
|||
:object: ".o" |
|||
:libraries: |
|||
- ".a" |
|||
- ".so" |
|||
:executable: ".out" |
|||
:map: ".map" |
|||
:list: ".lst" |
|||
:testpass: ".pass" |
|||
:testfail: ".fail" |
|||
:dependencies: ".d" |
|||
:unity: |
|||
:vendor_path: "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor" |
|||
:defines: [] |
|||
:cmock: |
|||
:vendor_path: "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor" |
|||
:defines: [] |
|||
:includes: [] |
|||
:mock_prefix: mock_ |
|||
:when_no_prototypes: :warn |
|||
:enforce_strict_ordering: true |
|||
:plugins: |
|||
- :ignore |
|||
- :callback |
|||
:treat_as: |
|||
uint8: HEX8 |
|||
uint16: HEX16 |
|||
uint32: UINT32 |
|||
int8: INT8 |
|||
bool: UINT8 |
|||
:mock_path: build/test/mocks |
|||
:verbosity: 3 |
|||
:unity_helper: false |
|||
:cexception: |
|||
:vendor_path: "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor" |
|||
:defines: [] |
|||
:test_runner: |
|||
:includes: [] |
|||
:file_suffix: _runner |
|||
:tools: |
|||
:test_compiler: |
|||
:executable: gcc |
|||
:name: default_test_compiler |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR |
|||
- -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE |
|||
- "-D$": COLLECTION_DEFINES_TEST_AND_VENDOR |
|||
- "-DGNU_COMPILER" |
|||
- "-g" |
|||
- '' |
|||
- -c "${1}" |
|||
- -o "${2}" |
|||
- "-MMD" |
|||
- -MF "${4}" |
|||
:test_fixture: |
|||
:executable: "${1}" |
|||
:name: default_test_fixture |
|||
:stderr_redirect: :auto |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: [] |
|||
:test_linker: |
|||
:executable: gcc |
|||
:name: default_test_linker |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- '' |
|||
- '"${1}"' |
|||
- "${5}" |
|||
- -o "${2}" |
|||
- '' |
|||
- "${4}" |
|||
- '' |
|||
:test_file_preprocessor: |
|||
:executable: gcc |
|||
:name: default_test_file_preprocessor |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- "-E" |
|||
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR |
|||
- -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE |
|||
- "-D$": COLLECTION_DEFINES_TEST_AND_VENDOR |
|||
- "-D$": DEFINES_TEST_PREPROCESS |
|||
- "-DGNU_COMPILER" |
|||
- '"${1}"' |
|||
- -o "${2}" |
|||
:test_file_preprocessor_directives: |
|||
:executable: gcc |
|||
:name: default_test_file_preprocessor_directives |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- "-E" |
|||
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR |
|||
- -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE |
|||
- "-D$": COLLECTION_DEFINES_TEST_AND_VENDOR |
|||
- "-D$": DEFINES_TEST_PREPROCESS |
|||
- "-DGNU_COMPILER" |
|||
- "-fdirectives-only" |
|||
- '"${1}"' |
|||
- -o "${2}" |
|||
:test_includes_preprocessor: |
|||
:executable: gcc |
|||
:name: default_test_includes_preprocessor |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- "-E" |
|||
- "-MM" |
|||
- "-MG" |
|||
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR |
|||
- -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE |
|||
- "-D$": COLLECTION_DEFINES_TEST_AND_VENDOR |
|||
- "-D$": DEFINES_TEST_PREPROCESS |
|||
- "-DGNU_COMPILER" |
|||
- '"${1}"' |
|||
:release_compiler: |
|||
:executable: gcc |
|||
:name: default_release_compiler |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- -I"$": COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR |
|||
- -I"$": COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE |
|||
- "-D$": COLLECTION_DEFINES_RELEASE_AND_VENDOR |
|||
- "-DGNU_COMPILER" |
|||
- '' |
|||
- -c "${1}" |
|||
- -o "${2}" |
|||
- "-MMD" |
|||
- -MF "${4}" |
|||
:release_linker: |
|||
:executable: gcc |
|||
:name: default_release_linker |
|||
:stderr_redirect: :none |
|||
:background_exec: :none |
|||
:optional: false |
|||
:arguments: |
|||
- '' |
|||
- '' |
|||
- '' |
|||
- '"${1}"' |
|||
- "${5}" |
|||
- -o "${2}" |
|||
- '' |
|||
- "${4}" |
|||
- '' |
|||
:test_compiler: |
|||
:arguments: [] |
|||
:test_linker: |
|||
:arguments: [] |
|||
:test_fixture: |
|||
:arguments: [] |
|||
:link_objects: [] |
|||
:test_includes_preprocessor: |
|||
:arguments: [] |
|||
:test_file_preprocessor: |
|||
:arguments: [] |
|||
:test_file_preprocessor_directives: |
|||
:arguments: [] |
|||
:test_dependencies_generator: |
|||
:arguments: [] |
|||
:release_compiler: |
|||
:arguments: [] |
|||
:release_linker: |
|||
:arguments: [] |
|||
:release_assembler: |
|||
:arguments: [] |
|||
:release_dependencies_generator: |
|||
:arguments: [] |
|||
:plugins: |
|||
:load_paths: |
|||
- "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/lib/../plugins" |
|||
:enabled: |
|||
- stdout_pretty_tests_report |
|||
- module_generator |
|||
:display_raw_test_results: false |
|||
:stdout_pretty_tests_report_path: "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/lib/../plugins/stdout_pretty_tests_report" |
|||
:module_generator_path: "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/lib/../plugins/module_generator" |
|||
:gcov: |
|||
:reports: |
|||
- HtmlDetailed |
|||
:gcovr: |
|||
:html_medium_threshold: 75 |
|||
:html_high_threshold: 90 |
|||
:module_generator: |
|||
:project_root: "./" |
|||
:source_root: src/ |
|||
:test_root: test/ |
@ -1 +0,0 @@ |
|||
build/release/out/c/Hallo_Welt.o: src/Hallo_Welt.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/add_student.o: src/main/c/add_student.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/add_subject.o: src/main/c/add_subject.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/game100.o: src/main/c/Template/game100.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/get_character.o: src/main/c/Snake/get_character.c |
@ -1,3 +0,0 @@ |
|||
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/Pong/pong.h |
@ -1,3 +0,0 @@ |
|||
build/release/out/c/minesweeper_start.o: \ |
|||
src/main/c/Minesweeper/minesweeper_start.c \ |
|||
src/main/c/Minesweeper/minesweeper_start.h |
@ -1 +0,0 @@ |
|||
build/release/out/c/modify_student.o: src/main/c/modify_student.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/modify_subject.o: src/main/c/modify_subject.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/pong.o: src/main/c/Pong/pong.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/show_statistics.o: src/main/c/show_statistics.c |
@ -1,2 +0,0 @@ |
|||
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,5 +0,0 @@ |
|||
build/release/out/c/testRunnerGenerator.o: \ |
|||
src/Unity/test/testdata/testRunnerGenerator.c \ |
|||
src/Unity/test/testdata/../../src/unity.h \ |
|||
src/Unity/test/testdata/../../src/unity_internals.h \ |
|||
src/Unity/test/testdata/Defs.h |
@ -1,3 +0,0 @@ |
|||
build/release/out/c/testRunnerGeneratorSmall.o: \ |
|||
src/Unity/test/testdata/testRunnerGeneratorSmall.c src/Unity/src/unity.h \ |
|||
src/Unity/src/unity_internals.h src/Unity/test/testdata/Defs.h |
@ -1,5 +0,0 @@ |
|||
build/release/out/c/testRunnerGeneratorWithMocks.o: \ |
|||
src/Unity/test/testdata/testRunnerGeneratorWithMocks.c \ |
|||
src/Unity/test/testdata/../../src/unity.h \ |
|||
src/Unity/test/testdata/../../src/unity_internals.h \ |
|||
src/Unity/test/testdata/Defs.h src/Unity/test/testdata/mockMock.h |
@ -1,5 +0,0 @@ |
|||
build/release/out/c/testsample_cmd.o: \ |
|||
src/Unity/test/expectdata/testsample_cmd.c \ |
|||
src/Unity/test/expectdata/../../src/unity.h \ |
|||
src/Unity/test/expectdata/../../src/unity_internals.h \ |
|||
src/Unity/test/testdata/CException.h |
@ -1 +0,0 @@ |
|||
build/release/out/c/tictactoe.o: src/main/c/GameTic_Tac_Toe/tictactoe.c |
@ -1 +0,0 @@ |
|||
build/release/out/c/top.o: src/main/c/Quiz/top.c |
@ -1,17 +1,3 @@ |
|||
--- |
|||
src/main/c/Template/game100.c: |
|||
- TEST |
|||
<<<<<<< HEAD |
|||
src/main/c/Calculator/calculator.c: |
|||
======= |
|||
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 |
|||
src/main/c/Pong/pong.c: |
|||
>>>>>>> 2acead7a056f156a3c7129d740f7d5585fbc805f |
|||
- TEST |
@ -1,79 +0,0 @@ |
|||
#include "build/temp/../../src/main/c/Calculator/calculator.h" |
|||
#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void setUp(void){ |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
void tearDown(void){ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void test_pow_N_N(void){ |
|||
|
|||
|
|||
|
|||
double result; |
|||
|
|||
double b = 3; |
|||
|
|||
double a = 3; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = pow(a, b); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((27)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_pow_Z_N(void){ |
|||
|
|||
|
|||
|
|||
double result; |
|||
|
|||
double b = 3; |
|||
|
|||
double a = -3; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = pow(a, b); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((-27)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(36), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
@ -1,79 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,143 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,69 +0,0 @@ |
|||
#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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -1,73 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -1,102 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,269 +0,0 @@ |
|||
#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 = 2; |
|||
|
|||
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_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)(49), 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)(63), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_detect_valid_tile_left(void){ |
|||
|
|||
|
|||
|
|||
Minesweeper_Board board = initialize_minesweeper(); |
|||
|
|||
int tile = board.width * board.height - 1; |
|||
|
|||
int direction = 2; |
|||
|
|||
int result; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = is_Valid_tile(&board, tile, direction); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((board.width * board.height - 2)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(77), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_detect_valid_tile_up(void){ |
|||
|
|||
|
|||
|
|||
Minesweeper_Board board = initialize_minesweeper(); |
|||
|
|||
int tile = board.width * board.height - 1; |
|||
|
|||
int direction = 3; |
|||
|
|||
int result; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = is_Valid_tile(&board, tile, direction); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
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); |
|||
|
|||
} |
@ -1,142 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,205 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,102 +0,0 @@ |
|||
#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); |
|||
|
|||
} |
@ -1,83 +0,0 @@ |
|||
#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); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -1,51 +0,0 @@ |
|||
#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,73 +0,0 @@ |
|||
#include "src/main/c/Template/game100.h" |
|||
#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void setUp(void){ |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
void tearDown(void){ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void test_input_all_5(void){ |
|||
|
|||
|
|||
|
|||
int result; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = some_function(5, 5); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((6)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(21), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void test_ignore_rest_from_division(void){ |
|||
|
|||
|
|||
|
|||
int result; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
result = some_function(5, 6); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((5)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
@ -1,6 +1,6 @@ |
|||
build/test/out/c/cmock.o: \ |
|||
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.c \ |
|||
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.h \ |
|||
/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock_internals.h \ |
|||
/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 |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.c \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock_internals.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h |
@ -1 +0,0 @@ |
|||
build/test/out/c/game100.o: src/main/c/Template/game100.c |
@ -1 +0,0 @@ |
|||
build/test/out/c/get_character.o: src/main/c/Snake/get_character.c |
@ -1,3 +0,0 @@ |
|||
build/test/out/c/minesweeper_start.o: \ |
|||
src/main/c/Minesweeper/minesweeper_start.c \ |
|||
src/main/c/Minesweeper/minesweeper_start.h |
@ -1 +0,0 @@ |
|||
build/test/out/c/pong.o: src/main/c/Pong/pong.c |
@ -1,2 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
build/test/out/c/test_add.o: test/Calculator/test_add.c \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ |
|||
test/Calculator/../../src/main/c/Calculator/calculator.h |
@ -1,3 +0,0 @@ |
|||
build/test/out/c/test_add_runner.o: build/test/runners/test_add_runner.c \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,5 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,4 +0,0 @@ |
|||
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 +0,0 @@ |
|||
build/test/out/c/test_template.o: test/test_template.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/Template/game100.h |
@ -1,4 +0,0 @@ |
|||
build/test/out/c/test_template_runner.o: \ |
|||
build/test/runners/test_template_runner.c \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h |
@ -1 +0,0 @@ |
|||
build/test/out/c/test_tictactoe.o: test/test_tictactoe.c |
@ -1,4 +0,0 @@ |
|||
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 |
@ -1,2 +1,4 @@ |
|||
build/test/out/c/unity.o: src/Unity/src/unity.c src/Unity/src/unity.h \ |
|||
src/Unity/src/unity_internals.h |
|||
build/test/out/c/unity.o: \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.c \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue