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

commits at source.squeak.org commits at source.squeak.org
Mon May 17 08:04:16 UTC 2021


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

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

Name: FFI-Tests-mt.42
Author: mt
Time: 17 May 2021, 10:04:14.48387 am
UUID: 7e88afc9-7a32-ee42-a024-591c91ea8b4a
Ancestors: FFI-Tests-mt.41

Complements FFI-Kernel-mt.157

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

Item was changed:
  ----- Method: ExternalTypeTests>>testArrayOfUnknown (in category 'tests - unkown types') -----
  testArrayOfUnknown
+ 	"For missing a referentClass, an unknown type will be constructed."
- 	"For missing referentClass, one can safely try to lookup an array type but forcing its creation will raise an error. Note that it is not possible to embed an array type for a struct in itself. You MUST use pointer types for that."
  	
+ 	| type |
+ 	Smalltalk garbageCollect.
+ 	ExternalType cleanupUnusedTypes.
+ 	
+ 	self assert: nil equals: (ExternalType typeNamed: 'UnknownStruct[]').
+ 	self assert: nil equals: (ExternalType typeNamed: 'UnknownStruct[5]').	
+ 	
+ 	type := ExternalType newTypeNamed: 'UnknownStruct[5]'.
+ 	self assert: type isArrayType.
+ 	self assert: type isUnknownType.
+ 
+ 	type := ExternalType newTypeNamed: 'UnknownStruct[]'.
+ 	self assert: type isArrayType.
+ 	self assert: type isUnknownType.
+ 	
+ 	"Already there."
+ 	self should: [ExternalType newTypeNamed: 'UnknownStruct[]'] raise: Error.
+ 	self should: [ExternalType newTypeNamed: 'UnknownStruct[5]'] raise: Error.	
+ !
- 	self
- 		assert: nil
- 		equals: (ExternalType typeNamed: 'UnknownStruct[5]').
- 		
- 	self
- 		should: [ExternalType newTypeNamed: 'UnknownStruct[5]']
- 		raise: Error.!

Item was changed:
  ----- Method: FFIAllocateTests>>test04ArrayCompositeAccess (in category 'tests - array') -----
  test04ArrayCompositeAccess
  
  	| data |
  	data := FFITestSdA5i allocate.
+ 	self assert: 0 equals: data a5i2 first.
- 	self assert: data a5i2 first equals: 0.
  	data writer a5i2 at: 1 put: 42.
+ 	self assert: 42 equals: data a5i2 first.!
- 	self assert: data a5i2 first equals: 42.!



More information about the Squeak-dev mailing list