/trunk/Examples/test-suite/chicken/newobject1_runme_proxy.ss

# · Scheme · 30 lines · 17 code · 13 blank · 0 comment · 1 complexity · 408c7b983d603183ce80c9b927ad4dd3 MD5 · raw file

  1. (require 'newobject1)
  2. (define-macro (check-count val)
  3. `(if (not (= (Foo-fooCount) ,val)) (error "Error checking val " ,val " != " ,(Foo-fooCount))))
  4. (define f (Foo-makeFoo))
  5. (check-count 1)
  6. (define f2 (makeMore f))
  7. (check-count 2)
  8. (set! f #f)
  9. (gc #t)
  10. (check-count 1)
  11. (define f3 (makeMore f2))
  12. (check-count 2)
  13. (set! f3 #f)
  14. (set! f2 #f)
  15. (gc #t)
  16. (check-count 0)
  17. (exit 0)