aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-02-25 19:59:23 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-02-25 21:18:58 +0800
commit24574ef3374cf6ce3a9b473649ebe84be6084c35 (patch)
treecd10f9415a8480962fa7f7d0aef91c543a852f23
parent7f22c53b327456901227dc367b31cb0569307757 (diff)
downloaddexon-solidity-24574ef3374cf6ce3a9b473649ebe84be6084c35.tar.gz
dexon-solidity-24574ef3374cf6ce3a9b473649ebe84be6084c35.tar.zst
dexon-solidity-24574ef3374cf6ce3a9b473649ebe84be6084c35.zip
add memory tests
-rw-r--r--stMemoryTestFiller.json137
-rw-r--r--state.cpp5
2 files changed, 142 insertions, 0 deletions
diff --git a/stMemoryTestFiller.json b/stMemoryTestFiller.json
new file mode 100644
index 00000000..6e35e3c3
--- /dev/null
+++ b/stMemoryTestFiller.json
@@ -0,0 +1,137 @@
+{
+ "mload8bitBound": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "42949672960",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 1 ]] (MLOAD 256) } ",
+ "storage": {}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "429496729600",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "1000",
+ "to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ },
+
+ "mload16bitBound": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "42949672960",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 1 ]] (MLOAD 65536) } ",
+ "storage": {}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "429496729600",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "26520",
+ "to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ },
+
+ "mload32bitBound": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "42949672960",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 1 ]] (MLOAD 4294967296) } ",
+ "storage": {}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "429496729600",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "1342183320",
+ "to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ },
+
+ "mload32bitBound2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "42949672960",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 1 ]] (MLOAD 6294967296) } ",
+ "storage": {}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "429496729600",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "1342183320",
+ "to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ }
+}
diff --git a/state.cpp b/state.cpp
index 6c76a09d..8872d985 100644
--- a/state.cpp
+++ b/state.cpp
@@ -182,6 +182,11 @@ BOOST_AUTO_TEST_CASE(stSolidityTest)
dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests);
}
+BOOST_AUTO_TEST_CASE(stMemoryTest)
+{
+ dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests);
+}
+
BOOST_AUTO_TEST_CASE(stCreateTest)
{
for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)