From 800303f3dc6f3f359787bbbc4a2b3a9024b708bc Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:05:04 +0100 Subject: [PATCH 1/6] Commited Unit Test m in km --- test/test_convert_M_in_KM.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test_convert_M_in_KM.c diff --git a/test/test_convert_M_in_KM.c b/test/test_convert_M_in_KM.c new file mode 100644 index 0000000..0a0b4c3 --- /dev/null +++ b/test/test_convert_M_in_KM.c @@ -0,0 +1,18 @@ +#include "../src/convert_M_in_KM.h" +#include "unity.h" +#include "limits.h" + +void setUp(void) { + // Set up resources here if needed +} + +void tearDown(void) { + // Clean up resources here if needed +} +void test_meter_to_kilometer(void) { + // Testfall 1: 1000 Meter sollten 1 Kilometer sein + double value_1 = 1000.0; + double expectedResult_1 = 1.0; + double result_1 = meter_to_kilometer(value_1); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); +} From 7c67f79786b62bb699481812d0924af1279f7ded Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:05:23 +0100 Subject: [PATCH 2/6] Commited Unit Test m in km --- test/test_convert_M_in_KM.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_M_in_KM.c b/test/test_convert_M_in_KM.c index 0a0b4c3..0df2589 100644 --- a/test/test_convert_M_in_KM.c +++ b/test/test_convert_M_in_KM.c @@ -16,3 +16,10 @@ void test_meter_to_kilometer(void) { double result_1 = meter_to_kilometer(value_1); TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); } +void test_meter_to_kilometer2(void) { + // Testfall 2: 500 Meter sollten 0.5 Kilometer sein + double value_2 = 500.0; + double expectedResult_2 = 0.5; + double result_2 = meter_to_kilometer(value_2); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); +} \ No newline at end of file From a1c14e6d25f4844dfc4cb5d72f2047ab7f0d24fd Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:05:36 +0100 Subject: [PATCH 3/6] Commited Unit Test m in km --- test/test_convert_M_in_KM.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_M_in_KM.c b/test/test_convert_M_in_KM.c index 0df2589..bdfeea0 100644 --- a/test/test_convert_M_in_KM.c +++ b/test/test_convert_M_in_KM.c @@ -22,4 +22,11 @@ void test_meter_to_kilometer2(void) { double expectedResult_2 = 0.5; double result_2 = meter_to_kilometer(value_2); TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); +} +void test_meter_to_kilometer3(void) { +// Testfall 3: 1500 Meter sollten 1.5 Kilometer sein + double value_3 = 1500.0; + double expectedResult_3 = 1.5; + double result_3 = meter_to_kilometer(value_3); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_3, result_3); } \ No newline at end of file From 45acadf4692c83a242ea9c4ce83214dfe5377664 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:07:06 +0100 Subject: [PATCH 4/6] Commited Unit Test m in km --- test/test_trigonometricFunctions.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/test_trigonometricFunctions.c diff --git a/test/test_trigonometricFunctions.c b/test/test_trigonometricFunctions.c new file mode 100644 index 0000000..04c55df --- /dev/null +++ b/test/test_trigonometricFunctions.c @@ -0,0 +1,17 @@ +#include "../src/trigonometricFunctions.h" +#include "unity.h" +#include "limits.h" + +void setUp(void) { + // set stuff up here +} + +void tearDown(void) { + // clean stuff up here +} +void test_trigonometricFunctions_trigonometricFunctionsofsin(void) { + double expectedResult = 0.850903525 ; + double *result; + result = calculate_sin_double(45); + TEST_ASSERT_DOUBLE_WITHIN(0.1, expectedResult, *result); +} From b4476ef1810b1f3c5fc4d381f59ffc790fe8a110 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:07:47 +0100 Subject: [PATCH 5/6] Commited Unit Test trigonometric Functions --- test/test_trigonometricFunctions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_trigonometricFunctions.c b/test/test_trigonometricFunctions.c index 04c55df..45e1328 100644 --- a/test/test_trigonometricFunctions.c +++ b/test/test_trigonometricFunctions.c @@ -15,3 +15,9 @@ void test_trigonometricFunctions_trigonometricFunctionsofsin(void) { result = calculate_sin_double(45); TEST_ASSERT_DOUBLE_WITHIN(0.1, expectedResult, *result); } +void test_trigonometricFunctions_trigonometricFunctionsofcos(void) { + double expectedResult = 0.525321989 ; + double *result; + result = calculate_cos_double(45); + TEST_ASSERT_DOUBLE_WITHIN(0.1, expectedResult, *result); +} \ No newline at end of file From ddc9e7e673450b6168a0f7b78d64be55b5c9604c Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:08:08 +0100 Subject: [PATCH 6/6] Commited Unit Test trigonometric Functions --- test/test_trigonometricFunctions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_trigonometricFunctions.c b/test/test_trigonometricFunctions.c index 45e1328..f21eb02 100644 --- a/test/test_trigonometricFunctions.c +++ b/test/test_trigonometricFunctions.c @@ -20,4 +20,10 @@ void test_trigonometricFunctions_trigonometricFunctionsofcos(void) { double *result; result = calculate_cos_double(45); TEST_ASSERT_DOUBLE_WITHIN(0.1, expectedResult, *result); +} +void test_trigonometricFunctions_trigonometricFunctionsoftan(void) { + double expectedResult = 1.61977519 ; + double *result; + result = calculate_tan_double(45); + TEST_ASSERT_DOUBLE_WITHIN(0.1, expectedResult, *result); } \ No newline at end of file