• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <math.h>
3 
4 using namespace testing::ext;
5 
6 class MathSignbitTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: __signbit_001
13  * @tc.desc: When the input parameter is valid, test the return value of this function.
14  * @tc.type: FUNC
15  */
16 HWTEST_F(MathSignbitTest, __signbit_001, TestSize.Level1)
17 {
18     EXPECT_EQ(0, __signbit(0.0));
19     EXPECT_EQ(0, __signbit(1.0));
20     EXPECT_NE(0, __signbit(-1.0));
21 }
22 
23 /**
24  * @tc.name: __signbitf_001
25  * @tc.desc: When the input parameter is of float type and valid, test the return value of this function.
26  * @tc.type: FUNC
27  */
28 HWTEST_F(MathSignbitTest, __signbitf_001, TestSize.Level1)
29 {
30     EXPECT_EQ(0, __signbitf(0.0f));
31     EXPECT_EQ(0, __signbitf(1.0f));
32     EXPECT_NE(0, __signbitf(-1.0f));
33 }
34 
35 /**
36  * @tc.name: __signbitl_001
37  * @tc.desc: When the input parameter is of long double type and valid, test the return value of this function.
38  * @tc.type: FUNC
39  */
40 HWTEST_F(MathSignbitTest, __signbitl_001, TestSize.Level1)
41 {
42     EXPECT_EQ(0L, __signbitl(0.0L));
43     EXPECT_EQ(0L, __signbitl(1.0L));
44     EXPECT_NE(0L, __signbitl(-1.0L));
45 }