From 9aa47c8fad6aa407971d95213136b087e78e2291 Mon Sep 17 00:00:00 2001 From: Adrien Bustany Date: Thu, 16 Jan 2014 17:43:46 +0100 Subject: [PATCH] tests: Allow resetting the value of a counter This is useful when you want to check the event count delta after doing some operations. --- fsnotify_test.go | 4 ++++ 1 file changed, 4 insertions(+) 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() -- 2.50.1