| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |