|
@ -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)); |
|
|
|
|
|
|
|
|
|
|
|
} |