reinterpret test ok

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

@ -25,6 +25,18 @@ mod tests {
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]
fn zero_size() {
let heap: HeapArray<u8> = heap![];

Loading…
Cancel
Save