aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-31 00:16:35 +0800
committerobscuren <geffobscura@gmail.com>2014-12-31 00:16:35 +0800
commit77924757a8ab1c0c1a57b00673eebc08912ba0e0 (patch)
tree36db974dd7b14ae3fec836225d4ba765dec214a7 /tests
parenta9068aa8ff1b3ee1a665f3759f4b3a94ac702884 (diff)
parent16460b0048b738b0474bc1556d0df469f64bcf26 (diff)
downloadgo-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar.gz
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar.bz2
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar.lz
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar.xz
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.tar.zst
go-tangerine-77924757a8ab1c0c1a57b00673eebc08912ba0e0.zip
Merge branch 'develop' into poc8
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/gh_test.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/vm/gh_test.go b/tests/vm/gh_test.go
index 1efda7fe0..e06b0ed82 100644
--- a/tests/vm/gh_test.go
+++ b/tests/vm/gh_test.go
@@ -107,7 +107,9 @@ func RunVmTest(p string, t *testing.T) {
logs state.Logs
)
- if len(test.Exec) > 0 {
+ isVmTest := len(test.Exec) > 0
+
+ if isVmTest {
ret, logs, gas, err = helper.RunVm(statedb, env, test.Exec)
} else {
ret, logs, gas, err = helper.RunState(statedb, env, test.Transaction)
@@ -124,10 +126,14 @@ func RunVmTest(p string, t *testing.T) {
t.Errorf("%s's return failed. Expected %x, got %x\n", name, rexp, ret)
}
- if len(test.Gas) > 0 {
- gexp := ethutil.Big(test.Gas)
- if gexp.Cmp(gas) != 0 {
- t.Errorf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas)
+ if isVmTest {
+ if len(test.Gas) == 0 && err == nil {
+ t.Errorf("%s's gas unspecified, indicating an error. VM returned (incorrectly) successfull")
+ } else {
+ gexp := ethutil.Big(test.Gas)
+ if gexp.Cmp(gas) != 0 {
+ t.Errorf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas)
+ }
}
}