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

Unified Diff: base/tuple_unittest.cc

Issue 785153002: Add index access support to base::Tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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') | no next file » | 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 8d620deb63984a2d6affda22e345d8613062af47..9715d552365f1f76dd5a9897de92f0507e4270b1 100644
--- a/base/tuple_unittest.cc
+++ b/base/tuple_unittest.cc
@@ -57,6 +57,24 @@ TEST(TupleTest, Basic) {
EXPECT_EQ(4, t6.d);
EXPECT_EQ(5, t6.e);
+ EXPECT_EQ(1, t1.Get<0>());
+ EXPECT_EQ(1, t2.Get<0>());
+ EXPECT_EQ(1, t3.Get<0>());
+ EXPECT_EQ(2, t3.Get<1>());
+ EXPECT_EQ(3, t3.Get<2>());
+ EXPECT_EQ(1, t4.Get<0>());
+ EXPECT_EQ(2, t4.Get<1>());
+ EXPECT_EQ(3, t4.Get<2>());
+ EXPECT_EQ(1, t5.Get<0>());
+ EXPECT_EQ(2, t5.Get<1>());
+ EXPECT_EQ(3, t5.Get<2>());
+ EXPECT_EQ(4, t5.Get<3>());
+ EXPECT_EQ(1, t6.Get<0>());
+ EXPECT_EQ(2, t6.Get<1>());
+ EXPECT_EQ(3, t6.Get<2>());
+ EXPECT_EQ(4, t6.Get<3>());
+ EXPECT_EQ(5, t6.Get<4>());
+
EXPECT_EQ(1, t1.a);
DispatchToFunction(&DoAdd, t4);
EXPECT_EQ(6, t1.a);
« no previous file with comments | « base/tuple.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698