mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +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:
parent
42f7c01e0a
commit
16f0612864
1 changed files with 9 additions and 0 deletions
|
@ -177,6 +177,15 @@
|
||||||
|
|
||||||
(with-test-prefix "structs"
|
(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"
|
(pass-if "parse-c-struct"
|
||||||
(let ((layout (list int64 uint8))
|
(let ((layout (list int64 uint8))
|
||||||
(data (list -300 43)))
|
(data (list -300 43)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue