aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/data-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/data-tests.el')
-rw-r--r--test/src/data-tests.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 688c32d6eeb..701e579ae2e 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -123,7 +123,7 @@ most-positive-fixnum, which is just less than a power of 2.")
123 (setq byte (lognot byte))) 123 (setq byte (lognot byte)))
124 (if (zerop byte) 124 (if (zerop byte)
125 0 125 0
126 (+ (logand byte 1) (data-tests-popcnt (lsh byte -1))))) 126 (+ (logand byte 1) (data-tests-popcnt (ash byte -1)))))
127 127
128(ert-deftest data-tests-logcount () 128(ert-deftest data-tests-logcount ()
129 (should (cl-loop for n in (number-sequence -255 255) 129 (should (cl-loop for n in (number-sequence -255 255)
@@ -186,17 +186,17 @@ most-positive-fixnum, which is just less than a power of 2.")
186 (dotimes (_ 4) 186 (dotimes (_ 4)
187 (aset bv i (> (logand 1 n) 0)) 187 (aset bv i (> (logand 1 n) 0))
188 (cl-incf i) 188 (cl-incf i)
189 (setf n (lsh n -1))))) 189 (setf n (ash n -1)))))
190 bv)) 190 bv))
191 191
192(defun test-bool-vector-to-hex-string (bv) 192(defun test-bool-vector-to-hex-string (bv)
193 (let (nibbles (v (cl-coerce bv 'list))) 193 (let (nibbles (v (cl-coerce bv 'list)))
194 (while v 194 (while v
195 (push (logior 195 (push (logior
196 (lsh (if (nth 0 v) 1 0) 0) 196 (ash (if (nth 0 v) 1 0) 0)
197 (lsh (if (nth 1 v) 1 0) 1) 197 (ash (if (nth 1 v) 1 0) 1)
198 (lsh (if (nth 2 v) 1 0) 2) 198 (ash (if (nth 2 v) 1 0) 2)
199 (lsh (if (nth 3 v) 1 0) 3)) 199 (ash (if (nth 3 v) 1 0) 3))
200 nibbles) 200 nibbles)
201 (setf v (nthcdr 4 v))) 201 (setf v (nthcdr 4 v)))
202 (mapconcat (lambda (n) (format "%X" n)) 202 (mapconcat (lambda (n) (format "%X" n))