|
@ -29,7 +29,6 @@ void test_cube(void) { |
|
|
void test_cubeRoot(void) { |
|
|
void test_cubeRoot(void) { |
|
|
float result = cubeRoot(27.0); |
|
|
float result = cubeRoot(27.0); |
|
|
TEST_ASSERT_EQUAL_FLOAT(3.0, result); |
|
|
TEST_ASSERT_EQUAL_FLOAT(3.0, result); |
|
|
// Add more test cases for different inputs and expected outputs |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_absolute(void) { |
|
|
void test_absolute(void) { |
|
@ -40,26 +39,27 @@ void test_absolute(void) { |
|
|
void test_logarithm(void) { |
|
|
void test_logarithm(void) { |
|
|
float result = logarithm(100.0); |
|
|
float result = logarithm(100.0); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 2.0, result); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 2.0, result); |
|
|
// Add more test cases for different inputs and expected outputs |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_naturalLogarithm(void) { |
|
|
void test_naturalLogarithm(void) { |
|
|
float result = naturalLogarithm(100.0); |
|
|
float result = naturalLogarithm(100.0); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result); |
|
|
// Add more test cases for different inputs and expected outputs |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_power(void) { |
|
|
void test_power(void) { |
|
|
float result = power(2.0, 3.0); |
|
|
float result = power(2.0, 3.0); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 8.0, result); |
|
|
TEST_ASSERT_FLOAT_WITHIN(0.000001, 8.0, result); |
|
|
// Add more test cases for different inputs and expected outputs |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_factorial(void) { |
|
|
void test_factorial(void) { |
|
|
int result = factorial(5); |
|
|
int result = factorial(5); |
|
|
TEST_ASSERT_EQUAL_INT(120, result); |
|
|
TEST_ASSERT_EQUAL_INT(120, result); |
|
|
// Add more test cases for different inputs and expected outputs |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_floorValue(void) { |
|
|
|
|
|
float result = floorValue(5.7); |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(5.0, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |