diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-06-08 23:17:43 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2017-06-13 22:57:08 +0800 |
commit | a0f8c94dadb11b697512af43f119c741aeba7f39 (patch) | |
tree | c327555f3700b5a5cbd061a1424e367583d79753 | |
parent | 464dea24597135cbb44ffa24d19dd184315d9085 (diff) | |
download | dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar.gz dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar.bz2 dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar.lz dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar.xz dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.tar.zst dexon-solidity-a0f8c94dadb11b697512af43f119c741aeba7f39.zip |
Add a test about checking a warning
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index db5b9bf8..1052d709 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -193,11 +193,16 @@ CHECK_ERROR_OR_WARNING(text, type, substring, false, false) #define CHECK_ERROR_ALLOW_MULTI(text, type, substring) \ CHECK_ERROR_OR_WARNING(text, type, substring, false, true) -// [checkWarning(text, type, substring)] asserts that the compilation down to typechecking -// emits a warning of type [type] and with a message containing [substring]. +// [checkWarning(text, substring)] asserts that the compilation down to typechecking +// emits a warning and with a message containing [substring]. #define CHECK_WARNING(text, substring) \ CHECK_ERROR_OR_WARNING(text, Warning, substring, true, false) +// [checkWarningAllowMulti(text, substring)] aserts that the compilation down to typechecking +// emits a warning and with a message containing [substring]. +#define CHECK_WARNING_ALLOW_MULTI(text, substring) \ +CHECK_ERROR_OR_WARNING(text, Warning, substring, true, true) + // [checkSuccess(text)] asserts that the compilation down to typechecking succeeds. #define CHECK_SUCCESS(text) do { BOOST_CHECK(success((text))); } while(0) @@ -5780,6 +5785,13 @@ BOOST_AUTO_TEST_CASE(no_unused_inline_asm) CHECK_SUCCESS_NO_WARNINGS(text); } +BOOST_AUTO_TEST_CASE(returndatacopy_as_variable) +{ + char const* text = R"( + contract c { function f() { uint returndatasize; assembly { returndatasize }}} + )"; + CHECK_WARNING_ALLOW_MULTI(text, "shadowed by an insturction of the same name"); +} BOOST_AUTO_TEST_SUITE_END() |