Browse Source

Unittest: getFirstUnit

remotes/origin/temperaturdev
Kevin Ludwig 1 year ago
parent
commit
b3b97bb783
  1. 1
      src/temperatur.h
  2. 6
      test/test_temperatur.c

1
src/temperatur.h

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

6
test/test_temperatur.c

@ -53,4 +53,10 @@ float expected = 77;
TEST_ASSERT_EQUAL(expected, result); TEST_ASSERT_EQUAL(expected, result);
} }
void test_returnUnit_first(void)
{
const char *result = getFirstUnit(1);
char expected[] = "Celsius";
TEST_ASSERT_EQUAL_STRING(expected, result);
}
#endif #endif
Loading…
Cancel
Save