Move testdata to root btcd directory.
Rather than duplicating the same data, just put it under testsdata at the root and access it from the modules from the parent directory.
This commit is contained in:
parent
6260dc959d
commit
1f87ee217a
7 changed files with 9 additions and 9 deletions
|
@ -22,7 +22,7 @@ func loadblocks(t *testing.T) []*btcutil.Block {
|
|||
return tstBlocks
|
||||
}
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if err != nil {
|
||||
t.Errorf("Unable to load blocks from test data: %v", err)
|
||||
|
|
|
@ -65,7 +65,7 @@ func testOperationalMode(t *testing.T, mode int) {
|
|||
db.SetDBInsertMode(btcdb.InsertValidatedInput)
|
||||
}
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if err != nil {
|
||||
t.Errorf("Unable to load blocks from test data for mode %v: %v",
|
||||
|
@ -185,7 +185,7 @@ func testBackout(t *testing.T, mode int) {
|
|||
|
||||
}
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if len(blocks) < 120 {
|
||||
t.Errorf("test data too small")
|
||||
|
@ -274,7 +274,7 @@ func loadBlocks(t *testing.T, file string) (blocks []*btcutil.Block, err error)
|
|||
blocks = savedblocks
|
||||
return
|
||||
}
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
var dr io.Reader
|
||||
var fi io.ReadCloser
|
||||
fi, err = os.Open(testdatafile)
|
||||
|
|
|
@ -58,7 +58,7 @@ func failtestOperationalMode(t *testing.T, mode int) {
|
|||
sqlite3.SetBlockCacheSize(db, 2)
|
||||
sqlite3.SetTxCacheSize(db, 3)
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if err != nil {
|
||||
t.Errorf("Unable to load blocks from test data for mode %v: %v",
|
||||
|
|
|
@ -21,7 +21,7 @@ func loadblocks(t *testing.T) []*btcutil.Block {
|
|||
return tstBlocks
|
||||
}
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if err != nil {
|
||||
t.Errorf("Unable to load blocks from test data: %v", err)
|
||||
|
|
|
@ -71,7 +71,7 @@ func testOperationalMode(t *testing.T, mode int) {
|
|||
sqlite3.SetBlockCacheSize(db, 2)
|
||||
sqlite3.SetTxCacheSize(db, 3)
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if err != nil {
|
||||
t.Errorf("Unable to load blocks from test data for mode %v: %v",
|
||||
|
@ -196,7 +196,7 @@ func testBackout(t *testing.T, mode int) {
|
|||
sqlite3.SetBlockCacheSize(db, 2)
|
||||
sqlite3.SetTxCacheSize(db, 3)
|
||||
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
blocks, err := loadBlocks(t, testdatafile)
|
||||
if len(blocks) < 120 {
|
||||
t.Errorf("test data too small")
|
||||
|
@ -275,7 +275,7 @@ func testBackout(t *testing.T, mode int) {
|
|||
}
|
||||
|
||||
func loadBlocks(t *testing.T, file string) (blocks []*btcutil.Block, err error) {
|
||||
testdatafile := filepath.Join("testdata", "blocks1-256.bz2")
|
||||
testdatafile := filepath.Join("..", "testdata", "blocks1-256.bz2")
|
||||
var dr io.Reader
|
||||
var fi io.ReadCloser
|
||||
fi, err = os.Open(testdatafile)
|
||||
|
|
BIN
sqlite3/testdata/blocks1-256.bz2
vendored
BIN
sqlite3/testdata/blocks1-256.bz2
vendored
Binary file not shown.
Loading…
Reference in a new issue