#include #include "modules/Elliptic_integrals.cpp" #include class Elliptic_IntegralsTest : public testing::Test{}; TEST_F(Elliptic_IntegralsTest, Elliptic_0_0) { std::vector res = Elliptic(0, 0); EXPECT_DOUBLE_EQ(res[0], 0) << "F(0, 0)"; EXPECT_DOUBLE_EQ(res[1], 0) << "E(0, 0)"; } TEST_F(Elliptic_IntegralsTest, Elliptic_90_0) { std::vector res = Elliptic(90, 0); EXPECT_DOUBLE_EQ(res[0], M_PI / 2) << "F(90, 0)"; EXPECT_DOUBLE_EQ(res[1], M_PI / 2)<< "E(90, 0)"; } TEST_F(Elliptic_IntegralsTest, Elliptic_0_1) { std::vector res = Elliptic(0, 1); EXPECT_DOUBLE_EQ(res[0], 0) << "F(0, 1)"; EXPECT_DOUBLE_EQ(res[1], 0) << "E(0, 1)"; } TEST_F(Elliptic_IntegralsTest, Elliptic_90_1) { std::vector res = Elliptic(90, 1); EXPECT_DOUBLE_EQ(res[0], std::numeric_limits::infinity()) << "F(90, 1)"; EXPECT_DOUBLE_EQ(res[1], 1)<< "E(90, 1)"; } TEST_F(Elliptic_IntegralsTest, Elliptic_Throw) { std::vector result = Elliptic(50, 2); EXPECT_EQ(result.size(), 0); // if k > 1 or k < - 1 vector of Elliptic(phi, k) should be empty } int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }