Browse Source

Unittest: retResult

remotes/origin/bmidev
Kevin Ludwig 11 months ago
parent
commit
6431014c7d
  1. 2
      src/bmi.c
  2. 1
      src/bmi.h
  3. 6
      test/test_bmi.c

2
src/bmi.c

@ -25,7 +25,7 @@ const char* retResult(float points){
return "Starkes Uebergewicht"; return "Starkes Uebergewicht";
} }
int main()
int run_bmi()
{ {
float var1 = 0; float var1 = 0;
float var2 = 0; float var2 = 0;

1
src/bmi.h

@ -2,5 +2,6 @@
#define BMI_H #define BMI_H
float calcBMI(float height, float weight); float calcBMI(float height, float weight);
const char* retResult(float points);
#endif //BMI_H #endif //BMI_H

6
test/test_bmi.c

@ -19,4 +19,10 @@ float expected = 25;
TEST_ASSERT_EQUAL(expected, result); 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 #endif
Loading…
Cancel
Save