1 #include <gtest/gtest.h> 2 #include <math.h> 3 4 using namespace testing::ext; 5 6 class MathFiniteTest : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: finite_001 13 * @tc.desc: When the input parameters are valid, test the return value of this function. 14 * @tc.type: FUNC 15 */ 16 HWTEST_F(MathFiniteTest, finite_001, TestSize.Level1) 17 { 18 EXPECT_TRUE(finite(100.0)); 19 } 20 21 /** 22 * @tc.name: finite_002 23 * @tc.desc: When the input parameters are infinite, test the return value of this function. 24 * @tc.type: FUNC 25 */ 26 HWTEST_F(MathFiniteTest, finite_002, TestSize.Level1) 27 { 28 EXPECT_FALSE(finite(HUGE_VAL)); 29 EXPECT_FALSE(finite(-HUGE_VAL)); 30 } 31