X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fsignals.impure.lisp;h=c4f347e443d069ad1956fa3c943377f5bd2a0ee1;hb=1cba0af01f5107ab384d0d8b94b1f6330b3d0ef4;hp=1cb5fd3e86494cbb77ca91b7ea6db4e36d5c14f8;hpb=e62bb3a4b9633dbd898fca05cc4af3dd0a16e0aa;p=sbcl.git diff --git a/tests/signals.impure.lisp b/tests/signals.impure.lisp index 1cb5fd3..c4f347e 100644 --- a/tests/signals.impure.lisp +++ b/tests/signals.impure.lisp @@ -38,7 +38,14 @@ (require :sb-posix) -(with-test (:name (:signal :errno)) +(with-test (:name (:signal :errno) + ;; This test asserts that nanosleep behaves correctly + ;; for invalid values and sets EINVAL. Well, we have + ;; nanosleep on Windows, but it depends on the caller + ;; (namely SLEEP) to produce known-good arguments, and + ;; even if we wanted to check argument validity, + ;; integration with `errno' is not to be expected. + :skipped-on :win32) (let* (saved-errno (returning nil) (timer (make-timer (lambda () @@ -57,12 +64,21 @@ (loop repeat 1000000000) (assert (= saved-errno (sb-unix::get-errno))))) -(with-test (:name :handle-interactive-interrupt) +(with-test (:name :handle-interactive-interrupt + ;; It is desirable to support C-c on Windows, but SIGINT + ;; is not the mechanism to use on this platform. + :skipped-on :win32) (assert (eq :condition (handler-case - (sb-thread::kill-safely - (sb-thread::thread-os-thread sb-thread::*current-thread*) - sb-unix:sigint) + (progn + (sb-thread::kill-safely + (sb-thread::thread-os-thread sb-thread::*current-thread*) + sb-unix:sigint) + #+sb-safepoint-strictly + ;; In this case, the signals handler gets invoked + ;; indirectly through an INTERRUPT-THREAD. Give it + ;; enough time to hit. + (sleep 1)) (sb-sys:interactive-interrupt () :condition))))) @@ -81,19 +97,3 @@ (sb-ext:with-timeout 0.1 (sleep 1) t)))) (sb-ext:timeout () nil)))) - -(with-test (:name :sleep-many-interrupts) - (let ((n 0) - (timer nil)) - (flet ((trip () - (when (< (incf n) 5) - (sleep 0.1) - (schedule-timer timer 0.1)))) - (setf timer (make-timer #'trip)) - (schedule-timer timer 0.1) - (let ((start (get-internal-real-time))) - (sleep 1.5) - (let ((ticks (/ (float (- (get-internal-real-time) start)) - internal-time-units-per-second))) - (assert (< 1.4 ticks 1.6)) - (assert (= n 5)))))))