aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-14 03:07:06 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-14 03:07:06 +0000
commit39dbb21d63fcd4848f54cf7dfc7188f7216c36f4 (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
parentf60eaea2240ba9e1c508e8e0c91d39ee9fc47be5 (diff)
parent6c9587948173932b64d97c288a947e43d2a2ac14 (diff)
downloadwebrtc-android13-qpr1-s4-release.tar.gz
Change-Id: I2cdc23e9d294e3701ac746469aea1ce793eb9ce4
Diffstat (limited to 'third_party/abseil-cpp/absl/container/flat_hash_set_test.cc')
-rw-r--r--third_party/abseil-cpp/absl/container/flat_hash_set_test.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc b/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
index 40d7f85c5d..8f6f9944ca 100644
--- a/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
+++ b/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc
@@ -16,6 +16,7 @@
#include <vector>
+#include "absl/base/internal/raw_logging.h"
#include "absl/container/internal/hash_generator_testing.h"
#include "absl/container/internal/unordered_set_constructor_test.h"
#include "absl/container/internal/unordered_set_lookup_test.h"
@@ -36,6 +37,17 @@ using ::testing::Pointee;
using ::testing::UnorderedElementsAre;
using ::testing::UnorderedElementsAreArray;
+// Check that absl::flat_hash_set works in a global constructor.
+struct BeforeMain {
+ BeforeMain() {
+ absl::flat_hash_set<int> x;
+ x.insert(1);
+ ABSL_RAW_CHECK(!x.contains(0), "x should not contain 0");
+ ABSL_RAW_CHECK(x.contains(1), "x should contain 1");
+ }
+};
+const BeforeMain before_main;
+
template <class T>
using Set =
absl::flat_hash_set<T, StatefulTestingHash, StatefulTestingEqual, Alloc<T>>;