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 "cc/hash_pair.h" | 5 #include "cc/hash_pair.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
| 8 namespace { |
| 9 |
8 class HashPairTest : public testing::Test { | 10 class HashPairTest : public testing::Test { |
9 }; | 11 }; |
10 | 12 |
11 #define INSERT_PAIR_TEST(Type, value1, value2) \ | 13 #define INSERT_PAIR_TEST(Type, value1, value2) \ |
12 { \ | 14 { \ |
13 Type pair(value1, value2); \ | 15 Type pair(value1, value2); \ |
14 base::hash_map<Type, int> map; \ | 16 base::hash_map<Type, int> map; \ |
15 map[pair] = 1; \ | 17 map[pair] = 1; \ |
16 } | 18 } |
17 | 19 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 typedef std::pair<int64, short> Int64ShortPair; | 53 typedef std::pair<int64, short> Int64ShortPair; |
52 typedef std::pair<int64, int> Int64IntPair; | 54 typedef std::pair<int64, int> Int64IntPair; |
53 typedef std::pair<int64, int32> Int64Int32Pair; | 55 typedef std::pair<int64, int32> Int64Int32Pair; |
54 typedef std::pair<int64, int64> Int64Int64Pair; | 56 typedef std::pair<int64, int64> Int64Int64Pair; |
55 | 57 |
56 INSERT_PAIR_TEST(Int64ShortPair, 4, 6); | 58 INSERT_PAIR_TEST(Int64ShortPair, 4, 6); |
57 INSERT_PAIR_TEST(Int64IntPair, 7, (1 << 30) + 4342); | 59 INSERT_PAIR_TEST(Int64IntPair, 7, (1 << 30) + 4342); |
58 INSERT_PAIR_TEST(Int64Int32Pair, 9, (1 << 29) + 378128932); | 60 INSERT_PAIR_TEST(Int64Int32Pair, 9, (1 << 29) + 378128932); |
59 INSERT_PAIR_TEST(Int64Int64Pair, 10, (1LL << 60) + 78931732321); | 61 INSERT_PAIR_TEST(Int64Int64Pair, 10, (1LL << 60) + 78931732321); |
60 } | 62 } |
| 63 |
| 64 } // anonymous namespace |
OLD | NEW |