diff options
author | Lu Guanqun <guanqun.lu@gmail.com> | 2015-02-10 22:43:13 +0800 |
---|---|---|
committer | Lu Guanqun <guanqun.lu@gmail.com> | 2015-02-10 23:39:13 +0800 |
commit | 466f0e01001bae0782d7f41ef944301f1a2e1e7f (patch) | |
tree | 16d5c60dc75a60810d059ad595eef5b544fd7b03 | |
parent | 2f15494f83838faf27502fe7bbeb02ffd34e6d46 (diff) | |
download | dexon-solidity-466f0e01001bae0782d7f41ef944301f1a2e1e7f.tar.gz dexon-solidity-466f0e01001bae0782d7f41ef944301f1a2e1e7f.tar.zst dexon-solidity-466f0e01001bae0782d7f41ef944301f1a2e1e7f.zip |
small fixes per chris's comments
-rw-r--r-- | SolidityEndToEndTest.cpp | 2 | ||||
-rw-r--r-- | SolidityNameAndTypeResolution.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index 74811014..13a666fb 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(exp_operator_const_signed) { char const* sourceCode = R"( contract test { - function f() returns(int d) { return -2 ** 3; } + function f() returns(int d) { return (-2) ** 3; } })"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("f()", bytes()) == toBigEndian(u256(-8))); diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index b529f0b7..d013f5c5 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -980,16 +980,16 @@ BOOST_AUTO_TEST_CASE(exp_operator_negative_exponent) contract test { function f() returns(uint d) { return 2 ** -3; } })"; - BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError); + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } -BOOST_AUTO_TEST_CASE(exp_operator_const_overflowed) +BOOST_AUTO_TEST_CASE(exp_operator_exponent_too_big) { char const* sourceCode = R"( contract test { - function f() returns(uint d) { return 10 ** 256; } + function f() returns(uint d) { return 2 ** 10000000000; } })"; - BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError); + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } BOOST_AUTO_TEST_SUITE_END() |