mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
30 lines
669 B
Plaintext
30 lines
669 B
Plaintext
(test-setup 16 #f)
|
|
|
|
(deftype small-struct-packed (structure)
|
|
((v1 int32)
|
|
(v2 int32)
|
|
(v3 int32))
|
|
(:pack)
|
|
)
|
|
|
|
(deftype small-struct (structure)
|
|
((v1 int32)
|
|
(v2 int32)
|
|
(v3 int32))
|
|
(:no-pack)
|
|
)
|
|
|
|
(deftype test-struct-type (basic)
|
|
((packed small-struct-packed 10 :inline #t)
|
|
(not-packed small-struct 10 :inline #t)
|
|
)
|
|
)
|
|
|
|
(let* ((obj (new 'static 'test-struct-type))
|
|
(pack-diff (- (the integer (&-> obj packed 1 v1)) (the integer (&-> obj packed 0 v1))))
|
|
(unpack-diff (- (the integer (&-> obj not-packed 1 v1)) (the integer (&-> obj not-packed 0 v1))))
|
|
)
|
|
|
|
(expect-true (eq? 12 pack-diff))
|
|
unpack-diff
|
|
) |