
* Fixes to main * Add librasan * Party like it's 2024 * Fix snapshot module to work with guest asan * Fix guest_asan module * Fixes to runner * Fix linking issues using a REL * Fix qemu_launcher * Change modify_mapping to a method * Fix gasan_test * Remove debug from Justfile * Optimize release build of librasan * Set ulimit for qasan and gasan tests * Tidy up symbol renaming * Add missing symbols for PPC * Change to support rustix 1.0.0 * Canonicalize the CUSTOM_ASAN_PATH * Review changes * Restructure backends * release_max_level_info * More review changes * Clippy fixes * Changes to reduce the burden on the CI * Fix macos clippy --------- Co-authored-by: Your Name <you@example.com>
30 lines
695 B
Rust
30 lines
695 B
Rust
#[cfg(test)]
|
|
#[cfg(feature = "hooks")]
|
|
mod tests {
|
|
use core::ptr::null;
|
|
|
|
use asan::{expect_panic, hooks::wcslen::wcslen, wchar_t};
|
|
use widestring::widecstr;
|
|
|
|
#[test]
|
|
fn test_wcslen_cs_null() {
|
|
expect_panic();
|
|
unsafe { wcslen(null() as *const wchar_t) };
|
|
unreachable!();
|
|
}
|
|
|
|
#[test]
|
|
fn test_wcslen_cs_empty() {
|
|
let data = widecstr!("");
|
|
let ret = unsafe { wcslen(data.as_ptr() as *const wchar_t) };
|
|
assert_eq!(ret, 0);
|
|
}
|
|
|
|
#[test]
|
|
fn test_wcslen_full() {
|
|
let data = widecstr!("abcdefghij");
|
|
let ret = unsafe { wcslen(data.as_ptr() as *const wchar_t) };
|
|
assert_eq!(ret, 10);
|
|
}
|
|
}
|