|
|
@ -0,0 +1,32 @@ |
|
|
|
#include "../src/convert_cm_in_dm.h" |
|
|
|
#include "unity.h" |
|
|
|
#include "limits.h" |
|
|
|
|
|
|
|
void setUp(void) { |
|
|
|
// Set up resources here if needed |
|
|
|
} |
|
|
|
|
|
|
|
void tearDown(void) { |
|
|
|
// Clean up resources here if needed |
|
|
|
} |
|
|
|
void test_cm_to_dm(void) { |
|
|
|
// Testfall 1: 100 cm sollten 10 Dezimeter sein |
|
|
|
double value_1 = 100.0; |
|
|
|
double expectedResult_1 = 10.0; |
|
|
|
double result_1 = cm_to_dm(value_1); |
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); |
|
|
|
} |
|
|
|
void test_cm_to_dm2(void) { |
|
|
|
// Testfall 2: 50 cm sollten 5 Dezimeter sein |
|
|
|
double value_2 = 50.0; |
|
|
|
double expectedResult_2 = 5.0; |
|
|
|
double result_2 = cm_to_dm(value_2); |
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); |
|
|
|
} |
|
|
|
void test_cm_to_dm3(void) { |
|
|
|
// Testfall 3: 200 cm sollten 20 Dezimeter sein |
|
|
|
double value_3 = 200.0; |
|
|
|
double expectedResult_3 = 20.0; |
|
|
|
double result_3 = cm_to_dm(value_3); |
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expectedResult_3, result_3); |
|
|
|
} |