diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-31 00:09:54 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-31 00:09:54 +0800 |
commit | 89244981a8a9f190a6afc74ec2c584692f04dcdd (patch) | |
tree | f289b00c5b18c68c9459053614599a15b836357a | |
parent | 138ab26b8c29db00022fb6afbca153f3c1928d00 (diff) | |
download | dexon-89244981a8a9f190a6afc74ec2c584692f04dcdd.tar.gz dexon-89244981a8a9f190a6afc74ec2c584692f04dcdd.tar.zst dexon-89244981a8a9f190a6afc74ec2c584692f04dcdd.zip |
Additional checking on gas
-rw-r--r-- | cmd/ethtest/main.go | 11 | ||||
-rw-r--r-- | tests/files/VMTests/RandomTests/randomTest.json | 46 |
2 files changed, 8 insertions, 49 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go index 94ab779db..96ef94e40 100644 --- a/cmd/ethtest/main.go +++ b/cmd/ethtest/main.go @@ -95,10 +95,15 @@ func RunVmTest(js string) (failed int) { failed = 1 } - gexp := ethutil.Big(test.Gas) - if gexp.Cmp(gas) != 0 { - log.Printf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas) + if len(test.Gas) == 0 && err == nil { + log.Printf("0 gas indicates error but no error given by VM") failed = 1 + } else { + gexp := ethutil.Big(test.Gas) + if gexp.Cmp(gas) != 0 { + log.Printf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas) + failed = 1 + } } for addr, account := range test.Post { diff --git a/tests/files/VMTests/RandomTests/randomTest.json b/tests/files/VMTests/RandomTests/randomTest.json deleted file mode 100644 index dad2ee4a2..000000000 --- a/tests/files/VMTests/RandomTests/randomTest.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "randomVMtest" : { - "callcreates" : [ - ], - "env" : { - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "currentDifficulty" : "256", - "currentGasLimit" : "1000000", - "currentNumber" : "0", - "currentTimestamp" : "1", - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" - }, - "exec" : { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "code" : "0x675545", - "data" : "0x", - "gas" : "10000", - "gasPrice" : "100000000000000", - "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : "1000000000000000000" - }, - "gas" : "9999", - "logs" : [ - ], - "out" : "0x", - "post" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : "1000000000000000000", - "code" : "0x675545", - "nonce" : "0", - "storage" : { - } - } - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : "1000000000000000000", - "code" : "0x675545", - "nonce" : "0", - "storage" : { - } - } - } - } -}
\ No newline at end of file |