diff options
author | Morgan Deters <mdeters@gmail.com> | 2011-04-20 08:07:07 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2011-04-20 08:07:07 +0000 |
commit | 5a98094e8eee680d4f489e901107dfc484a1679f (patch) | |
tree | 231b7b7af98afc720fe5777d440067793a16f4ff | |
parent | ce04216289985021ce53588e3040e2ac9d6a2a0d (diff) |
incorrect usage of C++ std::string caused a test to fail
-rw-r--r-- | test/unit/util/assert_white.h | 6 |
1 files changed, 4 insertions, 2 deletions
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') + " " + |