Browse Source

Comitted Unit Test

remotes/origin/testing
Sandro Welte 11 months ago
parent
commit
31ec07eea7
  1. 28
      test/test_convert_C_to_F.c

28
test/test_convert_C_to_F.c

@ -0,0 +1,28 @@
#include "../src/convert_C_to_F.h"
#include "unity.h"
#include "limits.h"
void setUp(void) {
}
void tearDown(void) {
// Clean up resources here if needed
}
void test_convert_temperature(void) {
float temperature = 100.0;
char from_unit = 'c';
char to_unit = 'f';
// Perform the conversion
float result = convert_temperature(temperature, from_unit, to_unit);
// Define the expected result (100 degrees Celsius to Fahrenheit is 212)
float expectedResult = 212;
// Assert the result
TEST_ASSERT_EQUAL_FLOAT(expectedResult, result);
}
Loading…
Cancel
Save