From 09420f1a4480e8bfeb13f861fda801e49bce8487 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Tue, 13 Mar 2018 17:54:22 +0100 Subject: Store filenames in static variable to guarantee sufficient lifetime. --- test/libsolidity/SyntaxTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/libsolidity/SyntaxTest.cpp') diff --git a/test/libsolidity/SyntaxTest.cpp b/test/libsolidity/SyntaxTest.cpp index f1c60458..45a851b6 100644 --- a/test/libsolidity/SyntaxTest.cpp +++ b/test/libsolidity/SyntaxTest.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include using namespace dev; @@ -188,6 +189,9 @@ int SyntaxTest::registerTests( } else { + static vector> filenames; + + filenames.emplace_back(new string(_path.string())); _suite.add(make_test_case( [fullpath] { @@ -196,7 +200,7 @@ int SyntaxTest::registerTests( BOOST_ERROR("Test expectation mismatch.\n" + errorStream.str()); }, _path.stem().string(), - _path.string(), + *filenames.back(), 0 )); numTestsAdded = 1; -- cgit v1.2.3