diff --git a/src/bmi.c b/src/bmi.c index b93dbd6..b9e7129 100644 --- a/src/bmi.c +++ b/src/bmi.c @@ -1,4 +1,5 @@ #include +#include "bmi.h" float calcBMI(float a, float b){ if(a > 0 && b > 0) diff --git a/src/bmi.h b/src/bmi.h new file mode 100644 index 0000000..b1a92c8 --- /dev/null +++ b/src/bmi.h @@ -0,0 +1,6 @@ +#ifndef BMI_H +#define BMI_H + +float calcBMI(float height, float weight); + +#endif //BMI_H diff --git a/test/test_bmi.c b/test/test_bmi.c new file mode 100644 index 0000000..e0530fc --- /dev/null +++ b/test/test_bmi.c @@ -0,0 +1,22 @@ +#ifdef TEST + +#include "unity.h" + +#include "bmi.h" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_berechnung_BMI(void) +{ +float result = calcBMI(2, 100); +float expected = 25; +TEST_ASSERT_EQUAL(expected, result); +} + +#endif