From e15ae7b7bfac129c9807b223518505636c6513a8 Mon Sep 17 00:00:00 2001 From: mpl Date: Sun, 1 Jan 2012 00:00:34 +0100 Subject: [PATCH] mongo index tests, details Change-Id: I8fee05b2c7bfc8521add54ccfb56581f80158951 --- lib/go/camli/index/index_test.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/go/camli/index/index_test.go b/lib/go/camli/index/index_test.go index 23bc0eeef..3fef2ad7b 100644 --- a/lib/go/camli/index/index_test.go +++ b/lib/go/camli/index/index_test.go @@ -200,15 +200,9 @@ func initMongoIndex() *Index { return idx } -type indexTester interface { - test(t *testing.T, tfn func(*testing.T, *Index)) -} +type mongoTester struct{} -type mongoTester struct { - -} - -func (mt *mongoTester) test(t *testing.T, tfn func(*testing.T, func() *Index)) { +func (mongoTester) test(t *testing.T, tfn func(*testing.T, func() *Index)) { once.Do(checkMongoUp) if mongoNotAvailable { err := os.NewError("Not running; start a mongoDB daemon on the standard port (27017). The \"keys\" collection in the \"camlitest\" database will be used.") @@ -223,7 +217,7 @@ func TestIndex_Memory(t *testing.T) { } func TestIndex_Mongo(t *testing.T) { - (&mongoTester{}).test(t, testIndex) + mongoTester{}.test(t, testIndex) } func testIndex(t *testing.T, initIdx func() *Index) { @@ -374,7 +368,7 @@ func TestPathsOfSignerTarget_Memory(t *testing.T) { } func TestPathsOfSignerTarget_Mongo(t *testing.T) { - (&mongoTester{}).test(t, testPathsOfSignerTarget) + mongoTester{}.test(t, testPathsOfSignerTarget) } func testPathsOfSignerTarget(t *testing.T, initIdx func() *Index) { @@ -432,7 +426,7 @@ func TestFiles_Memory(t *testing.T) { } func TestFiles_Mongo(t *testing.T) { - (&mongoTester{}).test(t, testFiles) + mongoTester{}.test(t, testFiles) } func testFiles(t *testing.T, initIdx func() *Index) {