aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-05-21 18:10:26 +0800
committerLiana Husikyan <liana@ethdev.com>2015-06-01 19:06:12 +0800
commit4a2f18b41a9977045a7bd5e859f96715e7f27e84 (patch)
tree891b4e515363d54e5a85249889294227c45ad431 /libsolidity
parent042491e0ccae9600b6d513c9e9023d35c9184feb (diff)
downloaddexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar.gz
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar.bz2
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar.lz
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar.xz
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.tar.zst
dexon-solidity-4a2f18b41a9977045a7bd5e859f96715e7f27e84.zip
one more test to test the call of non-existed function
Conflicts: test/libsolidity/SolidityEndToEndTest.cpp
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/SolidityEndToEndTest.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp
index faa5dad4..839ad792 100644
--- a/libsolidity/SolidityEndToEndTest.cpp
+++ b/libsolidity/SolidityEndToEndTest.cpp
@@ -4111,7 +4111,7 @@ BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping)
BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0));
}
-BOOST_AUTO_TEST_CASE(evm_exceptions)
+BOOST_AUTO_TEST_CASE(evm_exceptions_out_of_band_access)
{
char const* sourceCode = R"(
contract A {
@@ -4135,6 +4135,32 @@ BOOST_AUTO_TEST_CASE(evm_exceptions)
BOOST_CHECK(callContractFunction("test()") == encodeArgs(false));
}
+BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function)
+{
+ char const* sourceCode = R"(
+ contract A {
+ uint public test = 0;
+ function badFunction() returns (uint)
+ {
+ this.call("123");
+ test = 1;
+ return 2;
+ }
+ function testIt() returns (bool)
+ {
+ this.badFunction();
+ test = 2;
+ return true;
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "A");
+
+ BOOST_CHECK(callContractFunction("test()") == encodeArgs(0));
+ BOOST_CHECK(callContractFunction("testIt()") == encodeArgs());
+ BOOST_CHECK(callContractFunction("test()") == encodeArgs(0));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}