aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 8f645170..35b7078d 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2053,6 +2053,7 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses)
{
char const* sourceCode = R"(
contract helper {
+ function() { } // can receive ether
}
contract test {
helper h;
@@ -2540,6 +2541,19 @@ BOOST_AUTO_TEST_CASE(inherited_fallback_function)
BOOST_CHECK(callContractFunction("getData()") == encodeArgs(1));
}
+BOOST_AUTO_TEST_CASE(default_fallback_throws)
+{
+ char const* sourceCode = R"(
+ contract A {
+ function f() returns (bool) {
+ return this.call();
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(0));
+}
+
BOOST_AUTO_TEST_CASE(event)
{
char const* sourceCode = R"(
@@ -5944,6 +5958,7 @@ BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library)
function f(address x) returns (bool) {
return x.send(1);
}
+ function () {}
}
)";
compileAndRun(sourceCode, 0, "lib");