• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <math.h>
3 
4 using namespace testing::ext;
5 
6 class MathErfTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: erf_001
13  * @tc.desc: When the parameter of erf is valid, test the return value of the function.
14  * @tc.type: FUNC
15  */
16 HWTEST_F(MathErfTest, erf_001, TestSize.Level1)
17 {
18     EXPECT_DOUBLE_EQ(0.84270079294971489, erf(1.0));
19 }
20 
21 /**
22  * @tc.name: erff_001
23  * @tc.desc: When the parameter of erff is valid, test the return value of the function.
24  * @tc.type: FUNC
25  */
26 HWTEST_F(MathErfTest, erff_001, TestSize.Level1)
27 {
28     EXPECT_FLOAT_EQ(0.84270078f, erff(1.0f));
29 }
30 
31 /**
32  * @tc.name: erfl_001
33  * @tc.desc: When the parameter of erfl is valid, test the return value of the function.
34  * @tc.type: FUNC
35  */
36 HWTEST_F(MathErfTest, erfl_001, TestSize.Level1)
37 {
38     EXPECT_DOUBLE_EQ(0.84270079294971489L, erfl(1.0L));
39 }