Test solidity_free in tests too

This commit is contained in:
Alex Beregszaszi 2019-12-11 18:41:05 +00:00
parent b9c35916e5
commit 2ccf3ea4ab

View File

@ -59,8 +59,9 @@ bool containsError(Json::Value const& _compilerResult, string const& _type, stri
Json::Value compile(string const& _input, CStyleReadFileCallback _callback = nullptr)
{
string output(solidity_compile(_input.c_str(), _callback, nullptr));
// This should be safe given the above copies the output.
const char* output_ptr = solidity_compile(_input.c_str(), _callback, nullptr);
string output(output_ptr);
solidity_free(output_ptr);
solidity_reset();
Json::Value ret;
BOOST_REQUIRE(jsonParseStrict(output, ret));