24 lines
623 B
C++
24 lines
623 B
C++
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
|
|
|
#include "ext/doctest.h"
|
|
#include "ephemeris.hh"
|
|
|
|
TEST_CASE("testing ephemeris age") {
|
|
CHECK(ephAge(0,0) == 0);
|
|
CHECK(ephAge(100,0) == 100);
|
|
CHECK(ephAge(0,100) == -100);
|
|
CHECK(ephAge(0,2*86400) == -2*86400);
|
|
CHECK(ephAge(0,3*86400) == -3*86400);
|
|
CHECK(ephAge(0, 3.49*86400) == -3.49*86400);
|
|
|
|
CHECK(ephAge(0, 3.51*86400) != -3.51*86400);
|
|
CHECK(ephAge(0, 3.6*86400) != -3.6*86400);
|
|
|
|
|
|
CHECK(ephAge(2*86400, 0) == 2*86400);
|
|
CHECK(ephAge(3*86400, 0) == 3*86400);
|
|
|
|
CHECK(ephAge(3.49*86400, 0) == 3.49*86400);
|
|
}
|
|
|