mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests.
This commit is contained in:
parent
e3791d6dcf
commit
14b553897e
@ -219,6 +219,30 @@ BOOST_AUTO_TEST_CASE(type_identifiers)
|
||||
BOOST_CHECK_EQUAL(InaccessibleDynamicType().identifier(), "t_inaccessible");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(encoded_sizes)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(IntegerType(16).calldataEncodedSize(true), 32);
|
||||
BOOST_CHECK_EQUAL(IntegerType(16).calldataEncodedSize(false), 2);
|
||||
|
||||
BOOST_CHECK_EQUAL(FixedBytesType(16).calldataEncodedSize(true), 32);
|
||||
BOOST_CHECK_EQUAL(FixedBytesType(16).calldataEncodedSize(false), 16);
|
||||
|
||||
BOOST_CHECK_EQUAL(BoolType().calldataEncodedSize(true), 32);
|
||||
BOOST_CHECK_EQUAL(BoolType().calldataEncodedSize(false), 1);
|
||||
|
||||
shared_ptr<ArrayType> uint24Array = make_shared<ArrayType>(
|
||||
DataLocation::Memory,
|
||||
make_shared<IntegerType>(24),
|
||||
9
|
||||
);
|
||||
BOOST_CHECK_EQUAL(uint24Array->calldataEncodedSize(true), 9 * 32);
|
||||
BOOST_CHECK_EQUAL(uint24Array->calldataEncodedSize(false), 9 * 32);
|
||||
|
||||
ArrayType twoDimArray(DataLocation::Memory, uint24Array, 3);
|
||||
BOOST_CHECK_EQUAL(twoDimArray.calldataEncodedSize(true), 9 * 3 * 32);
|
||||
BOOST_CHECK_EQUAL(twoDimArray.calldataEncodedSize(false), 9 * 3 * 32);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user