What steps will reproduce the problem?
1. Compile any test case using death test asserts (eq. EXPECT_EXIT())
What is the expected output? What do you see instead?
The following error occurs:
"Example_unittest.cpp", line 14: Error: testing::internal::RE::RE(const
testing::internal::RE&) is not accessible from
jagent::ContextHelpTest_HelpDeathTest_Test::TestBody().
"Example_unittest.cpp", line 14: Warning (Anachronism):
testing::internal::RE::RE(const testing::internal::RE&) is not accessible
from jagent::ContextHelpTest_HelpDeathTest_Test::TestBody().
What version of the product are you using? On what operating system?
gtest 1.3.0
uname -a
SunOS 5.10 Generic_118833-03 sun4u sparc SUNW,Sun-Fire-V890
CC -V
Sun C++ 5.8 2005/10/13
Please provide any additional information below.
For some reasons the Sun compiler needs the copy constructor for the "const
::testing::internal::RE& gtest_regex = (regex);" assignment.
The following patch solves this problem:
==== gtest-1.3.0/include/gtest/internal/gtest-death-test-internal.h#1 -
gtest-1.3.0/include/gtest/internal/gtest-death-test-internal.h ====
@@ -158,7 +158,7 @@
#define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (true) { \
- const ::testing::internal::RE& gtest_regex = (regex); \
+ const ::testing::internal::RE gtest_regex(regex); \
::testing::internal::DeathTest* gtest_dt; \
if (!::testing::internal::DeathTest::Create(#statement, >est_regex,
\
__FILE__, __LINE__, >est_dt)) { \
Original issue reported on code.google.com by ade...@gmail.com on 29 Jul 2009 at 2:45
Original issue reported on code.google.com by
ade...@gmail.com
on 29 Jul 2009 at 2:45