diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-13 03:22:47 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-14 04:47:35 +0800 |
commit | e640bb2aed399fa920e35d42573f625fc139dcce (patch) | |
tree | fc34e2d99797390ba85c481e4f822140707b1298 /test | |
parent | cb4875a28b1595f31f1eb2d54464f5c3dfc66115 (diff) | |
download | dexon-solidity-e640bb2aed399fa920e35d42573f625fc139dcce.tar.gz dexon-solidity-e640bb2aed399fa920e35d42573f625fc139dcce.tar.zst dexon-solidity-e640bb2aed399fa920e35d42573f625fc139dcce.zip |
Add tests for large calldata arrays
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 472f1b97..dccedbfd 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6297,6 +6297,31 @@ BOOST_AUTO_TEST_CASE(implicit_conversion_disallowed) CHECK_ERROR(text, TypeError, "Return argument type uint32 is not implicitly convertible to expected type (type of first return variable) bytes4."); } +BOOST_AUTO_TEST_CASE(too_large_arrays_for_calldata) +{ + char const* text = R"( + contract C { + function f(uint[85678901234] a) external { + } + } + )"; + CHECK_ERROR(text, TypeError, "Array is too large to be encoded as calldata."); + text = R"( + contract C { + function f(uint[85678901234] a) internal { + } + } + )"; + CHECK_SUCCESS_NO_WARNINGS(text); + text = R"( + contract C { + function f(uint[85678901234] a) { + } + } + )"; + CHECK_SUCCESS_NO_WARNINGS(text); +} + BOOST_AUTO_TEST_SUITE_END() } |