diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-21 14:18:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-21 14:18:02 -0700 |
commit | 53fd7bd43eb9a513f5a81f9ebbd99a7cc4172430 (patch) | |
tree | b8cb3cbce20950aa3c73506ed36c0ff082b97c4d | |
parent | b963e5050aaa83ac59c323a2a0382aa6637f1338 (diff) | |
download | txr-53fd7bd43eb9a513f5a81f9ebbd99a7cc4172430.tar.gz txr-53fd7bd43eb9a513f5a81f9ebbd99a7cc4172430.tar.bz2 txr-53fd7bd43eb9a513f5a81f9ebbd99a7cc4172430.zip |
ffi: port glob tests to Darwin.
* tests/017/glob-carray.tl (glob-t): Initialize reserve
member to 0. Since it doesn't exist on Darwin, it will
stay nil, and change the the test output. A Darwin variant
of the corresponding FFI type is provided.
* tests/017/glob-zarray.tl (glob-t): Likewise.
-rw-r--r-- | tests/017/glob-carray.tl | 19 | ||||
-rw-r--r-- | tests/017/glob-zarray.tl | 19 |
2 files changed, 28 insertions, 10 deletions
diff --git a/tests/017/glob-carray.tl b/tests/017/glob-carray.tl index 3c68ac1a..f98359a8 100644 --- a/tests/017/glob-carray.tl +++ b/tests/017/glob-carray.tl @@ -1,12 +1,21 @@ (load "../common") (defstruct glob-t nil - pathc pathv reserve) + pathc pathv (reserve 0)) -(deffi-type glob-t (struct glob-t - (pathc size-t) - (pathv (carray str-d)) - (reserve size-t))) +(cond + ((eq (os-symbol) :macos) + (deffi-type glob-t (struct glob-t + (pathc size-t) + (nil int) + (nil size-t) + (nil int) + (pathv (carray str-d)) + (nil (array 4 cptr))))) + (t (deffi-type glob-t (struct glob-t + (pathc size-t) + (pathv (carray str-d)) + (reserve size-t))))) (with-dyn-lib nil (deffi globb "glob" int (str int closure (ptr-out glob-t))) diff --git a/tests/017/glob-zarray.tl b/tests/017/glob-zarray.tl index b6e16d13..0597da86 100644 --- a/tests/017/glob-zarray.tl +++ b/tests/017/glob-zarray.tl @@ -1,12 +1,21 @@ (load "../common") (defstruct glob-t nil - pathc pathv reserve) + pathc pathv (reserve 0)) -(deffi-type glob-t (struct glob-t - (pathc size-t) - (pathv (ptr-out-d (zarray str-d))) - (reserve size-t))) +(cond + ((eq (os-symbol) :macos) + (deffi-type glob-t (struct glob-t + (pathc size-t) + (nil int) + (nil size-t) + (nil int) + (pathv (ptr-out-d (zarray str-d))) + (nil (array 4 cptr))))) + (t (deffi-type glob-t (struct glob-t + (pathc size-t) + (pathv (ptr-out-d (zarray str-d))) + (reserve size-t))))) (with-dyn-lib (libc) (deffi globb "glob" int (str int closure (ptr-out glob-t))) |