aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-03-14 00:54:22 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-03-14 01:14:57 +0800
commit09420f1a4480e8bfeb13f861fda801e49bce8487 (patch)
treed48a7861ed993be4879acc1d1be502000e8fa99b
parent7a066efd7e0f371cfaee69c1f6b5f0aed1bfd107 (diff)
downloaddexon-solidity-09420f1a4480e8bfeb13f861fda801e49bce8487.tar.gz
dexon-solidity-09420f1a4480e8bfeb13f861fda801e49bce8487.tar.zst
dexon-solidity-09420f1a4480e8bfeb13f861fda801e49bce8487.zip
Store filenames in static variable to guarantee sufficient lifetime.
-rw-r--r--test/libsolidity/SyntaxTest.cpp6
1 files changed, 5 insertions, 1 deletions
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 <boost/throw_exception.hpp>
#include <cctype>
#include <fstream>
+#include <memory>
#include <stdexcept>
using namespace dev;
@@ -188,6 +189,9 @@ int SyntaxTest::registerTests(
}
else
{
+ static vector<unique_ptr<string>> 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;