aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-31 00:48:08 +0800
committerGitHub <noreply@github.com>2018-05-31 00:48:08 +0800
commit0e3d4f773fb40c3368d968e165c24ff653860120 (patch)
tree4b7a884f7042948533c189ecc619f707b2e3acfd /test
parent5a73044fa77c0572a3a5375b0c557313e8c600a7 (diff)
parent4ec3f508b0a72736f8f885199b44296f5264c02b (diff)
downloaddexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar.gz
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar.bz2
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar.lz
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar.xz
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.tar.zst
dexon-solidity-0e3d4f773fb40c3368d968e165c24ff653860120.zip
Merge pull request #4205 from ethereum/name-and-type-tests-split
Split up last NameAndTypeResolution test cases
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp96
1 files changed, 78 insertions, 18 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 260cb35c..38d7124c 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -7069,7 +7069,7 @@ BOOST_AUTO_TEST_CASE(array_length_invalid_expression_division_by_zero)
CHECK_ERROR(text, TypeError, "Operator / not compatible with types int_const 3 and int_const 0");
}
-BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_balance)
{
char const* text = R"(
contract C {
@@ -7079,7 +7079,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
}
)";
CHECK_WARNING(text, "Using contract member \"balance\" inherited from the address type is deprecated.");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_transfer)
+{
+ char const* text = R"(
contract C {
function f() view public {
this.transfer;
@@ -7090,7 +7094,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
{Error::Type::Warning, "Using contract member \"transfer\" inherited from the address type is deprecated"},
{Error::Type::TypeError, "Value transfer to a contract without a payable fallback function"}
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_send)
+{
+ char const* text = R"(
contract C {
function f() view public {
this.send;
@@ -7101,7 +7109,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
{Error::Type::Warning, "Using contract member \"send\" inherited from the address type is deprecated"},
{Error::Type::TypeError, "Value transfer to a contract without a payable fallback function"}
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_call)
+{
+ char const* text = R"(
contract C {
function f() view public {
this.call;
@@ -7109,7 +7121,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
}
)";
CHECK_WARNING(text, "Using contract member \"call\" inherited from the address type is deprecated.");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_callcode)
+{
+ char const* text = R"(
contract C {
function f() view public {
this.callcode;
@@ -7120,7 +7136,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
{Error::Type::Warning, "Using contract member \"callcode\" inherited from the address type is deprecated"},
{Error::Type::Warning, "\"callcode\" has been deprecated in favour of \"delegatecall\""}
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract_delegatecall)
+{
+ char const* text = R"(
contract C {
function f() view public {
this.delegatecall;
@@ -7130,7 +7150,7 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_contract)
CHECK_WARNING(text, "Using contract member \"delegatecall\" inherited from the address type is deprecated.");
}
-BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_balance)
{
char const* text = R"(
contract C {
@@ -7141,7 +7161,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
}
)";
CHECK_WARNING(text, "Using contract member \"balance\" inherited from the address type is deprecated");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_transfer)
+{
+ char const* text = R"(
contract C {
function f() view public {
C c;
@@ -7153,7 +7177,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
{Error::Type::Warning, "Using contract member \"transfer\" inherited from the address type is deprecated"},
{Error::Type::TypeError, "Value transfer to a contract without a payable fallback function"}
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_send)
+{
+ char const* text = R"(
contract C {
function f() view public {
C c;
@@ -7165,7 +7193,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
{Error::Type::Warning, "Using contract member \"send\" inherited from the address type is deprecated"},
{Error::Type::TypeError, "Value transfer to a contract without a payable fallback function"}
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_call)
+{
+ char const* text = R"(
contract C {
function f() pure public {
C c;
@@ -7174,7 +7206,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
}
)";
CHECK_WARNING(text, "Using contract member \"call\" inherited from the address type is deprecated");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_callcode)
+{
+ char const* text = R"(
contract C {
function f() pure public {
C c;
@@ -7186,7 +7222,11 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
"Using contract member \"callcode\" inherited from the address type is deprecated",
"\"callcode\" has been deprecated in favour of \"delegatecall\""
}));
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract_delegatecall)
+{
+ char const* text = R"(
contract C {
function f() pure public {
C c;
@@ -7197,7 +7237,7 @@ BOOST_AUTO_TEST_CASE(warn_about_address_members_on_non_this_contract)
CHECK_WARNING(text, "Using contract member \"delegatecall\" inherited from the address type is deprecated");
}
-BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_balance_v050)
{
char const* text = R"(
pragma experimental "v0.5.0";
@@ -7208,7 +7248,11 @@ BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
}
)";
CHECK_ERROR(text, TypeError, "Member \"balance\" not found or not visible after argument-dependent lookup in contract");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_transfer_v050)
+{
+ char const* text = R"(
pragma experimental "v0.5.0";
contract C {
function f() public {
@@ -7217,7 +7261,11 @@ BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
}
)";
CHECK_ERROR(text, TypeError, "Member \"transfer\" not found or not visible after argument-dependent lookup in contract");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_send_v050)
+{
+ char const* text = R"(
pragma experimental "v0.5.0";
contract C {
function f() public {
@@ -7226,7 +7274,11 @@ BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
}
)";
CHECK_ERROR(text, TypeError, "Member \"send\" not found or not visible after argument-dependent lookup in contract");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_call_v050)
+{
+ char const* text = R"(
pragma experimental "v0.5.0";
contract C {
function f() public {
@@ -7235,7 +7287,11 @@ BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
}
)";
CHECK_ERROR(text, TypeError, "Member \"call\" not found or not visible after argument-dependent lookup in contract");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_callcode_v050)
+{
+ char const* text = R"(
pragma experimental "v0.5.0";
contract C {
function f() public {
@@ -7244,7 +7300,11 @@ BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
}
)";
CHECK_ERROR(text, TypeError, "Member \"callcode\" not found or not visible after argument-dependent lookup in contract");
- text = R"(
+}
+
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract_delegatecall_v050)
+{
+ char const* text = R"(
pragma experimental "v0.5.0";
contract C {
function f() public {