Commit2e13b0f5Recorded17 Mar 2026Repositorysigil-ffi

Fix FFI callback test and add missing run-tests to dlopen test

Message

The callback test expected double-typed callbacks to error, but the dyncall handler fully supports float/double args and returns. Replace with a test verifying double callbacks create successfully.

Add missing (run-tests) call to test-ffi-dlopen.sgl so the CI smoke test actually reports results.

Changed
 test/test-ffi-dlopen.sgl | 2 ++
 test/test-ffi.sgl        | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
Diff
test/test-ffi-dlopen.sglmodified
@@ -158,3 +158,5 @@
158
;; Clean up the shared library
159
(when (file-exists? test-lib-so)
160
(delete-file test-lib-so))
+161
+162
(run-tests)
test/test-ffi.sglmodified
@@ -372,7 +372,8 @@
372
(assert-true (pointer? cb))
373
(c-callback-release cb)))
374
375
(test "unsupported signature raises error"
376
(assert-error
377
(c-callback (list ffi/double ffi/double) ffi/double
378
(lambda (a b) (+ a b))))))
+375
(test "double callback creates successfully"
+376
(let ((cb (c-callback (list ffi/double ffi/double) ffi/double
+377
(lambda (a b) (+ a b)))))
+378
(assert-true (pointer? cb))
+379
(c-callback-release cb))))