FFI Inbox: FFI-Tests-nice.22.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI Inbox: FFI-Tests-nice.22.mcz

commits-2
Nicolas Cellier uploaded a new version of FFI-Tests to project FFI Inbox:
http://source.squeak.org/FFIinbox/FFI-Tests-nice.22.mcz

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

Name: FFI-Tests-nice.22
Author: nice
Time: 21 June 2020, 10:39:31.548387 pm
UUID: 6cc5d336-7a73-402b-8409-ae6de4d03dd1
Ancestors: FFI-Tests-mt.21

Fix testIntAliasCall by calling the version that answers an int, not an IntAlias.

Fix testPointers - at least for the experimental FFI branch https://github.com/OpenSmalltalk/opensmalltalk-vm/tree/experimental_FFI

This version of FFI does not return an ExternalStructure when we return a pointer. It returns an ExternalData!
This is logical, we have no idea if the function returns a pointer to a single struct or to a whole array.

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

Item was changed:
  ----- Method: FFIPluginTests>>testIntAliasCall (in category 'tests - type alias') -----
  testIntAliasCall
 
  | result |
  result := FFITestLibrary
+ ffiTest4IntAliasSum: (FFITestIntAlias fromHandle: 1)
- ffiTestIntAlias4IntSum: (FFITestIntAlias fromHandle: 1)
  with: (FFITestIntAlias fromHandle: 2)
  with: (FFITestIntAlias fromHandle: 3)
  with: (FFITestIntAlias fromHandle: 4).
  self assert: 10 equals: result.!

Item was changed:
  ----- Method: FFIPluginTests>>testPointers (in category 'tests - structure') -----
  testPointers
  "Test passing and returning of pointers to structs"
+ | pt1 pt2 pt3 p3ptr |
- | pt1 pt2 pt3 |
  pt1 := FFITestPoint4 new.
  pt1 x: 1. pt1 y: 2. pt1 z: 3. pt1 w: 4.
  pt2 := FFITestPoint4 new.
  pt2 x: 5. pt2 y: 6. pt2 z: 7. pt2 w: 8.
+ p3ptr := FFITestLibrary ffiTestPointers: pt1 with: pt2.
+ pt3 := p3ptr at: 1.
- pt3 := FFITestLibrary ffiTestPointers: pt1 with: pt2.
  self assert: pt3 x = 6.
  self assert: pt3 y = 8.
  self assert: pt3 z = 10.
  self assert: pt3 w = 12.!