|
@ -0,0 +1,20 @@ |
|
|
|
|
|
#include "unity.h" // Include the Unity header file |
|
|
|
|
|
#include "../src/convert_kg_to_ton.h" |
|
|
|
|
|
|
|
|
|
|
|
// Test setup function |
|
|
|
|
|
void setUp(void) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Test teardown function |
|
|
|
|
|
void tearDown(void) { |
|
|
|
|
|
// This function will be called after each test |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Test case for kg_to_tons function |
|
|
|
|
|
void test_kg_to_tons(void) { |
|
|
|
|
|
// Test case |
|
|
|
|
|
double input = 2500.0; |
|
|
|
|
|
double expected_output = 2.5; |
|
|
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(expected_output, kg_to_tons(input)); |
|
|
|
|
|
} |