mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix test after change in call failure semantics.
This commit is contained in:
parent
88ecc27c2b
commit
66d2ec1d15
@ -1619,9 +1619,11 @@ BOOST_AUTO_TEST_CASE(gas_and_value_basic)
|
|||||||
function sendAmount(uint amount) returns (uint256 bal) {
|
function sendAmount(uint amount) returns (uint256 bal) {
|
||||||
return h.getBalance.value(amount)();
|
return h.getBalance.value(amount)();
|
||||||
}
|
}
|
||||||
function outOfGas() returns (bool flagBefore, bool flagAfter, uint myBal) {
|
function outOfGas() returns (bool ret) {
|
||||||
flagBefore = h.getFlag();
|
h.setFlag.gas(2)(); // should fail due to OOG
|
||||||
h.setFlag.gas(2)(); // should fail due to OOG, return value can be garbage
|
return true;
|
||||||
|
}
|
||||||
|
function checkState() returns (bool flagAfter, uint myBal) {
|
||||||
flagAfter = h.getFlag();
|
flagAfter = h.getFlag();
|
||||||
myBal = this.balance;
|
myBal = this.balance;
|
||||||
}
|
}
|
||||||
@ -1630,7 +1632,8 @@ BOOST_AUTO_TEST_CASE(gas_and_value_basic)
|
|||||||
compileAndRun(sourceCode, 20);
|
compileAndRun(sourceCode, 20);
|
||||||
BOOST_REQUIRE(callContractFunction("sendAmount(uint256)", 5) == encodeArgs(5));
|
BOOST_REQUIRE(callContractFunction("sendAmount(uint256)", 5) == encodeArgs(5));
|
||||||
// call to helper should not succeed but amount should be transferred anyway
|
// call to helper should not succeed but amount should be transferred anyway
|
||||||
BOOST_REQUIRE(callContractFunction("outOfGas()", 5) == encodeArgs(false, false, 20 - 5));
|
BOOST_REQUIRE(callContractFunction("outOfGas()", 5) == bytes());
|
||||||
|
BOOST_REQUIRE(callContractFunction("checkState()", 5) == encodeArgs(false, 20 - 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(value_complex)
|
BOOST_AUTO_TEST_CASE(value_complex)
|
||||||
|
Loading…
Reference in New Issue
Block a user