~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Examples/test-suite/chicken/li_std_string_runme_proxy.ss

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
(define scl (slot-ref struct 'MemberString))
 
30
(if (not (string=? (slot-ref scl 'str) ""))
 
31
  (error "Error 4.5"))
 
32
(slot-set! scl 'str "and how")
 
33
(if (not (string=? (slot-ref (slot-ref struct 'MemberString) 'str) "and how"))
 
34
  (error "Error 5"))
 
35
(if (not (string=? (slot-ref struct 'MemberString2) "member string 2"))
 
36
  (error "Error 6"))
 
37
(Structure-StaticMemberString "static str")
 
38
(if (not (string=? (Structure-StaticMemberString) "static str"))
 
39
  (error "Error 7"))
 
40
(if (not (string=? (Structure-StaticMemberString2) "static member string 2"))
 
41
  (error "Error 8"))
 
42
 
 
43
;(if (not (string=? (Structure-ConstMemberString-get struct) "const member string"))
 
44
;  (error "Error 9"))
 
45
(if (not (string=? (Structure-ConstStaticMemberString) "const static member string"))
 
46
  (error "Error 10"))
 
47
 
 
48
(exit 0)