[MzScheme] Typemaps for all integral types now accept the full range
of integral values, and they signal an error when a value outside the valid range is passed. [Guile] Typemaps for all integral types now signal an error when a value outside the valid range is passed. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4f7aeb6bdb
commit
b63f275984
8 changed files with 138 additions and 28 deletions
|
|
@ -9,8 +9,8 @@
|
|||
(define-macro (check-range function from to)
|
||||
`(begin (check-equality (,function ,from) ,from)
|
||||
(check-equality (,function ,to) ,to)
|
||||
(check-equality (throws-exception? (- ,from 1)) #t)
|
||||
(check-equality (throws-exception? (+ ,to 1)) #t)))
|
||||
(check-equality (throws-exception? (,function (- ,from 1))) #t)
|
||||
(check-equality (throws-exception? (,function (+ ,to 1))) #t)))
|
||||
|
||||
;;; signed char, unsigned char typemaps deal with characters, not integers.
|
||||
;; (check-range signed-char-identity (- (expt 2 7)) (- (expt 2 7) 1))
|
||||
|
|
@ -21,7 +21,8 @@
|
|||
(check-range unsigned-int-identity 0 (- (expt 2 32) 1))
|
||||
(check-range signed-long-identity (- (expt 2 31)) (- (expt 2 31) 1))
|
||||
(check-range unsigned-long-identity 0 (- (expt 2 32) 1))
|
||||
;;; long long not implemented in Guile.
|
||||
;;; long long not implemented in Guile and MzScheme.
|
||||
;; (check-range signed-long-long-identity (- (expt 2 63)) (- (expt 2 63) 1))
|
||||
;; (check-range unsigned-long-long-identity 0 (- (expt 2 64) 1))
|
||||
(quit)
|
||||
|
||||
(exit 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue