From 36f6a9347cabfe75f37c6fae223144fea5b2d133 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 5 Nov 2015 17:42:35 +0000 Subject: [PATCH] Benchmark must use *db.Instance --- lib/db/benchmark_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/db/benchmark_test.go b/lib/db/benchmark_test.go index 69b3155e..83e8f898 100644 --- a/lib/db/benchmark_test.go +++ b/lib/db/benchmark_test.go @@ -17,8 +17,6 @@ import ( "github.com/syncthing/syncthing/lib/db" "github.com/syncthing/syncthing/lib/protocol" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/opt" ) var files, oneFile, firstHalf, secondHalf []protocol.FileInfo @@ -44,16 +42,16 @@ func init() { fs.Replace(protocol.LocalDeviceID, firstHalf) } -func tempDB() (*leveldb.DB, string) { +func tempDB() (*db.Instance, string) { dir, err := ioutil.TempDir("", "syncthing") if err != nil { panic(err) } - db, err := leveldb.OpenFile(filepath.Join(dir, "db"), &opt.Options{OpenFilesCacheCapacity: 100}) + dbi, err := db.Open(filepath.Join(dir, "db")) if err != nil { panic(err) } - return db, dir + return dbi, dir } func BenchmarkReplaceAll(b *testing.B) {