1 #include <gtest/gtest.h> 2 #include <math.h> 3 4 using namespace testing::ext; 5 6 class MathJ0Test : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: j0_001 13 * @tc.desc: When the input parameters are valid, test the return value of this function. 14 * @tc.type: FUNC 15 */ 16 HWTEST_F(MathJ0Test, j0_001, TestSize.Level1) 17 { 18 EXPECT_DOUBLE_EQ(1.0, j0(0.0)); 19 EXPECT_DOUBLE_EQ(0.76519768655796661, j0(1.0)); 20 } 21 22 /** 23 * @tc.name: j0f_001 24 * @tc.desc: When the input parameter is of float type and valid, test the return value of this function. 25 * @tc.type: FUNC 26 */ 27 HWTEST_F(MathJ0Test, j0f_001, TestSize.Level1) 28 { 29 EXPECT_FLOAT_EQ(1.0f, j0f(0.0f)); 30 EXPECT_FLOAT_EQ(0.76519769f, j0f(1.0f)); 31 }