Fix test-case for bug-511072 in packages.impure.lisp
[sbcl.git] / tests / gc.impure.lisp
index cb9e3e7..ef4313a 100644 (file)
    (assert (eq :ok
                (handler-case
                    (dotimes (runs 100 :ok)
-                     (let ((len (length
-                                 (with-output-to-string (string)
-                                   (dotimes (i 1000000)
-                                     (write-sequence "hi there!" string))))))
-                       (assert (eql len (* 1000000 (length "hi there!"))))))
+                     (let* ((n (truncate (dynamic-space-size) 1200))
+                            (len (length
+                                  (with-output-to-string (string)
+                                    (dotimes (i n)
+                                      (write-sequence "hi there!" string))))))
+                       (assert (eql len (* n (length "hi there!"))))))
                  (storage-condition ()
                    :oom))))))