From: Adrien Bustany Date: Thu, 16 Jan 2014 16:43:46 +0000 (+0100) Subject: tests: Allow resetting the value of a counter X-Git-Tag: v1.7.2~327^2~1 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=9aa47c8fad6aa407971d95213136b087e78e2291;p=fsnotify.git tests: Allow resetting the value of a counter This is useful when you want to check the event count delta after doing some operations. --- diff --git a/fsnotify_test.go b/fsnotify_test.go index 8f1b1ae..fdb66b6 100644 --- a/fsnotify_test.go +++ b/fsnotify_test.go @@ -45,6 +45,10 @@ func (c *counter) value() int32 { return atomic.LoadInt32(&c.val) } +func (c *counter) reset() { + atomic.StoreInt32(&c.val, 0) +} + func TestFsnotifyMultipleOperations(t *testing.T) { // Create an fsnotify watcher instance and initialize it watcher, err := NewWatcher()