Hello,
I have fixed a lame bug in cffi-corman.lisp and know it passes 64 out of 71 tests (this includes the callbacks tests), which is pretty good. At least 6 of these 7 failures should be easy to fix and I'll be asking Roger Corman for help once I write some test cases by translation the cffi declarations to native corman lisp FFI.
That's the highlight of the following changes :-)
Thu Sep 15 05:34:23 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Corman Lisp update and note added to the manual.
- Added note to the User Manual that it reflects what's in cffi-luis, not the main branch. - Updated cffi-corman.lisp and fixed a critical bug. Now only 7 tests fail.
Thu Sep 15 02:30:27 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Removed test, tweaked tests/Makefile
- Commented out the test STRUCT.ALIGNMENT.5 because an empty struct is not valid standard C and some compilers, namely VC++, won't compile it. - Add -ansi -pedantic to the compiler flags to catch things like this sooner next time.
Thu Sep 15 01:14:14 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Missing DLLEXPORTs in libtest.c
Wed Sep 14 21:32:04 WEST 2005 Luis Oliveira loliveira@common-lisp.net * make clean -> rm *.fsl too.
Wed Sep 14 01:25:07 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Documentation and new test
- Added detailed node listing to the User Manual. - New regression test: WITH-FOREIGN-PTR.EVALX2 (checks if the size argument is not evaluated twice by mistake) - Also removed an old comment-out test function from cffi-lispworks.lisp
Very interesting. Lispworks also dies at the same place, in dbgheap.c. And I am not sure "dies" is the right word. Not sure how it survived, but it ran to completion (the "hi mom" thing got in when I was just trying to figure out where the code was going, and I just haven't gotten round to taking it out):
CL-USER 1 > (cffi-tests::do-tests) Doing 71 pending tests of 71 tests total.
(:HI-MOM T) CFFI-TESTS::DEFCFUN.CHAR (:HI-MOM T) CFFI-TESTS::DEFCFUN.INT (:HI-MOM T) CFFI-TESTS::DEFCFUN.LONG (:HI-MOM T) CFFI-TESTS::DEFCFUN.FLOAT (:HI-MOM T) CFFI-TESTS::DEFCFUN.DOUBLE (:HI-MOM T) CFFI-TESTS::DEFCFUN.STRING.1 (:HI-MOM T) CFFI-TESTS::DEFCFUN.STRING.2 (:HI-MOM T) CFFI-TESTS::DEFCFUN.STRING.3 (:HI-MOM T) CFFI-TESTS::DEFCFUN.NOARGS (:HI-MOM T) CFFI-TESTS::DEFCFUN.NOOP (:HI-MOM T) CFFI-TESTS::CALLBACKS.CHAR (:HI-MOM T) CFFI-TESTS::CALLBACKS.UNSIGNED-CHAR (:HI-MOM T) CFFI-TESTS::CALLBACKS.SHORT (:HI-MOM T) CFFI-TESTS::CALLBACKS.UNSIGNED-SHORT (:HI-MOM T) CFFI-TESTS::CALLBACKS.INT (:HI-MOM T) CFFI-TESTS::CALLBACKS.UNSIGNED-INT (:HI-MOM T) CFFI-TESTS::CALLBACKS.LONG (:HI-MOM T) CFFI-TESTS::CALLBACKS.UNSIGNED-LONG (:HI-MOM T) CFFI-TESTS::CALLBACKS.FLOAT (:HI-MOM T) CFFI-TESTS::CALLBACKS.DOUBLE (:HI-MOM T) CFFI-TESTS::CALLBACKS.POINTER (:HI-MOM T)
Here is where ACL and Lispworks (the Lisp images) land in the VC++ debugger on an assertion in dbgheap.c.
Test CFFI-TESTS::CALLBACKS.STRING failed Form: (CFFI-TESTS::EXPECT-STRCAT (CFFI:CALLBACK CFFI-TESTS::LISP-STRCAT)) Expected value: 1 Actual value: #<SIMPLE-ERROR 21BD3DD4>.
(:HI-MOM T) CFFI-TESTS::CALLBACKS.QSORT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.CHAR (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.UNSIGNED-CHAR (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.SHORT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.UNSIGNED-SHORT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.INT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.UNSIGNED-INT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.LONG (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.UNSIGNED-LONG (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.FLOAT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.DOUBLE (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.POINTER (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.REF.STRING (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.SET.INT (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.SET.STRING (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.GET-VAR-PTR.1 (:HI-MOM T) CFFI-TESTS::FOREIGN-GLOBALS.GET-VAR-PTR.2 (:HI-MOM T) CFFI-TESTS::DEREF.CHAR (:HI-MOM T) CFFI-TESTS::DEREF.UNSIGNED-CHAR (:HI-MOM T) CFFI-TESTS::DEREF.SHORT (:HI-MOM T) CFFI-TESTS::DEREF.UNSIGNED-SHORT (:HI-MOM T) CFFI-TESTS::DEREF.INT (:HI-MOM T) CFFI-TESTS::DEREF.UNSIGNED-INT (:HI-MOM T) CFFI-TESTS::DEREF.LONG (:HI-MOM T) CFFI-TESTS::DEREF.UNSIGNED-LONG (:HI-MOM T) CFFI-TESTS::DEREF.FLOAT.1 (:HI-MOM T) Test CFFI-TESTS::DEREF.FLOAT.2 failed Form: (CFFI:WITH-FOREIGN-OBJECT (CFFI-TESTS::P :FLOAT) (SETF (CFFI:MEM-REF CFFI-TESTS::P :FLOAT) MOST-POSITIVE-SINGLE-FLOAT) (CFFI:MEM-REF CFFI-TESTS::P :FLOAT)) Expected value: 1.7976931348623157E308 Actual value: +1D++0 #| +1D++0 is double-float plus-infinity |#.
(:HI-MOM T) Test CFFI-TESTS::DEREF.FLOAT.3 failed Form: (CFFI:WITH-FOREIGN-OBJECT (CFFI-TESTS::P :FLOAT) (SETF (CFFI:MEM-REF CFFI-TESTS::P :FLOAT) LEAST-POSITIVE-SINGLE-FLOAT) (CFFI:MEM-REF CFFI-TESTS::P :FLOAT)) Expected value: 4.9406564584124646E-324 Actual value: 0.0.
(:HI-MOM T) CFFI-TESTS::DEREF.DOUBLE.1 (:HI-MOM T) CFFI-TESTS::DEREF.DOUBLE.2 (:HI-MOM T) CFFI-TESTS::DEREF.DOUBLE.3 (:HI-MOM T) CFFI-TESTS::DEREF.POINTER.NULL (:HI-MOM T) CFFI-TESTS::LISP-STRING-TO-FOREIGN.EMPTY (:HI-MOM T) CFFI-TESTS::WITH-FOREIGN-PTR.EVALX2 (:HI-MOM T) CFFI-TESTS::STRUCT.1 (:HI-MOM T) CFFI-TESTS::STRUCT.2 (:HI-MOM T) CFFI-TESTS::STRUCT.3 (:HI-MOM T) CFFI-TESTS::STRUCT.ALIGNMENT.1 (:HI-MOM T) CFFI-TESTS::STRUCT.ALIGNMENT.2 (:HI-MOM T) CFFI-TESTS::STRUCT.ALIGNMENT.3 (:HI-MOM T) CFFI-TESTS::STRUCT.ALIGNMENT.4 (:HI-MOM T) CFFI-TESTS::UNION.1 (:HI-MOM T) CFFI-TESTS::ENUM.1 (:HI-MOM T) CFFI-TESTS::ENUM.2 (:HI-MOM T) CFFI-TESTS::ENUM.3 (:HI-MOM T) CFFI-TESTS::ENUM.4 (:HI-MOM T) CFFI-TESTS::MISC-TYPES.STRING+PTR (:HI-MOM T) CFFI-TESTS::MISC-TYPES.BOOLEAN (:HI-MOM T) CFFI-TESTS::MISC-TYPES.WRAPPER 3 out of 71 total tests failed: CFFI-TESTS::CALLBACKS.STRING, CFFI-TESTS::DEREF.FLOAT.2, CFFI-TESTS::DEREF.FLOAT.3. NIL
CL-USER 2 >
Luis Oliveira wrote:
Hello,
I have fixed a lame bug in cffi-corman.lisp and know it passes 64 out of 71 tests (this includes the callbacks tests), which is pretty good. At least 6 of these 7 failures should be easy to fix and I'll be asking Roger Corman for help once I write some test cases by translation the cffi declarations to native corman lisp FFI.
That's the highlight of the following changes :-)
Thu Sep 15 05:34:23 WEST 2005 Luis Oliveira loliveira@common-lisp.net
- Corman Lisp update and note added to the manual.
- Added note to the User Manual that it reflects what's in cffi-luis, not the main branch.
- Updated cffi-corman.lisp and fixed a critical bug. Now only 7 tests fail.
Thu Sep 15 02:30:27 WEST 2005 Luis Oliveira loliveira@common-lisp.net
- Removed test, tweaked tests/Makefile
- Commented out the test STRUCT.ALIGNMENT.5 because an empty struct is not valid standard C and some compilers, namely VC++, won't
compile it.
- Add -ansi -pedantic to the compiler flags to catch things like this sooner next time.
Thu Sep 15 01:14:14 WEST 2005 Luis Oliveira loliveira@common-lisp.net
- Missing DLLEXPORTs in libtest.c
Wed Sep 14 21:32:04 WEST 2005 Luis Oliveira loliveira@common-lisp.net
- make clean -> rm *.fsl too.
Wed Sep 14 01:25:07 WEST 2005 Luis Oliveira loliveira@common-lisp.net
- Documentation and new test
- Added detailed node listing to the User Manual.
- New regression test: WITH-FOREIGN-PTR.EVALX2 (checks if the size argument is not evaluated twice by mistake)
- Also removed an old comment-out test function from
cffi-lispworks.lisp
Building cffi-tests on Corman Lisp 2.51 I get:
;; Corman Lisp 2.51 Copyright © 2005 Corman Technologies. All rights reserved. ;; Licensed to Kenneth Tilton [version 2.0]. ;;; Warning: the following function(s) are called from forms ;;; in file "/0devtools/asdf.lisp" but have not yet been defined: ;;; DO-ONE-DEP ;;; MAKE-BROADCAST-STREAM 138 ; loading system definition from #P"\0devtools\cffi\cffi-tests.asd" ; into #<PACKAGE "ASDF7699"> ; registering #<SYSTEM CFFI-TESTS #x1263E90> as CFFI-TESTS ; loading system definition from #P"\0devtools\rt\rt.asd" into ; #<PACKAGE "ASDF7709"> ; registering #<SYSTEM :RT #x10F4070> as RT ; loading system definition from #P"\0devtools\cffi\cffi.asd" into ; #<PACKAGE "ASDF7713"> ; registering #<SYSTEM CFFI #x11C1B70> as CFFI ;;; An error occurred in function FIND-TYPE-OR-LOSE: ;;; Error: Undefined foreign type: :STRING ;;; Entering Corman Lisp debug loop. ;;; Use :C followed by an option to exit. Type :HELP for help. ;;; Restart options: ;;; 1 Retry performing #<ASDF:COMPILE-OP (:FORCES T) #x104DB6D8> on #<ASDF:CL-SOURCE-FILE "strings" #x10531430>. ;;; 2 Continue, treating #<ASDF:COMPILE-OP (:FORCES T) #x104DB6D8> on #<ASDF:CL-SOURCE-FILE "strings" #x10531430> as having been successful. ;;; 3 Abort to top level.
I would try debugging this, but I am wondering if I am missing a version somewhere. Corman 2.51 looks to be the latest, but should I download again? Or does this look like an error that has been fixed? Maybe the latest changes are not in the latest tarball?
kt
On 9/15/05, Kenny Tilton ktilton@nyc.rr.com wrote:
I would try debugging this, but I am wondering if I am missing a version somewhere. Corman 2.51 looks to be the latest, but should I download again? Or does this look like an error that has been fixed? Maybe the latest changes are not in the latest tarball?
See the notes on the website. You'll want to follow those instructions for setting up ASDF under Corman Lisp. Corman's COMPILE-FILE and its FASL loader are buggy.