diff options
Diffstat (limited to 'test_ffi/tests/test.js')
| -rw-r--r-- | test_ffi/tests/test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index a9681ab9f..943f86ae8 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -73,6 +73,12 @@ const dylib = Deno.dlopen(libPath, { parameters: [], result: "pointer", }, + "static_u32": { + type: "u32", + }, + "static_ptr": { + type: "pointer", + }, }); dylib.symbols.printSomething(); @@ -201,6 +207,14 @@ dylib.symbols.sleep_nonblocking(100).then(() => { console.log("Before"); console.log(performance.now() - start < 100); +console.log("Static u32:", dylib.symbols.static_u32); +console.log( + "Static ptr:", + dylib.symbols.static_ptr instanceof Deno.UnsafePointer, +); +const view = new Deno.UnsafePointerView(dylib.symbols.static_ptr); +console.log("Static ptr value:", view.getUint32()); + function cleanup() { dylib.close(); |
