[flexi-streams-cvs] r36 - in branches/edi: . test
eweitz at common-lisp.net
eweitz at common-lisp.net
Tue May 20 12:55:02 UTC 2008
Author: eweitz
Date: Tue May 20 08:55:00 2008
New Revision: 36
Modified:
branches/edi/decode.lisp
branches/edi/input.lisp
branches/edi/strings.lisp
branches/edi/test/test.lisp
Log:
Checkpoint
Modified: branches/edi/decode.lisp
==============================================================================
--- branches/edi/decode.lisp (original)
+++ branches/edi/decode.lisp Tue May 20 08:55:00 2008
@@ -1,5 +1,5 @@
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*-
-;;; $Header: /usr/local/cvsrep/flexi-streams/decode.lisp,v 1.14 2008/05/20 07:51:09 edi Exp $
+;;; $Header: /usr/local/cvsrep/flexi-streams/decode.lisp,v 1.15 2008/05/20 09:37:43 edi Exp $
;;; Copyright (c) 2005-2008, Dr. Edmund Weitz. All rights reserved.
@@ -239,6 +239,7 @@
(defmethod octets-to-char-code ((format flexi-cr-mixin) reader)
(declare #.*standard-optimize-settings*)
+ (declare (ignore reader))
(let ((char-code (call-next-method)))
(case char-code
(#.(char-code #\Return) #.(char-code #\Newline))
@@ -247,6 +248,7 @@
(defmethod octets-to-char-code ((format flexi-crlf-mixin) reader)
(declare #.*standard-optimize-settings*)
(declare (function *current-unreader*))
+ (declare (ignore reader))
(let ((char-code (call-next-method)))
(case char-code
(#.(char-code #\Return)
Modified: branches/edi/input.lisp
==============================================================================
--- branches/edi/input.lisp (original)
+++ branches/edi/input.lisp Tue May 20 08:55:00 2008
@@ -1,5 +1,5 @@
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*-
-;;; $Header: /usr/local/cvsrep/flexi-streams/input.lisp,v 1.66 2008/05/20 00:37:27 edi Exp $
+;;; $Header: /usr/local/cvsrep/flexi-streams/input.lisp,v 1.67 2008/05/20 09:38:07 edi Exp $
;;; Copyright (c) 2005-2008, Dr. Edmund Weitz. All rights reserved.
@@ -199,7 +199,9 @@
"An optimized version which uses a buffer underneath. The function
can deliver characters as well as octets and it decides what to do
based on the element type of the sequence \(which takes precedence)
-and the element type of the stream."
+and the element type of the stream. What you'll really get might also
+depend on your Lisp. Some of the implementations are more picky than
+others - see for example FLEXI-STREAMS-TEST:READ-SEQUENCE-TEST."
(declare #.*standard-optimize-settings*)
(declare (fixnum start end))
(with-accessors ((position flexi-stream-position)
Modified: branches/edi/strings.lisp
==============================================================================
--- branches/edi/strings.lisp (original)
+++ branches/edi/strings.lisp Tue May 20 08:55:00 2008
@@ -1,5 +1,5 @@
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS; Base: 10 -*-
-;;; $Header: /usr/local/cvsrep/flexi-streams/strings.lisp,v 1.20 2008/05/20 06:15:38 edi Exp $
+;;; $Header: /usr/local/cvsrep/flexi-streams/strings.lisp,v 1.21 2008/05/20 09:04:23 edi Exp $
;;; Copyright (c) 2005-2008, Dr. Edmund Weitz. All rights reserved.
@@ -130,7 +130,7 @@
(declare (inline next-char))
(etypecase factor
(integer
- (let* ((string-length (/ length factor))
+ (let* ((string-length (ceiling length factor))
(string (make-array string-length
:element-type 'char*)))
(declare (fixnum string-length))
Modified: branches/edi/test/test.lisp
==============================================================================
--- branches/edi/test/test.lisp (original)
+++ branches/edi/test/test.lisp Tue May 20 08:55:00 2008
@@ -1,5 +1,5 @@
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: FLEXI-STREAMS-TEST; Base: 10 -*-
-;;; $Header: /usr/local/cvsrep/flexi-streams/test/test.lisp,v 1.29 2008/05/20 00:37:30 edi Exp $
+;;; $Header: /usr/local/cvsrep/flexi-streams/test/test.lisp,v 1.30 2008/05/20 09:37:30 edi Exp $
;;; Copyright (c) 2006-2008, Dr. Edmund Weitz. All rights reserved.
@@ -339,11 +339,17 @@
(octets (file-as-octet-vector full-path))
(octet-length (length octets)))
(when (external-format-equal external-format (make-external-format :utf8))
+ #-:openmcl
+ ;; FLEXI-STREAMS puts integers into the list, but OpenMCL
+ ;; thinks they are characters...
(with-open-file (in full-path :element-type 'octet)
(let* ((in (make-flexi-stream in :external-format external-format))
(list (make-list octet-length)))
(setf (flexi-stream-element-type in) 'octet)
+ #-:clisp
(read-sequence list in)
+ #+:clisp
+ (ext:read-byte-sequence list in)
(check (sequence-equal list octets))))
(with-open-file (in full-path :element-type 'octet)
(let* ((in (make-flexi-stream in :external-format external-format))
@@ -370,7 +376,10 @@
(check (sequence-equal (loop repeat 50
collect (read-char in))
(subseq file-string 0 50)))
+ #-:clisp
(read-sequence list in)
+ #+:clisp
+ (ext:read-char-sequence list in)
(check (sequence-equal list (subseq file-string 50 (- string-length 50))))
(check (sequence-equal (loop repeat 50
collect (read-char in))
@@ -381,7 +390,10 @@
(check (sequence-equal (loop repeat 25
collect (read-char in))
(subseq file-string 0 25)))
+ #-:clisp
(read-sequence array in)
+ #+:clisp
+ (ext:read-char-sequence array in)
(check (sequence-equal array (subseq file-string 25 (- string-length 25))))
(check (sequence-equal (loop repeat 25
collect (read-char in))
@@ -500,11 +512,11 @@
(flet ((test-one-file (file-name external-format)
(with-open-file (in (merge-pathnames file-name *this-file*)
:element-type 'flex:octet)
- (setq in (make-flexi-stream in :external-format external-format))
- (loop repeat 300
- for char = (read-char in)
- do (unread-char char in)
- (check (char= (read-char in) char))))))
+ (let ((in (make-flexi-stream in :external-format external-format)))
+ (loop repeat 300
+ for char = (read-char in)
+ do (unread-char char in)
+ (check (char= (read-char in) char)))))))
(loop for (file-name symbols) in *test-files*
do (loop for symbol in symbols
do (loop for (file-name . external-format) in (create-file-variants file-name symbol)
@@ -520,9 +532,11 @@
(no-tests (* 8 (length compare-files-args-list))))
#+:lispworks
(setq no-tests (* 2 no-tests))
+ #+(or)
(dolist (*copy-function* '(copy-stream copy-stream*))
(dolist (args compare-files-args-list)
(apply 'compare-files args)))
+ #+(or)
(let ((string-test-args-list (loop for (file-name symbols) in *test-files*
nconc (create-test-combinations file-name symbols t))))
(incf no-tests (length string-test-args-list))
More information about the Flexi-streams-cvs
mailing list