func TestCheckDatabaseForLevelDB(t *testing.T) { m, err := leveldb.NewLevelDB(dbFilename, true) if err != nil { t.Errorf("%v", err) } defer CleanupLevelDB(t, m) dbo := databaseOverlay.NewOverlay(m) testHelper.PopulateTestDatabaseOverlay(dbo) CheckDatabase(dbo) }
func NewLevelMapHybridDB(filename string, create bool) (*HybridDB, error) { answer := new(HybridDB) m := new(mapdb.MapDB) m.Init(nil) answer.temporaryStorage = m b, err := leveldb.NewLevelDB(filename, create) if err != nil { return nil, err } answer.persistentStorage = b return answer, nil }