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

Unified Diff: base/tools_sanity_unittest.cc

Issue 8491013: More sanity unittests to make sure AddressSanitizer is instrumenting the code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
===================================================================
--- base/tools_sanity_unittest.cc (revision 108853)
+++ base/tools_sanity_unittest.cc (working copy)
@@ -123,12 +123,37 @@
}
#ifdef ADDRESS_SANITIZER
-TEST(ToolsSanityTest, DISABLED_AddressSanitizerCrashTest) {
+TEST(ToolsSanityTest, DISABLED_AddressSanitizerNullDerefCrashTest) {
// Intentionally crash to make sure AddressSanitizer is running.
// This test should not be ran on bots.
int* volatile zero = NULL;
*zero = 0;
}
+
+TEST(ToolsSanityTest, DISABLED_AddressSanitizerLocalOOBCrashTest) {
+ // Intentionally crash to make sure AddressSanitizer is instrumenting
+ // the local variables.
+ // This test should not be ran on bots.
+ int array[5];
+ // Work around the OOB warning reported by Clang.
+ int* volatile access = &array[5];
+ *access = 43;
+}
+
+namespace {
+int g_asan_test_global_array[10];
+} // namespace
+
+TEST(ToolsSanityTest, DISABLED_AddressSanitizerGlobalOOBCrashTest) {
+ // Intentionally crash to make sure AddressSanitizer is instrumenting
+ // the global variables.
+ // This test should not be ran on bots.
+
+ // Work around the OOB warning reported by Clang.
+ int* volatile access = g_asan_test_global_array - 1;
+ *access = 43;
+}
+
#endif
namespace {
« 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