Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
| 2 // All rights reserved. | 2 // 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * 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 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 unsigned int size_per_node = | 173 unsigned int size_per_node = |
| 174 sizeof(uint32_t) + sizeof(KeyType) + sizeof(ValueType); | 174 sizeof(uint32_t) + sizeof(KeyType) + sizeof(ValueType); |
| 175 for (testcase = 0; testcase < kNumberTestCases; ++testcase) { | 175 for (testcase = 0; testcase < kNumberTestCases; ++testcase) { |
| 176 correct_size[testcase] = | 176 correct_size[testcase] = |
| 177 sizeof(uint32_t) + std_map[testcase].size() * size_per_node; | 177 sizeof(uint32_t) + std_map[testcase].size() * size_per_node; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 void TearDown() { | 181 void TearDown() { |
| 182 for (int i = 0;i < kNumberTestCases; ++i) | 182 for (int i = 0;i < kNumberTestCases; ++i) |
| 183 delete map_data[i]; | 183 ::operator delete(map_data[i]); |
|
Mark Mentovai
2016/03/11 04:34:23
The use of operator new didn’t have ::, why does t
ivanpe
2016/03/12 00:30:04
The intention is to use the default new operator,
| |
| 184 } | 184 } |
| 185 | 185 |
| 186 | 186 |
| 187 void IteratorTester(int test_case) { | 187 void IteratorTester(int test_case) { |
| 188 // scan through: | 188 // scan through: |
| 189 iter_test = test_map[test_case].begin(); | 189 iter_test = test_map[test_case].begin(); |
| 190 iter_std = std_map[test_case].begin(); | 190 iter_std = std_map[test_case].begin(); |
| 191 | 191 |
| 192 for (; iter_test != test_map[test_case].end() && | 192 for (; iter_test != test_map[test_case].end() && |
| 193 iter_std != std_map[test_case].end(); | 193 iter_std != std_map[test_case].end(); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 | 377 |
| 378 // Test lookup operations. | 378 // Test lookup operations. |
| 379 LookupTester(test_case); | 379 LookupTester(test_case); |
| 380 } | 380 } |
| 381 | 381 |
| 382 int main(int argc, char *argv[]) { | 382 int main(int argc, char *argv[]) { |
| 383 ::testing::InitGoogleTest(&argc, argv); | 383 ::testing::InitGoogleTest(&argc, argv); |
| 384 | 384 |
| 385 return RUN_ALL_TESTS(); | 385 return RUN_ALL_TESTS(); |
| 386 } | 386 } |
| OLD | NEW |