@ -4,4 +4,9 @@
//addieren
float addieren(float a, float b) {
return a + b;
}
//subtrahieren
float subtrahieren(float a, float b) {
return a - b;
@ -2,5 +2,6 @@
#define MINIRECHNER_H
float addieren(float a, float b);
float subtrahieren(float a, float b);
#endif // MINIRECHNER_H
@ -36,4 +36,12 @@ void test_minitaschenrechner_0_plus_2(void)
float result = addieren(0, 2);
TEST_ASSERT_EQUAL(2, result);
// test subtraktion
void test_minitaschenrechner_5_minus_2(void)
{
float result = subtrahieren(5, 2);
TEST_ASSERT_EQUAL(3, result);
#endif // TEST