1 #include <gtest/gtest.h> 2 #include <stdlib.h> 3 using namespace testing::ext; 4 5 class StdlibDivTest : public testing::Test { SetUp()6 void SetUp() override {} TearDown()7 void TearDown() override {} 8 }; 9 10 constexpr int NUMONE = 17; 11 constexpr int NUMTWO = 5; 12 constexpr int EXPONE = 3; 13 constexpr int EXPTWO = 2; 14 /** 15 * @tc.name: div_001 16 * @tc.desc: Verify the functionality of the div() function by checking if it correctly computes the quotient and 17 * remainder of division between two given integers. 18 * @tc.type: FUNC 19 **/ 20 HWTEST_F(StdlibDivTest, div_001, TestSize.Level1) 21 { 22 div_t result = div(NUMONE, NUMTWO); 23 EXPECT_EQ(EXPONE, result.quot); 24 EXPECT_EQ(EXPTWO, result.rem); 25 }