From 7020914422c4180490e840afaee5df085e843cab Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Mon, 23 Mar 2015 11:40:03 +1100 Subject: [PATCH] FlushFSTest.Mmap_CloseBeforeMunmap --- samples/flushfs/flush_fs_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/flushfs/flush_fs_test.go b/samples/flushfs/flush_fs_test.go index 6452cbc..47e9dbb 100644 --- a/samples/flushfs/flush_fs_test.go +++ b/samples/flushfs/flush_fs_test.go @@ -569,7 +569,11 @@ func (t *FlushFSTest) Dup2_FlushError() { ExpectEq(nil, err) } -func (t *FlushFSTest) Mmap() { +func (t *FlushFSTest) Mmap_MunmapBeforeClose() { + AssertTrue(false, "TODO") +} + +func (t *FlushFSTest) Mmap_CloseBeforeMunmap() { var n int var err error @@ -612,13 +616,14 @@ func (t *FlushFSTest) Mmap() { AssertThat(t.getFlushes(), ElementsAre("taco")) AssertThat(t.getFsyncs(), ElementsAre()) - // Modify then unmap. The unmapping should cause another flush. + // Modify then unmap. data[0] = 'p' err = syscall.Munmap(data) AssertEq(nil, err) - ExpectThat(t.getFlushes(), ElementsAre("taco", "paco")) + // munmap does not cause a flush. + ExpectThat(t.getFlushes(), ElementsAre("taco")) ExpectThat(t.getFsyncs(), ElementsAre()) }