| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "platform/globals.h" | 6 #include "platform/globals.h" |
| 7 #include "platform/hashmap.h" | 7 #include "platform/hashmap.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 | 9 |
| 10 namespace dart { |
| 11 |
| 10 // Default initial size of hashmaps used in these tests. | 12 // Default initial size of hashmaps used in these tests. |
| 11 static intptr_t kInitialSize = 8; | 13 static intptr_t kInitialSize = 8; |
| 12 | 14 |
| 13 | 15 |
| 14 typedef uint32_t (*IntKeyHash)(uint32_t key); | 16 typedef uint32_t (*IntKeyHash)(uint32_t key); |
| 15 | 17 |
| 16 | 18 |
| 17 class IntSet { | 19 class IntSet { |
| 18 public: | 20 public: |
| 19 explicit IntSet(IntKeyHash hash) | 21 explicit IntSet(IntKeyHash hash) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 162 |
| 161 | 163 |
| 162 UNIT_TEST_CASE(Set) { | 164 UNIT_TEST_CASE(Set) { |
| 163 TestSet(WordHash, 100); | 165 TestSet(WordHash, 100); |
| 164 TestSet(Hash, 100); | 166 TestSet(Hash, 100); |
| 165 TestSet(CollisionHash1, 50); | 167 TestSet(CollisionHash1, 50); |
| 166 TestSet(CollisionHash2, 50); | 168 TestSet(CollisionHash2, 50); |
| 167 TestSet(CollisionHash3, 50); | 169 TestSet(CollisionHash3, 50); |
| 168 TestSet(CollisionHash4, 50); | 170 TestSet(CollisionHash4, 50); |
| 169 } | 171 } |
| 172 |
| 173 } // namespace dart |
| OLD | NEW |