aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-03 05:18:54 +0800
committerchriseth <c@ethdev.com>2015-10-03 05:18:54 +0800
commit5e4166acb811dcfc03ef9ed981616ac9cbd3e542 (patch)
tree3e1f9172e23bad9fe662ae4d757d9a3632207ce5 /test/libsolidity
parent795c894afc52033a9b5cd2d9fc223a1c4a09ac1b (diff)
downloaddexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar.gz
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar.bz2
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar.lz
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar.xz
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.tar.zst
dexon-solidity-5e4166acb811dcfc03ef9ed981616ac9cbd3e542.zip
Report warning in tests if requested.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 961c10b4..c386e2b4 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -72,22 +72,20 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false)
globalContext->setCurrentContract(*contract);
resolver.updateDeclaration(*globalContext->currentThis());
TypeChecker typeChecker;
- if (!typeChecker.checkTypeRequirements(*contract))
+ bool success = typeChecker.checkTypeRequirements(*contract);
+ BOOST_CHECK(success || !typeChecker.errors().empty());
+ for (auto const& firstError: typeChecker.errors())
{
- for (auto const& firstError: typeChecker.errors())
+ if (_reportWarnings || !dynamic_pointer_cast<Warning const>(firstError))
{
- if (_reportWarnings || !dynamic_pointer_cast<Warning const>(firstError))
- {
- err = firstError;
- break;
- }
- else if (_reportWarnings)
- {
- err = firstError;
- break;
- }
+ err = firstError;
+ break;
+ }
+ else if (_reportWarnings)
+ {
+ err = firstError;
+ break;
}
- break;
}
}
}