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

Unified Diff: base/debug/proc_maps_linux_unittest.cc

Issue 18661009: Update ReadProcMaps() to reflect lack of atomicity when reading /proc/self/maps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 3 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 | « base/debug/proc_maps_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/proc_maps_linux_unittest.cc
diff --git a/base/debug/proc_maps_linux_unittest.cc b/base/debug/proc_maps_linux_unittest.cc
index 9b7d7dcc4af3419c1ef0078eec4007f3fec804fa..7c2929f212a7ae60d16c5a9282053a541ca302a0 100644
--- a/base/debug/proc_maps_linux_unittest.cc
+++ b/base/debug/proc_maps_linux_unittest.cc
@@ -180,14 +180,7 @@ TEST(ProcMapsTest, Permissions) {
}
}
-// ProcMapsTest.ReadProcMaps fails under TSan on Linux,
-// see http://crbug.com/258451.
-#if defined(THREAD_SANITIZER)
-#define MAYBE_ReadProcMaps DISABLED_ReadProcMaps
-#else
-#define MAYBE_ReadProcMaps ReadProcMaps
-#endif
-TEST(ProcMapsTest, MAYBE_ReadProcMaps) {
+TEST(ProcMapsTest, ReadProcMaps) {
std::string proc_maps;
ASSERT_TRUE(ReadProcMaps(&proc_maps));
@@ -238,6 +231,13 @@ TEST(ProcMapsTest, MAYBE_ReadProcMaps) {
EXPECT_TRUE(found_address);
}
+TEST(ProcMapsTest, ReadProcMapsNonEmptyString) {
+ std::string old_string("I forgot to clear the string");
+ std::string proc_maps(old_string);
+ ASSERT_TRUE(ReadProcMaps(&proc_maps));
+ EXPECT_EQ(std::string::npos, proc_maps.find(old_string));
+}
+
TEST(ProcMapsTest, MissingFields) {
static const char* kTestCases[] = {
"00400000\n", // Missing end + beyond.
« no previous file with comments | « base/debug/proc_maps_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698