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

Side by Side Diff: mojo/public/cpp/bindings/tests/iterator_test_util.h

Issue 1372233002: Fix |Array| and iterator_util.h's Iterator operator->() behavior (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « mojo/public/cpp/bindings/lib/iterator_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 EXPECT_EQ(iter3_cp, iter3); 77 EXPECT_EQ(iter3_cp, iter3);
78 EXPECT_EQ(*iter3_cp, *iter3); 78 EXPECT_EQ(*iter3_cp, *iter3);
79 79
80 // Move constructible and assignable. 80 // Move constructible and assignable.
81 Iterator iter3_mv = static_cast<Iterator&&>(iter3); 81 Iterator iter3_mv = static_cast<Iterator&&>(iter3);
82 Iterator iter3_cp_mv; 82 Iterator iter3_cp_mv;
83 iter3_cp_mv = static_cast<Iterator&&>(iter3_cp); 83 iter3_cp_mv = static_cast<Iterator&&>(iter3_cp);
84 EXPECT_EQ(iter3_mv, iter3_cp_mv); 84 EXPECT_EQ(iter3_mv, iter3_cp_mv);
85 85
86 // operator->. 86 // operator->.
87 EXPECT_EQ(iter3_mv.operator->(), expected_values[1]); 87 EXPECT_EQ(*(iter3_mv.operator->()), expected_values[1]);
88 88
89 // Swap two iterators: 89 // Swap two iterators:
90 Iterator i1 = begin; 90 Iterator i1 = begin;
91 Iterator i2 = ++begin; 91 Iterator i2 = ++begin;
92 EXPECT_EQ(*i1, expected_values[0]); 92 EXPECT_EQ(*i1, expected_values[0]);
93 EXPECT_EQ(*i2, expected_values[1]); 93 EXPECT_EQ(*i2, expected_values[1]);
94 std::swap(i1, i2); 94 std::swap(i1, i2);
95 EXPECT_EQ(*i1, expected_values[1]); 95 EXPECT_EQ(*i1, expected_values[1]);
96 EXPECT_EQ(*i2, expected_values[0]); 96 EXPECT_EQ(*i2, expected_values[0]);
97 } 97 }
(...skipping 25 matching lines...) Expand all
123 *--it = 22; 123 *--it = 22;
124 values[0] = 22; 124 values[0] = 22;
125 ExpectIteratorValues(begin, end, values); 125 ExpectIteratorValues(begin, end, values);
126 } 126 }
127 } 127 }
128 128
129 } // namespace test 129 } // namespace test
130 } // namespace mojo 130 } // namespace mojo
131 131
132 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_ 132 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_ITERATOR_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/iterator_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698