FsyncErrorTest.Fdatasync

geesefs-0-30-9
Aaron Jacobs 2015-03-24 12:24:00 +11:00
parent 51f6b01135
commit db0ab82bdd
1 changed files with 11 additions and 1 deletions

View File

@ -791,5 +791,15 @@ func (t *FsyncErrorTest) Fsync() {
}
func (t *FsyncErrorTest) Fdatasync() {
AssertTrue(false, "TODO")
var err error
// Open the file.
t.f1, err = os.OpenFile(path.Join(t.Dir, "foo"), os.O_RDWR, 0)
AssertEq(nil, err)
// Fdatasync.
err = syscall.Fdatasync(int(t.f1.Fd()))
AssertNe(nil, err)
ExpectThat(err, Error(HasSubstr("no such file")))
}