diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-12 15:50:35 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-12 15:50:35 -0700 |
commit | 47224c438732d021e5aef74af30c7fd5801621d2 (patch) | |
tree | 86c3ed57636dc0794b61e6764c08ea5777bef072 /db_test.go | |
parent | Mock OS and File. (diff) | |
download | dedo-47224c438732d021e5aef74af30c7fd5801621d2.tar.gz dedo-47224c438732d021e5aef74af30c7fd5801621d2.tar.xz |
Mock syscall.
Diffstat (limited to 'db_test.go')
-rw-r--r-- | db_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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-") |