mirror of
https://github.com/lune-org/lune.git
synced 2025-04-04 10:30:54 +01:00
8 lines
408 B
Text
8 lines
408 B
Text
local callableWrapper = require("../utils/callableWrapper")
|
|
local ffi = require("@lune/ffi")
|
|
local lib = require("../utils/compile")("./tests/ffi/external_pointer/lib.c")
|
|
local c = ffi.c
|
|
|
|
local pointerRead = callableWrapper(lib:find("pointer_read"), { c.int:ptr() }, c.int)
|
|
local result = pointerRead(c.int:box(123):ref():ref())
|
|
assert(result == 123, `pointerRead failed. result expected 123, got {result}`)
|