diff --git a/build/test/cache/defines_dependency.yml b/build/test/cache/defines_dependency.yml index b9300c1..e15f9ea 100644 --- a/build/test/cache/defines_dependency.yml +++ b/build/test/cache/defines_dependency.yml @@ -13,3 +13,5 @@ src/bmi.c: - TEST src/MatheSpiele.c: - TEST +src/temperatur.c: +- TEST diff --git a/build/test/cache/test_temperatur.c b/build/test/cache/test_temperatur.c new file mode 100644 index 0000000..e4db9e2 --- /dev/null +++ b/build/test/cache/test_temperatur.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)); + +} diff --git a/build/test/dependencies/temperatur.d b/build/test/dependencies/temperatur.d new file mode 100644 index 0000000..6296cfe --- /dev/null +++ b/build/test/dependencies/temperatur.d @@ -0,0 +1 @@ +build/test/out/c/temperatur.o: src/temperatur.c src/temperatur.h diff --git a/build/test/dependencies/test_temperatur.d b/build/test/dependencies/test_temperatur.d new file mode 100644 index 0000000..ec6ff76 --- /dev/null +++ b/build/test/dependencies/test_temperatur.d @@ -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 diff --git a/build/test/dependencies/test_temperatur_runner.d b/build/test/dependencies/test_temperatur_runner.d new file mode 100644 index 0000000..ada394d --- /dev/null +++ b/build/test/dependencies/test_temperatur_runner.d @@ -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 diff --git a/build/test/out/c/MatheSpiele.o b/build/test/out/c/MatheSpiele.o index fe5a11b..40376e6 100644 Binary files a/build/test/out/c/MatheSpiele.o and b/build/test/out/c/MatheSpiele.o differ diff --git a/build/test/out/c/temperatur.o b/build/test/out/c/temperatur.o new file mode 100644 index 0000000..faaf2ed Binary files /dev/null and b/build/test/out/c/temperatur.o differ diff --git a/build/test/out/c/test_WortSpiel.o b/build/test/out/c/test_WortSpiel.o index a88a13f..63da72a 100644 Binary files a/build/test/out/c/test_WortSpiel.o and b/build/test/out/c/test_WortSpiel.o differ diff --git a/build/test/out/c/test_temperatur.o b/build/test/out/c/test_temperatur.o new file mode 100644 index 0000000..5a1b4e8 Binary files /dev/null and b/build/test/out/c/test_temperatur.o differ diff --git a/build/test/out/c/test_temperatur_runner.o b/build/test/out/c/test_temperatur_runner.o new file mode 100644 index 0000000..e5862f0 Binary files /dev/null and b/build/test/out/c/test_temperatur_runner.o differ diff --git a/build/test/out/test_MatheSpiele.out b/build/test/out/test_MatheSpiele.out index 3fd5ca7..c7bcde6 100644 Binary files a/build/test/out/test_MatheSpiele.out and b/build/test/out/test_MatheSpiele.out differ diff --git a/build/test/out/test_WortSpiel.out b/build/test/out/test_WortSpiel.out index 46f9f99..b7b416a 100644 Binary files a/build/test/out/test_WortSpiel.out and b/build/test/out/test_WortSpiel.out differ diff --git a/build/test/out/test_temperatur.out b/build/test/out/test_temperatur.out new file mode 100644 index 0000000..7931f51 Binary files /dev/null and b/build/test/out/test_temperatur.out differ diff --git a/build/test/preprocess/files/test_temperatur.c b/build/test/preprocess/files/test_temperatur.c new file mode 100644 index 0000000..e4db9e2 --- /dev/null +++ b/build/test/preprocess/files/test_temperatur.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)); + +} diff --git a/build/test/preprocess/includes/test_temperatur.c b/build/test/preprocess/includes/test_temperatur.c new file mode 100644 index 0000000..ab152af --- /dev/null +++ b/build/test/preprocess/includes/test_temperatur.c @@ -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 diff --git a/build/test/results/test_MatheSpiele.pass b/build/test/results/test_MatheSpiele.pass index db2b772..e8498af 100644 --- a/build/test/results/test_MatheSpiele.pass +++ b/build/test/results/test_MatheSpiele.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.853215300001466 +:time: 0.8709238999999798 diff --git a/build/test/results/test_SchereSteinPapier.pass b/build/test/results/test_SchereSteinPapier.pass index 08d9c8b..8f0073c 100644 --- a/build/test/results/test_SchereSteinPapier.pass +++ b/build/test/results/test_SchereSteinPapier.pass @@ -19,4 +19,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.06440469999870402 +:time: 0.31249270000012075 diff --git a/build/test/results/test_WortSpiel.pass b/build/test/results/test_WortSpiel.pass index 79e484b..b76c2c8 100644 --- a/build/test/results/test_WortSpiel.pass +++ b/build/test/results/test_WortSpiel.pass @@ -59,4 +59,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.056614699999045115 +:time: 0.32561580000015056 diff --git a/build/test/results/test_ageinseconds.pass b/build/test/results/test_ageinseconds.pass index d991ac1..c52b27a 100644 --- a/build/test/results/test_ageinseconds.pass +++ b/build/test/results/test_ageinseconds.pass @@ -23,4 +23,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.05363690000012866 +:time: 0.32248630000003686 diff --git a/build/test/results/test_bmi.pass b/build/test/results/test_bmi.pass index de1fa1f..f7988eb 100644 --- a/build/test/results/test_bmi.pass +++ b/build/test/results/test_bmi.pass @@ -19,4 +19,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.05756960000144318 +:time: 0.3210225000000264 diff --git a/build/test/results/test_minirechner.pass b/build/test/results/test_minirechner.pass index c338050..359d8ce 100644 --- a/build/test/results/test_minirechner.pass +++ b/build/test/results/test_minirechner.pass @@ -83,4 +83,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.05367609999666456 +:time: 0.3090987000000496 diff --git a/build/test/results/test_temperatur.pass b/build/test/results/test_temperatur.pass new file mode 100644 index 0000000..9b5a9b5 --- /dev/null +++ b/build/test/results/test_temperatur.pass @@ -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 diff --git a/build/test/results/test_zahlenraten.pass b/build/test/results/test_zahlenraten.pass index 593b6bc..89e6e51 100644 --- a/build/test/results/test_zahlenraten.pass +++ b/build/test/results/test_zahlenraten.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0543950000028417 +:time: 0.31821020000006683 diff --git a/build/test/runners/test_temperatur_runner.c b/build/test/runners/test_temperatur_runner.c new file mode 100644 index 0000000..d3be2c0 --- /dev/null +++ b/build/test/runners/test_temperatur_runner.c @@ -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(); +}