diff options
author | chriseth <chris@ethereum.org> | 2017-06-28 21:28:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-28 21:28:33 +0800 |
commit | e19c4125af62c4f02e476664791f8b091a467902 (patch) | |
tree | 15ceb1d359217b217d68b2494dbf997b16a0cdc2 /test/libsolidity/ErrorCheck.cpp | |
parent | 708d17d13fce9095178962c2ebc3fa17303b72f3 (diff) | |
parent | 803ab3626b2ea0ed6e9cee2c1b0ac01217390833 (diff) | |
download | dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar.gz dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar.bz2 dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar.lz dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar.xz dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.tar.zst dexon-solidity-e19c4125af62c4f02e476664791f8b091a467902.zip |
Merge pull request #2451 from ethereum/warnVarInLoop
Warn var in loop
Diffstat (limited to 'test/libsolidity/ErrorCheck.cpp')
-rw-r--r-- | test/libsolidity/ErrorCheck.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/ErrorCheck.cpp b/test/libsolidity/ErrorCheck.cpp index 75555c9b..9b0f9fb7 100644 --- a/test/libsolidity/ErrorCheck.cpp +++ b/test/libsolidity/ErrorCheck.cpp @@ -29,6 +29,15 @@ using namespace std; bool dev::solidity::searchErrorMessage(Error const& _err, std::string const& _substr) { if (string const* errorMessage = boost::get_error_info<dev::errinfo_comment>(_err)) - return errorMessage->find(_substr) != std::string::npos; + { + if (errorMessage->find(_substr) == std::string::npos) + { + cout << "Expected message \"" << _substr << "\" but found" << *errorMessage << endl; + return false; + } + return true; + } + else + cout << "Expected error message but found none." << endl; return _substr.empty(); } |