1 // Copyright (c) 2015-2016 The btcsuite developers
2 // Use of this source code is governed by an ISC
3 // license that can be found in the LICENSE file.
6 This test file is part of the ffldb package rather than than the ffldb_test
7 package so it can bridge access to the internals to properly test cases which
8 are either not possible or can't reliably be tested via the public interface.
9 The functions are only exported while the tests are being run.
14 import "github.com/btcsuite/btcd/database"
16 // TstRunWithMaxBlockFileSize runs the passed function with the maximum allowed
17 // file size for the database set to the provided value. The value will be set
18 // back to the original value upon completion.
19 func TstRunWithMaxBlockFileSize(idb database.DB, size uint32, fn func()) {
21 origSize := ffldb.store.maxBlockFileSize
23 ffldb.store.maxBlockFileSize = size
25 ffldb.store.maxBlockFileSize = origSize