1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Adapt test-out-of-memory to work on 32-bit systems

* test-suite/standalone/test-out-of-memory (*limit*): Reduce limit to 50 MB.
  Adapt vector test to avoid exceeding maximum vector size on 32-bit
  systems.
This commit is contained in:
Andy Wingo 2014-03-26 10:35:53 +01:00
parent 63b9e8b03f
commit 56f79491c4

View file

@ -17,8 +17,8 @@ exec guile -q -s "$0" "$@"
(write "Skipping test.\n" (current-error-port)) (write "Skipping test.\n" (current-error-port))
(exit 0))) (exit 0)))
;; 100 MB. ;; 50 MB.
(define *limit* (* 100 1024 1024)) (define *limit* (* 50 1024 1024))
(call-with-values (lambda () (getrlimit 'as)) (call-with-values (lambda () (getrlimit 'as))
(lambda (soft hard) (lambda (soft hard)
@ -36,8 +36,10 @@ exec guile -q -s "$0" "$@"
(use-modules (rnrs bytevectors)) (use-modules (rnrs bytevectors))
(test (lambda () (test (lambda ()
;; A vector with a billion elements doesn't fit into 100 MB. ;; Unhappily, on 32-bit systems, vectors are limited to 16M
(make-vector #e1e9))) ;; elements. Boo. Anyway, a vector with 16M elements takes 64
;; MB, which doesn't fit into 50 MB.
(make-vector (1- (ash 1 24)))))
(test (lambda () (test (lambda ()
;; Likewise for a bytevector. This is different from the above, ;; Likewise for a bytevector. This is different from the above,
;; as the elements of a bytevector are not traced by GC. ;; as the elements of a bytevector are not traced by GC.