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

Side by Side Diff: base/bits_unittest.cc

Issue 1538743002: Switch to standard integer types in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS roll too Created 4 years, 12 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 | « base/bits.h ('k') | base/callback_helpers.h » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This file contains the unit tests for the bit utilities. 5 // This file contains the unit tests for the bit utilities.
6 6
7 #include "base/bits.h" 7 #include "base/bits.h"
8 8
9 #include <stddef.h>
10
9 #include <limits> 11 #include <limits>
10 12
11 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
12 14
13 namespace base { 15 namespace base {
14 namespace bits { 16 namespace bits {
15 17
16 TEST(BitsTest, Log2Floor) { 18 TEST(BitsTest, Log2Floor) {
17 EXPECT_EQ(-1, Log2Floor(0)); 19 EXPECT_EQ(-1, Log2Floor(0));
18 EXPECT_EQ(0, Log2Floor(1)); 20 EXPECT_EQ(0, Log2Floor(1));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 EXPECT_EQ(4096ul, Align(1, 4096)); 56 EXPECT_EQ(4096ul, Align(1, 4096));
55 EXPECT_EQ(4096ul, Align(4096, 4096)); 57 EXPECT_EQ(4096ul, Align(4096, 4096));
56 EXPECT_EQ(4096ul, Align(4095, 4096)); 58 EXPECT_EQ(4096ul, Align(4095, 4096));
57 EXPECT_EQ(8192ul, Align(4097, 4096)); 59 EXPECT_EQ(8192ul, Align(4097, 4096));
58 EXPECT_EQ(kSizeTMax - 31, Align(kSizeTMax - 62, 32)); 60 EXPECT_EQ(kSizeTMax - 31, Align(kSizeTMax - 62, 32));
59 EXPECT_EQ(kSizeTMax / 2 + 1, Align(1, kSizeTMax / 2 + 1)); 61 EXPECT_EQ(kSizeTMax / 2 + 1, Align(1, kSizeTMax / 2 + 1));
60 } 62 }
61 63
62 } // namespace bits 64 } // namespace bits
63 } // namespace base 65 } // namespace base
OLDNEW
« no previous file with comments | « base/bits.h ('k') | base/callback_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698