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

« back to all changes in this revision

Viewing changes to Examples/test-suite/guile/overload_simple_runme.scm

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-01-10 09:48:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050110094852-axi555axhj1brbwq
Tags: 1.3.22-5ubuntu2
Build using python2.4 and pike7.6. Closes: #4146.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
;; Guile modules (namespaces) but simply put all the bindings into the
3
3
;; current module.  That's enough for such a simple test.
4
4
(dynamic-call "scm_init_overload_simple_module" (dynamic-link "./liboverload_simple.so"))
5
 
 
6
 
(if (not (string=? (foo 3) "foo:int"))
7
 
    (error "foo(int)"))
8
 
 
9
 
(if (not (string=? (foo 3.01) "foo:double"))
10
 
    (error "foo(double)"))
11
 
 
12
 
(if (not (string=? (foo "hello") "foo:char *"))
13
 
    (error "foo(char *)"))
14
 
 
15
 
(let ((f (new-Foo))
16
 
      (b (new-Bar))
17
 
      (s (new-Spam)))
18
 
  (if (not (string=? (foo f) "foo:Foo *"))
19
 
      (error "foo(Foo *)"))
20
 
  (if (not (string=? (foo b) "foo:Bar *"))
21
 
      (error "foo(Bar *)"))
22
 
  ;; Test member functions
23
 
  (if (not (string=? (Spam-foo s 3) "foo:int"))
24
 
      (error "Spam::foo(int)"))
25
 
  (if (not (string=? (Spam-foo s 3.01) "foo:double"))
26
 
      (error "Spam::foo(double)"))
27
 
  (if (not (string=? (Spam-foo s "hello") "foo:char *"))
28
 
      (error "Spam::foo(char *)"))
29
 
  (if (not (string=? (Spam-foo s f) "foo:Foo *"))
30
 
      (error "Spam::foo(Foo *)"))
31
 
  (if (not (string=? (Spam-foo s b) "foo:Bar *"))
32
 
      (error "Spam::foo(Bar *)"))
33
 
  ;; Test static member functions
34
 
  (if (not (string=? (Spam-bar 3) "bar:int"))
35
 
      (error "Spam::bar(int)"))
36
 
  (if (not (string=? (Spam-bar 3.01) "bar:double"))
37
 
      (error "Spam::bar(double)"))
38
 
  (if (not (string=? (Spam-bar "hello") "bar:char *"))
39
 
      (error "Spam::bar(char *)"))
40
 
  (if (not (string=? (Spam-bar f) "bar:Foo *"))
41
 
      (error "Spam::bar(Foo *)"))
42
 
  (if (not (string=? (Spam-bar b) "bar:Bar *"))
43
 
      (error "Spam::bar(Bar *)"))
44
 
  ;; Test constructors
45
 
  (if (not (string=? (Spam-type-get (new-Spam)) "none"))
46
 
      (error "Spam()"))
47
 
  (if (not (string=? (Spam-type-get (new-Spam 3)) "int"))
48
 
      (error "Spam(int)"))
49
 
  (if (not (string=? (Spam-type-get (new-Spam 3.4)) "double"))
50
 
      (error "Spam(double)"))
51
 
  (if (not (string=? (Spam-type-get (new-Spam "hello")) "char *"))
52
 
      (error "Spam(char *)"))
53
 
  (if (not (string=? (Spam-type-get (new-Spam b)) "Bar *"))
54
 
      (error "Spam(Bar *)")))
55
 
 
56
 
(exit 0)
 
5
(load "../schemerunme/overload_simple.scm")