mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-06 12:19:37 +00:00
Use consistent function names in thread-tests.el
* test/src/thread-tests.el (threads-call-error, threads-custom) (threads-errors, threads-sticky-point, threads-signal-early): Rename, using naming convention to prefix with "threads-".
This commit is contained in:
parent
1c862297e4
commit
17ebb6e5ae
1 changed files with 9 additions and 8 deletions
|
@ -253,31 +253,32 @@
|
||||||
(string= "hi bob"
|
(string= "hi bob"
|
||||||
(condition-name (make-condition-variable (make-mutex)
|
(condition-name (make-condition-variable (make-mutex)
|
||||||
"hi bob")))))
|
"hi bob")))))
|
||||||
(defun call-error ()
|
|
||||||
|
(defun threads-call-error ()
|
||||||
"Call `error'."
|
"Call `error'."
|
||||||
(error "Error is called"))
|
(error "Error is called"))
|
||||||
|
|
||||||
;; This signals an error internally; the error should be caught.
|
;; This signals an error internally; the error should be caught.
|
||||||
(defun thread-custom ()
|
(defun threads-custom ()
|
||||||
(defcustom thread-custom-face 'highlight
|
(defcustom threads-custom-face 'highlight
|
||||||
"Face used for thread customizations."
|
"Face used for thread customizations."
|
||||||
:type 'face
|
:type 'face
|
||||||
:group 'widget-faces))
|
:group 'widget-faces))
|
||||||
|
|
||||||
(ert-deftest thread-errors ()
|
(ert-deftest threads-errors ()
|
||||||
"Test what happens when a thread signals an error."
|
"Test what happens when a thread signals an error."
|
||||||
(skip-unless (featurep 'threads))
|
(skip-unless (featurep 'threads))
|
||||||
(let (th1 th2)
|
(let (th1 th2)
|
||||||
(setq th1 (make-thread #'call-error "call-error"))
|
(setq th1 (make-thread #'threads-call-error "call-error"))
|
||||||
(should (threadp th1))
|
(should (threadp th1))
|
||||||
(while (thread-alive-p th1)
|
(while (thread-alive-p th1)
|
||||||
(thread-yield))
|
(thread-yield))
|
||||||
(should (equal (thread-last-error)
|
(should (equal (thread-last-error)
|
||||||
'(error "Error is called")))
|
'(error "Error is called")))
|
||||||
(setq th2 (make-thread #'thread-custom "thread-custom"))
|
(setq th2 (make-thread #'threads-custom "threads-custom"))
|
||||||
(should (threadp th2))))
|
(should (threadp th2))))
|
||||||
|
|
||||||
(ert-deftest thread-sticky-point ()
|
(ert-deftest threads-sticky-point ()
|
||||||
"Test bug #25165 with point movement in cloned buffer."
|
"Test bug #25165 with point movement in cloned buffer."
|
||||||
(skip-unless (featurep 'threads))
|
(skip-unless (featurep 'threads))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
|
@ -288,7 +289,7 @@
|
||||||
(sit-for 1)
|
(sit-for 1)
|
||||||
(should (= (point) 21))))
|
(should (= (point) 21))))
|
||||||
|
|
||||||
(ert-deftest thread-signal-early ()
|
(ert-deftest threads-signal-early ()
|
||||||
"Test signaling a thread as soon as it is started by the OS."
|
"Test signaling a thread as soon as it is started by the OS."
|
||||||
(skip-unless (featurep 'threads))
|
(skip-unless (featurep 'threads))
|
||||||
(let ((thread
|
(let ((thread
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue