1 #include <gtest/gtest.h> 2 #include <thread> 3 #include <threads.h> 4 5 using namespace testing::ext; 6 7 #define tls_mod_off_t size_t 8 9 class ThreadTlsgetaddrTest : public testing::Test { SetUp()10 void SetUp() override {} TearDown()11 void TearDown() override {} 12 }; 13 14 extern "C" void* __tls_get_addr(tls_mod_off_t* v); 15 ThreadFunc()16void ThreadFunc() 17 { 18 tls_mod_off_t v; 19 EXPECT_EQ(nullptr, __tls_get_addr(&v)); 20 } 21 22 /** 23 * @tc.name: __tls_get_addr_001 24 * @tc.desc: Invalid parameter passed in, return value is empty. 25 * @tc.type: FUNC 26 * */ 27 HWTEST_F(ThreadTlsgetaddrTest, __tls_get_addr_001, TestSize.Level1) 28 { 29 std::thread t(ThreadFunc); 30 t.join(); 31 }