Skip to content

Commit

Permalink
Tightened up nlink-related tests for sample file systems.
Browse files Browse the repository at this point in the history
These are currently failing due to bazil/fuse@58c769a. See #2.
  • Loading branch information
jacobsa committed Mar 18, 2015
1 parent c1c5478 commit 33e35f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions samples/cachingfs/caching_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (t *BasicsTest) StatFoo() {
ExpectThat(fi.ModTime(), timeutil.TimeEq(t.initialMtime))
ExpectFalse(fi.IsDir())
ExpectEq(t.fs.FooID(), getInodeID(fi))
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

func (t *BasicsTest) StatDir() {
Expand All @@ -212,6 +213,7 @@ func (t *BasicsTest) StatDir() {
ExpectThat(fi.ModTime(), timeutil.TimeEq(t.initialMtime))
ExpectTrue(fi.IsDir())
ExpectEq(t.fs.DirID(), getInodeID(fi))
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

func (t *BasicsTest) StatBar() {
Expand All @@ -224,6 +226,7 @@ func (t *BasicsTest) StatBar() {
ExpectThat(fi.ModTime(), timeutil.TimeEq(t.initialMtime))
ExpectFalse(fi.IsDir())
ExpectEq(t.fs.BarID(), getInodeID(fi))
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 4 additions & 0 deletions samples/hellofs/hello_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os"
"path"
"strings"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -158,6 +159,7 @@ func (t *HelloFSTest) Stat_Hello() {
ExpectEq(0444, fi.Mode())
ExpectEq(0, t.clock.Now().Sub(fi.ModTime()), "ModTime: %v", fi.ModTime())
ExpectFalse(fi.IsDir())
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

func (t *HelloFSTest) Stat_Dir() {
Expand All @@ -169,6 +171,7 @@ func (t *HelloFSTest) Stat_Dir() {
ExpectEq(0555|os.ModeDir, fi.Mode())
ExpectEq(0, t.clock.Now().Sub(fi.ModTime()), "ModTime: %v", fi.ModTime())
ExpectTrue(fi.IsDir())
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

func (t *HelloFSTest) Stat_World() {
Expand All @@ -180,6 +183,7 @@ func (t *HelloFSTest) Stat_World() {
ExpectEq(0444, fi.Mode())
ExpectEq(0, t.clock.Now().Sub(fi.ModTime()), "ModTime: %v", fi.ModTime())
ExpectFalse(fi.IsDir())
ExpectEq(1, fi.Sys().(*syscall.Stat_t).Nlink)
}

func (t *HelloFSTest) Stat_NonExistent() {
Expand Down

0 comments on commit 33e35f5

Please sign in to comment.