OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 10 matching lines...) Expand all Loading... |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 // Tests for the interval tree class. | 26 // Tests for the interval tree class. |
27 | 27 |
28 #include "platform/PODIntervalTree.h" | 28 #include "platform/PODIntervalTree.h" |
29 | 29 |
30 #include "platform/testing/TreeTestHelpers.h" | 30 #include "platform/testing/TreeTestHelpers.h" |
| 31 #include "platform/wtf/Vector.h" |
| 32 #include "platform/wtf/text/WTFString.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
32 #include "wtf/Vector.h" | |
33 #include "wtf/text/WTFString.h" | |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 using TreeTestHelpers::InitRandom; | 37 using TreeTestHelpers::InitRandom; |
38 using TreeTestHelpers::NextRandom; | 38 using TreeTestHelpers::NextRandom; |
39 | 39 |
40 #ifndef NDEBUG | 40 #ifndef NDEBUG |
41 template <> | 41 template <> |
42 struct ValueToString<float> { | 42 struct ValueToString<float> { |
43 static String ToString(const float& value) { return String::Number(value); } | 43 static String ToString(const float& value) { return String::Number(value); } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 ASSERT_TRUE(tree.CheckInvariants()); | 340 ASSERT_TRUE(tree.CheckInvariants()); |
341 tree.Add(tree.CreateInterval(3, 5)); | 341 tree.Add(tree.CreateInterval(3, 5)); |
342 ASSERT_TRUE(tree.CheckInvariants()); | 342 ASSERT_TRUE(tree.CheckInvariants()); |
343 tree.Add(tree.CreateInterval(4, 12)); | 343 tree.Add(tree.CreateInterval(4, 12)); |
344 ASSERT_TRUE(tree.CheckInvariants()); | 344 ASSERT_TRUE(tree.CheckInvariants()); |
345 tree.Remove(tree.CreateInterval(4, 12)); | 345 tree.Remove(tree.CreateInterval(4, 12)); |
346 ASSERT_TRUE(tree.CheckInvariants()); | 346 ASSERT_TRUE(tree.CheckInvariants()); |
347 } | 347 } |
348 | 348 |
349 } // namespace blink | 349 } // namespace blink |
OLD | NEW |