move test to tests/scryer/ffi.rs
Signed-off-by: Thierry Marianne <thierry@marianne.io>
This commit is contained in:
@@ -302,3 +302,24 @@ fn ffi_heap() {
|
||||
r#"133742"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore = "ffi")]
|
||||
fn ffi_utf8_panic() {
|
||||
let dynlib_path = build_dynamic_library(
|
||||
"ffi_utf8_panic",
|
||||
r##"
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn ffi_invalid_utf8_cstr() -> *const core::ffi::c_char {
|
||||
b"Invalid\xFFUTF8\x00".as_ptr() as *const _
|
||||
}
|
||||
"##,
|
||||
);
|
||||
|
||||
load_module_test_with_input(
|
||||
"tests-pl/ffi_utf8_panic.pl",
|
||||
format!("LIB={dynlib_path:?}."),
|
||||
// Evaluates to: 'Invalid\xFFUTF8\n'
|
||||
"[73,110,118,97,108,105,100,255,85,84,70,56]\n",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user