From 057982d1fb4c70735c8b510423799d066320e2f2 Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Fri, 9 Feb 2024 16:13:49 +0100 Subject: [PATCH] Added more tests for division methods with different datatypes --- test/test_arithmeticDivision.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test_arithmeticDivision.c b/test/test_arithmeticDivision.c index 6428ea0..0ae60eb 100644 --- a/test/test_arithmeticDivision.c +++ b/test/test_arithmeticDivision.c @@ -17,3 +17,24 @@ void test_arithmeticDivision_numberdividedbynumberequalsnumber(void) { result = division_integer(14, 7); TEST_ASSERT_EQUAL_INT(expectedResult, *result); } + +void test_arithmeticDivision_longdividedbylongequalscorrectlong(void) { + long expectedResult = 5; + long* result; + result = division_long(10, 2); + TEST_ASSERT_EQUAL_INT(expectedResult, *result); +} + +void test_arithmeticDivsion_floatdividedbyfloatequalscorrectfloat(void) { + float expectedResult = 5.0; + float* result; + result = division_float(10.0, 2.0); + TEST_ASSERT_EQUAL_FLOAT(expectedResult, *result); +} + +void test_arithmeticDivision_doubledividedbydoublequalscorrectdouble(void) { + double expectedResult = 5.0; + double* result; + result = division_double(10.0, 2.0); + TEST_ASSERT_EQUAL_DOUBLE(expectedResult, *result); +}