~ubuntu-branches/ubuntu/lucid/gauche-c-wrapper/lucid

« back to all changes in this revision

Viewing changes to testsuite/fptr_array-test.scm

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2008-04-07 09:15:03 UTC
  • Revision ID: james.westby@ubuntu.com-20080407091503-wu0h414koe95kj4i
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;;
 
2
;;; Test for an array of function pointers
 
3
;;; 
 
4
 
 
5
(use gauche.test)
 
6
 
 
7
(test-start "fptr_array-test")
 
8
(use gauche.sequence)
 
9
(use c-wrapper)
 
10
(test-module 'c-wrapper)
 
11
 
 
12
(c-load-library "./fptr_array")
 
13
(c-include "./fptr_array.h")
 
14
 
 
15
(test "fptr_array"
 
16
      (list 3 55)
 
17
      (lambda ()
 
18
        (let ((foo (make (c-struct 'foo)))
 
19
              (v (make <c-int>))
 
20
              (results #f))
 
21
          (set! (ref v) 55)
 
22
          (fptr_array_set (ptr foo))
 
23
          (set! results (fptr_array_test (ptr foo) (ptr v)))
 
24
          (map identity (cast (c-array <c-int> 2) results)))))
 
25
 
 
26
;; epilogue
 
27
(test-end)
 
28