From 9c4ee94e606b64010d1b9946b2c00f3a119e0396 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Thu, 23 Jul 2009 14:50:47 +0000
Subject: [PATCH] o Load simple-streams library if needed. o For all tests that
 generate random characters, be sure to specify an   external format of
 iso8859-1, just in case *default-external-format*   is something else that
 might cause issues with random characters.

---
 .../rt/simple-streams-test.lisp               | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/pcl/simple-streams/rt/simple-streams-test.lisp b/pcl/simple-streams/rt/simple-streams-test.lisp
index 8dc172348..038336180 100644
--- a/pcl/simple-streams/rt/simple-streams-test.lisp
+++ b/pcl/simple-streams/rt/simple-streams-test.lisp
@@ -1,5 +1,7 @@
 ;;;; -*- lisp -*-
 
+(require :simple-streams)
+
 (defpackage simple-streams-test
   (:use #:common-lisp #:stream #:rt))
 
@@ -150,7 +152,8 @@
   (let* ((stream (make-instance 'file-simple-stream
                                 :filename *test-file* :direction :output
                                 :if-exists :overwrite
-                                :if-does-not-exist :create))
+                                :if-does-not-exist :create
+				:external-format :iso8859-1))
          (length (1+ (* 3 (device-buffer-length stream))))
          (content (make-string length)))
     (dotimes (i (length content))
@@ -158,7 +161,8 @@
     (with-open-stream (s stream)
       (write-string content s))
     (with-test-file (s *test-file* :class 'file-simple-stream
-                       :direction :input :if-does-not-exist :error)
+                       :direction :input :if-does-not-exist :error
+		       :external-format :iso8859-1)
       (let ((seq (make-string length)))
         #+nil (read-sequence seq s)
         #-nil (dotimes (i length)
@@ -170,7 +174,8 @@
   (let* ((stream (make-instance 'file-simple-stream
                                 :filename *test-file* :direction :output
                                 :if-exists :overwrite
-                                :if-does-not-exist :create))
+                                :if-does-not-exist :create
+				:external-format :iso8859-1))
          (length (1+ (* 3 (device-buffer-length stream))))
          (content (make-string length)))
     (dotimes (i (length content))
@@ -178,7 +183,8 @@
     (with-open-stream (s stream)
       (write-string content s))
     (with-test-file (s *test-file* :class 'file-simple-stream
-                       :direction :input :if-does-not-exist :error)
+                       :direction :input :if-does-not-exist :error
+		       :external-format :iso8859-1)
       (let ((seq (make-string length)))
         (read-sequence seq s)
         (string= content seq))))
@@ -188,7 +194,8 @@
   (let* ((stream (make-instance 'file-simple-stream
                                 :filename *test-file* :direction :output
                                 :if-exists :overwrite
-                                :if-does-not-exist :create))
+                                :if-does-not-exist :create
+				:external-format :iso8859-1))
          (length (1+ (* 3 (device-buffer-length stream))))
          (content (make-array length :element-type '(unsigned-byte 8))))
     (dotimes (i (length content))
@@ -196,7 +203,8 @@
     (with-open-stream (s stream)
       (write-sequence content s))
     (with-test-file (s *test-file* :class 'file-simple-stream
-                       :direction :input :if-does-not-exist :error)
+                       :direction :input :if-does-not-exist :error
+		       :external-format :iso8859-1)
       (let ((seq (make-array length :element-type '(unsigned-byte 8))))
         #+nil (read-sequence seq s)
         #-nil (dotimes (i length)
@@ -208,7 +216,8 @@
   (let* ((stream (make-instance 'file-simple-stream
                                 :filename *test-file* :direction :output
                                 :if-exists :overwrite
-                                :if-does-not-exist :create))
+                                :if-does-not-exist :create
+				:external-format :iso8859-1))
          (length (1+ (* 3 (device-buffer-length stream))))
          (content (make-array length :element-type '(unsigned-byte 8))))
     (dotimes (i (length content))
@@ -216,7 +225,8 @@
     (with-open-stream (s stream)
       (write-sequence content s))
     (with-test-file (s *test-file* :class 'file-simple-stream
-                       :direction :input :if-does-not-exist :error)
+                       :direction :input :if-does-not-exist :error
+		       :external-format :iso8859-1)
       (let ((seq (make-array length :element-type '(unsigned-byte 8))))
         (read-sequence seq s)
         (equalp content seq))))
@@ -501,4 +511,4 @@
 			 :external-format :utf8)
 	(let ((seq (read-line s)))
 	  (string= string seq))))
-  t)
\ No newline at end of file
+  t)
-- 
GitLab