aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'db_test.go')
-rw-r--r--db_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/db_test.go b/db_test.go
index 9c6ad85..a6ad919 100644
--- a/db_test.go
+++ b/db_test.go
@@ -47,6 +47,20 @@ func TestDBOpenMetaFileError(t *testing.T) {
})
}
+// Ensure that the database limits the upper bound of the page size.
+/*
+func TestDBLimitPageSize(t *testing.T) {
+ withMockDB(func(db *DB, mockos *mockos, path string) {
+ buf := make([]byte, 4096)
+ mockos.On("OpenFile", path, os.O_RDWR|os.O_CREATE, os.FileMode(0666)).Return(&mockfile{}, nil)
+ mockos.On("OpenFile", path, os.O_RDWR|os.O_SYNC, os.FileMode(0666)).Return(&mockfile{}, nil)
+ mockos.On("OpenFile", path, os.O_RDWR|os.O_SYNC, os.FileMode(0666)).Return(&mockfile{}, nil)
+ err := db.Open(path, 0666)
+ assert.Equal(t, err, exp)
+ })
+}
+*/
+
// withDB executes a function with a database reference.
func withDB(fn func(*DB, string)) {
f, _ := ioutil.TempFile("", "bolt-")