| OLD | NEW |
| 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/paged_array.h" | 5 #include "courgette/third_party/bsdiff/paged_array.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 class PagedArrayTest : public testing::Test { | 9 class PagedArrayTest : public testing::Test { |
| 10 public: | 10 public: |
| 11 // Total allocation of 4GB will fail in 32 bit programs if allocations are | 11 // Total allocation of 4GB will fail in 32 bit programs if allocations are |
| 12 // leaked. | 12 // leaked. |
| 13 static const int kIterations = 20; | 13 static const int kIterations = 20; |
| 14 static const int kSize = 200 * 1024 * 1024 / sizeof(int); // 200MB | 14 static const int kSize = 200 * 1024 * 1024 / sizeof(int); // 200MB |
| 15 }; | 15 }; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 37 const int kAccessSize = 3 * 1024 * 1024; | 37 const int kAccessSize = 3 * 1024 * 1024; |
| 38 courgette::PagedArray<int> a; | 38 courgette::PagedArray<int> a; |
| 39 a.Allocate(kAccessSize); | 39 a.Allocate(kAccessSize); |
| 40 for (int i = 0; i < kAccessSize; ++i) { | 40 for (int i = 0; i < kAccessSize; ++i) { |
| 41 a[i] = i; | 41 a[i] = i; |
| 42 } | 42 } |
| 43 for (int i = 0; i < kAccessSize; ++i) { | 43 for (int i = 0; i < kAccessSize; ++i) { |
| 44 EXPECT_EQ(i, a[i]); | 44 EXPECT_EQ(i, a[i]); |
| 45 } | 45 } |
| 46 } | 46 } |
| OLD | NEW |