diff --git a/src/c/funktionen.c b/src/c/funktionen.c index c6062dc..4a4a52a 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -85,4 +85,8 @@ int characterAppearanceInString(char c, char string[]) { int i(int v, int r) { return v / r; +} + +int p(int f, int a) { + return f / a; } \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 026caa6..97ca0fa 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -167,4 +167,19 @@ void test_current_at_voltage12_resistance6(void) TEST_ASSERT_EQUAL_INT(expected, actual); } +void test_pressure_at_force360_area12(void) +{ + /* arrange */ + int actual; + int expected = 30; + + /* act */ + int f = 360; + int a = 12; + actual = p(f, a); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, actual); +} + #endif \ No newline at end of file