From: Nikodemus S. <de...@us...> - 2008-10-18 14:11:34
|
Update of /cvsroot/sbcl/sbcl/tests In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12935/tests Modified Files: alien.impure.lisp Log Message: 1.0.21.29: handle alien record type redefinitions (bug 431) * Make PARSE-ALIEN-RECORD-FIELD return the parsed values instead of frobbing the type object. * In PARSE-ALIEN-RECORD-TYPE use that to parse the new fields so that we can compare them to the old ones -- signal a continuable error if there is a mismatch. Index: alien.impure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/alien.impure.lisp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- alien.impure.lisp 30 Jul 2008 13:49:09 -0000 1.21 +++ alien.impure.lisp 18 Oct 2008 14:11:20 -0000 1.22 @@ -226,4 +226,23 @@ (loop repeat 1024 do (try-to-leak-alien-stack t)))) +;;; bug 431 +(with-test (:name :alien-struct-redefinition) + (eval '(progn + (define-alien-type nil (struct mystruct (myshort short) (mychar char))) + (with-alien ((myst (struct mystruct))) + (with-alien ((mysh short (slot myst 'myshort))) + (assert (integerp mysh)))))) + (let ((restarted 0)) + (handler-bind ((error (lambda (e) + (let ((cont (find-restart 'continue e))) + (when cont + (incf restarted) + (invoke-restart cont)))))) + (eval '(define-alien-type nil (struct mystruct (myint int) (mychar char))))) + (assert (= 1 restarted))) + (eval '(with-alien ((myst (struct mystruct))) + (with-alien ((myin int (slot myst 'myint))) + (assert (integerp myin)))))) + ;;; success |