mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Use WITH-SCRATCH-FILE in md5 test
This commit is contained in:
parent
c4da17fcbc
commit
9ec3631242
|
|
@ -132,22 +132,13 @@
|
||||||
("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" . "a0d1395c7fb36247bfe2d49376d9d133")
|
("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" . "a0d1395c7fb36247bfe2d49376d9d133")
|
||||||
("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" . "ab75504250558b788f99d1ebd219abf2"))))
|
("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" . "ab75504250558b788f99d1ebd219abf2"))))
|
||||||
|
|
||||||
(deftest sb-md5.md5sum-file.0
|
;; This is barely a test. It's md5summing an empty file. Why?
|
||||||
(let ((file
|
(test-util:with-test (:name :sb-md5.md5sum-file.0)
|
||||||
(loop with ret
|
(test-util:with-scratch-file (name)
|
||||||
for filename = (format nil "md5-test-~6,'0D" (random 100000))
|
(with-open-file (stream name :direction :output :if-does-not-exist :create))
|
||||||
do (with-open-file (stream filename :direction :output
|
(let ((answer (md5sum-file name)))
|
||||||
:if-exists nil
|
(assert (string= (format nil "~(~{~2,'0X~}~)" (coerce answer 'list))
|
||||||
:if-does-not-exist :create)
|
"d41d8cd98f00b204e9800998ecf8427e")))))
|
||||||
(when stream
|
|
||||||
(setf ret stream)))
|
|
||||||
when ret return ret)))
|
|
||||||
(unwind-protect
|
|
||||||
(string= (format nil "~(~{~2,'0X~}~)"
|
|
||||||
(coerce (md5sum-file file) 'list))
|
|
||||||
"d41d8cd98f00b204e9800998ecf8427e")
|
|
||||||
(delete-file file)))
|
|
||||||
t)
|
|
||||||
|
|
||||||
(deftest sb-md5.md5sum-sequence.error.0
|
(deftest sb-md5.md5sum-sequence.error.0
|
||||||
(handler-case (md5sum-sequence "foo")
|
(handler-case (md5sum-sequence "foo")
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,8 @@
|
||||||
"../contrib/sb-simd/test-suite/test-horizontal-functions.lisp"
|
"../contrib/sb-simd/test-suite/test-horizontal-functions.lisp"
|
||||||
"../contrib/sb-simd/test-suite/test-hairy-simd-functions.lisp"
|
"../contrib/sb-simd/test-suite/test-hairy-simd-functions.lisp"
|
||||||
"../contrib/sb-simd/test-suite/test-packages.lisp")
|
"../contrib/sb-simd/test-suite/test-packages.lisp")
|
||||||
("sb-simple-streams.impure.lisp" "contrib/sb-simple-streams.fasl" "contrib/sb-bsd-sockets.fasl")
|
("sb-simple-streams.impure.lisp" "contrib/sb-simple-streams.fasl" "contrib/sb-bsd-sockets.fasl"
|
||||||
|
"../contrib/sb-simple-streams/simple-stream-tests.lisp")
|
||||||
("sb-rotate-byte.impure.lisp" "contrib/sb-rotate-byte.fasl"
|
("sb-rotate-byte.impure.lisp" "contrib/sb-rotate-byte.fasl"
|
||||||
"../contrib/sb-rotate-byte/rotate-byte-tests.lisp")
|
"../contrib/sb-rotate-byte/rotate-byte-tests.lisp")
|
||||||
("sb-sprof.impure.lisp" "contrib/sb-sprof.fasl"
|
("sb-sprof.impure.lisp" "contrib/sb-sprof.fasl"
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,4 @@
|
||||||
(when (search "ALIEN-FUNCALL" text)
|
(when (search "ALIEN-FUNCALL" text)
|
||||||
(error "Compiler bug on ~S" code)))))))))
|
(error "Compiler bug on ~S" code)))))))))
|
||||||
|
|
||||||
(setq run-tests::*allowed-inputs* :any) ; makes random pathnames without aid of WITH-SCRATCH-FILE
|
|
||||||
(load "../contrib/sb-md5/md5-tests.lisp")
|
(load "../contrib/sb-md5/md5-tests.lisp")
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
(require :sb-simple-streams)
|
(require :sb-simple-streams)
|
||||||
(setq run-tests::*allowed-inputs* :any)
|
;; impure tests don't use the input manifest under run-tests.sh
|
||||||
|
;; but do under parallel-exec, which runs each test as if pure,
|
||||||
|
;; but in a forked child.
|
||||||
|
#+parallel-test-runner (setq run-tests::*allowed-inputs* :any)
|
||||||
(load "../contrib/sb-simple-streams/simple-stream-tests.lisp")
|
(load "../contrib/sb-simple-streams/simple-stream-tests.lisp")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue