aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-09-17 21:15:36 +0800
committerLianaHus <liana@ethdev.com>2015-09-17 21:15:36 +0800
commite89b8d516b7e208bc67e273e174714f7f9b67b77 (patch)
treed5062550efb3a6713ea220b4107f49426fcf8596 /test
parent352c196eb37744b8054909a9801d55c672d0eb1c (diff)
downloaddexon-solidity-e89b8d516b7e208bc67e273e174714f7f9b67b77.tar.gz
dexon-solidity-e89b8d516b7e208bc67e273e174714f7f9b67b77.tar.zst
dexon-solidity-e89b8d516b7e208bc67e273e174714f7f9b67b77.zip
test
Conflicts: test/libsolidity/SolidityEndToEndTest.cpp
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 9c4d0c5b..803ff61a 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5283,6 +5283,51 @@ BOOST_AUTO_TEST_CASE(simple_throw)
BOOST_CHECK(callContractFunction("f(uint256)", u256(1)) == encodeArgs());
}
+BOOST_AUTO_TEST_CASE(strings_in_struct)
+{
+ char const* sourceCode = R"(
+ contract buggystruct {
+ Buggy public bug;
+
+ struct Buggy {
+ uint first;
+ uint second;
+ uint third;
+ string last;
+ }
+
+ function buggystruct(){
+ bug = Buggy(10, 20, 30, "a");
+ }
+ function getFirst() returns (uint)
+ {
+ return bug.first;
+ }
+ function getSecond() returns (uint)
+ {
+ return bug.second;
+ }
+ function getThird() returns (uint)
+ {
+ return bug.third;
+ }
+ function getLast() returns (string)
+ {
+ return bug.last;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ auto first = callContractFunction("getFirst()");
+ BOOST_CHECK(callContractFunction("getFirst()") == encodeArgs(u256(10)));
+ auto second = callContractFunction("getSecond()");
+ BOOST_CHECK(callContractFunction("getSecond()") == encodeArgs(u256(20)));
+ auto third = callContractFunction("getThird()");
+ BOOST_CHECK(callContractFunction("getThird()") == encodeArgs(u256(30)));
+ auto last = callContractFunction("getLast()");
+ BOOST_CHECK(callContractFunction("getLast()") == encodeArgs(string("a")));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}