diff options
Diffstat (limited to 'tests/dedo.go')
-rw-r--r-- | tests/dedo.go | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/tests/dedo.go b/tests/dedo.go index 0d86055..245eb07 100644 --- a/tests/dedo.go +++ b/tests/dedo.go @@ -3258,7 +3258,7 @@ func TestOpen_ErrVersionMismatch(t *testing.T) { path := db.Path() // Close database. - err := db.DB.Close() + err := db.databaseT.Close() if err != nil { t.Fatal(err) } @@ -3299,7 +3299,7 @@ func TestOpen_ErrChecksum(t *testing.T) { path := db.Path() // Close database. - err := db.DB.Close() + err := db.databaseT.Close() if err != nil { t.Fatal(err) } @@ -3357,7 +3357,7 @@ func TestOpen_Size(t *testing.T) { } // Close database and grab the size. - err = db.DB.Close() + err = db.databaseT.Close() if err != nil { t.Fatal(err) } @@ -3442,7 +3442,7 @@ func TestOpen_Size_Large(t *testing.T) { } // Close database and grab the size. - err := db.DB.Close() + err := db.databaseT.Close() if err != nil { t.Fatal(err) } @@ -3575,7 +3575,7 @@ func TestDB_Open_InitialMmapSize(t *testing.T) { if err != nil { t.Fatal(err) } - db := idb.(*DB) + db := idb.(*databaseT) // create a long-running read transaction // that never gets closed while writing @@ -3626,7 +3626,7 @@ func TestDB_Open_InitialMmapSize(t *testing.T) { // Ensure that a database cannot open a transaction when it's not open. func TestDB_Begin_ErrDatabaseNotOpen(t *testing.T) { - var db DB + var db databaseT _, err := db.beginSnapshot() if err != ErrDatabaseNotOpen { t.Fatalf("unexpected error: %s", err) @@ -3646,7 +3646,7 @@ func TestDB_BeginRW(t *testing.T) { t.Fatal("expected tx") } - if tx.db != db.DB { + if tx.db != db.databaseT { t.Fatal("unexpected tx database") } else if !tx.writable { t.Fatal("expected writable tx") @@ -3658,9 +3658,9 @@ func TestDB_BeginRW(t *testing.T) { } } -// Ensure that opening a transaction while the DB is closed returns an error. +// Ensure that opening a transaction while the databaseT is closed returns an error. func TestDB_BeginRW_Closed(t *testing.T) { - var db DB + var db databaseT _, err := db.beginTransaction() if err != ErrDatabaseNotOpen { t.Fatalf("unexpected error: %s", err) @@ -3778,7 +3778,7 @@ func TestDB_Update(t *testing.T) { // Ensure a closed database returns an error while running a transaction block func TestDB_Update_Closed(t *testing.T) { - var db DB + var db databaseT err := db.Update(func(tx TransactionI) error { _, err := tx.CreateBucket([]byte("widgets")) if err != nil { @@ -4316,7 +4316,7 @@ func ExampleDB_Begin_ReadOnly() { if err != nil { log.Fatal(err) } - db := idb.(*DB) + db := idb.(*databaseT) defer os.Remove(db.Path()) // Create a bucket using a read-write transaction. @@ -4591,7 +4591,7 @@ func validateBatchBench(b *testing.B, db *WDB) { // DB is a test wrapper for DB. type WDB struct { - *DB + *databaseT } // MustOpenDB returns a new, open DB at a temporary location. @@ -4600,7 +4600,7 @@ func MustOpenDB() *WDB { if err != nil { panic(err) } - db := idb.(*DB) + db := idb.(*databaseT) return &WDB{db} } @@ -4612,7 +4612,7 @@ func (db *WDB) Close() error { db.MustCheck() // Close database and remove file. - return db.DB.Close() + return db.databaseT.Close() } // MustClose closes the database and deletes the underlying file. Panic on @@ -5103,7 +5103,7 @@ func TestNode_write_LeafPage(t *testing.T) { inodes: make(inodes, 0), bucket: &bucketT{ tx: &transactionT{ - db: &DB{}, + db: &databaseT{}, meta: &meta{ pgid: 1, }, @@ -5151,7 +5151,7 @@ func TestNode_split(t *testing.T) { inodes: make(inodes, 0), bucket: &bucketT{ tx: &transactionT{ - db: &DB{}, + db: &databaseT{}, meta: &meta{ pgid: 1, }, @@ -5187,7 +5187,7 @@ func TestNode_split_MinKeys(t *testing.T) { inodes: make(inodes, 0), bucket: &bucketT{ tx: &transactionT{ - db: &DB{}, + db: &databaseT{}, meta: &meta{ pgid: 1, }, @@ -5212,7 +5212,7 @@ func TestNode_split_SinglePage(t *testing.T) { inodes: make(inodes, 0), bucket: &bucketT{ tx: &transactionT{ - db: &DB{}, + db: &databaseT{}, meta: &meta{ pgid: 1, }, @@ -5310,7 +5310,7 @@ func TestPgids_merge_quick(t *testing.T) { // // -quick.count The number of iterations to perform. // -quick.seed The seed to use for randomizing. -// -quick.maxitems The maximum number of items to insert into a DB. +// -quick.maxitems The maximum number of items to insert into a databaseT. // -quick.maxksize The maximum size of a key. // -quick.maxvsize The maximum size of a value. // @@ -5655,7 +5655,7 @@ func simulatePutHandler(tx *transactionT, qdb *QuickDB) { } // QuickDB is an in-memory database that replicates the functionality of the -// Bolt DB type except that it is entirely in-memory. It is meant for testing +// Bolt databaseT type except that it is entirely in-memory. It is meant for testing // that the Bolt database is consistent. type QuickDB struct { sync.RWMutex @@ -6493,7 +6493,7 @@ func ExampleTx_Rollback() { if err != nil { log.Fatal(err) } - db := idb.(*DB) + db := idb.(*databaseT) defer os.Remove(db.Path()) // Create a bucket. @@ -6564,20 +6564,20 @@ func MustOpen2() *WDB2 { if err != nil { panic(err.Error()) } - db := idb.(*DB) - return &WDB2{DB: db, Path: f.Name()} + db := idb.(*databaseT) + return &WDB2{databaseT: db, Path: f.Name()} } // DB is a test wrapper for bolt.DB. type WDB2 struct { - *DB + *databaseT Path string } // Close closes and removes the database. func (db *WDB2) Close() error { defer os.Remove(db.Path) - return db.DB.Close() + return db.databaseT.Close() } func fillBucket(b *bucketT, prefix []byte) error { |