reinterpret test ok

master
Avril 5 years ago
parent 632bd77a58
commit 1e4d6dd5d6
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -24,6 +24,18 @@ mod tests {
} }
struct Unit; struct Unit;
#[test]
fn reinterpret()
{
let heap = heap![u8; 32];
unsafe {
let heap = heap.reinterpret::<i32>();
assert_eq!(heap.len(), 8);
let heap = heap.reinterpret::<u8>();
assert_eq!(heap.len(), 32);
}
}
#[test] #[test]
fn zero_size() { fn zero_size() {

Loading…
Cancel
Save