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

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

Issue 288723003: Revert 270383 "Reland https://codereview.chromium.org/276493002:..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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: trunk/src/base/tools_sanity_unittest.cc
===================================================================
--- trunk/src/base/tools_sanity_unittest.cc (revision 270411)
+++ trunk/src/base/tools_sanity_unittest.cc (working copy)
@@ -100,25 +100,24 @@
// error report mechanism is different than with Asan so these tests will fail.
#define MAYBE_AccessesToNewMemory DISABLED_AccessesToNewMemory
#define MAYBE_AccessesToMallocMemory DISABLED_AccessesToMallocMemory
-#define MAYBE_SingleElementDeletedWithBraces \
- DISABLED_SingleElementDeletedWithBraces
-#define MAYBE_ArrayDeletedWithoutBraces DISABLED_ArrayDeletedWithoutBraces
#else
#define MAYBE_AccessesToNewMemory AccessesToNewMemory
#define MAYBE_AccessesToMallocMemory AccessesToMallocMemory
-
-#if defined(ADDRESS_SANITIZER) && !defined(OS_MACOSX)
-// AddressSanitizer for OSX doesn't support alloc-dealloc mismatch checks.
#define MAYBE_ArrayDeletedWithoutBraces ArrayDeletedWithoutBraces
#define MAYBE_SingleElementDeletedWithBraces SingleElementDeletedWithBraces
-#else
-#define MAYBE_ArrayDeletedWithoutBraces DISABLED_ArrayDeletedWithoutBraces
+#endif
+
+// The following tests pass with Clang r170392, but not r172454, which
+// makes AddressSanitizer detect errors in them. We disable these tests under
+// AddressSanitizer until we fully switch to Clang r172454. After that the
+// tests should be put back under the (defined(OS_IOS) || defined(OS_WIN))
+// clause above.
+// See also http://crbug.com/172614.
+#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
#define MAYBE_SingleElementDeletedWithBraces \
DISABLED_SingleElementDeletedWithBraces
+#define MAYBE_ArrayDeletedWithoutBraces DISABLED_ArrayDeletedWithoutBraces
#endif
-
-#endif
-
TEST(ToolsSanityTest, MAYBE_AccessesToNewMemory) {
char *foo = new char[10];
MakeSomeErrors(foo, 10);
@@ -145,12 +144,7 @@
// Without the |volatile|, clang optimizes away the next two lines.
int* volatile foo = new int[10];
- HARMFUL_ACCESS(delete foo, "alloc-dealloc-mismatch");
-#if defined(ADDRESS_SANITIZER)
- // Under ASan the crash happens in the process spawned by HARMFUL_ACCESS,
- // need to free the memory in the parent.
- delete [] foo;
-#endif
+ delete foo;
}
TEST(ToolsSanityTest, MAYBE_SingleElementDeletedWithBraces) {
@@ -164,12 +158,7 @@
// Without the |volatile|, clang optimizes away the next two lines.
int* volatile foo = new int;
(void) foo;
- HARMFUL_ACCESS(delete [] foo, "alloc-dealloc-mismatch");
-#if defined(ADDRESS_SANITIZER)
- // Under ASan the crash happens in the child process, need to free the memory
- // in the parent.
- delete foo;
-#endif
+ delete [] foo;
}
#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
« 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