From d1809e68b7c5fa2cb80f552c16ca472f9b8f15ad Mon Sep 17 00:00:00 2001 From: Kevin Ludwig Date: Wed, 7 Feb 2024 21:09:23 +0100 Subject: [PATCH] Unittest FzuK --- src/temperatur.c | 2 +- src/temperatur.h | 2 ++ test/test_temperatur.c | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/temperatur.c b/src/temperatur.c index 33b5e1d..1fbeaf0 100644 --- a/src/temperatur.c +++ b/src/temperatur.c @@ -15,7 +15,7 @@ float FzuK(float tempF){ return (tempF - 32) * 5/9 + 273.15; } -int main(){ +int run_TemperaturRechner(){ float var1, var2; int var3; diff --git a/src/temperatur.h b/src/temperatur.h index 226e114..1409e5d 100644 --- a/src/temperatur.h +++ b/src/temperatur.h @@ -3,6 +3,8 @@ float CzuF(float tempC); float CzuK(float tempC); + float FzuC(float tempF); +float FzuK(float tempF); #endif //TEMPERATUR_H diff --git a/test/test_temperatur.c b/test/test_temperatur.c index 9751fc2..f237aaf 100644 --- a/test/test_temperatur.c +++ b/test/test_temperatur.c @@ -33,4 +33,10 @@ float result = FzuC(77); float expected = 25; TEST_ASSERT_EQUAL(expected, result); } +void test_temperaturRechner_FzuK(void) +{ +float result = FzuK(77); +float expected = 298.15; +TEST_ASSERT_EQUAL(expected, result); +} #endif