Browse Source

add tests for cos function

master
fdai7848 11 months ago
parent
commit
08d0ad16e7
  1. 19
      test/test_reihen.c

19
test/test_reihen.c

@ -73,4 +73,23 @@ void test_sin(void){
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.0, r4);
}
void test_cos(void){
double r1, r2, r3, r4;
r1 = cosD(50.0);
r2 = cosD(90.0);
r3 = cosD(36.97);
r4 = cosD(180.0);
printf("%lf\n", r1);
printf("%lf\n", r2);
printf("%lf\n", r3);
printf("%lf\n", r4);
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.642787, r1);
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.0, r2);
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.798950, r3);
TEST_ASSERT_DOUBLE_WITHIN(0.000001, -1.0, r4);
}
#endif // TEST
Loading…
Cancel
Save