|
infix
A JIT-Powered FFI Library for C
|
Unit test for the dynamic library loading and symbol access API. More...
#include "common/compat_c23.h"#include "common/double_tap.h"#include "common/infix_config.h"#include <infix/infix.h>Macros | |
| #define | DBLTAP_IMPLEMENTATION |
Functions | |
| __attribute__ ((visibility("default"))) | |
Unit test for the dynamic library loading and symbol access API.
This test verifies the functionality of infix_library_open, infix_library_get_symbol, infix_read_global, and infix_write_global.
To perform a realistic test, the test runner opens itself as a dynamic library (using NULL as the path). It then looks up exported symbols within its own executable image.
The test covers:
g_test_export_var).infix_read_global with a signature string to read the variable's value.infix_write_global with a signature string to modify the variable's value.g_test_export_var being exported and visible to dlsym/GetProcAddress. On some platforms/linkers (e.g., MSVC without __declspec(dllexport)), symbols in the main executable are not exported by default. The test includes logic to skip gracefully if the symbol cannot be found, rather than failing. | #define DBLTAP_IMPLEMENTATION |
| __attribute__ | ( | (visibility("default")) | ) |