From a7c91d523628a2770d25699d9905db47c8c2d55a Mon Sep 17 00:00:00 2001 From: Sandro Welte Date: Fri, 9 Feb 2024 17:17:45 +0100 Subject: [PATCH] Comitted Unit Test --- test/test_convert_ton_to_mt.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/test_convert_ton_to_mt.c diff --git a/test/test_convert_ton_to_mt.c b/test/test_convert_ton_to_mt.c new file mode 100644 index 0000000..bce3793 --- /dev/null +++ b/test/test_convert_ton_to_mt.c @@ -0,0 +1,20 @@ +#include "unity.h" // Include the Unity header file +#include "../src/convert_ton_to_mt.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) { + // This function will be called after each test +} + +// Test case for tons_to_megatons function +void test_tons_to_megatons(void) { + // Test case + double input = 2500000; // 2.5 million tons + double expected_output = 2.5; // 2.5 megatons + TEST_ASSERT_EQUAL_DOUBLE(expected_output, tons_to_megatons(input)); +}