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