|
|
@ -0,0 +1,20 @@ |
|
|
|
#include "unity.h" // Include the Unity header file |
|
|
|
#include "../src/convert_g_to_mg.h" // Include the header file containing the function to be tested |
|
|
|
|
|
|
|
// Test setup function |
|
|
|
void setUp(void) { |
|
|
|
// This function will be called before each test |
|
|
|
} |
|
|
|
|
|
|
|
// Test teardown function |
|
|
|
void tearDown(void) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Test case for g_to_mg function |
|
|
|
void test_g_to_mg(void) { |
|
|
|
// Test case |
|
|
|
double input = 1.0; |
|
|
|
double expected_output = 1000.0; |
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(expected_output, g_to_mg(input)); |
|
|
|
} |