Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: base/threading/thread_local_storage_unittest.cc

Issue 2383833004: Ensure Freed TLS Slots Contain nullptr on Reallocation (Closed)
Patch Set: Add Banner Doc Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/threading/thread_local_storage_unittest.cc
diff --git a/base/threading/thread_local_storage_unittest.cc b/base/threading/thread_local_storage_unittest.cc
index ec75f7f8dd597207b7a09cc46834d26d960bb30c..335252b18ed5a079cdcecc3e809f9a0adae13399 100644
--- a/base/threading/thread_local_storage_unittest.cc
+++ b/base/threading/thread_local_storage_unittest.cc
@@ -128,9 +128,12 @@ TEST(ThreadLocalStorageTest, MAYBE_TLSDestructors) {
}
TEST(ThreadLocalStorageTest, TLSReclaim) {
- // Creates and destroys many TLS slots.
+ // Creates and destroys many TLS slots and ensures they all zero-inited.
for (int i = 0; i < 1000; ++i) {
ThreadLocalStorage::Slot slot(nullptr);
+ EXPECT_EQ(nullptr, slot.Get());
+ slot.Set(reinterpret_cast<void*>(0xBAADF00D));
+ EXPECT_EQ(reinterpret_cast<void*>(0xBAADF00D), slot.Get());
}
}
« base/threading/thread_local_storage.cc ('K') | « base/threading/thread_local_storage.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698