Fix test-case for bug-511072 in packages.impure.lisp
[sbcl.git] / tests / gc.impure.lisp
index d21d14a..ef4313a 100644 (file)
@@ -56,7 +56,8 @@
 (with-test (:name :bug-529014 :skipped-on '(not :gencgc))
   (loop for i from 0 to sb-vm:+pseudo-static-generation+
      do (assert (= (sb-ext:generation-bytes-consed-between-gcs i)
-                   (sb-ext:bytes-consed-between-gcs)))
+                   (truncate (sb-ext:bytes-consed-between-gcs)
+                             sb-vm:+highest-normal-generation+)))
         ;; FIXME: These parameters are a) tunable in the source and b)
         ;; duplicated multiple times there and now here.  It would be good to
         ;; OAOO-ify them (probably to src/compiler/generic/params.lisp).
    (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))))))