Hi Esteban,

On Wed, Jul 8, 2015 at 8:37 AM, Esteban Lorenzano <estebanlm@gmail.com> wrote:
 
Hi,

When doing my tests for Pharo on spur, I’m having some FFI problems: 

23 run, 19 passes, 0 skipped, 0 expected failures, 3 failures, 1 errors, 0 unexpected passes
Failures:
FFIPluginTests>>#testGenericCharCall
FFIPluginTests>>#testLibraryCharCall
FFIPluginTests>>#testConstructedCharCall

Errors:
FFIPluginTests>>#testLongLongs

Basically, first 3 failures is because FFI is answering an integer instead a char, and the last one is a coercion error. 

Hmmm, strange.  The code is at the bottom of ThreadedFFIPlugin>>ffiCreateIntegralResultOop:ofAtomicType:in:

"longlong, char"
^(atomicType >> 1) = (FFITypeSignedLongLong >> 1) 
ifTrue:
[(atomicType anyMask: 1)
ifTrue:[interpreterProxy signed64BitIntegerFor: retVal] "signed return"
ifFalse:[interpreterProxy positive64BitIntegerFor: retVal]]
ifFalse:
[interpreterProxy characterObjectOf:
(retVal bitAnd: (self cppIf: #SPURVM
ifTrue: [16rFFFFFFFF]
ifFalse: [255]))]
 

I suppose the “char” ones is because FFI is not taking into account that Character is now immediate (I might be wrong, I didn’t check). 
I do not understand why the second one can fail… 

Anyway… can anyone confirm if you have same errors?
(I’m using latest FFI package versions from http://source.squeakfoundation.org/FFI)

thanks,
Esteban




--
best,
Eliot