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

Unified Diff: base/allocator/allocator_shim_unittest.cc

Issue 1974723002: [Chromecast] Add metric reporting to ConnectivityCheckerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Initial PS Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_shim_unittest.cc
diff --git a/base/allocator/allocator_shim_unittest.cc b/base/allocator/allocator_shim_unittest.cc
index e1a7f53874ea6e472f34d3cbac1c80ae00061e85..776263f91d9f5fa55d2bc9e2e56c34a89147d850 100644
--- a/base/allocator/allocator_shim_unittest.cc
+++ b/base/allocator/allocator_shim_unittest.cc
@@ -158,7 +158,9 @@ class ThreadDelegateForNewHandlerTest : public PlatformThread::Delegate {
void ThreadMain() override {
event_->Wait();
- void* res = realloc(reinterpret_cast<void*>(0x42ul), 1);
+
+ // volatile to ensure the compiler doesn't optimize away the equality check
+ void* volatile res = realloc(reinterpret_cast<void*>(0x42ul), 1);
EXPECT_EQ(0x42u, reinterpret_cast<uintptr_t>(res));
}
« 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