/usr/share/common-lisp/source/nibbles/tests.lisp is in cl-nibbles 20150709-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | ;;;; tests.lisp -- tests for various bits of functionality
(cl:defpackage :nibbles-tests
(:use :cl))
(cl:in-package :nibbles-tests)
;;; Basic tests for correctness.
(defun make-byte-combiner (n-bytes big-endian-p)
(let ((count 0)
(buffer 0))
#'(lambda (byte)
(setf buffer
(if big-endian-p
(logior (ash buffer 8) byte)
(let ((x (logior (ash byte (* 8 count)) buffer)))
(if (= count n-bytes)
(ash x -8)
x))))
(unless (= count n-bytes)
(incf count))
(cond
((= count n-bytes)
(let ((val (ldb (byte (* 8 n-bytes) 0) buffer)))
(multiple-value-prog1 (values val t)
(setf buffer val))))
(t (values 0 nil))))))
(defun generate-random-octet-vector (n-octets)
(loop with v = (nibbles:make-octet-vector n-octets)
for i from 0 below n-octets
do (setf (aref v i) (random 256))
finally (return v)))
(defun generate-reffed-values (byte-vector bitsize signedp big-endian-p
&optional (rolling-p t))
(do* ((byte-kind (if signedp 'signed-byte 'unsigned-byte))
(bytesize (truncate bitsize 8))
(n-bytes-to-read (if rolling-p
(length byte-vector)
(* (floor (length byte-vector) bytesize)
bytesize)))
(n-values (if rolling-p
(- (length byte-vector) (1- bytesize))
(truncate n-bytes-to-read bytesize)))
(ev (make-array n-values
:element-type `(,byte-kind ,bitsize)
:adjustable t))
(i 0 (1+ i))
(j 0)
(combiner (make-byte-combiner bytesize big-endian-p)))
((>= i n-bytes-to-read) ev)
(multiple-value-bind (aggregate set-p) (funcall combiner (aref byte-vector i))
(when set-p
(setf (aref ev j)
(if (and signedp (logbitp (1- bitsize) aggregate))
(dpb aggregate (byte bitsize 0) -1)
aggregate))
(unless rolling-p
(setf combiner (make-byte-combiner bytesize big-endian-p)))
(incf j)))))
(defvar *default-n-values* 4096)
(defun generate-random-test (bitsize signedp big-endian-p
&optional (n-values *default-n-values*))
(let* ((n-bytes (truncate bitsize 8))
(total-octets (+ n-values (1- n-bytes)))
(random-octets (generate-random-octet-vector total-octets))
(expected-vector
(generate-reffed-values random-octets bitsize signedp big-endian-p)))
(values random-octets expected-vector)))
(defun compile-quietly (form)
(handler-bind ((style-warning #'muffle-warning)
#+sbcl (sb-ext:compiler-note #'muffle-warning))
(compile nil form)))
(defun ref-test (reffer bitsize signedp big-endian-p
&optional (n-octets *default-n-values*))
(multiple-value-bind (byte-vector expected-vector)
(generate-random-test bitsize signedp big-endian-p n-octets)
(flet ((run-test (reffer)
(loop for i from 0 below n-octets
for j from 0
do (let ((reffed-val (funcall reffer byte-vector i))
(expected-val (aref expected-vector j)))
(unless (= reffed-val expected-val)
(error "wanted ~D, got ~D from ~A"
expected-val reffed-val
(subseq byte-vector i
(+ i (truncate bitsize 8))))))
finally (return :ok))))
(run-test reffer)
(when (typep byte-vector '(simple-array (unsigned-byte 8) (*)))
(let ((compiled (compile-quietly
`(lambda (v i)
(declare (type (simple-array (unsigned-byte 8) (*)) v))
(declare (type (integer 0 #.(1- array-dimension-limit)) i))
(declare (optimize speed (debug 0)))
(,reffer v i)))))
(run-test compiled))))))
(defun set-test (reffer bitsize signedp big-endian-p
&optional (n-octets *default-n-values*))
;; We use GET-SETF-EXPANSION to avoid reaching too deeply into
;; internals. This bit relies on knowing that the writer-form will be
;; a simple function call whose CAR is the internal setter, but I
;; think that's a bit better than :: references everywhere.
(multiple-value-bind (vars vals store-vars writer-form reader-form)
(get-setf-expansion `(,reffer x i))
(declare (ignore vars vals store-vars reader-form))
(let ((setter (car writer-form)))
;; Sanity check.
(unless (eq (symbol-package setter) (find-package :nibbles))
(error "need to update setter tests!"))
(multiple-value-bind (byte-vector expected-vector)
(generate-random-test bitsize signedp big-endian-p n-octets)
(flet ((run-test (setter)
(loop with fill-vec = (let ((v (copy-seq byte-vector)))
(fill v 0)
v)
for i from 0 below n-octets
for j from 0
do (funcall setter fill-vec i (aref expected-vector j))
finally (return
(if (mismatch fill-vec byte-vector)
(error "wanted ~A, got ~A" byte-vector fill-vec)
:ok)))))
(run-test setter)
(when (typep byte-vector '(simple-array (unsigned-byte 8) (*)))
(let ((compiled (compile-quietly
`(lambda (v i new)
(declare (type (simple-array (unsigned-byte 8) (*)) v))
(declare (type (integer 0 #.(1- array-dimension-limit)) i))
(declare (type (,(if signedp 'signed-byte 'unsigned-byte)
,bitsize) new))
(declare (optimize speed (debug 0)))
(,setter v i new)))))
(run-test compiled))))))))
;;; Big-endian integer ref tests
(rtest:deftest :ub16ref/be
(ref-test 'nibbles:ub16ref/be 16 nil t)
:ok)
(rtest:deftest :sb16ref/be
(ref-test 'nibbles:sb16ref/be 16 t t)
:ok)
(rtest:deftest :ub32ref/be
(ref-test 'nibbles:ub32ref/be 32 nil t)
:ok)
(rtest:deftest :sb32ref/be
(ref-test 'nibbles:sb32ref/be 32 t t)
:ok)
(rtest:deftest :ub64ref/be
(ref-test 'nibbles:ub64ref/be 64 nil t)
:ok)
(rtest:deftest :sb64ref/be
(ref-test 'nibbles:sb64ref/be 64 t t)
:ok)
;;; Big-endian set tests
(rtest:deftest :ub16set/be
(set-test 'nibbles:ub16ref/be 16 nil t)
:ok)
(rtest:deftest :sb16set/be
(set-test 'nibbles:sb16ref/be 16 t t)
:ok)
(rtest:deftest :ub32set/be
(set-test 'nibbles:ub32ref/be 32 nil t)
:ok)
(rtest:deftest :sb32set/be
(set-test 'nibbles:sb32ref/be 32 t t)
:ok)
(rtest:deftest :ub64set/be
(set-test 'nibbles:ub64ref/be 64 nil t)
:ok)
(rtest:deftest :sb64set/be
(set-test 'nibbles:sb64ref/be 64 t t)
:ok)
;;; Little-endian integer ref tests
(rtest:deftest :ub16ref/le
(ref-test 'nibbles:ub16ref/le 16 nil nil)
:ok)
(rtest:deftest :sb16ref/le
(ref-test 'nibbles:sb16ref/le 16 t nil)
:ok)
(rtest:deftest :ub32ref/le
(ref-test 'nibbles:ub32ref/le 32 nil nil)
:ok)
(rtest:deftest :sb32ref/le
(ref-test 'nibbles:sb32ref/le 32 t nil)
:ok)
(rtest:deftest :ub64ref/le
(ref-test 'nibbles:ub64ref/le 64 nil nil)
:ok)
(rtest:deftest :sb64ref/le
(ref-test 'nibbles:sb64ref/le 64 t nil)
:ok)
;;; Little-endian set tests
(rtest:deftest :ub16set/le
(set-test 'nibbles:ub16ref/le 16 nil nil)
:ok)
(rtest:deftest :sb16set/le
(set-test 'nibbles:sb16ref/le 16 t nil)
:ok)
(rtest:deftest :ub32set/le
(set-test 'nibbles:ub32ref/le 32 nil nil)
:ok)
(rtest:deftest :sb32set/le
(set-test 'nibbles:sb32ref/le 32 t nil)
:ok)
(rtest:deftest :ub64set/le
(set-test 'nibbles:ub64ref/le 64 nil nil)
:ok)
(rtest:deftest :sb64set/le
(set-test 'nibbles:sb64ref/le 64 t nil)
:ok)
;;; Stream reading tests
(defvar *path* #.*compile-file-truename*)
(defun read-file-as-octets (pathname)
(with-open-file (stream pathname :direction :input
:element-type '(unsigned-byte 8))
(let ((v (nibbles:make-octet-vector (file-length stream))))
(read-sequence v stream)
v)))
(defun read-test (reader bitsize signedp big-endian-p)
(let* ((pathname *path*)
(file-contents (read-file-as-octets pathname))
(expected-values (generate-reffed-values file-contents bitsize
signedp big-endian-p)))
(with-open-file (stream pathname :direction :input
:element-type '(unsigned-byte 8))
(loop with n-values = (length expected-values)
for i from 0 below n-values
do (file-position stream i)
(let ((read-value (funcall reader stream))
(expected-value (aref expected-values i)))
(unless (= read-value expected-value)
(return :bad)))
finally (return :ok)))))
(defun read-sequence-test (result-type reader bitsize signedp big-endian-p)
(let* ((pathname *path*)
(file-contents (subseq (read-file-as-octets pathname) 0 8))
(expected-values (generate-reffed-values file-contents bitsize
signedp big-endian-p nil)))
(with-open-file (stream pathname :direction :input
:element-type '(unsigned-byte 8))
(let* ((n-values (truncate (length file-contents)
(truncate bitsize 8)))
(read-values (funcall reader result-type stream n-values)))
(if (or (not (typep read-values result-type))
(mismatch read-values expected-values))
:bad
:ok)))))
(rtest:deftest :read-ub16/be
(read-test 'nibbles:read-ub16/be 16 nil t)
:ok)
(rtest:deftest :read-sb16/be
(read-test 'nibbles:read-sb16/be 16 t t)
:ok)
(rtest:deftest :read-ub32/be
(read-test 'nibbles:read-ub32/be 32 nil t)
:ok)
(rtest:deftest :read-sb32/be
(read-test 'nibbles:read-sb32/be 32 t t)
:ok)
(rtest:deftest :read-ub64/be
(read-test 'nibbles:read-ub64/be 64 nil t)
:ok)
(rtest:deftest :read-sb64/be
(read-test 'nibbles:read-sb64/be 64 t t)
:ok)
(rtest:deftest :read-ub16/le
(read-test 'nibbles:read-ub16/le 16 nil nil)
:ok)
(rtest:deftest :read-sb16/le
(read-test 'nibbles:read-sb16/le 16 t nil)
:ok)
(rtest:deftest :read-ub32/le
(read-test 'nibbles:read-ub32/le 32 nil nil)
:ok)
(rtest:deftest :read-sb32/le
(read-test 'nibbles:read-sb32/le 32 t nil)
:ok)
(rtest:deftest :read-ub64/le
(read-test 'nibbles:read-ub64/le 64 nil nil)
:ok)
(rtest:deftest :read-sb64/le
(read-test 'nibbles:read-sb64/le 64 t nil)
:ok)
(rtest:deftest :read-ub16/be-vector
(read-sequence-test 'vector 'nibbles:read-ub16/be-sequence 16 nil t)
:ok)
(rtest:deftest :read-sb16/be-vector
(read-sequence-test 'vector 'nibbles:read-sb16/be-sequence 16 t t)
:ok)
(rtest:deftest :read-ub32/be-vector
(read-sequence-test 'vector 'nibbles:read-ub32/be-sequence 32 nil t)
:ok)
(rtest:deftest :read-sb32/be-vector
(read-sequence-test 'vector 'nibbles:read-sb32/be-sequence 32 t t)
:ok)
(rtest:deftest :read-ub64/be-vector
(read-sequence-test 'vector 'nibbles:read-ub64/be-sequence 64 nil t)
:ok)
(rtest:deftest :read-sb64/be-vector
(read-sequence-test 'vector 'nibbles:read-sb64/be-sequence 64 t t)
:ok)
(rtest:deftest :read-ub16/le-vector
(read-sequence-test 'vector 'nibbles:read-ub16/le-sequence 16 nil nil)
:ok)
(rtest:deftest :read-sb16/le-vector
(read-sequence-test 'vector 'nibbles:read-sb16/le-sequence 16 t nil)
:ok)
(rtest:deftest :read-ub32/le-vector
(read-sequence-test 'vector 'nibbles:read-ub32/le-sequence 32 nil nil)
:ok)
(rtest:deftest :read-sb32/le-vector
(read-sequence-test 'vector 'nibbles:read-sb32/le-sequence 32 t nil)
:ok)
(rtest:deftest :read-ub64/le-vector
(read-sequence-test 'vector 'nibbles:read-ub64/le-sequence 64 nil nil)
:ok)
(rtest:deftest :read-sb64/le-vector
(read-sequence-test 'vector 'nibbles:read-sb64/le-sequence 64 t nil)
:ok)
(rtest:deftest :read-ub16/be-list
(read-sequence-test 'list 'nibbles:read-ub16/be-sequence 16 nil t)
:ok)
(rtest:deftest :read-sb16/be-list
(read-sequence-test 'list 'nibbles:read-sb16/be-sequence 16 t t)
:ok)
(rtest:deftest :read-ub32/be-list
(read-sequence-test 'list 'nibbles:read-ub32/be-sequence 32 nil t)
:ok)
(rtest:deftest :read-sb32/be-list
(read-sequence-test 'list 'nibbles:read-sb32/be-sequence 32 t t)
:ok)
(rtest:deftest :read-ub64/be-list
(read-sequence-test 'list 'nibbles:read-ub64/be-sequence 64 nil t)
:ok)
(rtest:deftest :read-sb64/be-list
(read-sequence-test 'list 'nibbles:read-sb64/be-sequence 64 t t)
:ok)
(rtest:deftest :read-ub16/le-list
(read-sequence-test 'list 'nibbles:read-ub16/le-sequence 16 nil nil)
:ok)
(rtest:deftest :read-sb16/le-list
(read-sequence-test 'list 'nibbles:read-sb16/le-sequence 16 t nil)
:ok)
(rtest:deftest :read-ub32/le-list
(read-sequence-test 'list 'nibbles:read-ub32/le-sequence 32 nil nil)
:ok)
(rtest:deftest :read-sb32/le-list
(read-sequence-test 'list 'nibbles:read-sb32/le-sequence 32 t nil)
:ok)
(rtest:deftest :read-ub64/le-list
(read-sequence-test 'list 'nibbles:read-ub64/le-sequence 64 nil nil)
:ok)
(rtest:deftest :read-sb64/le-list
(read-sequence-test 'list 'nibbles:read-sb64/le-sequence 64 t nil)
:ok)
;;; Stream writing tests
(defvar *output-directory*
(merge-pathnames (make-pathname :name nil :type nil
:directory '(:relative "test-output"))
(make-pathname :directory (pathname-directory *path*))))
(defun write-test (writer bitsize signedp big-endian-p)
(multiple-value-bind (byte-vector expected-values)
(generate-random-test bitsize signedp big-endian-p)
(let ((tmpfile (make-pathname :name "tmp" :defaults *output-directory*)))
(ensure-directories-exist tmpfile)
(with-open-file (stream tmpfile :direction :output
:element-type '(unsigned-byte 8)
:if-does-not-exist :create
:if-exists :supersede)
(loop with n-values = (length expected-values)
for i from 0 below n-values
do (file-position stream i)
(funcall writer (aref expected-values i) stream)))
(let ((file-contents (read-file-as-octets tmpfile)))
(delete-file tmpfile)
(if (mismatch byte-vector file-contents)
:bad
:ok)))))
(defun read-sequence-from-file (filename seq-type reader n-values)
(with-open-file (stream filename :direction :input
:element-type '(unsigned-byte 8)
:if-does-not-exist :error)
(funcall reader seq-type stream n-values)))
(defun write-sequence-test (seq-type reader writer
bitsize signedp big-endian-p)
(multiple-value-bind (byte-vector expected-values)
(generate-random-test bitsize signedp big-endian-p)
(declare (ignore byte-vector))
(let ((tmpfile (make-pathname :name "tmp" :defaults *output-directory*))
(values-seq (coerce expected-values seq-type)))
(ensure-directories-exist tmpfile)
(flet ((run-random-test (values expected-start expected-end)
(with-open-file (stream tmpfile :direction :output
:element-type '(unsigned-byte 8)
:if-does-not-exist :create
:if-exists :supersede)
(funcall writer values stream :start expected-start
:end expected-end))
(let ((file-contents (read-sequence-from-file tmpfile
seq-type
reader
(- expected-end expected-start))))
(mismatch values file-contents
:start1 expected-start
:end1 expected-end))))
(let* ((block-size (truncate (length expected-values) 4))
(upper-quartile (* block-size 3)))
(unwind-protect
(loop repeat 32
when (run-random-test values-seq (random block-size)
(+ upper-quartile
(random block-size)))
do (return :bad)
finally (return :ok))
(delete-file tmpfile)))))))
(rtest:deftest :write-ub16/be
(write-test 'nibbles:write-ub16/be 16 nil t)
:ok)
(rtest:deftest :write-sb16/be
(write-test 'nibbles:write-sb16/be 16 t t)
:ok)
(rtest:deftest :write-ub32/be
(write-test 'nibbles:write-ub32/be 32 nil t)
:ok)
(rtest:deftest :write-sb32/be
(write-test 'nibbles:write-sb32/be 32 t t)
:ok)
(rtest:deftest :write-ub64/be
(write-test 'nibbles:write-ub64/be 64 nil t)
:ok)
(rtest:deftest :write-sb64/be
(write-test 'nibbles:write-sb64/be 64 t t)
:ok)
(rtest:deftest :write-ub16/le
(write-test 'nibbles:write-ub16/le 16 nil nil)
:ok)
(rtest:deftest :write-sb16/le
(write-test 'nibbles:write-sb16/le 16 t nil)
:ok)
(rtest:deftest :write-ub32/le
(write-test 'nibbles:write-ub32/le 32 nil nil)
:ok)
(rtest:deftest :write-sb32/le
(write-test 'nibbles:write-sb32/le 32 t nil)
:ok)
(rtest:deftest :write-ub64/le
(write-test 'nibbles:write-ub64/le 64 nil nil)
:ok)
(rtest:deftest :write-sb64/le
(write-test 'nibbles:write-sb64/le 64 t nil)
:ok)
(rtest:deftest :write-ub16/be-vector
(write-sequence-test 'vector
'nibbles:read-ub16/be-sequence
'nibbles:write-ub16/be-sequence 16 nil t)
:ok)
(rtest:deftest :write-sb16/be-vector
(write-sequence-test 'vector
'nibbles:read-sb16/be-sequence
'nibbles:write-sb16/be-sequence 16 t t)
:ok)
(rtest:deftest :write-ub32/be-vector
(write-sequence-test 'vector
'nibbles:read-ub32/be-sequence
'nibbles:write-ub32/be-sequence 32 nil t)
:ok)
(rtest:deftest :write-sb32/be-vector
(write-sequence-test 'vector
'nibbles:read-sb32/be-sequence
'nibbles:write-sb32/be-sequence 32 t t)
:ok)
(rtest:deftest :write-ub64/be-vector
(write-sequence-test 'vector
'nibbles:read-ub64/be-sequence
'nibbles:write-ub64/be-sequence 64 nil t)
:ok)
(rtest:deftest :write-sb64/be-vector
(write-sequence-test 'vector
'nibbles:read-sb64/be-sequence
'nibbles:write-sb64/be-sequence 64 t t)
:ok)
(rtest:deftest :write-ub16/le-vector
(write-sequence-test 'vector
'nibbles:read-ub16/le-sequence
'nibbles:write-ub16/le-sequence 16 nil nil)
:ok)
(rtest:deftest :write-sb16/le-vector
(write-sequence-test 'vector
'nibbles:read-sb16/le-sequence
'nibbles:write-sb16/le-sequence 16 t nil)
:ok)
(rtest:deftest :write-ub32/le-vector
(write-sequence-test 'vector
'nibbles:read-ub32/le-sequence
'nibbles:write-ub32/le-sequence 32 nil nil)
:ok)
(rtest:deftest :write-sb32/le-vector
(write-sequence-test 'vector
'nibbles:read-sb32/le-sequence
'nibbles:write-sb32/le-sequence 32 t nil)
:ok)
(rtest:deftest :write-ub64/le-vector
(write-sequence-test 'vector
'nibbles:read-ub64/le-sequence
'nibbles:write-ub64/le-sequence 64 nil nil)
:ok)
(rtest:deftest :write-sb64/le-vector
(write-sequence-test 'vector
'nibbles:read-sb64/le-sequence
'nibbles:write-sb64/le-sequence 64 t nil)
:ok)
(rtest:deftest :write-ub16/be-list
(write-sequence-test 'list
'nibbles:read-ub16/be-sequence
'nibbles:write-ub16/be-sequence 16 nil t)
:ok)
(rtest:deftest :write-sb16/be-list
(write-sequence-test 'list
'nibbles:read-sb16/be-sequence
'nibbles:write-sb16/be-sequence 16 t t)
:ok)
(rtest:deftest :write-ub32/be-list
(write-sequence-test 'list
'nibbles:read-ub32/be-sequence
'nibbles:write-ub32/be-sequence 32 nil t)
:ok)
(rtest:deftest :write-sb32/be-list
(write-sequence-test 'list
'nibbles:read-sb32/be-sequence
'nibbles:write-sb32/be-sequence 32 t t)
:ok)
(rtest:deftest :write-ub64/be-list
(write-sequence-test 'list
'nibbles:read-ub64/be-sequence
'nibbles:write-ub64/be-sequence 64 nil t)
:ok)
(rtest:deftest :write-sb64/be-list
(write-sequence-test 'list
'nibbles:read-sb64/be-sequence
'nibbles:write-sb64/be-sequence 64 t t)
:ok)
(rtest:deftest :write-ub16/le-list
(write-sequence-test 'list
'nibbles:read-ub16/le-sequence
'nibbles:write-ub16/le-sequence 16 nil nil)
:ok)
(rtest:deftest :write-sb16/le-list
(write-sequence-test 'list
'nibbles:read-sb16/le-sequence
'nibbles:write-sb16/le-sequence 16 t nil)
:ok)
(rtest:deftest :write-ub32/le-list
(write-sequence-test 'list
'nibbles:read-ub32/le-sequence
'nibbles:write-ub32/le-sequence 32 nil nil)
:ok)
(rtest:deftest :write-sb32/le-list
(write-sequence-test 'list
'nibbles:read-sb32/le-sequence
'nibbles:write-sb32/le-sequence 32 t nil)
:ok)
(rtest:deftest :write-ub64/le-list
(write-sequence-test 'list
'nibbles:read-ub64/le-sequence
'nibbles:write-ub64/le-sequence 64 nil nil)
:ok)
(rtest:deftest :write-sb64/le-list
(write-sequence-test 'list
'nibbles:read-sb64/le-sequence
'nibbles:write-sb64/le-sequence 64 t nil)
:ok)
|