diff options
| author | Michael Albinus | 2018-08-31 11:15:48 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-08-31 11:15:48 +0200 |
| commit | 6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e (patch) | |
| tree | 32ea1de28e6303b14a007c8d9e28e57dfbc0066e /test/src/thread-tests.el | |
| parent | db2fed3bdfb351c3283e481829ce687931d27a3d (diff) | |
| parent | ac7936cb8f4d4d6706535bfcea0d97741c2ca15f (diff) | |
| download | emacs-6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e.tar.gz emacs-6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e.zip | |
Merge from origin/emacs-26
ac7936cb8f Rename thread-alive-p to thread-live-p
3d09d533d1 rcirc: Document /reconnect as a built-in command (Bug#29656)
a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test.
Diffstat (limited to 'test/src/thread-tests.el')
| -rw-r--r-- | test/src/thread-tests.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index cc1dff8a281..a87eb3e1591 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | (declare-function mutex-lock "thread.c" (mutex)) | 34 | (declare-function mutex-lock "thread.c" (mutex)) |
| 35 | (declare-function mutex-unlock "thread.c" (mutex)) | 35 | (declare-function mutex-unlock "thread.c" (mutex)) |
| 36 | (declare-function thread--blocker "thread.c" (thread)) | 36 | (declare-function thread--blocker "thread.c" (thread)) |
| 37 | (declare-function thread-alive-p "thread.c" (thread)) | 37 | (declare-function thread-live-p "thread.c" (thread)) |
| 38 | (declare-function thread-join "thread.c" (thread)) | 38 | (declare-function thread-join "thread.c" (thread)) |
| 39 | (declare-function thread-last-error "thread.c" (&optional cleanup)) | 39 | (declare-function thread-last-error "thread.c" (&optional cleanup)) |
| 40 | (declare-function thread-name "thread.c" (thread)) | 40 | (declare-function thread-name "thread.c" (thread)) |
| @@ -63,11 +63,11 @@ | |||
| 63 | (should | 63 | (should |
| 64 | (string= "hi bob" (thread-name (make-thread #'ignore "hi bob"))))) | 64 | (string= "hi bob" (thread-name (make-thread #'ignore "hi bob"))))) |
| 65 | 65 | ||
| 66 | (ert-deftest threads-alive () | 66 | (ert-deftest threads-live () |
| 67 | "Test for thread liveness." | 67 | "Test for thread liveness." |
| 68 | (skip-unless (featurep 'threads)) | 68 | (skip-unless (featurep 'threads)) |
| 69 | (should | 69 | (should |
| 70 | (thread-alive-p (make-thread #'ignore)))) | 70 | (thread-live-p (make-thread #'ignore)))) |
| 71 | 71 | ||
| 72 | (ert-deftest threads-all-threads () | 72 | (ert-deftest threads-all-threads () |
| 73 | "Simple test for all-threads." | 73 | "Simple test for all-threads." |
| @@ -104,7 +104,7 @@ | |||
| 104 | (let ((thread (make-thread #'threads-test-thread1))) | 104 | (let ((thread (make-thread #'threads-test-thread1))) |
| 105 | (and (= (thread-join thread) 23) | 105 | (and (= (thread-join thread) 23) |
| 106 | (= threads-test-global 23) | 106 | (= threads-test-global 23) |
| 107 | (not (thread-alive-p thread))))))) | 107 | (not (thread-live-p thread))))))) |
| 108 | 108 | ||
| 109 | (ert-deftest threads-join-self () | 109 | (ert-deftest threads-join-self () |
| 110 | "Cannot `thread-join' the current thread." | 110 | "Cannot `thread-join' the current thread." |
| @@ -290,7 +290,7 @@ | |||
| 290 | (let (th1 th2) | 290 | (let (th1 th2) |
| 291 | (setq th1 (make-thread #'threads-call-error "call-error")) | 291 | (setq th1 (make-thread #'threads-call-error "call-error")) |
| 292 | (should (threadp th1)) | 292 | (should (threadp th1)) |
| 293 | (while (thread-alive-p th1) | 293 | (while (thread-live-p th1) |
| 294 | (thread-yield)) | 294 | (thread-yield)) |
| 295 | (should (equal (thread-last-error) | 295 | (should (equal (thread-last-error) |
| 296 | '(error "Error is called"))) | 296 | '(error "Error is called"))) |
| @@ -319,7 +319,7 @@ | |||
| 319 | (while t (thread-yield)))))) | 319 | (while t (thread-yield)))))) |
| 320 | (thread-signal thread 'error nil) | 320 | (thread-signal thread 'error nil) |
| 321 | (sit-for 1) | 321 | (sit-for 1) |
| 322 | (should-not (thread-alive-p thread)) | 322 | (should-not (thread-live-p thread)) |
| 323 | (should (equal (thread-last-error) '(error))))) | 323 | (should (equal (thread-last-error) '(error))))) |
| 324 | 324 | ||
| 325 | (ert-deftest threads-signal-main-thread () | 325 | (ert-deftest threads-signal-main-thread () |
| @@ -364,7 +364,7 @@ | |||
| 364 | (setq new-thread (make-thread #'threads-test-condvar-wait)) | 364 | (setq new-thread (make-thread #'threads-test-condvar-wait)) |
| 365 | 365 | ||
| 366 | ;; Make sure new-thread is alive. | 366 | ;; Make sure new-thread is alive. |
| 367 | (should (thread-alive-p new-thread)) | 367 | (should (thread-live-p new-thread)) |
| 368 | (should (= (length (all-threads)) 2)) | 368 | (should (= (length (all-threads)) 2)) |
| 369 | ;; Wait for new-thread to become blocked on the condvar. | 369 | ;; Wait for new-thread to become blocked on the condvar. |
| 370 | (while (not (eq (thread--blocker new-thread) threads-condvar)) | 370 | (while (not (eq (thread--blocker new-thread) threads-condvar)) |
| @@ -377,7 +377,7 @@ | |||
| 377 | (sleep-for 0.1) | 377 | (sleep-for 0.1) |
| 378 | ;; Make sure the thread is still there. This used to fail due to | 378 | ;; Make sure the thread is still there. This used to fail due to |
| 379 | ;; a bug in thread.c:condition_wait_callback. | 379 | ;; a bug in thread.c:condition_wait_callback. |
| 380 | (should (thread-alive-p new-thread)) | 380 | (should (thread-live-p new-thread)) |
| 381 | (should (= (length (all-threads)) 2)) | 381 | (should (= (length (all-threads)) 2)) |
| 382 | (should (eq (thread--blocker new-thread) threads-condvar)) | 382 | (should (eq (thread--blocker new-thread) threads-condvar)) |
| 383 | 383 | ||