SWIG chicken module now returns multiple values instead of returning a list.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7156 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b599732cdc
commit
d5974f3e1e
10 changed files with 91 additions and 28 deletions
|
|
@ -1,2 +1,12 @@
|
|||
(require 'li_typemaps)
|
||||
(load "../schemerunme/li_typemaps.scm")
|
||||
|
||||
(call-with-values (lambda () (inoutr-int2 3 -2))
|
||||
(lambda (a b)
|
||||
(if (not (and (= a 3) (= b -2)))
|
||||
(error "Error in inoutr-int2"))))
|
||||
(call-with-values (lambda () (out-foo 4))
|
||||
(lambda (a b)
|
||||
(if (not (and (= (Foo-a-get a) 4) (= b 8)))
|
||||
(error "Error in out-foo"))))
|
||||
(exit 0)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,13 @@
|
|||
(require 'li_typemaps)
|
||||
(load "../schemerunme/li_typemaps_proxy.scm")
|
||||
|
||||
(call-with-values (lambda () (inoutr-int2 3 -2))
|
||||
(lambda (a b)
|
||||
(if (not (and (= a 3) (= b -2)))
|
||||
(error "Error in inoutr-int2"))))
|
||||
(call-with-values (lambda () (out-foo 4))
|
||||
(lambda (a b)
|
||||
(if (not (and (= (slot-ref a 'a) 4) (= b 8)))
|
||||
(error "Error in out-foo"))))
|
||||
|
||||
(exit 0)
|
||||
|
|
|
|||
|
|
@ -6,3 +6,13 @@
|
|||
;; current module. That's enough for such a simple test.
|
||||
(dynamic-call "scm_init_li_typemaps_module" (dynamic-link "./libli_typemaps.so"))
|
||||
(load "../schemerunme/li_typemaps.scm")
|
||||
|
||||
(let ((lst (inoutr-int2 3 -2)))
|
||||
(if (not (and (= (car lst) 3) (= (cadr lst) -2)))
|
||||
(error "Error in inoutr-int2")))
|
||||
|
||||
(let ((lst (out-foo 4)))
|
||||
(if (not (and (= (Foo-a-get (car lst)) 4) (= (cadr lst) 8)))
|
||||
(error "Error in out-foo")))
|
||||
|
||||
(exit 0)
|
||||
|
|
|
|||
|
|
@ -23,12 +23,23 @@
|
|||
;(check "longlong" 1634 =)
|
||||
;(check "ulonglong" 6432 =)
|
||||
|
||||
(let ((lst (inoutr-int2 3 -2)))
|
||||
(if (not (and (= (car lst) 3) (= (cadr lst) -2)))
|
||||
(error "Error in inoutr-int2")))
|
||||
;; The checking of inoutr-int2 and out-foo is done in the individual
|
||||
;; language runme scripts, since chicken returns multiple values
|
||||
;; and must be checked with call-with-values, while guile just returns a list
|
||||
|
||||
(let ((lst (out-foo 4)))
|
||||
(if (not (and (= (Foo-a-get (car lst)) 4) (= (cadr lst) 8)))
|
||||
(error "Error in out-foo")))
|
||||
;(call-with-values (lambda () (inoutr-int2 3 -2))
|
||||
; (lambda (a b)
|
||||
; (if (not (and (= a 3) (= b -2)))
|
||||
; (error "Error in inoutr-int2"))))
|
||||
;(call-with-values (lambda () (out-foo 4))
|
||||
; (lambda (a b)
|
||||
; (if (not (and (= (Foo-a-get a) 4) (= b 8)))
|
||||
; (error "Error in out-foo"))))
|
||||
|
||||
;(let ((lst (inoutr-int2 3 -2)))
|
||||
; (if (not (and (= (car lst) 3) (= (cadr lst) -2)))
|
||||
; (error "Error in inoutr-int2")))
|
||||
|
||||
(exit 0)
|
||||
;(let ((lst (out-foo 4)))
|
||||
; (if (not (and (= (Foo-a-get (car lst)) 4) (= (cadr lst) 8)))
|
||||
; (error "Error in out-foo")))
|
||||
|
|
|
|||
|
|
@ -23,12 +23,23 @@
|
|||
(check "longlong" 1634 =)
|
||||
(check "ulonglong" 6432 =)
|
||||
|
||||
(let ((lst (inoutr-int2 3 -2)))
|
||||
(if (not (and (= (car lst) 3) (= (cadr lst) -2)))
|
||||
(error "Error in inoutr-int2")))
|
||||
;; The checking of inoutr-int2 and out-foo is done in the individual
|
||||
;; language runme scripts, since chicken returns multiple values
|
||||
;; and must be checked with call-with-values, while guile just returns a list
|
||||
|
||||
(let ((lst (out-foo 4)))
|
||||
(if (not (and (= (slot-ref (car lst) 'a) 4) (= (cadr lst) 8)))
|
||||
(error "Error in out-foo")))
|
||||
;(call-with-values (lambda () (inoutr-int2 3 -2))
|
||||
; (lambda (a b)
|
||||
; (if (not (and (= a 3) (= b -2)))
|
||||
; (error "Error in inoutr-int2"))))
|
||||
;(call-with-values (lambda () (out-foo 4))
|
||||
; (lambda (a b)
|
||||
; (if (not (and (= (slot-ref a 'a) 4) (= b 8)))
|
||||
; (error "Error in out-foo"))))
|
||||
|
||||
(exit 0)
|
||||
;(let ((lst (inoutr-int2 3 -2)))
|
||||
; (if (not (and (= (car lst) 3) (= (cadr lst) -2)))
|
||||
; (error "Error in inoutr-int2")))
|
||||
|
||||
;(let ((lst (out-foo 4)))
|
||||
; (if (not (and (= (slot-ref (car lst) 'a) 4) (= (cadr lst) 8)))
|
||||
; (error "Error in out-foo")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue