mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test: add a test about gas costs of EXP
This commit is contained in:
parent
c3b839ca75
commit
8387d0df83
@ -248,6 +248,23 @@ BOOST_AUTO_TEST_CASE(multiple_external_functions)
|
|||||||
testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)});
|
testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(exponent_size)
|
||||||
|
{
|
||||||
|
char const* sourceCode = R"(
|
||||||
|
contract A {
|
||||||
|
function g(uint x) returns (uint) {
|
||||||
|
return x ** 0x100;
|
||||||
|
}
|
||||||
|
function h(uint x) returns (uint) {
|
||||||
|
return x ** 0x10000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
testCreationTimeGas(sourceCode);
|
||||||
|
testRunTimeGas("f(uint256)", vector<bytes>{encodeArgs(2)});
|
||||||
|
testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)});
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user