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

commits at source.squeak.org commits at source.squeak.org
Thu Apr 14 09:15:58 UTC 2022


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

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

Name: FFI-Tests-mt.69
Author: mt
Time: 14 April 2022, 11:15:57.762452 am
UUID: 6adf1f78-f733-4381-a1ad-9ba193bdc942
Ancestors: FFI-Tests-mt.68

Adds some struct-init tests against our FFITestLibrary in the course of hunting down an arg-pushing bug in ARMv8.

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

Item was added:
+ ----- Method: FFIPluginTests>>testReturnStructSsisPassingValues (in category 'tests - structure') -----
+ testReturnStructSsisPassingValues
+ 
+ 	| s1 i2 s3 ssis |
+ 	s1 := 1.
+ 	i2 := 32767 + 1.
+ 	s3 := 2.
+ 	ssis := self invoke: 'ffiTestInitSsis' with: s1 with: i2 with: s3.
+ 	self assert: s1 equals: ssis s1.
+ 	self assert: i2 equals: ssis i2.
+ 	self assert: s3 equals: ssis s3.!

Item was added:
+ ----- Method: FFIPluginTests>>testReturnStructSslfPassingValues (in category 'tests - structure') -----
+ testReturnStructSslfPassingValues
+ 
+ 	| s1 l2 f3 sslf |
+ 	s1 := 256.
+ 	l2 := 4294967296.
+ 	f3 := 3.14.
+ 	sslf := self invoke: 'ffiTestInitSslf' with: s1 with: l2 with: f3.
+ 	self assert: s1 equals: sslf s1.
+ 	self assert: l2 equals: sslf l2.
+ 	self assert: (sslf f3 between: f3 - 0.0005 and: f3 + 0.0005)!

Item was added:
+ ----- Method: FFIPluginTests>>testReturnStructSslsPassingValues (in category 'tests - structure') -----
+ testReturnStructSslsPassingValues
+ 
+ 	| s1 l2 s3 ssls |
+ 	s1 := 1.
+ 	l2 := 2147483647 + 1.
+ 	s3 := 2.
+ 	ssls := self invoke: 'ffiTestInitSsls' with: s1 with: l2 with: s3.
+ 	self assert: s1 equals: ssls s1.
+ 	self assert: l2 equals: ssls l2.
+ 	self assert: s3 equals: ssls s3.!

Item was added:
+ ----- Method: FFITestLibrary class>>ffiTestInitSsis:with:with: (in category 'structure - init') -----
+ ffiTestInitSsis: s1 with: i2 with: s3
+ 	"FFITestLibrary ffiTestInitSsis: 1 with: 40000 with: 3"
+ 	<cdecl: FFITestSsis 'ffiTestInitSsis' (int16_t int32_t int16_t) module:'SqueakFFIPrims'>
+ 	^self externalCallFailed!

Item was added:
+ ----- Method: FFITestLibrary class>>ffiTestInitSslf:with:with: (in category 'structure - init') -----
+ ffiTestInitSslf: s1 with: l2 with: f3
+ 	"FFITestLibrary ffiTestInitSslf: 256 with: 4294967296 with: 3.14"
+ 	<cdecl: FFITestSslf 'ffiTestInitSslf' (int16_t int64_t float) module:'SqueakFFIPrims'>
+ 	^self externalCallFailed!

Item was added:
+ ----- Method: FFITestLibrary class>>ffiTestInitSsls:with:with: (in category 'structure - init') -----
+ ffiTestInitSsls: s1 with: l2 with: s3
+ 	"FFITestLibrary ffiTestInitSsls: 1 with: 16r1234567890 with: 3"
+ 	<cdecl: FFITestSsls 'ffiTestInitSsls' (int16_t int64_t int16_t) module:'SqueakFFIPrims'>
+ 	^self externalCallFailed!



More information about the Squeak-dev mailing list