aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vm/gh_test.go
diff options
context:
space:
mode:
authorEthan Buchman <ethan@coinculture.info>2015-02-18 08:25:18 +0800
committerEthan Buchman <ethan@coinculture.info>2015-02-18 08:25:18 +0800
commit2ba65f4fbaea49c1e0d99959b0331e09b153f931 (patch)
treeadd8cabb05cd7fbf0ba4b4bbaf9460dacfc2082d /tests/vm/gh_test.go
parent2da367a2bee84d74d1bb0ea1b42d4c22fae486dd (diff)
parent60318c96d03bcaaf731802b1080a3d87cb482124 (diff)
downloadgo-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar.gz
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar.bz2
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar.lz
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar.xz
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.tar.zst
go-tangerine-2ba65f4fbaea49c1e0d99959b0331e09b153f931.zip
Merge branch 'develop' of https://github.com/ethereum/go-ethereum into develop
Diffstat (limited to 'tests/vm/gh_test.go')
-rw-r--r--tests/vm/gh_test.go52
1 files changed, 39 insertions, 13 deletions
diff --git a/tests/vm/gh_test.go b/tests/vm/gh_test.go
index e1fdcd658..17f945910 100644
--- a/tests/vm/gh_test.go
+++ b/tests/vm/gh_test.go
@@ -79,6 +79,10 @@ func RunVmTest(p string, t *testing.T) {
helper.CreateFileTests(t, p, &tests)
for name, test := range tests {
+ helper.Logger.SetLogLevel(4)
+ if name != "TransactionNonceCheck2" {
+ continue
+ }
db, _ := ethdb.NewMemDatabase()
statedb := state.New(nil, db)
for addr, account := range test.Pre {
@@ -123,14 +127,10 @@ func RunVmTest(p string, t *testing.T) {
if isVmTest {
if len(test.Gas) == 0 && err == nil {
- // Log VM err
- helper.Log.Infof("%s's: %v\n", name, err)
t.Errorf("%s's gas unspecified, indicating an error. VM returned (incorrectly) successfull", name)
} else {
gexp := ethutil.Big(test.Gas)
if gexp.Cmp(gas) != 0 {
- // Log VM err
- helper.Log.Infof("%s's: %v\n", name, err)
t.Errorf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas)
}
}
@@ -172,47 +172,52 @@ func RunVmTest(p string, t *testing.T) {
// I've created a new function for each tests so it's easier to identify where the problem lies if any of them fail.
func TestVMArithmetic(t *testing.T) {
- const fn = "../files/vmtests/vmArithmeticTest.json"
+ const fn = "../files/VMTests/vmArithmeticTest.json"
+ RunVmTest(fn, t)
+}
+
+func TestSystemOperations(t *testing.T) {
+ const fn = "../files/VMTests/vmSystemOperationsTest.json"
RunVmTest(fn, t)
}
func TestBitwiseLogicOperation(t *testing.T) {
- const fn = "../files/vmtests/vmBitwiseLogicOperationTest.json"
+ const fn = "../files/VMTests/vmBitwiseLogicOperationTest.json"
RunVmTest(fn, t)
}
func TestBlockInfo(t *testing.T) {
- const fn = "../files/vmtests/vmBlockInfoTest.json"
+ const fn = "../files/VMTests/vmBlockInfoTest.json"
RunVmTest(fn, t)
}
func TestEnvironmentalInfo(t *testing.T) {
- const fn = "../files/vmtests/vmEnvironmentalInfoTest.json"
+ const fn = "../files/VMTests/vmEnvironmentalInfoTest.json"
RunVmTest(fn, t)
}
func TestFlowOperation(t *testing.T) {
- const fn = "../files/vmtests/vmIOandFlowOperationsTest.json"
+ const fn = "../files/VMTests/vmIOandFlowOperationsTest.json"
RunVmTest(fn, t)
}
func TestPushDupSwap(t *testing.T) {
- const fn = "../files/vmtests/vmPushDupSwapTest.json"
+ const fn = "../files/VMTests/vmPushDupSwapTest.json"
RunVmTest(fn, t)
}
func TestVMSha3(t *testing.T) {
- const fn = "../files/vmtests/vmSha3Test.json"
+ const fn = "../files/VMTests/vmSha3Test.json"
RunVmTest(fn, t)
}
func TestVm(t *testing.T) {
- const fn = "../files/vmtests/vmtests.json"
+ const fn = "../files/VMTests/vmtests.json"
RunVmTest(fn, t)
}
func TestVmLog(t *testing.T) {
- const fn = "../files/vmtests/vmLogTest.json"
+ const fn = "../files/VMTests/vmLogTest.json"
RunVmTest(fn, t)
}
@@ -240,3 +245,24 @@ func TestStateRefund(t *testing.T) {
const fn = "../files/StateTests/stRefundTest.json"
RunVmTest(fn, t)
}
+
+func TestStateBlockHash(t *testing.T) {
+ const fn = "../files/StateTests/stBlockHashTest.json"
+ RunVmTest(fn, t)
+}
+
+func TestStateInitCode(t *testing.T) {
+ const fn = "../files/StateTests/stInitCodeTest.json"
+ RunVmTest(fn, t)
+}
+
+func TestStateLog(t *testing.T) {
+ const fn = "../files/StateTests/stLogTests.json"
+ RunVmTest(fn, t)
+}
+
+func TestStateTransaction(t *testing.T) {
+ t.Skip()
+ const fn = "../files/StateTests/stTransactionTest.json"
+ RunVmTest(fn, t)
+}