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

Side by Side Diff: base/tools_sanity_unittest.cc

Issue 8050008: gcc 4.6 warnings cleanup (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/history/history_browsertest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/atomicops.h" 5 #include "base/atomicops.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 7 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 delete foo; 92 delete foo;
93 } 93 }
94 94
95 TEST(ToolsSanityTest, SingleElementDeletedWithBraces) { 95 TEST(ToolsSanityTest, SingleElementDeletedWithBraces) {
96 // This test may corrupt memory if not run under Valgrind. 96 // This test may corrupt memory if not run under Valgrind.
97 if (!RunningOnValgrind()) 97 if (!RunningOnValgrind())
98 return; 98 return;
99 99
100 // Without the |volatile|, clang optimizes away the next two lines. 100 // Without the |volatile|, clang optimizes away the next two lines.
101 int* volatile foo = new int; 101 int* volatile foo = new int;
102 (void) foo;
102 delete [] foo; 103 delete [] foo;
103 } 104 }
104 105
105 106
106 namespace { 107 namespace {
107 108
108 // We use caps here just to ensure that the method name doesn't interfere with 109 // We use caps here just to ensure that the method name doesn't interfere with
109 // the wildcarded suppressions. 110 // the wildcarded suppressions.
110 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { 111 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate {
111 public: 112 public:
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 182
182 TEST(ToolsSanityTest, AtomicsAreIgnored) { 183 TEST(ToolsSanityTest, AtomicsAreIgnored) {
183 base::subtle::Atomic32 shared = 0; 184 base::subtle::Atomic32 shared = 0;
184 ReleaseStoreThread thread1(&shared); 185 ReleaseStoreThread thread1(&shared);
185 AcquireLoadThread thread2(&shared); 186 AcquireLoadThread thread2(&shared);
186 RunInParallel(&thread1, &thread2); 187 RunInParallel(&thread1, &thread2);
187 EXPECT_EQ(kMagicValue, shared); 188 EXPECT_EQ(kMagicValue, shared);
188 } 189 }
189 190
190 } // namespace base 191 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698