mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Store filenames in static variable to guarantee sufficient lifetime.
This commit is contained in:
parent
7a066efd7e
commit
09420f1a44
@ -21,6 +21,7 @@
|
|||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
using namespace dev;
|
using namespace dev;
|
||||||
@ -188,6 +189,9 @@ int SyntaxTest::registerTests(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
static vector<unique_ptr<string>> filenames;
|
||||||
|
|
||||||
|
filenames.emplace_back(new string(_path.string()));
|
||||||
_suite.add(make_test_case(
|
_suite.add(make_test_case(
|
||||||
[fullpath]
|
[fullpath]
|
||||||
{
|
{
|
||||||
@ -196,7 +200,7 @@ int SyntaxTest::registerTests(
|
|||||||
BOOST_ERROR("Test expectation mismatch.\n" + errorStream.str());
|
BOOST_ERROR("Test expectation mismatch.\n" + errorStream.str());
|
||||||
},
|
},
|
||||||
_path.stem().string(),
|
_path.stem().string(),
|
||||||
_path.string(),
|
*filenames.back(),
|
||||||
0
|
0
|
||||||
));
|
));
|
||||||
numTestsAdded = 1;
|
numTestsAdded = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user