aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-14 02:43:02 +0800
committerGitHub <noreply@github.com>2018-03-14 02:43:02 +0800
commit032ea9bc5ba0e0d46deb2620934500071f31e3de (patch)
treed48a7861ed993be4879acc1d1be502000e8fa99b
parent7a066efd7e0f371cfaee69c1f6b5f0aed1bfd107 (diff)
parent09420f1a4480e8bfeb13f861fda801e49bce8487 (diff)
downloaddexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar.gz
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar.bz2
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar.lz
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar.xz
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.tar.zst
dexon-solidity-032ea9bc5ba0e0d46deb2620934500071f31e3de.zip
Merge pull request #3726 from ethereum/syntaxTestsFilenameFix
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;