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

Unified Diff: base/tools_sanity_unittest.cc

Issue 3691007: base_unittests: move local functions into an anonymous namespace (Closed)
Patch Set: Created 10 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 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/tools_sanity_unittest.cc
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index 47a19b3fd7cd33d7553fd6bb49b74708cf126501..0f213818fe598626e54c56898c51f0610462cc7a 100644
--- a/base/tools_sanity_unittest.cc
+++ b/base/tools_sanity_unittest.cc
@@ -27,14 +27,6 @@ class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate {
bool *value_;
};
-}
-
-// A memory leak detector should report an error in this test.
-TEST(ToolsSanityTest, MemoryLeak) {
- int *leak = new int[256]; // Leak some memory intentionally.
- leak[4] = 1; // Make sure the allocated memory is used.
-}
-
void ReadUninitializedValue(char *ptr) {
if (*ptr == '\0') {
(*ptr)++;
@@ -77,6 +69,14 @@ void MakeSomeErrors(char *ptr, size_t size) {
#endif
}
+} // namespace
+
+// A memory leak detector should report an error in this test.
+TEST(ToolsSanityTest, MemoryLeak) {
+ int *leak = new int[256]; // Leak some memory intentionally.
+ leak[4] = 1; // Make sure the allocated memory is used.
+}
+
TEST(ToolsSanityTest, AccessesToNewMemory) {
// This test may corrupt memory if not run under Valgrind.
if (!RunningOnValgrind())
« 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