Browse Source

absolute funktion test

remotes/origin/Abdelrahman
Abdelrahman 11 months ago
parent
commit
fda57e8d0c
  1. 3
      src/c/funktionen.h
  2. 5
      src/test/test_funktionen.c

3
src/c/funktionen.h

@ -13,4 +13,7 @@ float cube(float x);
// Function to calculate the cube root of a number
float cubeRoot(float x);
// Function to calculate the absolute value of a number
float absolute(float x);
#endif

5
src/test/test_funktionen.c

@ -32,4 +32,9 @@ void test_cubeRoot(void) {
// Add more test cases for different inputs and expected outputs
}
void test_absolute(void) {
float result = absolute(-5.0);
TEST_ASSERT_EQUAL_FLOAT(5.0, result);
}
#endif
Loading…
Cancel
Save