diff options
Diffstat (limited to 'tests/reverse')
-rw-r--r-- | tests/reverse/correctness_test.go | 19 | ||||
-rw-r--r-- | tests/reverse/inomap_test.go | 2 |
2 files changed, 3 insertions, 18 deletions
diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go index 8747a11..930048f 100644 --- a/tests/reverse/correctness_test.go +++ b/tests/reverse/correctness_test.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io/ioutil" - "log" "os" "path/filepath" "strings" @@ -296,22 +295,6 @@ func TestSeekData(t *testing.T) { f.Close() } -func findInum(dir string, inum uint64) (name string) { - entries, err := os.ReadDir(dir) - if err != nil { - panic(err) - } - for _, e := range entries { - info, _ := e.Info() - st := info.Sys().(*syscall.Stat_t) - if st.Ino == inum { - return dir + "/" + e.Name() - } - } - log.Panicf("inum %d not found", inum) - return "" -} - // gocryptfs.longname.*.name of hardlinked files should not appear hardlinked (as the // contents are different). // @@ -339,7 +322,7 @@ func TestHardlinkedLongname(t *testing.T) { if err := syscall.Stat(workdir, &st); err != nil { t.Fatal(err) } - cWorkdir := findInum(dirB, st.Ino) + cWorkdir := dirB + "/" + findIno(dirB, st.Ino) t.Logf("workdir=%q cWorkdir=%q", workdir, cWorkdir) matches, err := filepath.Glob(cWorkdir + "/gocryptfs.longname.*.name") diff --git a/tests/reverse/inomap_test.go b/tests/reverse/inomap_test.go index a79ddd2..aadb782 100644 --- a/tests/reverse/inomap_test.go +++ b/tests/reverse/inomap_test.go @@ -2,6 +2,7 @@ package reverse_test import ( "bytes" + "log" "os" "strings" "syscall" @@ -30,6 +31,7 @@ func findIno(dir string, ino uint64) string { return entry } } + log.Panicf("ino %d not found", ino) return "" } |