summaryrefslogtreecommitdiff
path: root/absl/container/internal/raw_hash_set_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container/internal/raw_hash_set_test.cc')
-rw-r--r--absl/container/internal/raw_hash_set_test.cc30
1 files changed, 9 insertions, 21 deletions
diff --git a/absl/container/internal/raw_hash_set_test.cc b/absl/container/internal/raw_hash_set_test.cc
index f59a19b4..f48578eb 100644
--- a/absl/container/internal/raw_hash_set_test.cc
+++ b/absl/container/internal/raw_hash_set_test.cc
@@ -687,7 +687,7 @@ TEST(Table, RehashWithNoResize) {
Modulo1000HashTable t;
// Adding the same length (and the same hash) strings
// to have at least kMinFullGroups groups
- // with Group::kWidth collisions. Then feel upto MaxDensitySize;
+ // with Group::kWidth collisions. Then fill up to MaxDensitySize;
const size_t kMinFullGroups = 7;
std::vector<int> keys;
for (size_t i = 0; i < MaxDensitySize(Group::kWidth * kMinFullGroups); ++i) {
@@ -1029,7 +1029,6 @@ ExpectedStats XorSeedExpectedStats() {
{{0.95, 0.1}},
{{0.95, 0}, {0.99, 2}, {0.999, 4}, {0.9999, 10}}};
}
- break;
case 16:
if (kRandomizesInserts) {
return {0.1,
@@ -1042,10 +1041,8 @@ ExpectedStats XorSeedExpectedStats() {
{{0.95, 0.05}},
{{0.95, 0}, {0.99, 1}, {0.999, 4}, {0.9999, 10}}};
}
- break;
- default:
- ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
}
+ ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
return {};
}
TEST(Table, DISABLED_EnsureNonQuadraticTopNXorSeedByProbeSeqLength) {
@@ -1125,7 +1122,6 @@ ExpectedStats LinearTransformExpectedStats() {
{{0.95, 0.3}},
{{0.95, 0}, {0.99, 3}, {0.999, 15}, {0.9999, 25}}};
}
- break;
case 16:
if (kRandomizesInserts) {
return {0.1,
@@ -1138,10 +1134,8 @@ ExpectedStats LinearTransformExpectedStats() {
{{0.95, 0.1}},
{{0.95, 0}, {0.99, 1}, {0.999, 6}, {0.9999, 10}}};
}
- break;
- default:
- ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
}
+ ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
return {};
}
TEST(Table, DISABLED_EnsureNonQuadraticTopNLinearTransformByProbeSeqLength) {
@@ -1834,18 +1828,15 @@ std::vector<std::pair<double, double>> StringTablePefectRatios() {
} else {
return {{0.995, 0.01}, {0.97, 0.01}, {0.89, 0.02}};
}
- break;
case 16:
if (kRandomizesInserts) {
return {{0.973, 0.01}, {0.965, 0.01}, {0.92, 0.02}};
} else {
return {{0.995, 0.005}, {0.99, 0.005}, {0.94, 0.01}};
}
- break;
- default:
- // Ignore anything else.
- return {};
}
+ ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
+ return {};
}
// This is almost a change detector, but it allows us to know how we are
@@ -1884,18 +1875,15 @@ std::vector<std::pair<double, double>> IntTablePefectRatios() {
} else {
return {{0.99, 0.01}, {0.99, 0.01}, {0.95, 0.02}};
}
- break;
case 16:
if (kRandomizesInserts) {
return {{0.98, 0.02}, {0.978, 0.02}, {0.96, 0.02}};
} else {
return {{0.998, 0.003}, {0.995, 0.01}, {0.975, 0.02}};
}
- break;
- default:
- // Ignore anything else.
- return {};
}
+ ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width");
+ return {};
}
// This is almost a change detector, but it allows us to know how we are
@@ -1916,7 +1904,7 @@ TEST(Table, EffectiveLoadFactorInts) {
}
// Confirm that we assert if we try to erase() end().
-TEST(Table, EraseOfEndAsserts) {
+TEST(TableDeathTest, EraseOfEndAsserts) {
// Use an assert with side-effects to figure out if they are actually enabled.
bool assert_enabled = false;
assert([&]() {
@@ -1928,7 +1916,7 @@ TEST(Table, EraseOfEndAsserts) {
IntTable t;
// Extra simple "regexp" as regexp support is highly varied across platforms.
constexpr char kDeathMsg[] = "it != end";
- EXPECT_DEATH(t.erase(t.end()), kDeathMsg);
+ EXPECT_DEATH_IF_SUPPORTED(t.erase(t.end()), kDeathMsg);
}
#ifdef ADDRESS_SANITIZER