aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-02-28 04:24:08 +0800
committerGav Wood <i@gavwood.com>2014-02-28 04:24:08 +0800
commit857b9f9bf9345397a686fd5b35034e94cfde33e0 (patch)
tree64cbf5c62d3e9badb199b03ae0fbc21ea0cbbde2
parent41b271e342a8400fcff83a3ba5d36ae5c36f5ff2 (diff)
downloaddexon-solidity-857b9f9bf9345397a686fd5b35034e94cfde33e0.tar.gz
dexon-solidity-857b9f9bf9345397a686fd5b35034e94cfde33e0.tar.zst
dexon-solidity-857b9f9bf9345397a686fd5b35034e94cfde33e0.zip
More VM tests.
-rw-r--r--vm.cpp2
-rw-r--r--vmtests.json82
2 files changed, 69 insertions, 15 deletions
diff --git a/vm.cpp b/vm.cpp
index 137803a3..1ba54d30 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -343,7 +343,7 @@ public:
Transactions txs;
};
-#define CREATE_TESTS 0
+#define CREATE_TESTS 1
template <> class UnitTest<1>
{
diff --git a/vmtests.json b/vmtests.json
index 52e31f4e..3b1d2db1 100644
--- a/vmtests.json
+++ b/vmtests.json
@@ -1,29 +1,83 @@
{
"suicide": {
- "env" : {
+ "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"feeMultiplier" : 1
- },
- "pre" : {
+ },
+ "pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
- "balance" : 1000000000000000000,
- "nonce" : 0,
- "code" : "(suicide (txsender))"
+ "balance" : 1000000000000000000,
+ "nonce" : 0,
+ "code" : "(suicide (txsender))"
}
- },
- "exec" : [
+ },
+ "exec" : [
{
- "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
- "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681",
- "value" : 1000000000000000000,
- "data" : [
- ]
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : 1000000000000000000,
+ "data" : [
+ ]
}
- ]
+ ]
+ },
+
+ "arith": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "feeMultiplier" : 1
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : 1000000000000000000,
+ "nonce" : 0,
+ "code" : "(seq (mktx (txsender) (+ 2 2 (* 4 4 4) (/ 2 2) (% 3 2) (- 8 2 2)) 0) )"
+ }
+ },
+ "exec" : [
+ {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : 1000000000000000000,
+ "data" : [
+ ]
+ }
+ ]
+ },
+
+ "boolean": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "feeMultiplier" : 1
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : 1000000000000000000,
+ "nonce" : 0,
+ "code" : "(seq (when (and 1 1) (mktx (txsender) 2 0)) (when (and 1 0) (mktx (txsender) 3 0)) (when (and 0 1) (mktx (txsender) 4 0)) (when (and 0 0) (mktx (txsender) 5 0)) (when (or 1 1) (mktx (txsender) 12 0)) (when (or 1 0) (mktx (txsender) 13 0)) (when (or 0 1) (mktx (txsender) 14 0)) (when (or 0 0) (mktx (txsender) 15 0)) )"
+ }
+ },
+ "exec" : [
+ {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : 1000000000000000000,
+ "data" : [
+ ]
+ }
+ ]
},
"mktx": {