summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-12 17:41:52 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-12 17:41:52 +0000
commita44aee65118957ee04984676d7364b065fba77d8 (patch)
treeb00222f4104528898f6a9872e36b70408fb88515
parent13a15f5ee23ae3c5350cf715a32ffa83b2a5b2fd (diff)
downloadchromium_src-a44aee65118957ee04984676d7364b065fba77d8.zip
chromium_src-a44aee65118957ee04984676d7364b065fba77d8.tar.gz
chromium_src-a44aee65118957ee04984676d7364b065fba77d8.tar.bz2
This change ensures that base_unittests will not segfault on this.
I actually managed to crash it. I had /dev/shm unmounted by accident. In these conditions the test fail and you get SIGSEGV. Patch by Pawel Hajdan jr <phajdan.jr@gmail.com> git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2121 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/shared_memory_unittest.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/shared_memory_unittest.cc b/base/shared_memory_unittest.cc
index 89df135..599352d 100644
--- a/base/shared_memory_unittest.cc
+++ b/base/shared_memory_unittest.cc
@@ -118,6 +118,9 @@ TEST(SharedMemoryTest, OpenClose) {
EXPECT_TRUE(rv);
EXPECT_NE(memory1.memory(), memory2.memory()); // Compare the pointers.
+ // Make sure we don't segfault. (it actually happened!)
+ ASSERT_NE(memory1.memory(), static_cast<void*>(NULL));
+ ASSERT_NE(memory2.memory(), static_cast<void*>(NULL));
// Write data to the first memory segment, verify contents of second.
memset(memory1.memory(), '1', kDataSize);