1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Add FFI tests for `sizeof' and structs.

* test-suite/tests/foreign.test ("structs")["sizeof { int8, double }",
  "sizeof { short, int, long, pointer }"]: New tests.
This commit is contained in:
Ludovic Courtès 2010-11-11 16:36:29 +01:00
parent 42f7c01e0a
commit 16f0612864

View file

@ -177,6 +177,15 @@
(with-test-prefix "structs"
(pass-if "sizeof { int8, double }"
(= (sizeof (list int8 double))
(+ (alignof double) (sizeof double))))
(pass-if "sizeof { short, int, long, pointer }"
(let ((layout (list short int long '*)))
(>= (sizeof layout)
(reduce + 0.0 (map sizeof layout)))))
(pass-if "parse-c-struct"
(let ((layout (list int64 uint8))
(data (list -300 43)))