aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-20 00:34:07 +0800
committerGitHub <noreply@github.com>2018-02-20 00:34:07 +0800
commitabc23ac6086fe724b82eb8ca7f9805cf7ff5ba10 (patch)
tree31ebad3bbafe2fca6292989e7521ab0e8146f9d3 /test/libsolidity
parenta938e39a9d1784a91984c6959300f64734172864 (diff)
parent305d5f70c25d63d602477c6b576b2f62d388c032 (diff)
downloaddexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar.gz
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar.bz2
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar.lz
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar.xz
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.tar.zst
dexon-solidity-abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10.zip
Merge pull request #3135 from federicobond/formatter-instance
Convert static SourceReferenceFormatter functions to member ones
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/GasMeter.cpp6
-rw-r--r--test/libsolidity/SolidityExecutionFramework.h9
2 files changed, 9 insertions, 6 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index 86e8201b..9d3409dd 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -136,8 +136,10 @@ BOOST_AUTO_TEST_CASE(non_overlapping_filtered_costs)
{
BOOST_CHECK_MESSAGE(false, "Source locations should not overlap!");
auto scannerFromSource = [&](string const& _sourceName) -> Scanner const& { return m_compiler.scanner(_sourceName); };
- SourceReferenceFormatter::printSourceLocation(cout, &first->first->location(), scannerFromSource);
- SourceReferenceFormatter::printSourceLocation(cout, &second->first->location(), scannerFromSource);
+ SourceReferenceFormatter formatter(cout, scannerFromSource);
+
+ formatter.printSourceLocation(&first->first->location());
+ formatter.printSourceLocation(&second->first->location());
}
}
}
diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h
index b0daaba9..b853d558 100644
--- a/test/libsolidity/SolidityExecutionFramework.h
+++ b/test/libsolidity/SolidityExecutionFramework.h
@@ -60,12 +60,13 @@ public:
m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns);
if (!m_compiler.compile())
{
+ auto scannerFromSourceName = [&](std::string const& _sourceName) -> solidity::Scanner const& { return m_compiler.scanner(_sourceName); };
+ SourceReferenceFormatter formatter(std::cerr, scannerFromSourceName);
+
for (auto const& error: m_compiler.errors())
- SourceReferenceFormatter::printExceptionInformation(
- std::cerr,
+ formatter.printExceptionInformation(
*error,
- (error->type() == Error::Type::Warning) ? "Warning" : "Error",
- [&](std::string const& _sourceName) -> solidity::Scanner const& { return m_compiler.scanner(_sourceName); }
+ (error->type() == Error::Type::Warning) ? "Warning" : "Error"
);
BOOST_ERROR("Compiling contract failed");
}