1 #include <gtest/gtest.h> 2 #include <math.h> 3 4 using namespace testing::ext; 5 6 class MathY1Test : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: y1_001 13 * @tc.desc: When the value is valid, test the return value of the function. 14 * @tc.type: FUNC 15 */ 16 HWTEST_F(MathY1Test, y1_001, TestSize.Level1) 17 { 18 EXPECT_DOUBLE_EQ(-HUGE_VAL, y1(0.0)); 19 EXPECT_DOUBLE_EQ(-0.78121282130028868, y1(1.0)); 20 } 21 22 /** 23 * @tc.name: y1f_001 24 * @tc.desc: When the float value is valid, test the return value of the function. 25 * @tc.type: FUNC 26 */ 27 HWTEST_F(MathY1Test, y1f_001, TestSize.Level1) 28 { 29 EXPECT_FLOAT_EQ(-HUGE_VALF, y1f(0.0f)); 30 EXPECT_FLOAT_EQ(-0.78121281f, y1f(1.0f)); 31 }