Lines Matching refs:key

49   pthread_key_t key;  in TEST()  local
50 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
51 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
53 ASSERT_EQ(EINVAL, pthread_key_delete(key)); in TEST()
73 for (const auto& key : keys) { in TEST() local
74 EXPECT_EQ(0, pthread_key_delete(key)); in TEST()
79 pthread_key_t key; in TEST() local
81 ASSERT_EQ(0, pthread_key_create(&key, nullptr)) << i << " of " << nkeys; in TEST()
82 keys.push_back(key); in TEST()
83 ASSERT_EQ(0, pthread_setspecific(key, reinterpret_cast<void*>(i))); in TEST()
88 pthread_key_t key = keys.back(); in TEST() local
90 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
101 pthread_key_t key; in TEST() local
102 rv = pthread_key_create(&key, nullptr); in TEST()
107 keys.push_back(key); in TEST()
111 for (const auto& key : keys) { in TEST() local
112 EXPECT_EQ(0, pthread_key_delete(key)); in TEST()
123 pthread_key_t key; in TEST() local
124 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
125 ASSERT_EQ(0, pthread_setspecific(key, expected)); in TEST()
126 ASSERT_EQ(expected, pthread_getspecific(key)); in TEST()
127 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
129 ASSERT_EQ(nullptr, pthread_getspecific(key)); in TEST()
131 ASSERT_EQ(EINVAL, pthread_setspecific(key, expected)); in TEST()
136 pthread_key_t key; in TEST() local
137 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
138 ASSERT_EQ(0, pthread_setspecific(key, expected)); in TEST()
139 ASSERT_EQ(expected, pthread_getspecific(key)); in TEST()
146 ASSERT_EQ(expected, pthread_getspecific(key)); in TEST()
152 ASSERT_EQ(expected, pthread_getspecific(key)); in TEST()
153 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
156 static void* DirtyKeyFn(void* key) { in DirtyKeyFn() argument
157 return pthread_getspecific(*reinterpret_cast<pthread_key_t*>(key)); in DirtyKeyFn()
161 pthread_key_t key; in TEST() local
162 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
174 ASSERT_EQ(0, pthread_create(&t, &attr, DirtyKeyFn, &key)); in TEST()
181 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
188 static pthread_key_t key; in TEST() local
189 ASSERT_EQ(nullptr, pthread_getspecific(key)); in TEST()
190 ASSERT_EQ(EINVAL, pthread_setspecific(key, nullptr)); in TEST()
191 ASSERT_EQ(EINVAL, pthread_key_delete(key)); in TEST()