;;;; guardians.test --- test suite for Guile Guardians -*- scheme -*-
;;;; Jim Blandy <jimb@red-bean.com> --- July 1999
;;;;
-;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc.
+;;;; Copyright (C) 1999, 2001, 2006, 2014 Free Software Foundation, Inc.
;;;;
-;;;; This program is free software; you can redistribute it and/or modify
-;;;; it under the terms of the GNU General Public License as published by
-;;;; the Free Software Foundation; either version 2, or (at your option)
-;;;; any later version.
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
;;;;
-;;;; This program is distributed in the hope that it will be useful,
+;;;; This library is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;;; GNU General Public License for more details.
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;;; Lesser General Public License for more details.
;;;;
-;;;; You should have received a copy of the GNU General Public License
-;;;; along with this software; see the file COPYING. If not, write to
-;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;;;; Boston, MA 02110-1301 USA
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;;; These tests make some questionable assumptions.
;;;
(gc)
(let ((p (cons #f #f)))
(g p)
- (vector-set! v 0 p)
+ (weak-vector-set! v 0 p)
(set! p #f)) ;; clear refs left on the stack
(if (not (eq? (g) #f))
(throw 'unresolved)
(gc)
(let ((p (cons #f #f)))
(g p)
- (vector-set! v 0 p)
+ (weak-vector-set! v 0 p)
(set! p #f)) ;; clear refs left on the stack
(begin
(gc)
(throw 'unresolved)
(begin
(gc)
- (or (not (vector-ref v 0))
+ (or (not (weak-vector-ref v 0))
(throw 'unresolved))))))))
(with-test-prefix "guarding weak containers"
(v (weak-vector #f)))
;; Note: We don't pass `(cons #f #f)' as an argument to `weak-vector'
;; otherwise references to it are likely to be left on the stack.
- (vector-set! v 0 (cons #f #f))
+ (weak-vector-set! v 0 (cons #f #f))
(g v)
(gc)
- (if (equal? (vector-ref v 0) (cons #f #f))
+ (if (equal? (weak-vector-ref v 0) (cons #f #f))
(throw 'unresolved)
#t))))