From 9fb595ce1d0ddbbc83292f6ea52cfbe6baac2a54 Mon Sep 17 00:00:00 2001 From: Enrico Schellenberger Date: Tue, 6 Feb 2024 16:31:18 +0100 Subject: [PATCH] added main to develop branch --- src/test/c/test_taschenrechner.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/test/c/test_taschenrechner.c b/src/test/c/test_taschenrechner.c index 5e16459..cf6c739 100644 --- a/src/test/c/test_taschenrechner.c +++ b/src/test/c/test_taschenrechner.c @@ -68,5 +68,46 @@ void test_ConTemp(void) {//5 celsius to fahrenheit TEST_ASSERT_EQUAL(41, result); } +void test_ConSpeed(void) {//5 kmh to mph + double result = ConTemp(5, 0, 1); + TEST_ASSERT_EQUAL(3.10686, result); +} + +void test_ConLiter(void) {//5 l to ml + double result = ConTemp(5, 1, 0); + TEST_ASSERT_EQUAL(5000, result); +} + +void test_ConLiterToGallon(void) {//5 l to gallon + double result = ConTemp(5, 0, 1); + TEST_ASSERT_EQUAL(1.32086, result); +} + +void test_ConData(void) {//5 b to kb + double result = ConData(5, 0, 1); + TEST_ASSERT_EQUAL(0.005, result); +} + +void test_ConArea(void) {//5 mm to cm + double result = ConData(5, 0, 1); + TEST_ASSERT_EQUAL(0.05), result); +} + +void test_ConVolume(void) {//5 mm to cm + double result = ConData(5, 0, 1); + TEST_ASSERT_EQUAL(0.005), result); +} + +void test_ConClock(void) {//5:00 to 5AM + double result = ConData(5, 0, 1); + TEST_ASSERT_EQUAL(5), result); +} + +void test_ConTime(void) {//5 ms to s + double result = ConData(5, 0, 1); + TEST_ASSERT_EQUAL(0.005), result); +} + + #endif // TEST