From 6431014c7d6b328b406324e43fc8688a6d5d5628 Mon Sep 17 00:00:00 2001 From: Kevin Ludwig Date: Wed, 7 Feb 2024 18:52:50 +0100 Subject: [PATCH] Unittest: retResult --- src/bmi.c | 2 +- src/bmi.h | 1 + test/test_bmi.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bmi.c b/src/bmi.c index f363258..b915b22 100644 --- a/src/bmi.c +++ b/src/bmi.c @@ -25,7 +25,7 @@ const char* retResult(float points){ return "Starkes Uebergewicht"; } -int main() +int run_bmi() { float var1 = 0; float var2 = 0; diff --git a/src/bmi.h b/src/bmi.h index b1a92c8..ac463e0 100644 --- a/src/bmi.h +++ b/src/bmi.h @@ -2,5 +2,6 @@ #define BMI_H float calcBMI(float height, float weight); +const char* retResult(float points); #endif //BMI_H diff --git a/test/test_bmi.c b/test/test_bmi.c index e0530fc..6dfa7fc 100644 --- a/test/test_bmi.c +++ b/test/test_bmi.c @@ -19,4 +19,10 @@ float expected = 25; TEST_ASSERT_EQUAL(expected, result); } +void test_ausgabe_ergebnis(void) +{ +const char *result = retResult(25); +char expected[] = "Normalgewicht"; +TEST_ASSERT_EQUAL_STRING(expected, result); +} #endif