51 lines
1.5 KiB
Plaintext
51 lines
1.5 KiB
Plaintext
;; Function To Be Tested: make-random-state
|
|
;;
|
|
;; Source: Common Lisp by Guy Steele
|
|
;; Section 12.9: Random Numbers
|
|
;; Page: 228
|
|
;;
|
|
;; Created By: John Park
|
|
;;
|
|
;; Creation Date: July 22, 86
|
|
;;
|
|
;; Last Update: Jan 28, 1987 Jim Blum - removed case which is implementation dependent
|
|
;;
|
|
;; Filed as: {eris}<lispcore>cml>test>12-9-make-random-state.test
|
|
;;
|
|
;; Syntax: make-random-state &optional state
|
|
;;
|
|
;; Function Description: This function returns a new object of type random-state,
|
|
;; suitable for use as the value of the variable *random-state*. If state is nil
|
|
;; or omitted, random-state returns a copy of the current random-number state
|
|
;; object. If state is a state object, a copy of that state object is returned.
|
|
;; If state is t, then a new state object is returned that has been "randomly"
|
|
;; initialized by some means (i.e. time-of-day clock).
|
|
;;
|
|
;; Argument(s): t, nil, or optional state
|
|
;;
|
|
;; Returns: object of type random-state
|
|
;;
|
|
;; Constraints/limitations: None
|
|
|
|
|
|
(do-test-group make-random-state-test-setup
|
|
:before (progn
|
|
(setq random-state1 (make-random-state))
|
|
(setq random-state2 (make-random-state))
|
|
(setq random-state3 (make-random-state)))
|
|
|
|
|
|
(do-test *random-state*-exist?
|
|
(and (boundp '*random-state*)
|
|
(random-state-p *random-state*)))
|
|
|
|
(do-test make-random-state-test
|
|
(and (random-state-p (make-random-state))
|
|
(random-state-p (make-random-state *random-state*))
|
|
(random-state-p (make-random-state random-state1)))))
|
|
|
|
|
|
STOP
|
|
|
|
|