diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-09 21:22:45 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-12 03:17:10 +0800 |
commit | daa69df447e167fe75d57a5bbbabee4d637218a4 (patch) | |
tree | 06651c92bf79cbc14a931d28fc161ad480997506 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 418e2725b50aebc169dd80f78a0ce3eefc2e296e (diff) | |
download | dexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.tar.gz dexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.tar.zst dexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.zip |
Error on invalid arithmetic with constant expressions.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 39f4b03e..f7f1062d 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7847,12 +7847,12 @@ BOOST_AUTO_TEST_CASE(addmod_mulmod_zero) { char const* sourceCode = R"( contract C { - function f() pure returns (uint) { - addmod(1, 2, 0); + function f(uint d) pure returns (uint) { + addmod(1, 2, d); return 2; } - function g() pure returns (uint) { - mulmod(1, 2, 0); + function g(uint d) pure returns (uint) { + mulmod(1, 2, d); return 2; } function h() pure returns (uint) { @@ -7865,8 +7865,8 @@ BOOST_AUTO_TEST_CASE(addmod_mulmod_zero) } )"; compileAndRun(sourceCode); - ABI_CHECK(callContractFunction("f()"), encodeArgs()); - ABI_CHECK(callContractFunction("g()"), encodeArgs()); + ABI_CHECK(callContractFunction("f(uint)", 0), encodeArgs()); + ABI_CHECK(callContractFunction("g(uint)", 0), encodeArgs()); ABI_CHECK(callContractFunction("h()"), encodeArgs(2)); } |