aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-19 17:57:02 +0800
committerobscuren <geffobscura@gmail.com>2015-03-19 17:57:02 +0800
commitd7ab716eea1d1892e3358b1dece6b0e2cd31fce8 (patch)
treec0fe4ca2dc47ff8512065f3601b9f3ab6b21dd43 /cmd
parente67d32b46744928b07b4d964ae3dede9a1ffdddf (diff)
downloaddexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar.gz
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar.bz2
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar.lz
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar.xz
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.tar.zst
dexon-d7ab716eea1d1892e3358b1dece6b0e2cd31fce8.zip
Fixed mkdnode & added some tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethtest/main.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go
index 23ae9e525..cf1ec6dfa 100644
--- a/cmd/ethtest/main.go
+++ b/cmd/ethtest/main.go
@@ -24,7 +24,6 @@ package main
import (
"bytes"
"encoding/json"
- "fmt"
"io"
"io/ioutil"
"log"
@@ -33,8 +32,8 @@ import (
"strconv"
"strings"
- "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
@@ -136,7 +135,7 @@ func RunVmTest(r io.Reader) (failed int) {
rexp := helper.FromHex(test.Out)
if bytes.Compare(rexp, ret) != 0 {
- fmt.Printf("FAIL: %s's return failed. Expected %x, got %x\n", name, rexp, ret)
+ helper.Log.Infof("FAIL: %s's return failed. Expected %x, got %x\n", name, rexp, ret)
failed = 1
}
@@ -148,7 +147,13 @@ func RunVmTest(r io.Reader) (failed int) {
if len(test.Exec) == 0 {
if obj.Balance().Cmp(common.Big(account.Balance)) != 0 {
- fmt.Printf("FAIL: %s's : (%x) balance failed. Expected %v, got %v => %v\n", name, obj.Address()[:4], account.Balance, obj.Balance(), new(big.Int).Sub(common.Big(account.Balance), obj.Balance()))
+ helper.Log.Infof("FAIL: %s's : (%x) balance failed. Expected %v, got %v => %v\n",
+ name,
+ obj.Address()[:4],
+ account.Balance,
+ obj.Balance(),
+ new(big.Int).Sub(common.Big(account.Balance), obj.Balance()),
+ )
failed = 1
}
}
@@ -158,20 +163,20 @@ func RunVmTest(r io.Reader) (failed int) {
vexp := helper.FromHex(value)
if bytes.Compare(v, vexp) != 0 {
- fmt.Printf("FAIL: %s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)\n", name, obj.Address()[0:4], addr, vexp, v, common.BigD(vexp), common.BigD(v))
+ helper.Log.Infof("FAIL: %s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)\n", name, obj.Address()[0:4], addr, vexp, v, common.BigD(vexp), common.BigD(v))
failed = 1
}
}
}
if !bytes.Equal(common.Hex2Bytes(test.PostStateRoot), statedb.Root()) {
- fmt.Printf("FAIL: %s's : Post state root error. Expected %s, got %x\n", name, test.PostStateRoot, statedb.Root())
+ helper.Log.Infof("FAIL: %s's : Post state root error. Expected %s, got %x\n", name, test.PostStateRoot, statedb.Root())
failed = 1
}
if len(test.Logs) > 0 {
if len(test.Logs) != len(logs) {
- fmt.Printf("FAIL: log length mismatch. Expected %d, got %d", len(test.Logs), len(logs))
+ helper.Log.Infof("FAIL: log length mismatch. Expected %d, got %d", len(test.Logs), len(logs))
failed = 1
} else {
/*