From dab4880c3fb7c821923222784d7b854aba38e726 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Tue, 21 Jan 2025 12:59:59 -0800 Subject: [PATCH] fbcode//fb303/test:simple_lru_map_test Reviewed By: cjhawley Differential Revision: D68272450 fbshipit-source-id: b272749100d5420a64b8148f137fc9275ac6fb3b --- fb303/test/SimpleLRUMapTest.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/fb303/test/SimpleLRUMapTest.cpp b/fb303/test/SimpleLRUMapTest.cpp index b2505db29..ab91d8165 100644 --- a/fb303/test/SimpleLRUMapTest.cpp +++ b/fb303/test/SimpleLRUMapTest.cpp @@ -677,29 +677,29 @@ TEST(SimpleLRUMap, MapGet) { TEST(SimpleLRUMap, MapGetPtr) { lru_map lru(2); - auto out = stl::mapGetPtr(as_const(lru), 0); + auto out = folly::get_ptr(as_const(lru), 0); EXPECT_EQ(nullptr, out); checkContents(lru, {}); lru.set(0, "0"); checkContents(lru, {{0, "0"}}); - out = stl::mapGetPtr(as_const(lru), 0); + out = folly::get_ptr(as_const(lru), 0); EXPECT_NE(nullptr, out); EXPECT_EQ("0", *out); checkContents(lru, {{0, "0"}}); lru.set(1, "1"); checkContents(lru, {{1, "1"}, {0, "0"}}); - out = stl::mapGetPtr(as_const(lru), 1); + out = folly::get_ptr(as_const(lru), 1); EXPECT_NE(nullptr, out); EXPECT_EQ("1", *out); checkContents(lru, {{1, "1"}, {0, "0"}}); - out = stl::mapGetPtr(as_const(lru), 0); + out = folly::get_ptr(as_const(lru), 0); EXPECT_NE(nullptr, out); EXPECT_EQ("0", *out); checkContents(lru, {{1, "1"}, {0, "0"}}); - out = stl::mapGetPtr(as_const(lru), 9); + out = folly::get_ptr(as_const(lru), 9); EXPECT_EQ(nullptr, out); checkContents(lru, {{1, "1"}, {0, "0"}}); } @@ -707,22 +707,22 @@ TEST(SimpleLRUMap, MapGetPtr) { TEST(SimpleLRUMap, MapGetDefault) { lru_map lru(2); - EXPECT_EQ("x", stl::mapGetDefault(lru, 0, "x")); + EXPECT_EQ("x", folly::get_default(lru, 0, "x")); checkContents(lru, {}); lru.set(0, "0"); checkContents(lru, {{0, "0"}}); - EXPECT_EQ("0", stl::mapGetDefault(lru, 0, "x")); + EXPECT_EQ("0", folly::get_default(lru, 0, "x")); checkContents(lru, {{0, "0"}}); lru.set(1, "1"); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("1", stl::mapGetDefault(lru, 1, "x")); + EXPECT_EQ("1", folly::get_default(lru, 1, "x")); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("0", stl::mapGetDefault(lru, 0, "x")); + EXPECT_EQ("0", folly::get_default(lru, 0, "x")); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("x", stl::mapGetDefault(lru, 9, "x")); + EXPECT_EQ("x", folly::get_default(lru, 9, "x")); checkContents(lru, {{1, "1"}, {0, "0"}}); } @@ -730,22 +730,22 @@ TEST(SimpleLRUMap, MapGetRefDefault) { lru_map lru(2); const std::string x = "x"; - EXPECT_EQ("x", stl::mapGetRefDefault(lru, 0, x)); + EXPECT_EQ("x", folly::get_ref_default(lru, 0, x)); checkContents(lru, {}); lru.set(0, "0"); checkContents(lru, {{0, "0"}}); - EXPECT_EQ("0", stl::mapGetRefDefault(lru, 0, x)); + EXPECT_EQ("0", folly::get_ref_default(lru, 0, x)); checkContents(lru, {{0, "0"}}); lru.set(1, "1"); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("1", stl::mapGetRefDefault(lru, 1, x)); + EXPECT_EQ("1", folly::get_ref_default(lru, 1, x)); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("0", stl::mapGetRefDefault(lru, 0, x)); + EXPECT_EQ("0", folly::get_ref_default(lru, 0, x)); checkContents(lru, {{1, "1"}, {0, "0"}}); - EXPECT_EQ("x", stl::mapGetRefDefault(lru, 9, x)); + EXPECT_EQ("x", folly::get_ref_default(lru, 9, x)); checkContents(lru, {{1, "1"}, {0, "0"}}); }