diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-24 18:55:30 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-11-17 08:46:45 +0800 |
commit | f7249abe284b5f29996621f2e19cab7f09f51785 (patch) | |
tree | 5bd109b47740f2dd66574a9e9540ad4cd16aa8fe | |
parent | 8d26894841d7b5897b7c6f126f6ea1b8293ab5a2 (diff) | |
download | dexon-solidity-f7249abe284b5f29996621f2e19cab7f09f51785.tar.gz dexon-solidity-f7249abe284b5f29996621f2e19cab7f09f51785.tar.zst dexon-solidity-f7249abe284b5f29996621f2e19cab7f09f51785.zip |
Extend address checksum tests
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 30624260..88ec58ee 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -5766,7 +5766,7 @@ BOOST_AUTO_TEST_CASE(invalid_address_checksum) } } )"; - CHECK_WARNING(text, "checksum"); + CHECK_WARNING(text, "This looks like an address but has an invalid checksum."); } BOOST_AUTO_TEST_CASE(invalid_address_no_checksum) @@ -5779,10 +5779,10 @@ BOOST_AUTO_TEST_CASE(invalid_address_no_checksum) } } )"; - CHECK_WARNING(text, "checksum"); + CHECK_WARNING(text, "This looks like an address but has an invalid checksum."); } -BOOST_AUTO_TEST_CASE(invalid_address_length) +BOOST_AUTO_TEST_CASE(invalid_address_length_short) { char const* text = R"( contract C { @@ -5792,7 +5792,20 @@ BOOST_AUTO_TEST_CASE(invalid_address_length) } } )"; - CHECK_WARNING(text, "checksum"); + CHECK_WARNING(text, "This looks like an address but has an invalid checksum."); +} + +BOOST_AUTO_TEST_CASE(invalid_address_length_long) +{ + char const* text = R"( + contract C { + function f() pure public { + address x = 0xFA0bFc97E48458494Ccd857e1A85DC91F7F0046E0; + x; + } + } + )"; + CHECK_WARNING_ALLOW_MULTI(text, "This looks like an address but has an invalid checksum."); } BOOST_AUTO_TEST_CASE(address_test_for_bug_in_implementation) |