Browse Source

refactoring: Funktionsnamen und Parametervariablen verbessert

remotes/origin/habib
Habib 11 months ago
parent
commit
dc8179cc62
  1. 4
      src/c/funktionen.c
  2. 2
      src/c/funktionen.h
  3. 2
      src/test/test_funktionen.c

4
src/c/funktionen.c

@ -121,6 +121,6 @@ int calculatePressure(int force, int area) {
return force / area; return force / area;
} }
float f(float m) {
return m * 9.81;
float calculateWeight(float mass) {
return mass * 9.81;
} }

2
src/c/funktionen.h

@ -58,7 +58,7 @@ int calculateCurrent(int voltage, int resistance);
int calculatePressure(int force, int area); int calculatePressure(int force, int area);
// berechnet den Druck // berechnet den Druck
float f(float m);
float calculateWeight(float mass);
// berechnet die Gewichtkraft // berechnet die Gewichtkraft
#endif #endif

2
src/test/test_funktionen.c

@ -265,7 +265,7 @@ void test_weight_at_mass100(void)
/* act */; /* act */;
float m = 100; float m = 100;
actual = f(m);
actual = calculateWeight(m);
/* assert */ /* assert */
TEST_ASSERT_EQUAL_FLOAT(expected, actual); TEST_ASSERT_EQUAL_FLOAT(expected, actual);

Loading…
Cancel
Save