about summary refs log tree commit diff
path: root/src/libcore/tests/alloc.rs
blob: 63537ba23d84dc0edfabc9384a45e7a7a2249b7b (plain)
1
2
3
4
5
6
7
8
9
10
use core::alloc::Layout;

#[test]
fn const_unchecked_layout() {
    const SIZE: usize = 0x2000;
    const ALIGN: usize = 0x1000;
    const LAYOUT: Layout = unsafe { Layout::from_size_align_unchecked(SIZE, ALIGN) };
    assert_eq!(LAYOUT.size(), SIZE);
    assert_eq!(LAYOUT.align(), ALIGN);
}