mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
two more tests
style fixes
This commit is contained in:
parent
ae0fa99123
commit
25e4cf071a
@ -418,9 +418,23 @@ BOOST_AUTO_TEST_CASE(function_external_types)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(function_external_call_conversion)
|
BOOST_AUTO_TEST_CASE(function_external_call_allowed_conversion)
|
||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* text = R"(
|
||||||
|
contract C {}
|
||||||
|
contract Test {
|
||||||
|
function externalCall() {
|
||||||
|
C arg;
|
||||||
|
this.g(arg);
|
||||||
|
}
|
||||||
|
function g (C c) external {}
|
||||||
|
})";
|
||||||
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(function_external_call_not_allowed_conversion)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
contract C {}
|
contract C {}
|
||||||
contract Test {
|
contract Test {
|
||||||
function externalCall() {
|
function externalCall() {
|
||||||
@ -429,10 +443,26 @@ BOOST_AUTO_TEST_CASE(function_external_call_conversion)
|
|||||||
}
|
}
|
||||||
function g (C c) external {}
|
function g (C c) external {}
|
||||||
})";
|
})";
|
||||||
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(function_internal_call_conversion)
|
BOOST_AUTO_TEST_CASE(function_internal_allowed_conversion)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract C {
|
||||||
|
uint a;
|
||||||
|
}
|
||||||
|
contract Test {
|
||||||
|
C a;
|
||||||
|
function g (C c) {}
|
||||||
|
function internalCall() {
|
||||||
|
g(a);
|
||||||
|
}
|
||||||
|
})";
|
||||||
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(function_internal_not_allowed_conversion)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract C {
|
contract C {
|
||||||
|
Loading…
Reference in New Issue
Block a user