aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-12 15:50:35 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-01-12 15:50:35 -0700
commit47224c438732d021e5aef74af30c7fd5801621d2 (patch)
tree86c3ed57636dc0794b61e6764c08ea5777bef072 /db_test.go
parentMock OS and File. (diff)
downloaddedo-47224c438732d021e5aef74af30c7fd5801621d2.tar.gz
dedo-47224c438732d021e5aef74af30c7fd5801621d2.tar.xz
Mock syscall.
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-")