From 47224c438732d021e5aef74af30c7fd5801621d2 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sun, 12 Jan 2014 15:50:35 -0700 Subject: Mock syscall. --- db_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'db_test.go') 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-") -- cgit v1.2.3