Lennart Goetze
11 months ago
24 changed files with 488 additions and 7 deletions
-
2build/test/cache/defines_dependency.yml
-
163build/test/cache/test_temperatur.c
-
1build/test/dependencies/temperatur.d
-
4build/test/dependencies/test_temperatur.d
-
4build/test/dependencies/test_temperatur_runner.d
-
BINbuild/test/out/c/MatheSpiele.o
-
BINbuild/test/out/c/temperatur.o
-
BINbuild/test/out/c/test_WortSpiel.o
-
BINbuild/test/out/c/test_temperatur.o
-
BINbuild/test/out/c/test_temperatur_runner.o
-
BINbuild/test/out/test_MatheSpiele.out
-
BINbuild/test/out/test_WortSpiel.out
-
BINbuild/test/out/test_temperatur.out
-
163build/test/preprocess/files/test_temperatur.c
-
3build/test/preprocess/includes/test_temperatur.c
-
2build/test/results/test_MatheSpiele.pass
-
2build/test/results/test_SchereSteinPapier.pass
-
2build/test/results/test_WortSpiel.pass
-
2build/test/results/test_ageinseconds.pass
-
2build/test/results/test_bmi.pass
-
2build/test/results/test_minirechner.pass
-
46build/test/results/test_temperatur.pass
-
2build/test/results/test_zahlenraten.pass
-
95build/test/runners/test_temperatur_runner.c
@ -0,0 +1,163 @@ |
|||
#include "src/temperatur.h" |
|||
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void setUp(void) |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void tearDown(void) |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_CzuF(void) |
|||
|
|||
{ |
|||
|
|||
float result = CzuF(25); |
|||
|
|||
float expected = 77; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_CzuK(void) |
|||
|
|||
{ |
|||
|
|||
float result = CzuK(25); |
|||
|
|||
float expected = 298.15; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(26), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_FzuC(void) |
|||
|
|||
{ |
|||
|
|||
float result = FzuC(77); |
|||
|
|||
float expected = 25; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(34), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
void test_temperaturRechner_FzuK(void) |
|||
|
|||
{ |
|||
|
|||
float result = FzuK(77); |
|||
|
|||
float expected = 298.15; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(40), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_KzuC(void) |
|||
|
|||
{ |
|||
|
|||
float result = KzuC(298.15); |
|||
|
|||
float expected = 25; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(47), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
void test_temperaturRechner_KzuF(void) |
|||
|
|||
{ |
|||
|
|||
float result = KzuF(298.15); |
|||
|
|||
float expected = 77; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(53), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_returnUnit_first(void) |
|||
|
|||
{ |
|||
|
|||
const char *result = getFirstUnit(1); |
|||
|
|||
char expected[] = "Celsius"; |
|||
|
|||
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(60)); |
|||
|
|||
} |
|||
|
|||
void test_returnUnit_second(void) |
|||
|
|||
{ |
|||
|
|||
const char *result = getSecondUnit(2); |
|||
|
|||
char expected[] = " Kelvin"; |
|||
|
|||
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(66)); |
|||
|
|||
} |
@ -0,0 +1 @@ |
|||
build/test/out/c/temperatur.o: src/temperatur.c src/temperatur.h |
@ -0,0 +1,4 @@ |
|||
build/test/out/c/test_temperatur.o: test/test_temperatur.c \ |
|||
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ |
|||
src/temperatur.h |
@ -0,0 +1,4 @@ |
|||
build/test/out/c/test_temperatur_runner.o: \ |
|||
build/test/runners/test_temperatur_runner.c \ |
|||
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ |
|||
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h |
@ -0,0 +1,163 @@ |
|||
#include "src/temperatur.h" |
|||
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void setUp(void) |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void tearDown(void) |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_CzuF(void) |
|||
|
|||
{ |
|||
|
|||
float result = CzuF(25); |
|||
|
|||
float expected = 77; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_CzuK(void) |
|||
|
|||
{ |
|||
|
|||
float result = CzuK(25); |
|||
|
|||
float expected = 298.15; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(26), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_FzuC(void) |
|||
|
|||
{ |
|||
|
|||
float result = FzuC(77); |
|||
|
|||
float expected = 25; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(34), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
void test_temperaturRechner_FzuK(void) |
|||
|
|||
{ |
|||
|
|||
float result = FzuK(77); |
|||
|
|||
float expected = 298.15; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(40), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_temperaturRechner_KzuC(void) |
|||
|
|||
{ |
|||
|
|||
float result = KzuC(298.15); |
|||
|
|||
float expected = 25; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(47), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
void test_temperaturRechner_KzuF(void) |
|||
|
|||
{ |
|||
|
|||
float result = KzuF(298.15); |
|||
|
|||
float expected = 77; |
|||
|
|||
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(53), UNITY_DISPLAY_STYLE_INT); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void test_returnUnit_first(void) |
|||
|
|||
{ |
|||
|
|||
const char *result = getFirstUnit(1); |
|||
|
|||
char expected[] = "Celsius"; |
|||
|
|||
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(60)); |
|||
|
|||
} |
|||
|
|||
void test_returnUnit_second(void) |
|||
|
|||
{ |
|||
|
|||
const char *result = getSecondUnit(2); |
|||
|
|||
char expected[] = " Kelvin"; |
|||
|
|||
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), ( |
|||
|
|||
((void *)0) |
|||
|
|||
), (UNITY_UINT)(66)); |
|||
|
|||
} |
@ -0,0 +1,3 @@ |
|||
--- |
|||
- C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h |
|||
- src/temperatur.h |
@ -0,0 +1,46 @@ |
|||
--- |
|||
:source: |
|||
:path: test |
|||
:file: test_temperatur.c |
|||
:successes: |
|||
- :test: test_temperaturRechner_CzuF |
|||
:line: 15 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_temperaturRechner_CzuK |
|||
:line: 22 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_temperaturRechner_FzuC |
|||
:line: 30 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_temperaturRechner_FzuK |
|||
:line: 36 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_temperaturRechner_KzuC |
|||
:line: 43 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_temperaturRechner_KzuF |
|||
:line: 49 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_returnUnit_first |
|||
:line: 56 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
- :test: test_returnUnit_second |
|||
:line: 62 |
|||
:message: '' |
|||
:unity_test_time: 0 |
|||
:failures: [] |
|||
:ignores: [] |
|||
:counts: |
|||
:total: 8 |
|||
:passed: 8 |
|||
:failed: 0 |
|||
:ignored: 0 |
|||
:stdout: [] |
|||
:time: 0.32527379999987716 |
@ -0,0 +1,95 @@ |
|||
/* 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_temperaturRechner_CzuF(void); |
|||
extern void test_temperaturRechner_CzuK(void); |
|||
extern void test_temperaturRechner_FzuC(void); |
|||
extern void test_temperaturRechner_FzuK(void); |
|||
extern void test_temperaturRechner_KzuC(void); |
|||
extern void test_temperaturRechner_KzuF(void); |
|||
extern void test_returnUnit_first(void); |
|||
extern void test_returnUnit_second(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_temperatur.c"); |
|||
run_test(test_temperaturRechner_CzuF, "test_temperaturRechner_CzuF", 15); |
|||
run_test(test_temperaturRechner_CzuK, "test_temperaturRechner_CzuK", 22); |
|||
run_test(test_temperaturRechner_FzuC, "test_temperaturRechner_FzuC", 30); |
|||
run_test(test_temperaturRechner_FzuK, "test_temperaturRechner_FzuK", 36); |
|||
run_test(test_temperaturRechner_KzuC, "test_temperaturRechner_KzuC", 43); |
|||
run_test(test_temperaturRechner_KzuF, "test_temperaturRechner_KzuF", 49); |
|||
run_test(test_returnUnit_first, "test_returnUnit_first", 56); |
|||
run_test(test_returnUnit_second, "test_returnUnit_second", 62); |
|||
|
|||
return UnityEnd(); |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue