From 5a98094e8eee680d4f489e901107dfc484a1679f Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Wed, 20 Apr 2011 08:07:07 +0000 Subject: incorrect usage of C++ std::string caused a test to fail --- test/unit/util/assert_white.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/unit/util') diff --git a/test/unit/util/assert_white.h b/test/unit/util/assert_white.h index 75006ed12..6a8438136 100644 --- a/test/unit/util/assert_white.h +++ b/test/unit/util/assert_white.h @@ -60,7 +60,8 @@ public: // we don't want to match on the entire string, because it may // have an absolute path to the unit test binary, line number // info, etc. - const char* theString = e.toString().c_str(); + std::string s = e.toString(); + const char* theString = s.c_str(); const char* firstPart = "Assertion failure\nvoid AssertWhite::testReallyLongAssert()\n"; string lastPartStr = "\n\n false\n" + msg; @@ -84,7 +85,8 @@ public: // we don't want to match on the entire string, because it may // have an absolute path to the unit test binary, line number // info, etc. - const char* theString = e.toString().c_str(); + std::string s = e.toString(); + const char* theString = s.c_str(); const char* firstPart = "Assertion failure\nvoid AssertWhite::testReallyLongAssert()\n"; string lastPartStr = "\n\n false\n" + string(200, 'x') + " " + -- cgit v1.2.3