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

Function testFunctionCall

test/libsolidity/util/TestFileParserTests.cpp:51–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void testFunctionCall(
52 FunctionCall const& _call,
53 FunctionCall::DisplayMode _mode,
54 std::string _signature = "",
55 bool _failure = true,
56 bytes _arguments = bytes{},
57 bytes _expectations = bytes{},
58 FunctionValue _value = { 0 },
59 std::string _argumentComment = "",
60 std::string _expectationComment = "",
61 std::vector<std::string> _rawArguments = std::vector<std::string>{},
62 bool _isConstructor = false,
63 bool _isLibrary = false
64)
65{
66 BOOST_REQUIRE_EQUAL(_call.expectations.failure, _failure);
67 BOOST_REQUIRE_EQUAL(_call.signature, _signature);
68 ABI_CHECK(_call.arguments.rawBytes(), _arguments);
69 ABI_CHECK(_call.expectations.rawBytes(), _expectations);
70 BOOST_REQUIRE_EQUAL(_call.displayMode, _mode);
71 BOOST_REQUIRE_EQUAL(_call.value.value, _value.value);
72 BOOST_REQUIRE_EQUAL(static_cast<size_t>(_call.value.unit), static_cast<size_t>(_value.unit));
73 BOOST_REQUIRE_EQUAL(_call.arguments.comment, _argumentComment);
74 BOOST_REQUIRE_EQUAL(_call.expectations.comment, _expectationComment);
75
76 if (!_rawArguments.empty())
77 {
78 BOOST_REQUIRE_EQUAL(_call.arguments.parameters.size(), _rawArguments.size());
79 size_t index = 0;
80 for (Parameter const& param: _call.arguments.parameters)
81 {
82 BOOST_REQUIRE_EQUAL(param.rawString, _rawArguments[index]);
83 ++index;
84 }
85 }
86
87 BOOST_REQUIRE_EQUAL(_call.kind == FunctionCall::Kind::Constructor, _isConstructor);
88 BOOST_REQUIRE_EQUAL(_call.kind == FunctionCall::Kind::Library, _isLibrary);
89}
90
91}
92

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

rawBytesMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected