jak-project/test/old_goal_tests/tests/test-bitfield-set1.gc
2020-08-22 22:32:18 -04:00

21 lines
564 B
Plaintext

(test-setup 50.3432 #f)
(deftype test-bf-type3 (int64)
((f1 uint16 :offset-assert 0)
(f2 uint8 :size 7 :offset-assert 16)
(f3 float :offset-assert 23)
(f4 uint8 :size 1 :offset-assert 55)
(f5 uint8 :offset-assert 56)
)
)
(let ((temp (the test-bf-type3 #x0)))
(set! (-> temp f1) #x12)
(set! (-> temp f2) #x13)
(set! (-> temp f3) 12.3433)
(set! (-> temp f4) #xffffffff) ; will get truncated.
(expect-true (eq? 0 (-> temp f5))) ; check it gets truncated
(format #t "~f~%" (+ (-> temp f3) (-> temp f2) (-> temp f1) (-> temp f4)))
)