init
This commit is contained in:
11
tests/strlen.rs
Normal file
11
tests/strlen.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
#[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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user