aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-05 21:04:16 +0800
committerGitHub <noreply@github.com>2017-10-05 21:04:16 +0800
commit8b26d65b62f54083e1bec02b34994962770b420f (patch)
treec14630e18f3ed34b5bb3e8b3f373cb127a4dd893 /test
parent6ba0c2bba85ba099b10c58d1c7d10d91e1364471 (diff)
parent10529e994f9a587436c57bfdeef52476da9770bb (diff)
downloaddexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar.gz
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar.bz2
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar.lz
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar.xz
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.tar.zst
dexon-solidity-8b26d65b62f54083e1bec02b34994962770b420f.zip
Merge pull request #3020 from ethereum/smt-functioncall
SMT should not crash on special function calls (typecast)
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SMTChecker.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/SMTChecker.cpp b/test/libsolidity/SMTChecker.cpp
index d58f296f..8d712a80 100644
--- a/test/libsolidity/SMTChecker.cpp
+++ b/test/libsolidity/SMTChecker.cpp
@@ -79,6 +79,32 @@ BOOST_AUTO_TEST_CASE(simple_overflow)
CHECK_WARNING(text, "Overflow (resulting value larger than");
}
+BOOST_AUTO_TEST_CASE(warn_on_typecast)
+{
+ string text = R"(
+ contract C {
+ function f() public pure returns (uint) {
+ return uint8(1);
+ }
+ }
+ )";
+ CHECK_WARNING(text, "Assertion checker does not yet implement this expression.");
+}
+
+BOOST_AUTO_TEST_CASE(warn_on_struct)
+{
+ string text = R"(
+ contract C {
+ struct A { uint a; uint b; }
+ function f() public pure returns (A) {
+ return A({ a: 1, b: 2 });
+ }
+ }
+ )";
+ /// Multiple warnings, should check for: Assertion checker does not yet implement this expression.
+ CHECK_WARNING_ALLOW_MULTI(text, "");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}