Browse Source

Unittest: getSecondUnit

remotes/origin/temperaturdev
Kevin Ludwig 11 months ago
parent
commit
2876af69eb
  1. 1
      src/temperatur.h
  2. 6
      test/test_temperatur.c

1
src/temperatur.h

@ -11,4 +11,5 @@ float KzuC(float tempK);
float KzuF(float tempK); float KzuF(float tempK);
const char* getFirstUnit(int input); const char* getFirstUnit(int input);
const char* getSecondUnit(int input);
#endif //TEMPERATUR_H #endif //TEMPERATUR_H

6
test/test_temperatur.c

@ -59,4 +59,10 @@ const char *result = getFirstUnit(1);
char expected[] = "Celsius"; char expected[] = "Celsius";
TEST_ASSERT_EQUAL_STRING(expected, result); TEST_ASSERT_EQUAL_STRING(expected, result);
} }
void test_returnUnit_second(void)
{
const char *result = getSecondUnit(2);
char expected[] = " Kelvin";
TEST_ASSERT_EQUAL_STRING(expected, result);
}
#endif #endif
Loading…
Cancel
Save