Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1948)

Unified Diff: base/tuple_unittest.cc

Issue 2023243002: Remove base::Tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/tuple.h ('k') | chrome/renderer/chrome_render_frame_observer_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tuple_unittest.cc
diff --git a/base/tuple_unittest.cc b/base/tuple_unittest.cc
index 55a91392353076d49f7f896dd477c8e03e2b4ad9..815b43bb1b3236b10cc5a142b4d5ef1e264d84b1 100644
--- a/base/tuple_unittest.cc
+++ b/base/tuple_unittest.cc
@@ -32,51 +32,34 @@ struct Addz {
} // namespace
TEST(TupleTest, Basic) {
- base::Tuple<> t0 = base::MakeTuple();
+ std::tuple<> t0 = std::make_tuple();
ALLOW_UNUSED_LOCAL(t0);
- base::Tuple<int> t1(1);
- base::Tuple<int, const char*> t2 =
- base::MakeTuple(1, static_cast<const char*>("wee"));
- base::Tuple<int, int, int> t3(1, 2, 3);
- base::Tuple<int, int, int, int*> t4(1, 2, 3, &get<0>(t1));
- base::Tuple<int, int, int, int, int*> t5(1, 2, 3, 4, &get<0>(t4));
- base::Tuple<int, int, int, int, int, int*> t6(1, 2, 3, 4, 5, &get<0>(t4));
-
- EXPECT_EQ(1, get<0>(t1));
- EXPECT_EQ(1, get<0>(t2));
- EXPECT_EQ(1, get<0>(t3));
- EXPECT_EQ(2, get<1>(t3));
- EXPECT_EQ(3, get<2>(t3));
- EXPECT_EQ(1, get<0>(t4));
- EXPECT_EQ(2, get<1>(t4));
- EXPECT_EQ(3, get<2>(t4));
- EXPECT_EQ(1, get<0>(t5));
- EXPECT_EQ(2, get<1>(t5));
- EXPECT_EQ(3, get<2>(t5));
- EXPECT_EQ(4, get<3>(t5));
- EXPECT_EQ(1, get<0>(t6));
- EXPECT_EQ(2, get<1>(t6));
- EXPECT_EQ(3, get<2>(t6));
- EXPECT_EQ(4, get<3>(t6));
- EXPECT_EQ(5, get<4>(t6));
-
- EXPECT_EQ(1, get<0>(t1));
+ std::tuple<int> t1(1);
+ std::tuple<int, const char*> t2 =
+ std::make_tuple(1, static_cast<const char*>("wee"));
+ ALLOW_UNUSED_LOCAL(t2);
+ std::tuple<int, int, int> t3(1, 2, 3);
+ std::tuple<int, int, int, int*> t4(1, 2, 3, &std::get<0>(t1));
+ std::tuple<int, int, int, int, int*> t5(1, 2, 3, 4, &std::get<0>(t4));
+ std::tuple<int, int, int, int, int, int*> t6(1, 2, 3, 4, 5, &std::get<0>(t4));
+
+ EXPECT_EQ(1, std::get<0>(t1));
DispatchToFunction(&DoAdd, t4);
- EXPECT_EQ(6, get<0>(t1));
+ EXPECT_EQ(6, std::get<0>(t1));
int res = 0;
- DispatchToFunction(&DoAdd, base::MakeTuple(9, 8, 7, &res));
+ DispatchToFunction(&DoAdd, std::make_tuple(9, 8, 7, &res));
EXPECT_EQ(24, res);
Addy addy;
- EXPECT_EQ(1, get<0>(t4));
+ EXPECT_EQ(1, std::get<0>(t4));
DispatchToMethod(&addy, &Addy::DoAdd, t5);
- EXPECT_EQ(10, get<0>(t4));
+ EXPECT_EQ(10, std::get<0>(t4));
Addz addz;
- EXPECT_EQ(10, get<0>(t4));
+ EXPECT_EQ(10, std::get<0>(t4));
DispatchToMethod(&addz, &Addz::DoAdd, t6);
- EXPECT_EQ(15, get<0>(t4));
+ EXPECT_EQ(15, std::get<0>(t4));
}
namespace {
@@ -111,8 +94,8 @@ TEST(TupleTest, Copying) {
bool res = false;
// Creating the tuple should copy the class to store internally in the tuple.
- base::Tuple<CopyLogger, CopyLogger*, bool*> tuple(logger, &logger, &res);
- get<1>(tuple) = &get<0>(tuple);
+ std::tuple<CopyLogger, CopyLogger*, bool*> tuple(logger, &logger, &res);
+ std::get<1>(tuple) = &std::get<0>(tuple);
EXPECT_EQ(2, CopyLogger::TimesConstructed);
EXPECT_EQ(1, CopyLogger::TimesCopied);
« no previous file with comments | « base/tuple.h ('k') | chrome/renderer/chrome_render_frame_observer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698