diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-06-04 18:42:55 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-06-04 18:42:55 +0800 |
commit | 0e664b05aa71641619101de51d16cf5baea6fdf7 (patch) | |
tree | 2f25bb3ba01ec5e3a7e1b7ae47c0079079b40bc0 /libsolidity | |
parent | c7e6bbb82c7ad989df59906e8287db852012bbb9 (diff) | |
download | dexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.tar.gz dexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.tar.zst dexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.zip |
- style fixes
- added test for uint8 = -1 which doesn't fail; todo: fix that
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/SolidityNameAndTypeResolution.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp index a35b7bbe..4f7b82ec 100644 --- a/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/libsolidity/SolidityNameAndTypeResolution.cpp @@ -1856,6 +1856,16 @@ BOOST_AUTO_TEST_CASE(positive_integers_to_signed_out_of_bound_max) BOOST_CHECK_NO_THROW(parseTextAndResolveNames(sourceCode)); } +BOOST_AUTO_TEST_CASE(negative_integers_to_unsigned) +{ + char const* sourceCode = R"( + contract test { + uint8 public x = -1; + } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } |