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

# · Scheme · 29 lines · 19 code · 10 blank · 0 comment · 1 complexity · 4ef38ee3d7fbd777bccdc72c64be76c7 MD5 · raw file

  1. (load "newobject2.so")
  2. (define f (new-Foo))
  3. (Foo-dummy-set f 14)
  4. (if (not (= (Foo-dummy-get f) 14))
  5. (error "Bad dummy value"))
  6. (if (not (= (fooCount) 0))
  7. (error "Bad foo count 1"))
  8. (define f2 (makeFoo))
  9. (if (not (= (fooCount) 1))
  10. (error "Bad foo count 2"))
  11. (Foo-dummy-set f2 16)
  12. (if (not (= (Foo-dummy-get f2) 16))
  13. (error "Bad dummy value for f2"))
  14. (set! f #f)
  15. (set! f2 #f)
  16. (gc #t)
  17. (if (not (= (fooCount) -1))
  18. (error "Bad foo count 3"))
  19. (exit 0)