|
@ -16,9 +16,9 @@ void tearDown(void) |
|
|
void test_ln_with_positive_number(void){ |
|
|
void test_ln_with_positive_number(void){ |
|
|
double r1, r2, r3; |
|
|
double r1, r2, r3; |
|
|
|
|
|
|
|
|
r1 = logN(1.0, 0.000001); |
|
|
|
|
|
r2 = logN(10.0, 0.000001); |
|
|
|
|
|
r3 = logN(2.5, 0.000001); |
|
|
|
|
|
|
|
|
r1 = logN(1.0); |
|
|
|
|
|
r2 = logN(10.0); |
|
|
|
|
|
r3 = logN(2.5); |
|
|
|
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0, r1); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0, r1); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.302585, r2); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.302585, r2); |
|
@ -28,9 +28,9 @@ void test_ln_with_positive_number(void){ |
|
|
void test_ln_with_zero_and_negative_numbers(void){ |
|
|
void test_ln_with_zero_and_negative_numbers(void){ |
|
|
double r1, r2, r3; |
|
|
double r1, r2, r3; |
|
|
|
|
|
|
|
|
r1 = logN(0.0, 0.000001); |
|
|
|
|
|
r2 = logN(-1.0, 0.000001); |
|
|
|
|
|
r3 = logN(-2.5, 0.000001); |
|
|
|
|
|
|
|
|
r1 = logN(0.0); |
|
|
|
|
|
r2 = logN(-1.0); |
|
|
|
|
|
r3 = logN(-2.5); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r1); |
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r1); |
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r2); |
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r2); |
|
|