From 0d247eb1cdedc67f60a1272fffa9fd0637c30428 Mon Sep 17 00:00:00 2001 From: Enrico Schellenberger Date: Sat, 3 Feb 2024 12:28:31 +0100 Subject: [PATCH] added test to develop branch --- src/test/c/test_taschenrechner.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/test/c/test_taschenrechner.c b/src/test/c/test_taschenrechner.c index d3fc8c9..6ad4cc7 100644 --- a/src/test/c/test_taschenrechner.c +++ b/src/test/c/test_taschenrechner.c @@ -14,14 +14,29 @@ void tearDown(void) void test_addition(void) { - /* arrange */ - char* result; - char expected[] = "2\n"; + doulbe result = add(1, 2); + TEST_ASSERT_EQUAL(3, result); +} + +void test_minus(void) +{ + doulbe result = minus(3, 1); + TEST_ASSERT_EQUAL(2, result); +} - /* act */ - result = convert(2); +void test_multiply(void) +{ + doulbe result = multiply(1, 2); + TEST_ASSERT_EQUAL(2, result); +} + +void test_divide(void) +{ + doulbe result = divide(4, 2); + TEST_ASSERT_EQUAL(2, result); - /* assert */ + doulbe result1 = divide(4, 0); + TEST_ASSERT_EQUAL(0, result1); } #endif // TEST