emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master e26166a: Fix filenotify-tests on MS-Windows


From: Eli Zaretskii
Subject: [Emacs-diffs] master e26166a: Fix filenotify-tests on MS-Windows
Date: Fri, 27 Jan 2017 08:29:14 +0000 (UTC)

branch: master
commit e26166aae0616264a476cac3ba1e2c5979d442b5
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix filenotify-tests on MS-Windows
    
    * test/lisp/filenotify-tests.el (file-notify-test04-file-validity)
    (file-notify-test05-dir-validity)
    (file-notify-test06-many-events)
    (file-notify-test08-watched-file-in-watched-dir): Manually remove
    the watch descriptor before calling file-notify--test-cleanup-p.
    (Bug#25539)
---
 test/lisp/filenotify-tests.el |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index d237d0c..db7f55e 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -850,6 +850,13 @@ delivered."
        ;; After deleting the parent directory, the descriptor must
        ;; not be valid anymore.
        (should-not (file-notify-valid-p file-notify--test-desc))
+        ;; w32notify doesn't generate 'stopped' events when the parent
+        ;; directory is deleted, which doesn't provide a chance for
+        ;; filenotify.el to remove the descriptor from the internal
+        ;; hash table it maintains.  So we must remove the descriptor
+        ;; manually.
+        (if (string-equal (file-notify--test-library) "w32notify")
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -906,6 +913,8 @@ delivered."
         (file-notify--test-timeout)
         (not (file-notify-valid-p file-notify--test-desc)))
         (should-not (file-notify-valid-p file-notify--test-desc))
+        (if (string-equal (file-notify--test-library) "w32notify")
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -975,6 +984,8 @@ delivered."
             (file-notify--test-read-event)
             (delete-file file)))
         (delete-directory file-notify--test-tmpfile)
+        (if (string-equal (file-notify--test-library) "w32notify")
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -1184,6 +1195,9 @@ the file watch."
           (delete-directory file-notify--test-tmpfile 'recursive))
         (should-not (file-notify-valid-p file-notify--test-desc1))
         (should-not (file-notify-valid-p file-notify--test-desc2))
+        (when (string-equal (file-notify--test-library) "w32notify")
+          (file-notify--rm-descriptor file-notify--test-desc1)
+          (file-notify--rm-descriptor file-notify--test-desc2))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]