Browse Source

p() definiert und einen Test für die Funktion erstellt

remotes/origin/habib
Habib 11 months ago
parent
commit
bfc9a37417
  1. 4
      src/c/funktionen.c
  2. 15
      src/test/test_funktionen.c

4
src/c/funktionen.c

@ -86,3 +86,7 @@ int characterAppearanceInString(char c, char string[]) {
int i(int v, int r) {
return v / r;
}
int p(int f, int a) {
return f / a;
}

15
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
Loading…
Cancel
Save