From 324612a30d70e1b9ea1f60bf3a554e689f6f257a Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 16:57:52 +0100 Subject: [PATCH 1/7] Commited Unit Test calculate Factorial --- test/test_calculateFactorial .c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/test_calculateFactorial .c diff --git a/test/test_calculateFactorial .c b/test/test_calculateFactorial .c new file mode 100644 index 0000000..fa7a51b --- /dev/null +++ b/test/test_calculateFactorial .c @@ -0,0 +1,17 @@ +#include "../src/calculateFactorial.h" +#include "unity.h" +#include "limits.h" + +void setUp(void) { + // set stuff up here +} + +void tearDown(void) { + // clean stuff up here +} +void test_calculateFactorial_calculateFactorialofanumber(void) { + int expectedResult = 120; + int result; + result = calculateFactorial_integer(5); + TEST_ASSERT_EQUAL_INT(expectedResult, result); +} From 0d8c89547d126a18cb2f59a5c84686ecb2f0e274 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 16:59:56 +0100 Subject: [PATCH 2/7] Commited Unit Test cm in dm --- test/test_convert_cm_in_dm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test_convert_cm_in_dm.c diff --git a/test/test_convert_cm_in_dm.c b/test/test_convert_cm_in_dm.c new file mode 100644 index 0000000..3bce101 --- /dev/null +++ b/test/test_convert_cm_in_dm.c @@ -0,0 +1,18 @@ +#include "../src/convert_cm_in_dm.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_cm_to_dm(void) { + // Testfall 1: 100 cm sollten 10 Dezimeter sein + double value_1 = 100.0; + double expectedResult_1 = 10.0; + double result_1 = cm_to_dm(value_1); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); +} \ No newline at end of file From 89d3690fc64460926781d042be3ac4de2c46ff6f Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:00:16 +0100 Subject: [PATCH 3/7] Commited Unit Test cm in dm --- test/test_convert_cm_in_dm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_cm_in_dm.c b/test/test_convert_cm_in_dm.c index 3bce101..6cf23e3 100644 --- a/test/test_convert_cm_in_dm.c +++ b/test/test_convert_cm_in_dm.c @@ -15,4 +15,11 @@ void test_cm_to_dm(void) { double expectedResult_1 = 10.0; double result_1 = cm_to_dm(value_1); TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); +} +void test_cm_to_dm2(void) { + // Testfall 2: 50 cm sollten 5 Dezimeter sein + double value_2 = 50.0; + double expectedResult_2 = 5.0; + double result_2 = cm_to_dm(value_2); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); } \ No newline at end of file From 6bdaf0b74a8bdb769e80bf9706b5898779189a20 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:00:29 +0100 Subject: [PATCH 4/7] Commited Unit Test cm in dm --- test/test_convert_cm_in_dm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_cm_in_dm.c b/test/test_convert_cm_in_dm.c index 6cf23e3..112ee0d 100644 --- a/test/test_convert_cm_in_dm.c +++ b/test/test_convert_cm_in_dm.c @@ -22,4 +22,11 @@ void test_cm_to_dm2(void) { double expectedResult_2 = 5.0; double result_2 = cm_to_dm(value_2); TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); +} +void test_cm_to_dm3(void) { + // Testfall 3: 200 cm sollten 20 Dezimeter sein + double value_3 = 200.0; + double expectedResult_3 = 20.0; + double result_3 = cm_to_dm(value_3); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_3, result_3); } \ No newline at end of file From 2c55d2f61a24b51ec712f1f22ce2936c8e4bda7d Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:02:01 +0100 Subject: [PATCH 5/7] Commited Unit Test cm in m --- test/test_convert_CM_in_M.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test_convert_CM_in_M.c diff --git a/test/test_convert_CM_in_M.c b/test/test_convert_CM_in_M.c new file mode 100644 index 0000000..5d456ab --- /dev/null +++ b/test/test_convert_CM_in_M.c @@ -0,0 +1,18 @@ +#include "../src/convert_CM_in_M.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_cm_to_meter(void) { + // Testfall 1: 100 cm sollten 1 Meter sein + float value_1 = 100.0; + float expectedResult_1 = 1.0; + float result_1 = cm_to_meter(value_1); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); +} \ No newline at end of file From d7e1d5879390ff45e4a5da029f764283d0dbe08f Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:02:16 +0100 Subject: [PATCH 6/7] Commited Unit Test cm in m --- test/test_convert_CM_in_M.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_CM_in_M.c b/test/test_convert_CM_in_M.c index 5d456ab..eaa55d1 100644 --- a/test/test_convert_CM_in_M.c +++ b/test/test_convert_CM_in_M.c @@ -15,4 +15,11 @@ void test_cm_to_meter(void) { float expectedResult_1 = 1.0; float result_1 = cm_to_meter(value_1); TEST_ASSERT_EQUAL_FLOAT(expectedResult_1, result_1); +} +void test_cm_to_meter2(void) { + // Testfall 2: 50 cm sollten 0.5 Meter sein + float value_2 = 50.0; + float expectedResult_2 = 0.5; + float result_2 = cm_to_meter(value_2); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); } \ No newline at end of file From 90929037efce3a0ce430e2cd7db338cb6b320a70 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Fri, 9 Feb 2024 17:02:58 +0100 Subject: [PATCH 7/7] Commited Unit Test cm in m --- test/test_convert_CM_in_M.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_convert_CM_in_M.c b/test/test_convert_CM_in_M.c index eaa55d1..83ee807 100644 --- a/test/test_convert_CM_in_M.c +++ b/test/test_convert_CM_in_M.c @@ -22,4 +22,11 @@ void test_cm_to_meter2(void) { float expectedResult_2 = 0.5; float result_2 = cm_to_meter(value_2); TEST_ASSERT_EQUAL_FLOAT(expectedResult_2, result_2); +} +void test_cm_to_meter3(void) { + // Testfall 3: 200 cm sollten 2 Meter sein + float value_3 = 200.0; + float expectedResult_3 = 2.0; + float result_3 = cm_to_meter(value_3); + TEST_ASSERT_EQUAL_FLOAT(expectedResult_3, result_3); } \ No newline at end of file