aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-12 22:44:35 +0800
committerChristian <c@ethdev.com>2015-02-12 22:44:35 +0800
commitc90adbf5938b0f8e163953cd267d484aa3988c1c (patch)
tree5a41411dc0ed88ae87ebd689758d83354bf5e676
parent2472e2b9987c1d90b5bdd5a275392d79ba20a27e (diff)
downloaddexon-solidity-c90adbf5938b0f8e163953cd267d484aa3988c1c.tar.gz
dexon-solidity-c90adbf5938b0f8e163953cd267d484aa3988c1c.tar.zst
dexon-solidity-c90adbf5938b0f8e163953cd267d484aa3988c1c.zip
length member for byte arrays.
-rw-r--r--SolidityEndToEndTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index a57eb270..71cb4a6f 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -2409,6 +2409,21 @@ BOOST_AUTO_TEST_CASE(bytes_inside_mappings)
BOOST_CHECK(m_state.storage(m_contractAddress).empty());
}
+BOOST_AUTO_TEST_CASE(bytes_length_member)
+{
+ char const* sourceCode = R"(
+ contract c {
+ function set() returns (bool) { data = msg.data; return true; }
+ function getLength() returns (uint) { return data.length; }
+ bytes data;
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("getLength()") == encodeArgs(0));
+ BOOST_CHECK(callContractFunction("set()", 1, 2) == encodeArgs(true));
+ BOOST_CHECK(callContractFunction("getLength()") == encodeArgs(4+32+32));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}