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