From 88849201ffab6cebfad7ae4313d01726176352a7 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 28 Feb 2021 10:35:27 +0200 Subject: [PATCH] fix tests --- chain/store/splitstore/liveset_test.go | 12 ++++++++---- chain/store/splitstore/snoop_test.go | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/chain/store/splitstore/liveset_test.go b/chain/store/splitstore/liveset_test.go index e08bf1865..cc0183f6a 100644 --- a/chain/store/splitstore/liveset_test.go +++ b/chain/store/splitstore/liveset_test.go @@ -9,14 +9,18 @@ import ( ) func TestLMDBLiveSet(t *testing.T) { - testLiveSet(t, true) + testLiveSet(t, "lmdb") } func TestBoltLiveSet(t *testing.T) { - testLiveSet(t, false) + testLiveSet(t, "bolt") } -func testLiveSet(t *testing.T, useLMDB bool) { +func TestBloomLiveSet(t *testing.T) { + testLiveSet(t, "bloom") +} + +func testLiveSet(t *testing.T, lsType string) { t.Helper() path := "/tmp/liveset-test" @@ -26,7 +30,7 @@ func testLiveSet(t *testing.T, useLMDB bool) { t.Fatal(err) } - env, err := NewLiveSetEnv(path, useLMDB) + env, err := NewLiveSetEnv(path, lsType) if err != nil { t.Fatal(err) } diff --git a/chain/store/splitstore/snoop_test.go b/chain/store/splitstore/snoop_test.go index 96cfb667d..b13953a4d 100644 --- a/chain/store/splitstore/snoop_test.go +++ b/chain/store/splitstore/snoop_test.go @@ -10,7 +10,15 @@ import ( "github.com/filecoin-project/go-state-types/abi" ) -func testTrackingStore(t *testing.T, useLMDB bool) { +func TestLMDBTrackingStore(t *testing.T) { + testTrackingStore(t, "lmdb") +} + +func TestBoltTrackingStore(t *testing.T) { + testTrackingStore(t, "bolt") +} + +func testTrackingStore(t *testing.T, tsType string) { t.Helper() makeCid := func(key string) cid.Cid { @@ -47,7 +55,7 @@ func testTrackingStore(t *testing.T, useLMDB bool) { t.Fatal(err) } - s, err := NewTrackingStore(path, useLMDB) + s, err := NewTrackingStore(path, tsType) if err != nil { t.Fatal(err) } @@ -114,7 +122,7 @@ func testTrackingStore(t *testing.T, useLMDB bool) { t.Fatal(err) } - s, err = NewTrackingStore(path, useLMDB) + s, err = NewTrackingStore(path, tsType) if err != nil { t.Fatal(err) } @@ -126,11 +134,3 @@ func testTrackingStore(t *testing.T, useLMDB bool) { s.Close() //nolint:errcheck } - -func TestLMDBTrackingStore(t *testing.T) { - testTrackingStore(t, true) -} - -func TestBoltTrackingStore(t *testing.T) { - testTrackingStore(t, false) -}