Commit 2445a2e9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Use testing.T.Log() rather than fmt.Println().

parent 0603a121
...@@ -194,13 +194,13 @@ func (self *testCase) testRemove() { ...@@ -194,13 +194,13 @@ func (self *testCase) testRemove() {
func (self *testCase) testWriteThroughFuse() { func (self *testCase) testWriteThroughFuse() {
// Create (for write), write. // Create (for write), write.
fmt.Println("Testing create.") self.tester.Log("Testing create.")
f, err := os.Open(self.mountFile, os.O_WRONLY|os.O_CREATE, 0644) f, err := os.Open(self.mountFile, os.O_WRONLY|os.O_CREATE, 0644)
if err != nil { if err != nil {
self.tester.Errorf("Fuse create/open %v", err) self.tester.Errorf("Fuse create/open %v", err)
} }
fmt.Println("Testing write.") self.tester.Log("Testing write.")
n, err := f.WriteString(contents) n, err := f.WriteString(contents)
if err != nil { if err != nil {
self.tester.Errorf("fuse write %v", err) self.tester.Errorf("fuse write %v", err)
...@@ -224,7 +224,7 @@ func (self *testCase) testWriteThroughFuse() { ...@@ -224,7 +224,7 @@ func (self *testCase) testWriteThroughFuse() {
if err != nil { if err != nil {
self.tester.Errorf("orig read %v", err) self.tester.Errorf("orig read %v", err)
} }
fmt.Println("Orig contents", slice[:n]) self.tester.Log("Orig contents", slice[:n])
if string(slice[:n]) != contents { if string(slice[:n]) != contents {
self.tester.Errorf("write contents error %v", slice[:n]) self.tester.Errorf("write contents error %v", slice[:n])
} }
...@@ -250,7 +250,7 @@ func (self *testCase) testMkdirRmdir() { ...@@ -250,7 +250,7 @@ func (self *testCase) testMkdirRmdir() {
} }
func (self *testCase) testLink() { func (self *testCase) testLink() {
fmt.Println("Testing hard links.") self.tester.Log("Testing hard links.")
self.writeOrigFile() self.writeOrigFile()
err := os.Mkdir(self.origSubdir, 0777) err := os.Mkdir(self.origSubdir, 0777)
if err != nil { if err != nil {
...@@ -284,7 +284,7 @@ func (self *testCase) testLink() { ...@@ -284,7 +284,7 @@ func (self *testCase) testLink() {
} }
func (self *testCase) testSymlink() { func (self *testCase) testSymlink() {
fmt.Println("testing symlink/readlink.") self.tester.Log("testing symlink/readlink.")
self.writeOrigFile() self.writeOrigFile()
linkFile := "symlink-file" linkFile := "symlink-file"
...@@ -321,7 +321,7 @@ func (self *testCase) testSymlink() { ...@@ -321,7 +321,7 @@ func (self *testCase) testSymlink() {
} }
func (self *testCase) testRename() { func (self *testCase) testRename() {
fmt.Println("Testing rename.") self.tester.Log("Testing rename.")
self.writeOrigFile() self.writeOrigFile()
self.makeOrigSubdir() self.makeOrigSubdir()
...@@ -368,7 +368,7 @@ func (self *testCase) testAccess() { ...@@ -368,7 +368,7 @@ func (self *testCase) testAccess() {
} }
func (self *testCase) testMknod() { func (self *testCase) testMknod() {
fmt.Println("Testing mknod.") self.tester.Log("Testing mknod.")
errNo := syscall.Mknod(self.mountFile, syscall.S_IFIFO|0777, 0) errNo := syscall.Mknod(self.mountFile, syscall.S_IFIFO|0777, 0)
if errNo != 0 { if errNo != 0 {
self.tester.Errorf("Mknod %v", errNo) self.tester.Errorf("Mknod %v", errNo)
...@@ -382,7 +382,7 @@ func (self *testCase) testMknod() { ...@@ -382,7 +382,7 @@ func (self *testCase) testMknod() {
} }
func (self *testCase) testReaddir() { func (self *testCase) testReaddir() {
fmt.Println("Testing rename.") self.tester.Log("Testing readdir.")
self.writeOrigFile() self.writeOrigFile()
self.makeOrigSubdir() self.makeOrigSubdir()
...@@ -418,7 +418,7 @@ func (self *testCase) testReaddir() { ...@@ -418,7 +418,7 @@ func (self *testCase) testReaddir() {
} }
func (self *testCase) testFSync() { func (self *testCase) testFSync() {
fmt.Println("Testing rename.") self.tester.Log("Testing fsync.")
self.writeOrigFile() self.writeOrigFile()
f, err := os.Open(self.mountFile, os.O_WRONLY, 0) f, err := os.Open(self.mountFile, os.O_WRONLY, 0)
...@@ -436,6 +436,7 @@ func (self *testCase) testFSync() { ...@@ -436,6 +436,7 @@ func (self *testCase) testFSync() {
} }
func (self *testCase) testLargeRead() { func (self *testCase) testLargeRead() {
self.tester.Log("Testing large read.")
name := path.Join(self.origDir, "large") name := path.Join(self.origDir, "large")
f, err := os.Open(name, os.O_WRONLY|os.O_CREATE, 0777) f, err := os.Open(name, os.O_WRONLY|os.O_CREATE, 0777)
if err != nil { if err != nil {
...@@ -450,7 +451,6 @@ func (self *testCase) testLargeRead() { ...@@ -450,7 +451,6 @@ func (self *testCase) testLargeRead() {
b.WriteString("something extra to not be round") b.WriteString("something extra to not be round")
slice := b.Bytes() slice := b.Bytes()
fmt.Println("len : ", len(slice))
n, err := f.Write(slice) n, err := f.Write(slice)
if err != nil { if err != nil {
self.tester.Errorf("write err %v %v", err, n) self.tester.Errorf("write err %v %v", err, n)
...@@ -523,6 +523,7 @@ func randomLengthString(length int) string { ...@@ -523,6 +523,7 @@ func randomLengthString(length int) string {
func (self *testCase) testLargeDirRead() { func (self *testCase) testLargeDirRead() {
self.tester.Log("Testing large readdir.")
created := 100 created := 100
names := make([]string, created) names := make([]string, created)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment