source: trunk/source/tests/ansi-tests/get-internal-time.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.6 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun May  8 20:28:21 2005
4;;;; Contains: Tests of GET-INTERNAL-REAL-TIME, GET-INTERNAL-RUN-TIME
5
6(in-package :cl-test)
7
8(deftest get-internal-real-time.1
9  (notnot-mv (typep (multiple-value-list (get-internal-real-time)) '(cons unsigned-byte null)))
10  t)
11
12(deftest get-internal-real-time.2
13  (funcall
14   (compile
15    nil
16    '(lambda ()
17       (let ((prev (get-internal-real-time)))
18         (loop for next = (get-internal-real-time)
19               repeat 100000
20               do (assert (>= next prev))
21               do (setf prev next))))))
22  nil)
23
24(deftest get-internal-real-time.error.1
25  (signals-error (get-internal-real-time nil) program-error)
26  t)
27
28(deftest get-internal-real-time.error.2
29  (signals-error (get-internal-real-time :allow-other-keys t) program-error)
30  t)
31
32;;;;;
33
34(deftest get-internal-run-time.1
35  (notnot-mv (typep (multiple-value-list (get-internal-run-time)) '(cons unsigned-byte null)))
36  t)
37
38(deftest get-internal-run-time.2
39  (funcall
40   (compile
41    nil
42    '(lambda ()
43       (let ((prev (get-internal-run-time)))
44         (loop for next = (get-internal-run-time)
45               repeat 100000
46               do (assert (>= next prev))
47               do (setf prev next))))))
48  nil)
49
50(deftest get-internal-run-time.error.1
51  (signals-error (get-internal-run-time nil) program-error)
52  t)
53
54(deftest get-internal-run-time.error.2
55  (signals-error (get-internal-run-time :allow-other-keys t) program-error)
56  t)
57
58;;;
59
60(deftest internal-time-units-per-second.1
61  (notnot-mv (constantp 'internal-time-units-per-second))
62  t)
63
64(deftest internal-time-units-per-second.2
65  (notnot-mv (typep internal-time-units-per-second '(integer 1)))
66  t)
Note: See TracBrowser for help on using the repository browser.