From f270135c1614843f43a9df0e68b6e3fa556b6774 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 15 Aug 2020 15:39:08 +0200 Subject: test_helper: VerifyExistence: don't panic Instead bubble up the error to the testing object. --- tests/reverse/correctness_test.go | 4 ++-- tests/reverse/exclude_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/reverse') diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go index 9ebff37..47b8b73 100644 --- a/tests/reverse/correctness_test.go +++ b/tests/reverse/correctness_test.go @@ -26,7 +26,7 @@ func TestLongnameStat(t *testing.T) { } fd.Close() path := dirC + "/" + name - if !test_helpers.VerifyExistence(path) { + if !test_helpers.VerifyExistence(t, path) { t.Fatalf("failed to verify %q", path) } test_helpers.VerifySize(t, path, 0) @@ -106,7 +106,7 @@ func TestSymlinkDentrySize(t *testing.T) { // gocryptfs.conf func TestConfigMapping(t *testing.T) { c := dirB + "/gocryptfs.conf" - if !test_helpers.VerifyExistence(c) { + if !test_helpers.VerifyExistence(t, c) { t.Errorf("%s missing", c) } data, err := ioutil.ReadFile(c) diff --git a/tests/reverse/exclude_test.go b/tests/reverse/exclude_test.go index 110a407..b5d0f5b 100644 --- a/tests/reverse/exclude_test.go +++ b/tests/reverse/exclude_test.go @@ -118,7 +118,7 @@ func testExclude(t *testing.T, flag string) { cExclude := encryptExcludeTestPaths(t, sock, pExclude) // Check that "excluded" paths are not there and "ok" paths are there for _, v := range cExclude { - if test_helpers.VerifyExistence(mnt + "/" + v) { + if test_helpers.VerifyExistence(t, mnt+"/"+v) { t.Errorf("File %q is visible, but should be excluded", v) } if nametransform.IsLongContent(filepath.Base(v)) { @@ -126,7 +126,7 @@ func testExclude(t *testing.T, flag string) { } } for _, v := range cOk { - if !test_helpers.VerifyExistence(mnt + "/" + v) { + if !test_helpers.VerifyExistence(t, mnt+"/"+v) { t.Errorf("File %q is hidden, but should be visible", v) } } -- cgit v1.2.3