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

Unified Diff: sandbox/win/src/address_sanitizer_test.cc

Issue 1837403002: Fix sandbox ASan test to cope with forward slashes in __FILE__ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: sandbox/win/src/address_sanitizer_test.cc
diff --git a/sandbox/win/src/address_sanitizer_test.cc b/sandbox/win/src/address_sanitizer_test.cc
index a18cab7ab62fc5bd8fac5e34dad58c14348d81ef..18239126188c5672d2439fb3e32a859af42f72cd 100644
--- a/sandbox/win/src/address_sanitizer_test.cc
+++ b/sandbox/win/src/address_sanitizer_test.cc
@@ -93,7 +93,10 @@ TEST_F(AddressSanitizerTests, TestAddressSanitizer) {
<< "There doesn't seem to be an ASan report:\n" << data;
ASSERT_TRUE(strstr(data.c_str(), "AddressSanitizerTests_Report"))
<< "The ASan report doesn't appear to be symbolized:\n" << data;
- ASSERT_TRUE(strstr(data.c_str(), strrchr(__FILE__, '\\')))
+ std::string source_file_basename(__FILE__);
+ size_t last_slash = source_file_basename.find_last_of("/\\");
+ last_slash = last_slash == std::string::npos ? 0 : last_slash + 1;
+ ASSERT_TRUE(strstr(data.c_str(), &source_file_basename[last_slash]))
<< "The stack trace doesn't have a correct filename:\n" << data;
} else {
LOG(WARNING) << "Not an AddressSanitizer build, skipping the run.";
« 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