summaryrefslogtreecommitdiff
path: root/tests/decode-tests.lisp
diff options
context:
space:
mode:
authorPiotr Szarmanski2023-08-05 22:57:30 +0200
committerPiotr Szarmanski2023-08-05 22:57:30 +0200
commitda0e1aa69defa7cbc87209966c751918f523f1fb (patch)
treeba1796f8500d314d93e46874e910492bf83ff4a2 /tests/decode-tests.lisp
parenta5e2232edc0415dc16643aaeaafe91bdb1d18b59 (diff)
Encoder refactor, new tests and proper non-file stream handling
Diffstat (limited to 'tests/decode-tests.lisp')
-rw-r--r--tests/decode-tests.lisp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/decode-tests.lisp b/tests/decode-tests.lisp
index 5053d11..918cd82 100644
--- a/tests/decode-tests.lisp
+++ b/tests/decode-tests.lisp
@@ -96,7 +96,9 @@
(assert-array-decode (make-octets 16385 :element 8) 1024)
(assert-array-decode (make-octets 32767 :element 9) 1024)
(assert-array-decode (make-octets 32768 :element 10) 1024)
- (assert-array-decode (make-octets 131072 :element 11) 1024))
+ (assert-array-decode (make-octets 131072 :element 11) 1024)
+ (for-all ((buffer (gen-buffer :length (gen-integer :min 0 :max 40000))))
+ (assert-array-decode buffer 1024)))
(test simple-decoding-32kib
(assert-array-decode (make-octets 1 :element 2) 32kib)
@@ -104,7 +106,9 @@
(assert-array-decode (make-octets 32768 :element 2) 32kib)
(assert-array-decode (make-octets 32769 :element 2) 32kib)
(assert-array-decode (make-octets 32768 :element 2) 32kib)
- (assert-array-decode (make-octets 16777216 :element 2) 32kib))
+ (assert-array-decode (make-octets 16777216 :element 2) 32kib)
+ (for-all ((buffer (gen-buffer :length (gen-integer :min 0 :max 70000))))
+ (assert-array-decode buffer 32kib)))
(test proper-return-values
(assert-bytes-read (make-octets 1 :element 3) 1024 (1))
@@ -127,12 +131,6 @@
(stream (eris-decode read-capability #'hashtable-decode)))
(setf (stream-file-position stream) ,pos)
(stream-read-sequence stream buf 0 (length buf))
- ;; (print (pos (buffer stream)))
- ;; (print (+ 24 ,buffer-pos))
- ;; (print (pos stream))
- ;; (print (+ 24 ,pos))
- ;; (print buf)
- ;; (print ,array-at-pos)
(is (and
(eql (eris::pos (eris::buffer stream))
(+ 24 ,buffer-pos))
@@ -200,7 +198,9 @@
(assert-length (make-array 1024 :element-type '(unsigned-byte 8) :initial-element 2) 1024)
(assert-length (make-array 2048 :element-type '(unsigned-byte 8) :initial-element 2) 1024)
(assert-length (make-array 16383 :element-type '(unsigned-byte 8) :initial-element 2) 1024)
- (assert-length (make-array 16384 :element-type '(unsigned-byte 8) :initial-element 2) 1024))
+ (assert-length (make-array 16384 :element-type '(unsigned-byte 8) :initial-element 2) 1024)
+ (for-all ((buffer (gen-buffer :length (gen-integer :min 0 :max 40000))))
+ (assert-length buffer 1024)))
(defmacro assert-read-byte (array block-size)