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

Side by Side Diff: courgette/third_party/bsdiff/paged_array_unittest.cc

Issue 2036393002: asan/win: Unbreak build after https://codereview.chromium.org/2008553007/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "courgette/third_party/bsdiff/paged_array.h" 5 #include "courgette/third_party/bsdiff/paged_array.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
11 #include <random> 11 #include <random>
12 #include <vector> 12 #include <vector>
13 13
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace { 16 namespace {
17 17
18 #if !defined(ADDRESS_SANITIZER) || !defined(OS_WIN)
18 // Total allocation of 4GB will fail in 32 bit programs if allocations are 19 // Total allocation of 4GB will fail in 32 bit programs if allocations are
19 // leaked. 20 // leaked.
20 const int kIterations = 20; 21 const int kIterations = 20;
21 const int kSizeBig = 200 * 1024 * 1024 / sizeof(int); // 200MB 22 const int kSizeBig = 200 * 1024 * 1024 / sizeof(int); // 200MB
23 #endif
22 24
23 const size_t kLogBlockSizeSmall = 10; 25 const size_t kLogBlockSizeSmall = 10;
24 const size_t kBlockSizeSmall = 1 << kLogBlockSizeSmall; 26 const size_t kBlockSizeSmall = 1 << kLogBlockSizeSmall;
25 const size_t kSizeList[] = {1, 27 const size_t kSizeList[] = {1,
26 16, 28 16,
27 123, 29 123,
28 kBlockSizeSmall, 30 kBlockSizeSmall,
29 kBlockSizeSmall + 1, 31 kBlockSizeSmall + 1,
30 123 * kBlockSizeSmall + 567}; 32 123 * kBlockSizeSmall + 567};
31 33
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 for (size_t i = 0; i < size; ++i) { 239 for (size_t i = 0; i < size; ++i) {
238 v[i] = pseudo_rand_gen(); 240 v[i] = pseudo_rand_gen();
239 a[i] = v[i]; 241 a[i] = v[i];
240 } 242 }
241 std::sort(v.begin(), v.end()); 243 std::sort(v.begin(), v.end());
242 std::sort(a.begin(), a.end()); 244 std::sort(a.begin(), a.end());
243 for (size_t i = 0; i < size; ++i) 245 for (size_t i = 0; i < size; ++i)
244 EXPECT_EQ(v[i], a[i]); 246 EXPECT_EQ(v[i], a[i]);
245 } 247 }
246 } 248 }
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