emacs-websocket
emacs-websocket copied to clipboard
websocket-to-bytes tests fail on 32-bit machines
trafficstars
The fourth test for websocket-to-bytes tests is failing on my 32-bit machine. If I had to guess, commit d29b171b812893b30fa0b86eebbaf548518992f9 looks like it introduced the failure. lsh doesn't like it when you give it a float.
Here's the backtrace I get when evaluating (websocket-to-bytes 536870912 8). Notice that I did not turn 536870912 into a float, but the reader did that for me, like what is happening in the test.
Debugger entered--Lisp error: (wrong-type-argument integerp 536870912.0)
lsh(536870912.0 -32)
(let ((hi-32bits (lsh val -32)) (low-32bits (if (= 0 (expt 2 32)) val (logand 4294967295.0 val)))) (if (or (> hi-32bits 0) (> (lsh low-32bits -29) 0)) (progn (signal (quote websocket-frame-too-large) val))) (bindat-pack (quote ((:val vec 2 u32))) (list (cons (quote :val) (vector hi-32bits low-32bits)))))
(progn (let ((hi-32bits (lsh val -32)) (low-32bits (if (= 0 (expt 2 32)) val (logand 4294967295.0 val)))) (if (or (> hi-32bits 0) (> (lsh low-32bits -29) 0)) (progn (signal (quote websocket-frame-too-large) val))) (bindat-pack (quote ((:val vec 2 u32))) (list (cons (quote :val) (vector hi-32bits low-32bits))))))
(if (= nbytes 8) (progn (let ((hi-32bits (lsh val -32)) (low-32bits (if (= 0 (expt 2 32)) val (logand 4294967295.0 val)))) (if (or (> hi-32bits 0) (> (lsh low-32bits -29) 0)) (progn (signal (quote websocket-frame-too-large) val))) (bindat-pack (quote ((:val vec 2 u32))) (list (cons (quote :val) (vector hi-32bits low-32bits)))))) (bindat-pack (list (list (quote :val) (cond ((= nbytes 1) (quote u8)) ((= nbytes 2) (quote u16)) ((= nbytes 4) (quote u32)) (t (error "websocket-to-bytes: Unknown NBYTES: %s" nbytes))))) (list (cons (quote :val) val))))
websocket-to-bytes(536870912.0 8)
eval((websocket-to-bytes 536870912.0 8) nil)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
Relevant emacs info
In GNU Emacs 24.5.1 (i686-pc-mingw32)
of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.3.9600
Configured using:
`configure --prefix=/c/usr --host=i686-pc-mingw32'
I think someone with a 32 bit machine will have to fix this one...