Update of /cvsroot/sbcl/sbcl/tests
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32398/tests
Modified Files:
external-format.impure.lisp
Log Message:
1.0.38.5: PPC character handling fixes.
* SAP-REF-32LE referred to SAP-REF-16 instead of SAP-REF-16LE on
non-x86oid platforms, incorrect for all big-endian targets.
* The immediate-character MOVE function was using a 16-bit-only
load instruction, which was insufficient for unicode operation.
* The -c (constant) character compare VOPs use a compare
instruction with a 16-bit immediate field. Disabled on unicode
(there's no good way to conditionally use them when the code
point of the constant character fits a signed-byte 16).
* Cleaned up some external-format.impure.lisp test-cases, adding
with-test and names as needed.
Index: external-format.impure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/external-format.impure.lisp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- external-format.impure.lisp 16 Dec 2009 22:12:35 -0000 1.27
+++ external-format.impure.lisp 1 May 2010 00:15:10 -0000 1.28
@@ -23,23 +23,31 @@
(defvar *test-path* "external-format-test.tmp")
-(do-external-formats (xf)
- (with-open-file (s #-win32 "/dev/null" #+win32 "nul" :direction :input :external-format xf)
- (assert (eq (read-char s nil s) s))))
+(with-test (:name :end-of-file)
+ (do-external-formats (xf)
+ (with-open-file (s #-win32 "/dev/null" #+win32 "nul" :direction :input :external-format xf)
+ (assert (eq (read-char s nil s) s)))))
;;; Test standard character read-write equivalency over all external formats.
-(let ((standard-characters "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!$\"'(),_-./:;?+<=>#%&*@[\\]{|}`^~"))
- (do-external-formats (xf)
- (with-open-file (s *test-path* :direction :output
- :if-exists :supersede :external-format xf)
- (loop for character across standard-characters
- do (write-char character s)))
- (with-open-file (s *test-path* :direction :input
- :external-format xf)
- (loop for character across standard-characters
- do (let ((got (read-char s)))
- (unless (eql character got)
- (error "wanted ~S, got ~S" character got)))))))
+(macrolet
+ ((frob ()
+ (let ((tests nil))
+ (do-external-formats (xf)
+ (pushnew `(with-test (:name (:standard-character :read-write-equivalency ,xf))
+ (let ((standard-characters "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!$\"'(),_-./:;?+<=>#%&*@[\\]{|}`^~"))
+ (with-open-file (s *test-path* :direction :output
+ :if-exists :supersede :external-format ,xf)
+ (loop for character across standard-characters
+ do (write-char character s)))
+ (with-open-file (s *test-path* :direction :input
+ :external-format ,xf)
+ (loop for character across standard-characters
+ do (let ((got (read-char s)))
+ (unless (eql character got)
+ (error "wanted ~S, got ~S" character got)))))))
+ tests :key #'cadr :test #'equal))
+ `(progn ,@tests))))
+ (frob))
(delete-file *test-path*)
#-sb-unicode
|