diff options
author | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 05:31:33 +0000 |
---|---|---|
committer | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 05:31:33 +0000 |
commit | e260ebce4f0767fe68caecf8af007a6acf10d347 (patch) | |
tree | 0bc49397b2cd93cd2e08331f3980cb0c555fc8d8 | |
parent | 23efc4c787b09c7f089e85359a34a03ca3ec7fe1 (diff) | |
download | chromium_src-e260ebce4f0767fe68caecf8af007a6acf10d347.zip chromium_src-e260ebce4f0767fe68caecf8af007a6acf10d347.tar.gz chromium_src-e260ebce4f0767fe68caecf8af007a6acf10d347.tar.bz2 |
Make gtest always use simple internal regex engine.
In order to allow regex matches in gtest to be shared between Windows and other
systems, we tell gtest to always use it's internal engine.
The syntax supported by the internal engine initially looks like a subset of
POSIX regexs. However character class shortcuts are not valid POSIX.
Even more confusingly the system POSIX regex function often defines extra
features not actually part of the standard allowing regex that work on Linux
fail on Mac OS X.
A search through the code base did not reveal any locations where features not
supported by the internal regex engine where used.
See bug https://code.google.com/p/chromium/issues/detail?id=317224 for more detailed description.
BUG=317224
Review URL: https://codereview.chromium.org/55983002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241500 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/message_loop/message_pump_io_ios_unittest.cc | 2 | ||||
-rw-r--r-- | base/message_loop/message_pump_libevent_unittest.cc | 2 | ||||
-rw-r--r-- | base/process/memory_unittest.cc | 8 | ||||
-rw-r--r-- | base/tools_sanity_unittest.cc | 9 | ||||
-rw-r--r-- | testing/gtest.gyp | 10 |
5 files changed, 20 insertions, 11 deletions
diff --git a/base/message_loop/message_pump_io_ios_unittest.cc b/base/message_loop/message_pump_io_ios_unittest.cc index f3b598c..e6dcc33 100644 --- a/base/message_loop/message_pump_io_ios_unittest.cc +++ b/base/message_loop/message_pump_io_ios_unittest.cc @@ -82,7 +82,7 @@ TEST_F(MessagePumpIOSForIOTest, TestWatchingFromBadThread) { ASSERT_DEBUG_DEATH(io_loop()->WatchFileDescriptor( STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate), "Check failed: " - "watch_file_descriptor_caller_checker_.CalledOnValidThread()"); + "watch_file_descriptor_caller_checker_.CalledOnValidThread\\(\\)"); } #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG) diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc index bf6d21c..4530e188 100644 --- a/base/message_loop/message_pump_libevent_unittest.cc +++ b/base/message_loop/message_pump_libevent_unittest.cc @@ -78,7 +78,7 @@ TEST_F(MessagePumpLibeventTest, TestWatchingFromBadThread) { ASSERT_DEATH(io_loop()->WatchFileDescriptor( STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate), "Check failed: " - "watch_file_descriptor_caller_checker_.CalledOnValidThread()"); + "watch_file_descriptor_caller_checker_.CalledOnValidThread\\(\\)"); } #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG) diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc index e5c759d..33fcc85 100644 --- a/base/process/memory_unittest.cc +++ b/base/process/memory_unittest.cc @@ -121,9 +121,7 @@ TEST(ProcessMemoryTest, MacMallocFailureDoesNotTerminate) { buf = malloc(std::numeric_limits<size_t>::max() - (2 * PAGE_SIZE) - 1); }, testing::KilledBySignal(SIGTRAP), - "\\*\\*\\* error: can't allocate region.*" - "(Terminating process due to a potential for future heap " - "corruption){0}"); + "\\*\\*\\* error: can't allocate region.*\\n?.*"); base::debug::Alias(buf); } @@ -143,8 +141,8 @@ TEST(ProcessMemoryTest, MacTerminateOnHeapCorruption) { ASSERT_DEATH(free(buf), "attempting free on address which " "was not malloc\\(\\)-ed"); #else - ASSERT_DEATH(free(buf), "being freed.*" - "\\*\\*\\* set a breakpoint in malloc_error_break to debug.*" + ASSERT_DEATH(free(buf), "being freed.*\\n?\\.*" + "\\*\\*\\* set a breakpoint in malloc_error_break to debug.*\\n?.*" "Terminating process due to a potential for future heap corruption"); #endif // ARCH_CPU_64_BITS || defined(ADDRESS_SANITIZER) } diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc index ff78938..4804a35 100644 --- a/base/tools_sanity_unittest.cc +++ b/base/tools_sanity_unittest.cc @@ -65,14 +65,15 @@ void WriteValueOutOfArrayBoundsRight(char *ptr, size_t size) { void MakeSomeErrors(char *ptr, size_t size) { ReadUninitializedValue(ptr); + HARMFUL_ACCESS(ReadValueOutOfArrayBoundsLeft(ptr), - "heap-buffer-overflow.*2 bytes to the left"); + "2 bytes to the left"); HARMFUL_ACCESS(ReadValueOutOfArrayBoundsRight(ptr, size), - "heap-buffer-overflow.*1 bytes to the right"); + "1 bytes to the right"); HARMFUL_ACCESS(WriteValueOutOfArrayBoundsLeft(ptr), - "heap-buffer-overflow.*1 bytes to the left"); + "1 bytes to the left"); HARMFUL_ACCESS(WriteValueOutOfArrayBoundsRight(ptr, size), - "heap-buffer-overflow.*0 bytes to the right"); + "0 bytes to the right"); } } // namespace diff --git a/testing/gtest.gyp b/testing/gtest.gyp index 517bd06..486f3e7 100644 --- a/testing/gtest.gyp +++ b/testing/gtest.gyp @@ -50,6 +50,16 @@ 'dependencies': [ 'gtest_prod', ], + 'defines': [ + # In order to allow regex matches in gtest to be shared between Windows + # and other systems, we tell gtest to always use it's internal engine. + 'GTEST_HAS_POSIX_RE=0', + ], + 'all_dependent_settings': { + 'defines': [ + 'GTEST_HAS_POSIX_RE=0', + ], + }, 'conditions': [ ['OS == "mac" or OS == "ios"', { 'sources': [ |