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