OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "media/base/ranges.h" | 5 #include "media/base/ranges.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <sstream> | 9 #include <sstream> |
8 | 10 |
9 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 | 13 |
12 namespace media { | 14 namespace media { |
13 | 15 |
14 // Human-readable output operator, for debugging/testability. | 16 // Human-readable output operator, for debugging/testability. |
15 template<class T> | 17 template<class T> |
16 std::ostream& operator<<(std::ostream& os, const Ranges<T>& r) { | 18 std::ostream& operator<<(std::ostream& os, const Ranges<T>& r) { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // first range and ends at the end of the last range. | 144 // first range and ends at the end of the last range. |
143 b.clear(); | 145 b.clear(); |
144 ASSERT_EQ(b.Add(0, 12), 1u) << b; | 146 ASSERT_EQ(b.Add(0, 12), 1u) << b; |
145 ASSERT_RANGES(a, "{ [0,1) [4,7) [10,12) }"); | 147 ASSERT_RANGES(a, "{ [0,1) [4,7) [10,12) }"); |
146 ASSERT_RANGES(b, "{ [0,12) }"); | 148 ASSERT_RANGES(b, "{ [0,12) }"); |
147 ASSERT_RANGES(a.IntersectionWith(b), "{ [0,1) [4,7) [10,12) }"); | 149 ASSERT_RANGES(a.IntersectionWith(b), "{ [0,1) [4,7) [10,12) }"); |
148 ASSERT_RANGES(b.IntersectionWith(a), "{ [0,1) [4,7) [10,12) }"); | 150 ASSERT_RANGES(b.IntersectionWith(a), "{ [0,1) [4,7) [10,12) }"); |
149 } | 151 } |
150 | 152 |
151 } // namespace media | 153 } // namespace media |
OLD | NEW |