|
|
@ -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 |