|
@ -12,24 +12,24 @@ void tearDown(void) |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_IntegerExponent_ForPositiveExponent(void){ |
|
|
|
|
|
|
|
|
void test_DoubleBase_ForPositiveExponent(void){ |
|
|
int r1, r2, r3; |
|
|
int r1, r2, r3; |
|
|
|
|
|
|
|
|
r1 = expI(2, -2); |
|
|
|
|
|
r2 = expI(3, -3); |
|
|
|
|
|
r3 = expI(4, 5); |
|
|
|
|
|
|
|
|
r1 = expI(2.0, -2.0); |
|
|
|
|
|
r2 = expI(3.0, -3.0); |
|
|
|
|
|
r3 = expI(4.0, 5.0); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(4, r1); |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(-27, r2); |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(625, r3); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(4.0, r1); |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(-27.0, r2); |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(625.0, r3); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_IntegerExponent_ForNegativeExponent(void){ |
|
|
|
|
|
|
|
|
void test_DoubleBase_ForNegativeExponent(void){ |
|
|
float r1, r2, r3; |
|
|
float r1, r2, r3; |
|
|
|
|
|
|
|
|
r1 = expIN(-1, 2); |
|
|
|
|
|
r2 = expIN(-3, -3); |
|
|
|
|
|
r3 = expIN(-2, -2); |
|
|
|
|
|
|
|
|
r1 = expIN(-1.0, 2.0); |
|
|
|
|
|
r2 = expIN(-3.0, -3.0); |
|
|
|
|
|
r3 = expIN(-2.0, -2.0); |
|
|
|
|
|
|
|
|
printf("Result 1: %d\n", r1); |
|
|
printf("Result 1: %d\n", r1); |
|
|
printf("Result 2: %d\n", r2); |
|
|
printf("Result 2: %d\n", r2); |
|
|