Chicken test suite now runs with no errors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10054 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c6b4403b40
commit
4ace915a56
7 changed files with 95 additions and 15 deletions
28
Examples/test-suite/chicken/member_pointer_runme.ss
Normal file
28
Examples/test-suite/chicken/member_pointer_runme.ss
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
(require 'member_pointer)
|
||||
|
||||
(define (check-eq? msg expected actual)
|
||||
(if (not (= expected actual))
|
||||
(error "Error " msg ": expected " expected " got " actual)))
|
||||
|
||||
(define area-pt (areapt))
|
||||
(define perim-pt (perimeterpt))
|
||||
|
||||
(define s (new-Square 10))
|
||||
|
||||
(check-eq? "Square area" 100.0 (do-op s area-pt))
|
||||
(check-eq? "Square perim" 40.0 (do-op s perim-pt))
|
||||
|
||||
(check-eq? "Square area" 100.0 (do-op s (areavar)))
|
||||
(check-eq? "Square perim" 40.0 (do-op s (perimetervar)))
|
||||
|
||||
;; Set areavar to return value of function
|
||||
(areavar perim-pt)
|
||||
(check-eq? "Square perim" 40 (do-op s (areavar)))
|
||||
|
||||
(check-eq? "Square area" 100.0 (do-op s (AREAPT)))
|
||||
(check-eq? "Square perim" 40.0 (do-op s (PERIMPT)))
|
||||
|
||||
(define test (NULLPT))
|
||||
|
||||
(perimetervar (AREAPT))
|
||||
(check-eq? "Square area" 100.0 (do-op s (perimetervar)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue