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

Unified Diff: trunk/src/base/atomicops_unittest.cc

Issue 227743006: Revert 262147 "Remove all uses of GG_LONGLONG and GG_ULONGLONG." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/base/allocator/allocator_unittest.cc ('k') | trunk/src/base/basictypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/base/atomicops_unittest.cc
===================================================================
--- trunk/src/base/atomicops_unittest.cc (revision 262163)
+++ trunk/src/base/atomicops_unittest.cc (working copy)
@@ -4,9 +4,9 @@
#include "base/atomicops.h"
-#include <stdint.h>
#include <string.h>
+#include "base/port.h"
#include "testing/gtest/include/gtest/gtest.h"
template <class AtomicType>
@@ -91,7 +91,7 @@
// Use test value that has non-zero bits in both halves, more for testing
// 64-bit implementation on 32-bit platforms.
- const AtomicType k_test_val = (static_cast<uint64_t>(1) <<
+ const AtomicType k_test_val = (GG_ULONGLONG(1) <<
(NUM_BITS(AtomicType) - 2)) + 11;
value = k_test_val;
prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 5);
@@ -114,7 +114,7 @@
// Use test value that has non-zero bits in both halves, more for testing
// 64-bit implementation on 32-bit platforms.
- const AtomicType k_test_val = (static_cast<uint64_t>(1) <<
+ const AtomicType k_test_val = (GG_ULONGLONG(1) <<
(NUM_BITS(AtomicType) - 2)) + 11;
value = k_test_val;
new_value = base::subtle::NoBarrier_AtomicExchange(&value, k_test_val);
@@ -131,7 +131,7 @@
template <class AtomicType>
static void TestAtomicIncrementBounds() {
// Test at rollover boundary between int_max and int_min
- AtomicType test_val = (static_cast<uint64_t>(1) <<
+ AtomicType test_val = (GG_ULONGLONG(1) <<
(NUM_BITS(AtomicType) - 1));
AtomicType value = -1 ^ test_val;
AtomicType new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
@@ -142,7 +142,7 @@
EXPECT_EQ(-1 ^ test_val, value);
// Test at 32-bit boundary for 64-bit atomic type.
- test_val = static_cast<uint64_t>(1) << (NUM_BITS(AtomicType) / 2);
+ test_val = GG_ULONGLONG(1) << (NUM_BITS(AtomicType) / 2);
value = test_val - 1;
new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
EXPECT_EQ(test_val, value);
« no previous file with comments | « trunk/src/base/allocator/allocator_unittest.cc ('k') | trunk/src/base/basictypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698