1 #include <gtest/gtest.h> 2 #include <setjmp.h> 3 using namespace testing::ext; 4 5 class SetJmpSetJmpTest : public testing::Test { SetUp()6 void SetUp() override {} TearDown()7 void TearDown() override {} 8 }; 9 10 /** 11 * @tc.name: setjmp_001 12 * @tc.desc: Verify that the setjmp function successfully stores the calling environment in env, and returns 0 13 * when directly invoked. 14 * @tc.type: FUNC 15 **/ 16 HWTEST_F(SetJmpSetJmpTest, setjmp_001, TestSize.Level1) 17 { 18 jmp_buf env; 19 EXPECT_EQ(setjmp(env), 0); 20 }