add non raw array ffi test

This commit is contained in:
Kristin Rutenkolk 2024-10-30 21:00:45 +01:00
parent d190873f72
commit 2b1d062277

View file

@ -95,5 +95,13 @@
{:x {:x 3.0 :y 4.0} :y 3 :w "hello from c"} #(dissoc % :z) {:x {:x 3.0 :y 4.0} :y 3 :w "hello from c"} #(dissoc % :z)
[5 6 7 8] (comp vec :z))) [5 6 7 8] (comp vec :z)))
(mem/defstruct ComplexTypeWrapped [::Point x ::mem/byte y [::mem/array ::mem/int 4] z ::mem/c-string w] :raw-arrays? false)
(t/deftest can-call-with-wrapped-complex-defstruct
(t/are [x y] (= x (y ((ffi/cfn "complexTypeTest" [::ComplexTypeWrapped] ::ComplexTypeWrapped)
(ComplexTypeWrapped. (Point. 2 3) 4 (int-array [5 6 7 8]) "hello from clojure"))))
{:x {:x 3.0 :y 4.0} :y 3 :w "hello from c"} #(dissoc % :z)
[5 6 7 8] (comp vec :z)))