MCPcopy Create free account
hub / github.com/argotorg/solidity / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/libsolidity/ABIEncoderTests.cpp:50–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48BOOST_FIXTURE_TEST_SUITE(ABIEncoderTest, SolidityExecutionFramework)
49
50BOOST_AUTO_TEST_CASE(value_types)
51{
52 std::string sourceCode = R"(
53 contract C {
54 event E(uint a, uint16 b, uint24 c, int24 d, bytes3 x, bool, C);
55 function f() public {
56 bytes6 x = hex"1bababababa2";
57 bool b;
58 assembly { b := 7 }
59 C c;
60 assembly { c := sub(0, 5) }
61 emit E(10, uint16(type(uint).max - 1), uint24(uint(0x12121212)), int24(int256(-1)), bytes3(x), b, c);
62 }
63 }
64 )";
65 BOTH_ENCODERS(
66 compileAndRun(sourceCode);
67 callContractFunction("f()");
68 REQUIRE_LOG_DATA(encodeArgs(
69 10, u256(65534), u256(0x121212), u256(-1), std::string("\x1b\xab\xab"), true, h160("fffffffffffffffffffffffffffffffffffffffb")
70 ));
71 )
72}
73
74BOOST_AUTO_TEST_CASE(string_literal)
75{

Callers 1

Calls 6

getFunction · 0.85
asStringFunction · 0.85
selectorFromSignatureH32Function · 0.85
refMethod · 0.80
keccak256Function · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected