FFI: FFI-Tests-mt.47.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Tests-mt.47.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Tests to project FFI:
http://source.squeak.org/FFI/FFI-Tests-mt.47.mcz

==================== Summary ====================

Name: FFI-Tests-mt.47
Author: mt
Time: 22 May 2021, 3:20:44.808855 pm
UUID: d0f55a99-244f-8d4f-ac64-3068068e631c
Ancestors: FFI-Tests-mt.46

Complements FFI-Kernel-mt.166

=============== Diff against FFI-Tests-mt.46 ===============

Item was added:
+ ----- Method: FFIAllocateTests>>test19ArrayFromVoidPointer (in category 'tests - array') -----
+ test19ArrayFromVoidPointer
+ "Check whether the construction of external data with void or void* will always set void* as containerType and void as contentType. Whether or not the #externalType will be a pointer type still corresponds to the kind of handle, that is, byte array (void) or external address (void*)."
+
+ | type void array |
+ type := ExternalType int32_t.
+ void := ExternalType void.
+ array := self allocate: type size: 5.
+
+ array := ExternalData
+ fromHandle: array getHandle
+ type: void asPointerType.
+ self assert: void asPointerType equals: array containerType.
+ self assert: void equals: array contentType.
+ self checkAllocate: array.
+
+ array := ExternalData
+ fromHandle: array getHandle
+ type: void. "Should still become void*"
+ self assert: void asPointerType equals: array containerType.
+ self assert: void equals: array contentType.
+ self checkAllocate: array.
+
+ array := ExternalData fromHandle: array getHandle.
+ self assert: void asPointerType equals: array containerType.
+ self assert: void equals: array contentType.
+ self checkAllocate: array.!