fdai7184
2 years ago
46 changed files with 484 additions and 99 deletions
-
2build/test/cache/defines_dependency.yml
-
33build/test/cache/test_Spiellogik.c
-
123build/test/cache/test_input.c
-
4build/test/dependencies/Spiellogik.d
-
1build/test/dependencies/input.d
-
2build/test/dependencies/test_Spiellogik.d
-
4build/test/dependencies/test_input.d
-
4build/test/dependencies/test_input_runner.d
-
BINbuild/test/out/c/Spiellogik.o
-
BINbuild/test/out/c/Umgebung.o
-
BINbuild/test/out/c/input.o
-
BINbuild/test/out/c/probe.o
-
BINbuild/test/out/c/test_Spiellogik.o
-
BINbuild/test/out/c/test_Spiellogik_runner.o
-
BINbuild/test/out/c/test_Umgebung.o
-
BINbuild/test/out/c/test_Umgebung_runner.o
-
BINbuild/test/out/c/test_input.o
-
BINbuild/test/out/c/test_input_runner.o
-
BINbuild/test/out/c/test_test.o
-
BINbuild/test/out/c/test_test_runner.o
-
BINbuild/test/out/test_Spiellogik.out
-
BINbuild/test/out/test_Umgebung.out
-
BINbuild/test/out/test_input.out
-
BINbuild/test/out/test_test.out
-
33build/test/preprocess/files/test_Spiellogik.c
-
123build/test/preprocess/files/test_input.c
-
1build/test/preprocess/includes/test_Spiellogik.c
-
3build/test/preprocess/includes/test_input.c
-
34build/test/results/test_Spiellogik.pass
-
2build/test/results/test_Umgebung.pass
-
42build/test/results/test_input.pass
-
2build/test/results/test_test.pass
-
32build/test/runners/test_Spiellogik_runner.c
-
93build/test/runners/test_input_runner.c
-
BINsrc/Main.o
-
19src/Move.c
-
BINsrc/Spiellogik
-
11src/Spiellogik.c
-
4src/Spiellogik.h
-
BINsrc/Spiellogik.o
-
2src/Umgebung.c
-
2src/Umgebung.h
-
BINsrc/Umgebung.o
-
BINsrc/input.o
-
BINsrc/probe.o
-
1test/test_Spiellogik.c
@ -0,0 +1,123 @@ |
|||
#include "src/input.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_testArrow(void){ |
|||
|
|||
|
|||
|
|||
char result = getTInput('\033'); |
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('ar')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(18), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testw(void){ |
|||
|
|||
char result = getTInput('w'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('w')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testa(void){ |
|||
|
|||
char result = getTInput('a'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('a')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_tests(void){ |
|||
|
|||
char result = getTInput('s'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('s')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testd(void){ |
|||
|
|||
char result = getTInput('d'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('d')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(38), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testq(void){ |
|||
|
|||
char result = getTInput('q'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('q')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testp(void){ |
|||
|
|||
char result = getTInput('p'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('p')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(48), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
@ -1 +1,3 @@ |
|||
build/test/out/c/Spiellogik.o: src/Spiellogik.c |
|||
build/test/out/c/Spiellogik.o: src/Spiellogik.c src/Umgebung.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 |
@ -0,0 +1 @@ |
|||
build/test/out/c/input.o: src/input.c |
@ -1,4 +1,4 @@ |
|||
build/test/out/c/test_Spiellogik.o: test/test_Spiellogik.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 \ |
|||
src/Spiellogik.h |
|||
src/Spiellogik.h src/Umgebung.h |
@ -0,0 +1,4 @@ |
|||
build/test/out/c/test_input.o: test/test_input.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 \ |
|||
src/input.h |
@ -0,0 +1,4 @@ |
|||
build/test/out/c/test_input_runner.o: \ |
|||
build/test/runners/test_input_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 |
@ -0,0 +1,123 @@ |
|||
#include "src/input.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_testArrow(void){ |
|||
|
|||
|
|||
|
|||
char result = getTInput('\033'); |
|||
|
|||
|
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('ar')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(18), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testw(void){ |
|||
|
|||
char result = getTInput('w'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('w')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testa(void){ |
|||
|
|||
char result = getTInput('a'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('a')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_tests(void){ |
|||
|
|||
char result = getTInput('s'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('s')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(33), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testd(void){ |
|||
|
|||
char result = getTInput('d'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('d')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(38), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testq(void){ |
|||
|
|||
char result = getTInput('q'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('q')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_testp(void){ |
|||
|
|||
char result = getTInput('p'); |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(('p')), (UNITY_INT)(UNITY_INT8 )((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(48), UNITY_DISPLAY_STYLE_CHAR); |
|||
|
|||
} |
@ -1,3 +1,4 @@ |
|||
--- |
|||
- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
- src/Spiellogik.h |
|||
- src/Umgebung.h |
@ -0,0 +1,3 @@ |
|||
--- |
|||
- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
- src/input.h |
@ -0,0 +1,42 @@ |
|||
--- |
|||
:source: |
|||
:path: test |
|||
:file: test_input.c |
|||
:successes: |
|||
- :test: test_testArrow |
|||
:line: 14 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_testw |
|||
:line: 21 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_testa |
|||
:line: 26 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_tests |
|||
:line: 31 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_testd |
|||
:line: 36 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_testq |
|||
:line: 41 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_testp |
|||
:line: 46 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
:failures: [] |
|||
:ignores: [] |
|||
:counts: |
|||
:total: 7 |
|||
:passed: 7 |
|||
:failed: 0 |
|||
:ignored: 0 |
|||
:stdout: [] |
|||
:time: 0.0016068740005721338 |
@ -0,0 +1,93 @@ |
|||
/* 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_testArrow(void); |
|||
extern void test_testw(void); |
|||
extern void test_testa(void); |
|||
extern void test_tests(void); |
|||
extern void test_testd(void); |
|||
extern void test_testq(void); |
|||
extern void test_testp(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_input.c"); |
|||
run_test(test_testArrow, "test_testArrow", 14); |
|||
run_test(test_testw, "test_testw", 21); |
|||
run_test(test_testa, "test_testa", 26); |
|||
run_test(test_tests, "test_tests", 31); |
|||
run_test(test_testd, "test_testd", 36); |
|||
run_test(test_testq, "test_testq", 41); |
|||
run_test(test_testp, "test_testp", 46); |
|||
|
|||
return UnityEnd(); |
|||
} |
@ -1,19 +0,0 @@ |
|||
#define _CRT_SECURE_NO_WARNINGS |
|||
#define re return |
|||
#define s 10 |
|||
#define up 'w' |
|||
#define down 's' |
|||
#define right 'd' |
|||
#define left 'a' |
|||
#include<stdio.h> |
|||
|
|||
enum directions |
|||
{ |
|||
up, down, left, right, |
|||
}; |
|||
|
|||
uint16_t curDirections = left; |
|||
|
|||
void move(void) { |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue