aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-24 22:41:17 +0800
committerchriseth <c@ethdev.com>2016-06-26 19:53:32 +0800
commit25a64c7f8f35833b9dec6068232be6e0ce9d2e78 (patch)
treea907069c75d43e2c86629e4e148383d4e3d5d26f /test
parentcc6314cd019be80a9212f6bd5b0c86206be16c88 (diff)
downloaddexon-solidity-25a64c7f8f35833b9dec6068232be6e0ce9d2e78.tar.gz
dexon-solidity-25a64c7f8f35833b9dec6068232be6e0ce9d2e78.tar.zst
dexon-solidity-25a64c7f8f35833b9dec6068232be6e0ce9d2e78.zip
Only warn about unused return in low-level functions.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 1f42c23e..7e81bd7e 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3760,7 +3760,7 @@ BOOST_AUTO_TEST_CASE(unused_return_value)
}
}
)";
- BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+ BOOST_CHECK(success(text));
}
BOOST_AUTO_TEST_CASE(unused_return_value_send)
@@ -3775,6 +3775,54 @@ BOOST_AUTO_TEST_CASE(unused_return_value_send)
BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
}
+BOOST_AUTO_TEST_CASE(unused_return_value_call)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ address(0x12).call("abc");
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
+BOOST_AUTO_TEST_CASE(unused_return_value_call_value)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ address(0x12).call.value(2)("abc");
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
+BOOST_AUTO_TEST_CASE(unused_return_value_callcode)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ address(0x12).callcode("abc");
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
+BOOST_AUTO_TEST_CASE(unused_return_value_delegatecall)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ address(0x12).delegatecall("abc");
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}