mirror of
https://git.intege.rs/xlib/xrt.git
synced 2025-12-05 21:35:02 +00:00
12 lines
314 B
Rust
12 lines
314 B
Rust
|
|
|
|
#[test]
|
|
pub fn test_strlen() {
|
|
let mut buffer: Vec<u8> = "a".repeat(1000).into();
|
|
buffer.push(0);
|
|
assert_eq!(unsafe { xrt::strlen(buffer.as_ptr()) }, 1000);
|
|
assert_eq!(unsafe { xrt::strlen((&buffer[1..]).as_ptr()) }, 999);
|
|
assert_eq!(unsafe { xrt::strlen((&buffer[8..]).as_ptr()) }, 992);
|
|
}
|
|
|