import source from 1.3.40
[external/swig.git] / Examples / test-suite / guile / overload_complicated_runme.scm
1 ;; The SWIG modules have "passive" Linkage, i.e., they don't generate
2 ;; Guile modules (namespaces) but simply put all the bindings into the
3 ;; current module.  That's enough for such a simple test.
4 (dynamic-call "scm_init_overload_complicated_module" (dynamic-link "./liboverload_complicated.so"))
5
6 (define-macro (check form)
7   `(if (not ,form)
8        (error "Check failed: " ',form)))
9
10 (define (=~ a b)
11   (< (abs (- a b)) 1e-8))
12
13 ;; Check first method
14 (check (=~ (foo 1 2 "bar" 4) 15))
15
16 ;; Check second method
17 (check (=~ (foo 1 2) 4811.4))
18 (check (=~ (foo 1 2 3.2) 4797.2))
19 (check (=~ (foo 1 2 3.2 #\Q) 4798.2))
20
21 (exit 0)