The libc++ upgrade lets us use contains() in tests now.
Change-Id: I2999aad2cc186c34037dcea4b8a587d868aabda3
diff --git a/tests/dirent_test.cpp b/tests/dirent_test.cpp
index 4d21246..cde2d11 100644
--- a/tests/dirent_test.cpp
+++ b/tests/dirent_test.cpp
@@ -33,11 +33,11 @@
static void CheckProcSelf(std::set<std::string>& names) {
// We have a good idea of what should be in /proc/self.
- ASSERT_TRUE(names.find(".") != names.end());
- ASSERT_TRUE(names.find("..") != names.end());
- ASSERT_TRUE(names.find("cmdline") != names.end());
- ASSERT_TRUE(names.find("fd") != names.end());
- ASSERT_TRUE(names.find("stat") != names.end());
+ ASSERT_TRUE(names.contains("."));
+ ASSERT_TRUE(names.contains(".."));
+ ASSERT_TRUE(names.contains("cmdline"));
+ ASSERT_TRUE(names.contains("fd"));
+ ASSERT_TRUE(names.contains("stat"));
}
template <typename DirEntT>
diff --git a/tests/ifaddrs_test.cpp b/tests/ifaddrs_test.cpp
index b3ab94d..da64770 100644
--- a/tests/ifaddrs_test.cpp
+++ b/tests/ifaddrs_test.cpp
@@ -137,7 +137,7 @@
sockaddr_in* sock = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr);
in_addr_t addr = sock->sin_addr.s_addr;
- EXPECT_TRUE(addrs.find(addr) != addrs.end()) << if_name << ' ' << std::hex << ntohl(addr);
+ EXPECT_TRUE(addrs.contains(addr)) << if_name << ' ' << std::hex << ntohl(addr);
}
TEST(ifaddrs, getifaddrs_INET) {
diff --git a/tests/link_test.cpp b/tests/link_test.cpp
index 127a3d9..ae3a1cd 100644
--- a/tests/link_test.cpp
+++ b/tests/link_test.cpp
@@ -195,7 +195,7 @@
}
void AddModule(dl_phdr_info* info, size_t s) {
ASSERT_EQ(sizeof(dl_phdr_info), s);
- ASSERT_TRUE(dl_iter_mods.find(info->dlpi_addr) == dl_iter_mods.end());
+ ASSERT_FALSE(dl_iter_mods.contains(info->dlpi_addr));
ASSERT_TRUE(info->dlpi_name != nullptr);
dl_iter_mods[info->dlpi_addr] = {
.name = info->dlpi_name,
diff --git a/tests/stack_protector_test.cpp b/tests/stack_protector_test.cpp
index aea791c..5817a27 100644
--- a/tests/stack_protector_test.cpp
+++ b/tests/stack_protector_test.cpp
@@ -48,7 +48,7 @@
printf("[thread %d] TLS stack guard = %p\n", tid, guard);
// Duplicate tid. gettid(2) bug? Seeing this would be very upsetting.
- ASSERT_TRUE(tids.find(tid) == tids.end());
+ ASSERT_FALSE(tids.contains(tid));
// Uninitialized guard. Our bug. Note this is potentially flaky; we _could_
// get four random zero bytes, but it should be vanishingly unlikely.