@ -8,3 +8,8 @@ int* subtraction_integer(int a, int b) {
*result=a - b;
return result;
}
float* subtraction_float(float a, float b) {
float* result= malloc(sizeof (float));
@ -3,5 +3,6 @@
#define THEADMIRALS_ARITHMETICSUBTRACTION_H
int* subtraction_integer(int a, int b);
float* subtraction_float(float a, float b);
#endif //THEADMIRALS_ARITHMETICSUBTRACTION_H
@ -15,4 +15,10 @@ void test_arithmeticSubtraction_subractionoftwonumbers(void) {
result = subtraction_integer(14, 7);
TEST_ASSERT_EQUAL_INT(expectedResult, *result);
void test_arithmeticSubtraction_subractionoftwonumberswithfloat(void) {
float expectedResult = 7;
float* result;
result = subtraction_float(14, 7);
TEST_ASSERT_EQUAL_FLOAT(expectedResult, *result);