new SET-SBCL-SOURCE-LOCATION convenience function
[sbcl.git] / tests / gc.impure.lisp
index e1dd98d..faf5693 100644 (file)
 (let ((gc-happend nil))
   (push (lambda () (setq gc-happend t)) sb-ext:*after-gc-hooks*)
 
-  ;; check GC-{ON,OFF} works and gc is deferred
-  (gc-off)
-  (gc)
-  (assert (not gc-happend))
-  (gc-on)
-  (assert gc-happend)
-
   ;; check that WITHOUT-GCING defers explicit gc
-  (setq gc-happend nil)
   (sb-sys:without-gcing
     (gc)
     (assert (not gc-happend)))
       (assert (not gc-happend)))
     ;; give the hook time to run
     (sleep 1)
-    (assert gc-happend))
-
-  ;; check GC-ON works even in a WITHOUT-GCING
-  (setq gc-happend nil)
-  (sb-sys:without-gcing
-    (gc)
-    (assert (not gc-happend))
-    (gc-on)
-    (assert gc-happend)
-    (setq gc-happend nil))
-  (assert (not gc-happend)))
+    (assert gc-happend)))
 
-(sb-ext:quit :unix-status 104)
+;;; SB-EXT:GENERATION-* accessors returned bogus values for generation > 0
+(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)))
+        ;; 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 (= (sb-ext:generation-minimum-age-before-gc i) 0.75))
+        (assert (= (sb-ext:generation-number-of-gcs-before-promotion i) 1))))