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

commits at source.squeak.org commits at source.squeak.org
Tue Dec 14 10:17:02 UTC 2021


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

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

Name: FFI-Tests-mt.66
Author: mt
Time: 14 December 2021, 11:16:18.08291 am
UUID: 9ea84003-a3cf-cd49-bb99-a01aec974a56
Ancestors: FFI-Tests-mt.65

Clarify tests with alias-to-atomic types. We should start on working on the coercion logic in the FFI plugin rather sooner than later. :-)

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

Item was changed:
  ----- Method: FFIPluginTests>>expectedFailures (in category 'failures') -----
  expectedFailures
  
  	^ #(
+ 		testIntAliasCall "argument-type coercing failed - handle must not be atomic but ByteArray or ExternalAddress"
  		testIntAliasCallReturnIntAlias "return-type coercing failed - check referentClass notNil missing?"
  		testIntCallReturnIntAlias "return-type coercing failed - check referentClass notNil missing?"
  		testMixedDoublesAndLongsSum "more than 15 method args needed"
  		testSumStructSslf4 "some overflow issue, maybe expected"
  		testPrintWideString "no support for WideString arguments yet")!

Item was changed:
  ----- Method: FFIPluginTests>>testIntAliasCall (in category 'tests - type alias') -----
  testIntAliasCall
  
  	| result |
+ 	self flag: #workaround. "mt: You can use #fromHandle: on atomics directly to make coercion work for now. However, #on: and #value(:) is the correct interface."
  	result := FFITestLibrary
+ 		ffiTestIntAlias4IntSum: (FFITestAliasForInt32 on: 1)
+ 		with: (FFITestAliasForInt32 on: 2)
+ 		with: (FFITestAliasForInt32 on: 3)
+ 		with: (FFITestAliasForInt32 on: 4).
- 		ffiTestIntAlias4IntSum: (FFITestAliasForInt32 fromHandle: 1)
- 		with: (FFITestAliasForInt32 fromHandle: 2)
- 		with: (FFITestAliasForInt32 fromHandle: 3)
- 		with: (FFITestAliasForInt32 fromHandle: 4).
  	self assert: 10 equals: result.!

Item was changed:
  ----- Method: FFIPluginTests>>testIntAliasCallReturnIntAlias (in category 'tests - type alias') -----
  testIntAliasCallReturnIntAlias
  
  	| result |
  	result := FFITestLibrary
+ 		ffiTestIntAlias4IntAliasSum: (FFITestAliasForInt32 on: 1)
+ 		with: (FFITestAliasForInt32 on: 2)
+ 		with: (FFITestAliasForInt32 on: 3)
+ 		with: (FFITestAliasForInt32 on: 4).
- 		ffiTestIntAlias4IntAliasSum: (FFITestAliasForInt32 fromHandle: 1)
- 		with: (FFITestAliasForInt32 fromHandle: 2)
- 		with: (FFITestAliasForInt32 fromHandle: 3)
- 		with: (FFITestAliasForInt32 fromHandle: 4).
  	self
  		assert: (result isKindOf: FFITestAliasForInt32);
  		assert: 10 equals: result value.!



More information about the Squeak-dev mailing list