[squeak-dev] FFI: FFI-Tests-mt.47.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 22 13:20:47 UTC 2021


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.!



More information about the Squeak-dev mailing list