Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/processor/static_map_unittest.cc

Issue 1788473002: Used non-sized delete for dynamically sized memory. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698