Commit 7ea83d34 authored by pfdietz's avatar pfdietz
Browse files

Add tests for get-internal-real/run-time

parent 7d3b08bf
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun May 8 20:28:21 2005
;;;; Contains: Tests of GET-INTERNAL-REAL-TIME, GET-INTERNAL-RUN-TIME
(in-package :cl-test)
(deftest get-internal-real-time.1
(notnot-mv (typep (multiple-value-list (get-internal-real-time)) '(cons unsigned-byte null)))
t)
(deftest get-internal-real-time.2
(funcall
(compile
nil
'(lambda ()
(let ((prev (get-internal-real-time)))
(loop for next = (get-internal-real-time)
repeat 100000
do (assert (>= next prev))
do (setf prev next))))))
nil)
(deftest get-internal-real-time.error.1
(signals-error (get-internal-real-time nil) program-error)
t)
(deftest get-internal-real-time.error.2
(signals-error (get-internal-real-time :allow-other-keys t) program-error)
t)
;;;;;
(deftest get-internal-run-time.1
(notnot-mv (typep (multiple-value-list (get-internal-run-time)) '(cons unsigned-byte null)))
t)
(deftest get-internal-run-time.2
(funcall
(compile
nil
'(lambda ()
(let ((prev (get-internal-run-time)))
(loop for next = (get-internal-run-time)
repeat 100000
do (assert (>= next prev))
do (setf prev next))))))
nil)
(deftest get-internal-run-time.error.1
(signals-error (get-internal-run-time nil) program-error)
t)
(deftest get-internal-run-time.error.2
(signals-error (get-internal-run-time :allow-other-keys t) program-error)
t)
;;;
(deftest internal-time-units-per-second.1
(notnot-mv (constantp 'internal-time-units-per-second))
t)
(deftest internal-time-units-per-second.2
(notnot-mv (typep internal-time-units-per-second '(integer 1)))
t)
......@@ -17,3 +17,4 @@
(load "encode-universal-time.lsp")
(load "get-universal-time.lsp")
(load "sleep.lsp")
(load "get-internal-time.lsp")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment