diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-17 19:29:06 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-01 17:35:51 +0800 |
commit | 7cbf6a86dda594dd880d77eaa399a345bd2d8659 (patch) | |
tree | 0cf0fe8b46706097dc266aa5fc36b9b26a1027c9 /test/libsolidity | |
parent | b3be9d6fdc195519eccce22f07af5ee42af399ed (diff) | |
download | dexon-solidity-7cbf6a86dda594dd880d77eaa399a345bd2d8659.tar.gz dexon-solidity-7cbf6a86dda594dd880d77eaa399a345bd2d8659.tar.zst dexon-solidity-7cbf6a86dda594dd880d77eaa399a345bd2d8659.zip |
test: add a test about storing an invalid boolean
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index da725581..26d4ff4a 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -3702,6 +3702,27 @@ BOOST_AUTO_TEST_CASE(enum_explicit_overflow) BOOST_CHECK(callContractFunction("getChoiceExp(uint256)", 0) == encodeArgs(0)); } +BOOST_AUTO_TEST_CASE(storing_invalid_boolean) +{ + char const* sourceCode = R"( + contract C { + bool public perm; + function set() returns(uint) { + bool tmp; + assembly { + tmp := 5 + } + perm = tmp; + return 1; + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("set()") == encodeArgs(1)); + BOOST_CHECK(callContractFunction("perm()") == encodeArgs(1)); +} + + BOOST_AUTO_TEST_CASE(using_contract_enums_with_explicit_contract_name) { char const* sourceCode = R"( |