channeldb: ensure the cleanUp func is always run during tests

This commit is contained in:
Olaoluwa Osuntokun committed 2016-12-27 16:43:17 -08:00
1 parent 326c62c6b5
commit 587bde5636
4 files changed
+15 -15

No files matched your search

+2 -2
View File
@@ -13,10 +13,10 @@ import (
// database.
func TestVersionFetchPut(t *testing.T) {
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
t.Fatal(err)
}
defer cleanUp()
meta, err := db.FetchMeta(nil)
if err != nil {
@@ -117,10 +117,10 @@ func applyMigration(t *testing.T, beforeMigration, afterMigration func(d *DB),
migrationFunc migration, shouldFail bool) {
cdb, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
t.Fatal(err)
}
defer cleanUp()
// beforeMigration usually used for populating the database
// with test data.