diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/reverse/correctness_test.go | 21 | ||||
-rw-r--r-- | tests/reverse/longname_perf_test.go | 2 | ||||
-rw-r--r-- | tests/reverse/main_test.go | 3 |
3 files changed, 20 insertions, 6 deletions
diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go index e268815..77a440b 100644 --- a/tests/reverse/correctness_test.go +++ b/tests/reverse/correctness_test.go @@ -3,15 +3,28 @@ package reverse_test import ( "os" "testing" + //"time" + + "github.com/rfjakob/gocryptfs/tests/test_helpers" ) func TestLongnameStat(t *testing.T) { - _, err := os.Stat(dirA + "/" + "") + fd, err := os.Create(dirA + "/" + x240) if err != nil { - t.Error(err) + t.Fatal(err) + } + path := dirC + "/" + x240 + if !test_helpers.VerifyExistence(path) { + t.Fail() } - _, err = os.Stat(dirA + "/" + "") + test_helpers.VerifySize(t, path, 0) + _, err = fd.Write(make([]byte, 10)) if err != nil { - t.Error(err) + t.Fatal(err) } + fd.Close() + /* + time.Sleep(1000 * time.Millisecond) + test_helpers.VerifySize(t, path, 10) + */ } diff --git a/tests/reverse/longname_perf_test.go b/tests/reverse/longname_perf_test.go index f170ad7..1707cea 100644 --- a/tests/reverse/longname_perf_test.go +++ b/tests/reverse/longname_perf_test.go @@ -1,7 +1,6 @@ package reverse_test import ( - "bytes" "fmt" "os" "testing" @@ -13,7 +12,6 @@ func genName(i int, postfix string) string { // Create 10000 files with long names func generateLongnameFiles(dir string) { - x240 := string(bytes.Repeat([]byte("x"), 240)) for i := 0; i < 100000; i++ { n := genName(i, x240) f, err := os.Create(dir + "/" + n) diff --git a/tests/reverse/main_test.go b/tests/reverse/main_test.go index 3d10750..f59386b 100644 --- a/tests/reverse/main_test.go +++ b/tests/reverse/main_test.go @@ -1,6 +1,7 @@ package reverse_test import ( + "bytes" "os" "testing" @@ -8,8 +9,10 @@ import ( ) var dirA, dirB, dirC string +var x240 string func TestMain(m *testing.M) { + x240 = string(bytes.Repeat([]byte("x"), 240)) dirA = test_helpers.TmpDir + "/a" dirB = test_helpers.TmpDir + "/b" dirC = test_helpers.TmpDir + "/c" |