aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-10-15 19:54:59 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-10-15 19:54:59 +0800
commit9224c1f7128f92f47ddf3feaf83b57d6d98e0a04 (patch)
treec6d94f12a23b771a388994b01f034a04f338eb01 /test/libsolidity/SolidityEndToEndTest.cpp
parenta521843f6b0bf019a19d9a377f4bbbc473083151 (diff)
downloaddexon-solidity-9224c1f7128f92f47ddf3feaf83b57d6d98e0a04.tar.gz
dexon-solidity-9224c1f7128f92f47ddf3feaf83b57d6d98e0a04.tar.zst
dexon-solidity-9224c1f7128f92f47ddf3feaf83b57d6d98e0a04.zip
Working implementation of arraypush
ByteArrayPush() gets a test but is ignored for now, since there are still some issues with its implementation
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 7ae97db2..96a426dd 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -3493,9 +3493,28 @@ BOOST_AUTO_TEST_CASE(array_push)
}
)";
compileAndRun(sourceCode);
- BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 2));
+ BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 3));
}
-
+#if 0 // reactivate once ByteArrayPush is properly implemented
+BOOST_AUTO_TEST_CASE(byte_array_push)
+{
+ char const* sourceCode = R"(
+ contract c {
+ bytes data;
+ function test() returns (byte x, byte y, byte z, uint l) {
+ data.push(5);
+ x = data[0];
+ data.push(4);
+ y = data[1];
+ l = data.push(3);
+ z = data[2];
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 3));
+}
+#endif
BOOST_AUTO_TEST_CASE(external_array_args)
{
char const* sourceCode = R"(