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 |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "gtest/gtest.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 namespace test { | 14 namespace test { |
15 | 15 |
16 template <typename Iterator, typename ValueType> | 16 template <typename Iterator, typename ValueType> |
17 void ExpectIteratorValues(Iterator begin, | 17 void ExpectIteratorValues(Iterator begin, |
18 Iterator end, | 18 Iterator end, |
19 const std::vector<ValueType>& expected_values) { | 19 const std::vector<ValueType>& expected_values) { |
20 size_t i = 0u; | 20 size_t i = 0u; |
21 for (Iterator it = begin; it != end; ++it, ++i) { | 21 for (Iterator it = begin; it != end; ++it, ++i) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |