summaryrefslogtreecommitdiffstats
path: root/base/tools_sanity_unittest.cc
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 08:25:54 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 08:25:54 +0000
commit66d051bb5092e35d36320e6a0fcc3ddb75f16c51 (patch)
tree15c6a3ab2bc239c5f46004aa5ede1392016af1a9 /base/tools_sanity_unittest.cc
parent1be341329409a49db07ca4406eb83b5c0b7cf1c2 (diff)
downloadchromium_src-66d051bb5092e35d36320e6a0fcc3ddb75f16c51.zip
chromium_src-66d051bb5092e35d36320e6a0fcc3ddb75f16c51.tar.gz
chromium_src-66d051bb5092e35d36320e6a0fcc3ddb75f16c51.tar.bz2
Copied Evan's http://codereview.chromium.org/3691007 (base_unittests: move
local functions into an anonymous namespace) and made the necessary changes to sanity suppressions. Review URL: http://codereview.chromium.org/3765002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62521 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tools_sanity_unittest.cc')
-rw-r--r--base/tools_sanity_unittest.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index 47a19b3..0f21381 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())