]> code.delx.au - gnu-emacs/commitdiff
Fix error introduced recently in file-notify-tests.el
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 3 Jun 2015 18:03:42 +0000 (20:03 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 3 Jun 2015 18:03:42 +0000 (20:03 +0200)
* test/automated/file-notify-tests.el
(file-notify--test-remote-enabled): Do not use `file-notify--test-desc'.
(file-notify--deftest-remote): Revert previous patch, not
necessary anymore.

test/automated/file-notify-tests.el

index 806bdd73bd116ab632abf995193438d08f011416..11589b99295c214ab63a9257907fde4870f41e18 100644 (file)
@@ -85,21 +85,18 @@ being the result.")
 (defun file-notify--test-remote-enabled ()
   "Whether remote file notification is enabled."
   (unless (consp file-notify--test-remote-enabled-checked)
-    (unwind-protect
-        (ignore-errors
-          (and
-           (file-remote-p file-notify-test-remote-temporary-file-directory)
-           (file-directory-p file-notify-test-remote-temporary-file-directory)
-           (file-writable-p file-notify-test-remote-temporary-file-directory)
-           (setq file-notify--test-desc
-                 (file-notify-add-watch
-                  file-notify-test-remote-temporary-file-directory
-                  '(change) 'ignore))))
-      ;; Unwind forms.
-      (setq file-notify--test-remote-enabled-checked
-            (cons t file-notify--test-desc))
-      (when file-notify--test-desc
-        (file-notify-rm-watch file-notify--test-desc))))
+    (let (desc)
+      (ignore-errors
+        (and
+         (file-remote-p file-notify-test-remote-temporary-file-directory)
+         (file-directory-p file-notify-test-remote-temporary-file-directory)
+         (file-writable-p file-notify-test-remote-temporary-file-directory)
+         (setq desc
+               (file-notify-add-watch
+                file-notify-test-remote-temporary-file-directory
+                '(change) 'ignore))))
+      (setq file-notify--test-remote-enabled-checked (cons t desc))
+      (when desc (file-notify-rm-watch desc))))
   ;; Return result.
   (cdr file-notify--test-remote-enabled-checked))
 
@@ -108,21 +105,17 @@ being the result.")
   (declare (indent 1))
   `(ert-deftest ,(intern (concat (symbol-name test) "-remote")) ()
      ,docstring
-     (condition-case err
-         (let* ((temporary-file-directory
-                 file-notify-test-remote-temporary-file-directory)
-                (ert-test (ert-get-test ',test)))
-           (skip-unless (file-notify--test-remote-enabled))
-           (tramp-cleanup-connection
-            (tramp-dissect-file-name temporary-file-directory)
-            nil 'keep-password)
-           (funcall (ert-test-body ert-test)))
-         ((error quit) (ert-fail err)))))
+     (let* ((temporary-file-directory
+            file-notify-test-remote-temporary-file-directory)
+           (ert-test (ert-get-test ',test)))
+       (skip-unless (file-notify--test-remote-enabled))
+       (tramp-cleanup-connection
+       (tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
+       (funcall (ert-test-body ert-test)))))
 
 (ert-deftest file-notify-test00-availability ()
   "Test availability of `file-notify'."
   (skip-unless (file-notify--test-local-enabled))
-  ;; Check, that different valid parameters are accepted.
   (should
    (setq file-notify--test-desc
          (file-notify-add-watch temporary-file-directory '(change) 'ignore)))