adjust tests to make use of :raw? option in arrays
This commit is contained in:
parent
86c4f99a3f
commit
87e9bb7a7b
2 changed files with 6 additions and 6 deletions
|
|
@ -87,7 +87,7 @@
|
|||
:x 3.14
|
||||
:y 42.0})))
|
||||
|
||||
(mem/defstruct ComplexType [::Point x ::mem/byte y [::mem/array ::mem/int 4] z ::mem/c-string w])
|
||||
(mem/defstruct ComplexType [::Point x ::mem/byte y [::mem/array ::mem/int 4 :raw? true] z ::mem/c-string w])
|
||||
|
||||
(t/deftest can-call-with-complex-defstruct
|
||||
(t/are [x y] (= x (y ((ffi/cfn "complexTypeTest" [::ComplexType] ::ComplexType)
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
{:x {:x 3.0 :y 4.0} :y 3 :w "hello from c"} #(dissoc % :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)
|
||||
(mem/defstruct ComplexTypeWrapped [::Point x ::mem/byte y [::mem/array ::mem/int 4] z ::mem/c-string w])
|
||||
|
||||
(t/deftest can-call-with-wrapped-complex-defstruct
|
||||
(t/are [x y] (= x (y ((ffi/cfn "complexTypeTest" [::ComplexTypeWrapped] ::ComplexTypeWrapped)
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@
|
|||
(t/deftest can-define-structs-with-array-members
|
||||
(t/is
|
||||
(eval
|
||||
`(mem/defstruct ~'ArrayTestType [::mem/int ~'x ::mem/byte ~'y [::mem/array ::mem/int 4] ~'z]))))
|
||||
`(mem/defstruct ~'ArrayTestType [::mem/int ~'x ::mem/byte ~'y [::mem/array ::mem/int 4 :raw? true] ~'z]))))
|
||||
|
||||
(mem/defstruct ArrayTestType [::mem/int x ::mem/byte y [::mem/array ::mem/int 4] z])
|
||||
(mem/defstruct ArrayTestType [::mem/int x ::mem/byte y [::mem/array ::mem/int 4 :raw? true] z])
|
||||
|
||||
(t/deftest can-instantiated-array-member-structs
|
||||
(t/are [x y z] (z x (y (ArrayTestType. 5 6 (int-array [1 2 3 4]))))
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(int-array [1 2 3 4])
|
||||
(.z (mem/deserialize (mem/serialize (ArrayTestType. 5 6 (int-array [1 2 3 4])) ::ArrayTestType) ::ArrayTestType)))))
|
||||
|
||||
(mem/defstruct ComplexTestType [[::mem/array ::ArrayTestType 4] x ::mem/byte y [::mem/array ::mem/int 4] z ::NestedTestType w])
|
||||
(mem/defstruct ComplexTestType [[::mem/array ::ArrayTestType 4 :raw? true] x ::mem/byte y [::mem/array ::mem/int 4 :raw? true] z ::NestedTestType w])
|
||||
|
||||
(t/deftest can-serialize-deserialize-complex-struct-type
|
||||
(t/is
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
(mem/serialize ::ComplexTestType)
|
||||
(mem/deserialize ::ComplexTestType)))))
|
||||
|
||||
(mem/defstruct ComplexTestTypeWrapped [[::mem/array ::ArrayTestType 4] x ::mem/byte y [::mem/array ::mem/int 4] z ::NestedTestType w] :raw-arrays? false)
|
||||
(mem/defstruct ComplexTestTypeWrapped [[::mem/array ::ArrayTestType 4] x ::mem/byte y [::mem/array ::mem/int 4] z ::NestedTestType w])
|
||||
|
||||
(t/deftest can-serialize-deserialize-complex-wrapped-struct-type
|
||||
(t/is
|
||||
|
|
|
|||
Loading…
Reference in a new issue