Skip to content

Commit 4d40a9c

Browse files
committed
Remove bad strcpy test.
1 parent 3b6d9e9 commit 4d40a9c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/strcpy.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@ mod test {
3030
let mut dest = *b"abcdef"; // no null terminator
3131
let result = unsafe { strcpy(dest.as_mut_ptr(), src.as_ptr()) };
3232
assert_eq!(
33-
unsafe { core::slice::from_raw_parts(result, 5) },
34-
*b"hi\0de"
33+
unsafe { core::slice::from_raw_parts(result, 6) },
34+
*b"hi\0def"
3535
);
3636
}
37-
38-
#[test]
39-
fn two() {
40-
let src = b"hi\0";
41-
let mut dest = [0u8; 2]; // no space for null terminator
42-
let result = unsafe { strcpy(dest.as_mut_ptr(), src.as_ptr()) };
43-
assert_eq!(unsafe { core::slice::from_raw_parts(result, 2) }, b"hi");
44-
}
4537
}

0 commit comments

Comments
 (0)