channeldb: ensure the cleanUp func is always run during tests

This commit is contained in:
Olaoluwa Osuntokun
2016-12-22 12:04:41 -08:00
parent 326c62c6b5
commit 587bde5636
4 changed files with 15 additions and 15 deletions

View File

@@ -33,10 +33,10 @@ func randInvoice(value btcutil.Amount) (*Invoice, error) {
func TestInvoiceWorkflow(t *testing.T) {
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
t.Fatalf("unable to make test db: %v", err)
}
defer cleanUp()
// Create a fake invoice which we'll use several times in the tests
// below.