File: reference_global_vars.scm

package info (click to toggle)
swig1.3 1.3.24-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 19,336 kB
  • ctags: 10,604
  • sloc: cpp: 27,917; ansic: 24,160; yacc: 4,412; python: 4,255; java: 4,156; makefile: 3,735; sh: 3,552; cs: 2,250; ruby: 2,150; lisp: 1,605; tcl: 1,136; perl: 980; php: 879; ml: 825
file content (59 lines) | stat: -rw-r--r-- 2,049 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(define (!= a b) (not (= a b)))

; const class reference variable
(if (!= (TestClass-num-get (getconstTC)) 33)
  (begin (display "Runtime test 1 failed.\n") (exit 1)))

; primitive reference variables
(var-bool (createref-bool #f))
(if (value-bool (var-bool))
  (begin (display "Runtime test 2 failed.\n") (exit 1)))

(var-char (createref-char #\w))
(if (not (char=? (value-char (var-char)) #\w))
  (begin (display "Runtime test 3 failed.\n") (exit 1)))

(var-unsigned-char (createref-unsigned-char #\nl))
(if (not (char=? (value-unsigned-char (var-unsigned-char)) #\nl))
  (begin (display "Runtime test 4 failed.\n") (exit 1)))

(var-signed-char (createref-signed-char #\nl))
(if (not (char=? (value-signed-char (var-signed-char)) #\nl))
  (begin (display "Runtime test 5 failed.\n") (exit 1)))

(var-unsigned-short (createref-unsigned-short 10))
(if (!= (value-unsigned-short (var-unsigned-short)) 10)
  (begin (display "Runtime test 6 failed.\n") (exit 1)))

(var-int (createref-int 10))
(if (!= (value-int (var-int)) 10)
  (begin (display "Runtime test 7 failed.\n") (exit 1)))

(var-unsigned-int (createref-unsigned-int 10))
(if (!= (value-unsigned-int (var-unsigned-int)) 10)
  (begin (display "Runtime test 8 failed.\n") (exit 1)))

(var-long (createref-long 10))
(if (!= (value-long (var-long)) 10)
  (begin (display "Runtime test 9 failed.\n") (exit 1)))

(var-unsigned-long (createref-unsigned-long 10))
(if (!= (value-unsigned-long (var-unsigned-long)) 10)
  (begin (display "Runtime test 10 failed.\n") (exit 1)))

;skip long long and unsigned long long

(var-float (createref-float 10.5))
(if (!= (value-float (var-float)) 10.5)
  (begin (display "Runtime test 11 failed.\n") (exit 1)))

(var-double (createref-double 10.55))
(if (!= (value-double (var-double)) 10.55)
  (begin (display "Runtime test 12 failed.\n") (exit 1)))

;class reference
(var-TestClass (createref-TestClass (new-TestClass 20)))
(if (!= (TestClass-num-get (value-TestClass (var-TestClass))) 20)
  (begin (display "Runtime test 13 failed.\n") (exit 1)))

(exit 0)