diff --git a/src/c/funktionen.c b/src/c/funktionen.c index d6cb83d..ba2978e 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -119,4 +119,8 @@ int i(int v, int r) { int p(int f, int a) { return f / a; +} + +float f(float m) { + return m * 9.81; } \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index e73a405..a03c572 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -257,4 +257,18 @@ void test_pressure_at_force360_area12(void) TEST_ASSERT_EQUAL_INT(expected, actual); } +void test_weight_at_mass100(void) +{ + /* arrange */ + float actual; + float expected = 981; + + /* act */; + float m = 100; + actual = f(m); + + /* assert */ + TEST_ASSERT_EQUAL_FLOAT(expected, actual); +} + #endif \ No newline at end of file