Skip to content
Commit 68ac7272 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Test conversion of array of structs

Added test struct-values.translation.mem-aref.1 that creates an array
of two struct-pairs, sets their values, then retrieves both pairs.
This test fails: the returned first pair is actually the second, and
the returned second pair is garbage.  Repeating the same test gives
different garbage.

(with-foreign-object (p '(:struct struct-pair) 2)
      (setf (mem-aref p '(:struct struct-pair) 0) '(1 . 2)
            (mem-aref p '(:struct struct-pair) 1) '(3 . 4))
      (values (mem-aref p '(:struct struct-pair) 0)
              (mem-aref p '(:struct struct-pair) 1)))
(3 . 4)
(213829 . 0)

(with-foreign-object (p '(:struct struct-pair) 2)
      (setf (mem-aref p '(:struct struct-pair) 0) '(1 . 2)
            (mem-aref p '(:struct struct-pair) 1) '(3 . 4))
      (values (mem-aref p '(:struct struct-pair) 0)
              (mem-aref p '(:struct struct-pair) 1)))
(3 . 4)
(425347 . 0)
parent a227e3be
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment