From e2d1d832efe0623539c9d37ca8aee17d44e47067 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 2 Jan 2015 13:00:25 +0100 Subject: added nil check --- core/chain_manager_test.go | 10 +--------- core/types/block_test.go | 22 ---------------------- 2 files changed, 1 insertion(+), 31 deletions(-) (limited to 'core') diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index 10ff7359b..2ed3c6c9e 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -16,17 +16,9 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) -//var Logger logpkg.LogSystem - -//var Log = logpkg.NewLogger("TEST") - func init() { runtime.GOMAXPROCS(runtime.NumCPU()) - //Logger = logpkg.NewStdLogSystem(os.Stdout, log.LstdFlags, logpkg.DebugLevel) - //logpkg.AddLogSystem(Logger) - ethutil.ReadConfig("/tmp/ethtest", "/tmp/ethtest", "ETH") - } func reset() { @@ -38,7 +30,7 @@ func reset() { } func loadChain(fn string, t *testing.T) (types.Blocks, error) { - fh, err := os.OpenFile(path.Join("..", "_data", fn), os.O_RDONLY, os.ModePerm) + fh, err := os.OpenFile(path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "_data", fn), os.O_RDONLY, os.ModePerm) if err != nil { return nil, err } diff --git a/core/types/block_test.go b/core/types/block_test.go index c85708975..ab1254f4c 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -1,23 +1 @@ package types - -import ( - "bytes" - "testing" - - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethutil" - "github.com/ethereum/go-ethereum/rlp" -) - -func init() { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "") - ethutil.Config.Db, _ = ethdb.NewMemDatabase() -} - -func TestNewBlock(t *testing.T) { - block := GenesisBlock() - data := ethutil.Encode(block) - - var genesis Block - err := rlp.Decode(bytes.NewReader(data), &genesis) -} -- cgit