aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/ErrorCheck.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-11-25 04:22:17 +0800
committerGitHub <noreply@github.com>2016-11-25 04:22:17 +0800
commit9e7b608e789d71ff6f5751645e91a17e24c7e139 (patch)
treee8de9d03d1be8f2e9aa591f3eea1019896641253 /test/libsolidity/ErrorCheck.cpp
parenta077a3a5ec58c36a0e1ced3eaf8dacd8c761a209 (diff)
parenta87ed2895a5e45bc4edeb1028a17b4390e35487b (diff)
downloaddexon-solidity-9e7b608e789d71ff6f5751645e91a17e24c7e139.tar.gz
dexon-solidity-9e7b608e789d71ff6f5751645e91a17e24c7e139.tar.zst
dexon-solidity-9e7b608e789d71ff6f5751645e91a17e24c7e139.zip
Merge pull request #1392 from ethereum/check_warning_contents
Check warning text in tests
Diffstat (limited to 'test/libsolidity/ErrorCheck.cpp')
-rw-r--r--test/libsolidity/ErrorCheck.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/libsolidity/ErrorCheck.cpp b/test/libsolidity/ErrorCheck.cpp
new file mode 100644
index 00000000..75555c9b
--- /dev/null
+++ b/test/libsolidity/ErrorCheck.cpp
@@ -0,0 +1,34 @@
+/*
+ This file is part of solidity.
+
+ solidity is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ solidity is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with solidity. If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file ErrorCheck.cpp
+ * @author Yoichi Hirai <i@yoichihirai.com>
+ * @date 2016
+ */
+
+#include <test/libsolidity/ErrorCheck.h>
+#include <libdevcore/Exceptions.h>
+
+#include <string>
+
+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;
+ return _substr.empty();
+}