summaryrefslogtreecommitdiff
path: root/absl/container/internal/raw_hash_set_test.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-01-31 08:00:06 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-01-31 08:01:11 -0800
commitdcddc54407e44b55815e9aa784c84f5c933ca310 (patch)
tree05bae0e3d6fb8db2258d55c94506aa70ee6232cb /absl/container/internal/raw_hash_set_test.cc
parented59f62f8bbc5f05bcba2f89ee16f107e03813f2 (diff)
Rollback in sanitizer mode, detect when references become invalidated by randomly rehashing on insertions when there is no reserved growth.
Rollback of ed59f62f8bbc5f05bcba2f89ee16f107e03813f2 PiperOrigin-RevId: 506003574 Change-Id: I1766321f279a3226e2821e0390387d5639d28964
Diffstat (limited to 'absl/container/internal/raw_hash_set_test.cc')
-rw-r--r--absl/container/internal/raw_hash_set_test.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/absl/container/internal/raw_hash_set_test.cc b/absl/container/internal/raw_hash_set_test.cc
index e33fda20..bdffb817 100644
--- a/absl/container/internal/raw_hash_set_test.cc
+++ b/absl/container/internal/raw_hash_set_test.cc
@@ -865,10 +865,6 @@ void TestDecompose(bool construct_three) {
}
TEST(Table, Decompose) {
- if (SwisstableGenerationsEnabled()) {
- GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
- }
-
TestDecompose<DecomposeHash, DecomposeEq>(false);
struct TransparentHashIntOverload {
@@ -907,10 +903,6 @@ struct Modulo1000HashTable
// Test that rehash with no resize happen in case of many deleted slots.
TEST(Table, RehashWithNoResize) {
- if (SwisstableGenerationsEnabled()) {
- GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
- }
-
Modulo1000HashTable t;
// Adding the same length (and the same hash) strings
// to have at least kMinFullGroups groups
@@ -1004,10 +996,6 @@ TEST(Table, EnsureNonQuadraticAsInRust) {
}
TEST(Table, ClearBug) {
- if (SwisstableGenerationsEnabled()) {
- GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
- }
-
IntTable t;
constexpr size_t capacity = container_internal::Group::kWidth - 1;
constexpr size_t max_size = capacity / 2 + 1;
@@ -2330,25 +2318,6 @@ TEST(Table, ReservedGrowthUpdatesWhenTableDoesntGrow) {
EXPECT_EQ(*it, 0);
}
-TEST(Table, InvalidReferenceUseCrashesWithSanitizers) {
- if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
-#ifdef ABSL_HAVE_MEMORY_SANITIZER
- GTEST_SKIP() << "MSan fails to detect some of these rehashes.";
-#endif
-
- IntTable t;
- t.insert(0);
- // Rehashing is guaranteed on every insertion while capacity is less than
- // RehashProbabilityConstant().
- int64_t i = 0;
- while (t.capacity() <= RehashProbabilityConstant()) {
- // ptr will become invalidated on rehash.
- const int64_t* ptr = &*t.begin();
- t.insert(++i);
- EXPECT_DEATH_IF_SUPPORTED(std::cout << *ptr, "heap-use-after-free") << i;
- }
-}
-
} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END