use dungeon_cell::layout::{Alignment, Layout, Size}; use dungeon_cell::{layout_for, DungeonCore}; #[test] fn correct_layout() { type A = DungeonCore; type B = DungeonCore; type C = DungeonCore; type D = DungeonCore; type E = DungeonCore; fn assert() { assert_eq!( std::mem::size_of::(), std::mem::size_of::() + std::mem::size_of::(), "size doesn't match expected for {}", std::any::type_name::() ); assert_eq!( std::mem::align_of::(), std::mem::align_of::(), "alignmnet doesn't match expected for {}", std::any::type_name::() ); } assert::(); assert::(); assert::(); assert::(); assert::(); } #[test] fn const_new() { const _X: DungeonCore = DungeonCore::new(123_i32); // std::hint::black_box(X); } #[test] fn const_a() { type X = DungeonCore, Alignment<16>>>; assert_eq!(std::mem::size_of::(), 16,); assert_eq!(std::mem::align_of::(), 16,); }