Marcel Taeumel uploaded a new version of FFI-Tests to project FFI:
http://source.squeak.org/FFI/FFI-Tests-mt.51.mcz==================== Summary ====================
Name: FFI-Tests-mt.51
Author: mt
Time: 27 May 2021, 2:26:45.499609 pm
UUID: 14a23269-4dbc-7b4d-a13c-791d62924be1
Ancestors: FFI-Tests-mt.50
Complements FFI-Kernel-mt.176 and FFI-Kernel-mt.177
=============== Diff against FFI-Tests-mt.50 ===============
Item was added:
+ ----- Method: ExternalTypeTests>>testAtomicTypeBySpec (in category 'tests - atomic types') -----
+ testAtomicTypeBySpec
+ "Check whether the lookup of atomic types will yield the singleton instances of those types."
+
+ ExternalType atomicTypes do: [:type |
+ self
+ assert: type
+ identical: (ExternalType lookupType: type typeName);
+ assert: type
+ identical: (ExternalType lookupType: type)].!
Item was added:
+ ----- Method: ExternalTypeTests>>testPointerByShortcut (in category 'tests - pointer types') -----
+ testPointerByShortcut
+
+ | pointer |
+ pointer := ExternalType void asPointerType.
+ self
+ assert: pointer
+ identical: ExternalType pointer;
+ assert: pointer
+ identical: (ExternalType typeNamed: 'pointer');
+ assert: pointer
+ identical: (ExternalType lookupType: pointer);
+ assert: pointer
+ identical: (ExternalType lookupType: #pointer).!
Item was added:
+ ----- Method: ExternalTypeTests>>testStructTypeBySpec (in category 'tests - struct types') -----
+ testStructTypeBySpec
+
+ self classesForStructures do: [:structClass | | type |
+ type := structClass externalType.
+ self
+ assert: type
+ identical: (ExternalType lookupType: structClass)]!
Item was changed:
----- Method: FFIAllocateTests>>lookupType: (in category 'running') -----
lookupType: structClassOrTypeNameOrType
+ ^ ExternalType lookupType: structClassOrTypeNameOrType!
- ^ structClassOrTypeNameOrType isString
- ifTrue: [ExternalType typeNamed: structClassOrTypeNameOrType]
- ifFalse: [structClassOrTypeNameOrType isBehavior
- ifTrue: [structClassOrTypeNameOrType externalType]
- ifFalse: [structClassOrTypeNameOrType]]!
Item was added:
+ ----- Method: FFIAllocateTests>>test06AliasForArrayAccess (in category 'tests - type alias') -----
+ test06AliasForArrayAccess
+
+ | array |
+ array := self allocate: FFITestAliasForInt32Array.
+ self assert: FFITestAliasForInt32Array identical: array class.
+
+ self assert: 0 equals: (array at: 5).
+ array at: 5 put: 42.
+ self assert: 42 equals: (array at: 5).!