aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-12-10 01:42:55 +0800
committerchriseth <c@ethdev.com>2016-12-12 18:12:12 +0800
commit7bc2ecf30afe8fde3a178a9f9f298a56c845a078 (patch)
tree556572ed10ac44b2557984aeddb8630e208ea012 /test/libsolidity/SolidityEndToEndTest.cpp
parentffccbd432a36a9fae0857961d44d0455fce93c1c (diff)
downloaddexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar.gz
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar.bz2
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar.lz
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar.xz
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.tar.zst
dexon-solidity-7bc2ecf30afe8fde3a178a9f9f298a56c845a078.zip
Correct test expectations.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 3d38516d..ff128330 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -8570,8 +8570,8 @@ BOOST_AUTO_TEST_CASE(shift_right_garbled)
}
)";
compileAndRun(sourceCode, 0, "C");
- BOOST_CHECK(callContractFunction("f(uint256,uint256)", u256(0x0), u256(4)) == encodeArgs(u256(0xf)));
- BOOST_CHECK(callContractFunction("f(uint256,uint256)", u256(0x0), u256(0x1004)) == encodeArgs(u256(0xf)));
+ BOOST_CHECK(callContractFunction("f(uint8,uint8)", u256(0x0), u256(4)) == encodeArgs(u256(0xf)));
+ BOOST_CHECK(callContractFunction("f(uint8,uint8)", u256(0x0), u256(0x1004)) == encodeArgs(u256(0xf)));
}
BOOST_AUTO_TEST_CASE(shift_right_uint32)
@@ -8767,7 +8767,8 @@ BOOST_AUTO_TEST_CASE(shift_overflow)
BOOST_CHECK(callContractFunction("leftU(uint8,uint8)", 255, 1) == encodeArgs(u256(254)));
BOOST_CHECK(callContractFunction("leftU(uint8,uint8)", 255, 0) == encodeArgs(u256(255)));
- BOOST_CHECK(callContractFunction("leftS(int8,int8)", 1, 7) == encodeArgs(u256(128)));
+ // Result is -128 and output is sign-extended, not zero-padded.
+ BOOST_CHECK(callContractFunction("leftS(int8,int8)", 1, 7) == encodeArgs(u256(0) - 128));
BOOST_CHECK(callContractFunction("leftS(int8,int8)", 1, 6) == encodeArgs(u256(64)));
}
@@ -8780,6 +8781,7 @@ BOOST_AUTO_TEST_CASE(cleanup_in_compound_assign)
uint16 x = uint16(a);
uint16 y = x;
x /= 0x100;
+ y = y / 0x100;
return (x, y);
}
}