1 #include <gtest/gtest.h> 2 #include <math.h> 3 4 using namespace testing::ext; 5 6 class MathJnTest : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: jn_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(MathJnTest, jn_001, TestSize.Level1) 17 { 18 EXPECT_DOUBLE_EQ(0.0, jn(4, 0.0)); 19 EXPECT_DOUBLE_EQ(0.0024766389641099553, jn(4, 1.0)); 20 } 21 22 /** 23 * @tc.name: jnf_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(MathJnTest, jnf_001, TestSize.Level1) 28 { 29 EXPECT_FLOAT_EQ(0.0f, jnf(4, 0.0f)); 30 EXPECT_FLOAT_EQ(0.0024766389f, jnf(4, 1.0f)); 31 }