1
0
mirror of https://github.com/golang/go synced 2024-11-24 22:57:57 -07:00

os/inotify: use _test for test files, not _obj

R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4408043
This commit is contained in:
Russ Cox 2011-04-13 16:17:49 -04:00
parent 6392fc75cf
commit da8c5e7239
2 changed files with 5 additions and 5 deletions

View File

@ -109,7 +109,7 @@ func (w *Watcher) AddWatch(path string, flags uint32) os.Error {
} }
wd, errno := syscall.InotifyAddWatch(w.fd, path, flags) wd, errno := syscall.InotifyAddWatch(w.fd, path, flags)
if wd == -1 { if wd == -1 {
return os.NewSyscallError("inotify_add_watch", errno) return &os.PathError{"inotify_add_watch", path, os.Errno(errno)}
} }
if !found { if !found {

View File

@ -17,8 +17,8 @@ func TestInotifyEvents(t *testing.T) {
t.Fatalf("NewWatcher() failed: %s", err) t.Fatalf("NewWatcher() failed: %s", err)
} }
// Add a watch for "_obj" // Add a watch for "_test"
err = watcher.Watch("_obj") err = watcher.Watch("_test")
if err != nil { if err != nil {
t.Fatalf("Watcher.Watch() failed: %s", err) t.Fatalf("Watcher.Watch() failed: %s", err)
} }
@ -30,7 +30,7 @@ func TestInotifyEvents(t *testing.T) {
} }
}() }()
const testFile string = "_obj/TestInotifyEvents.testfile" const testFile string = "_test/TestInotifyEvents.testfile"
// Receive events on the event channel on a separate goroutine // Receive events on the event channel on a separate goroutine
eventstream := watcher.Event eventstream := watcher.Event
@ -90,7 +90,7 @@ func TestInotifyClose(t *testing.T) {
t.Fatal("double Close() test failed: second Close() call didn't return") t.Fatal("double Close() test failed: second Close() call didn't return")
} }
err := watcher.Watch("_obj") err := watcher.Watch("_test")
if err == nil { if err == nil {
t.Fatal("expected error on Watch() after Close(), got nil") t.Fatal("expected error on Watch() after Close(), got nil")
} }