[bknr-cvs] r2558 - in trunk/bknr/datastore/src: . data

ksprotte at common-lisp.net ksprotte at common-lisp.net
Mon Feb 18 17:20:25 UTC 2008


Author: ksprotte
Date: Mon Feb 18 12:20:24 2008
New Revision: 2558

Modified:
   trunk/bknr/datastore/src/bknr-datastore.asd
   trunk/bknr/datastore/src/data/encoding-test.lisp
Log:
use of bknr.utils:with-temp-file in encoding-test - thanks


Modified: trunk/bknr/datastore/src/bknr-datastore.asd
==============================================================================
--- trunk/bknr/datastore/src/bknr-datastore.asd	(original)
+++ trunk/bknr/datastore/src/bknr-datastore.asd	Mon Feb 18 12:20:24 2008
@@ -29,7 +29,7 @@
                                             (:file "blob" :depends-on ("txn" "object" "package"))))))
 
 (defsystem :bknr-datastore-test  
-  :depends-on (:bknr-datastore :FiveAM :cl-store)
+  :depends-on (:bknr-datastore :fiveam :cl-store :bknr-utils)
   :components ((:module "data" :components ((:file "encoding-test")
                                             ))))
 

Modified: trunk/bknr/datastore/src/data/encoding-test.lisp
==============================================================================
--- trunk/bknr/datastore/src/data/encoding-test.lisp	(original)
+++ trunk/bknr/datastore/src/data/encoding-test.lisp	Mon Feb 18 12:20:24 2008
@@ -17,22 +17,22 @@
 
 (defun congruent-p (a b)
   "Are lisp value A and B (deeply) congruent?"
-  (let ((path-a "/tmp/a.pwgl-tmp")
-	(path-b "/tmp/b.pwgl-tmp"))
-    (cl-store:store a path-a)
-    (cl-store:store b path-b)
-    (prog1
-	(files-identical-content-p path-a path-b)
-      (delete-file path-a)
-      (delete-file path-b))))
+  (bknr.utils:with-temp-file (path-a)
+    (bknr.utils:with-temp-file (path-b)
+      (cl-store:store a path-a)
+      (cl-store:store b path-b)
+      (prog1
+          (files-identical-content-p path-a path-b)
+        (delete-file path-a)
+        (delete-file path-b)))))
 
 (defun copy-by-encoding (value)
-  (with-open-file (out "/tmp/bknr-encoding-test.tmp" :direction :output :if-exists :supersede
-                       :element-type '(unsigned-byte 8))
-    (encode value out))
-  (with-open-file (in "/tmp/bknr-encoding-test.tmp"
-                      :element-type '(unsigned-byte 8))
-    (decode in)))
+  (bknr.utils:with-temp-file (path)
+    (with-open-file (out path :direction :output :if-exists :supersede
+                         :element-type '(unsigned-byte 8))
+      (encode value out))
+    (with-open-file (in path :element-type '(unsigned-byte 8))
+      (decode in))))
 
 (defmacro test-encoding (name value)
   (let ((options (arnesi:ensure-list name)))
@@ -653,4 +653,3 @@
 ;;   (when (probe-file *test-file*)
 ;;     (ignore-errors (delete-file *test-file*))))
 
-;; ;; EOF



More information about the Bknr-cvs mailing list