PageRenderTime 23ms CodeModel.GetById 10ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Scheme | 47 lines | 30 code | 10 blank | 7 comment | 0 complexity | 70f73b4d51dc7b606e070ff6b9542a84 MD5 | raw file
 1(load "li_std_string.so")
 2
 3(define x "hello")
 4
 5(if (not (string=? (test-value x) x))
 6  (begin (error "Error 1") (exit 1)))
 7
 8(if (not (string=? (test-const-reference x) x))
 9  (begin (error "Error 2") (exit 1)))
10
11(define y (test-pointer-out))
12(test-pointer y)
13(define z (test-const-pointer-out))
14(test-const-pointer z)
15
16(define a (test-reference-out))
17(test-reference a)
18
19;; test global variables
20(GlobalString "whee")
21(if (not (string=? (GlobalString) "whee"))
22  (error "Error 3"))
23(if (not (string=? (GlobalString2) "global string 2"))
24  (error "Error 4"))
25
26(define struct (make <Structure>))
27
28;; MemberString should be a wrapped class
29(if (not (string=? (slot-ref struct 'MemberString) ""))
30  (error "Error 4.5"))
31;(slot-set! (slot-ref struct 'MemberString) "and how")
32;;(if (not (string=? (slot-ref struct 'MemberString) "and how"))
33;;  (error "Error 5"))
34(if (not (string=? (slot-ref struct 'MemberString2) "member string 2"))
35  (error "Error 6"))
36(Structure-StaticMemberString "static str")
37(if (not (string=? (Structure-StaticMemberString) "static str"))
38  (error "Error 7"))
39(if (not (string=? (Structure-StaticMemberString2) "static member string 2"))
40  (error "Error 8"))
41
42;(if (not (string=? (Structure-ConstMemberString-get struct) "const member string"))
43;  (error "Error 9"))
44(if (not (string=? (Structure-ConstStaticMemberString) "const static member string"))
45  (error "Error 10"))
46
47(exit 0)