Commit 70209144 authored by Aaron Jacobs's avatar Aaron Jacobs

FlushFSTest.Mmap_CloseBeforeMunmap

parent 83d4308a
...@@ -569,7 +569,11 @@ func (t *FlushFSTest) Dup2_FlushError() { ...@@ -569,7 +569,11 @@ func (t *FlushFSTest) Dup2_FlushError() {
ExpectEq(nil, err) ExpectEq(nil, err)
} }
func (t *FlushFSTest) Mmap() { func (t *FlushFSTest) Mmap_MunmapBeforeClose() {
AssertTrue(false, "TODO")
}
func (t *FlushFSTest) Mmap_CloseBeforeMunmap() {
var n int var n int
var err error var err error
...@@ -612,13 +616,14 @@ func (t *FlushFSTest) Mmap() { ...@@ -612,13 +616,14 @@ func (t *FlushFSTest) Mmap() {
AssertThat(t.getFlushes(), ElementsAre("taco")) AssertThat(t.getFlushes(), ElementsAre("taco"))
AssertThat(t.getFsyncs(), ElementsAre()) AssertThat(t.getFsyncs(), ElementsAre())
// Modify then unmap. The unmapping should cause another flush. // Modify then unmap.
data[0] = 'p' data[0] = 'p'
err = syscall.Munmap(data) err = syscall.Munmap(data)
AssertEq(nil, err) AssertEq(nil, err)
ExpectThat(t.getFlushes(), ElementsAre("taco", "paco")) // munmap does not cause a flush.
ExpectThat(t.getFlushes(), ElementsAre("taco"))
ExpectThat(t.getFsyncs(), ElementsAre()) ExpectThat(t.getFsyncs(), ElementsAre())
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment