diff options
author | chriseth <c@ethdev.com> | 2017-03-03 19:51:51 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-03-06 22:05:09 +0800 |
commit | 5c5d83fd704e18f88d80e346386e97ed600b7281 (patch) | |
tree | 7a689acc32f72a20889d685686d5d293e78f9e0a /test | |
parent | d089a1ef2b4d9dbcdeb311edc3efd5df74282ba3 (diff) | |
download | dexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.tar.gz dexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.tar.zst dexon-solidity-5c5d83fd704e18f88d80e346386e97ed600b7281.zip |
Check for circular references in constant variables.
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index ec80b133..7576ee09 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -20,19 +20,23 @@ * Unit tests for the name and type resolution of the solidity parser. */ -#include <string> +#include <test/libsolidity/ErrorCheck.h> + +#include <test/TestHelper.h> -#include <libdevcore/SHA3.h> #include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Parser.h> #include <libsolidity/analysis/NameAndTypeResolver.h> #include <libsolidity/analysis/StaticAnalyzer.h> +#include <libsolidity/analysis/PostTypeChecker.h> #include <libsolidity/analysis/SyntaxChecker.h> #include <libsolidity/interface/Exceptions.h> #include <libsolidity/analysis/GlobalContext.h> #include <libsolidity/analysis/TypeChecker.h> -#include "../TestHelper.h" -#include "ErrorCheck.h" + +#include <libdevcore/SHA3.h> + +#include <string> using namespace std; @@ -93,10 +97,11 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false, BOOST_CHECK(success || !errors.empty()); } if (success) - { - StaticAnalyzer staticAnalyzer(errors); - staticAnalyzer.analyze(*sourceUnit); - } + if (!PostTypeChecker(errors).check(*sourceUnit)) + success = false; + if (success) + if (!StaticAnalyzer(errors).analyze(*sourceUnit)) + success = false; if (errors.size() > 1 && !_allowMultipleErrors) BOOST_FAIL("Multiple errors found"); for (auto const& currentError: errors) |