Browse Source

Unittest FzuK

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

2
src/temperatur.c

@ -15,7 +15,7 @@ float FzuK(float tempF){
return (tempF - 32) * 5/9 + 273.15; return (tempF - 32) * 5/9 + 273.15;
} }
int main(){
int run_TemperaturRechner(){
float var1, var2; float var1, var2;
int var3; int var3;

2
src/temperatur.h

@ -3,6 +3,8 @@
float CzuF(float tempC); float CzuF(float tempC);
float CzuK(float tempC); float CzuK(float tempC);
float FzuC(float tempF); float FzuC(float tempF);
float FzuK(float tempF);
#endif //TEMPERATUR_H #endif //TEMPERATUR_H

6
test/test_temperatur.c

@ -33,4 +33,10 @@ float result = FzuC(77);
float expected = 25; float expected = 25;
TEST_ASSERT_EQUAL(expected, result); TEST_ASSERT_EQUAL(expected, result);
} }
void test_temperaturRechner_FzuK(void)
{
float result = FzuK(77);
float expected = 298.15;
TEST_ASSERT_EQUAL(expected, result);
}
#endif #endif
Loading…
Cancel
Save