()
| 47 | #[cfg(feature="unsafe")] |
| 48 | #[test] |
| 49 | fn std_unsafe_heap_test() { |
| 50 | let mut halloc = unsafe{HeapAllocUninitialized::<u8>::new()}; |
| 51 | for _i in 1..10 { // heap test |
| 52 | let mut x = halloc.alloc_cell(100000); |
| 53 | x.slice_mut()[0] = 4; |
| 54 | let mut y = halloc.alloc_cell(110000); |
| 55 | y.slice_mut()[0] = 5; |
| 56 | let mut z = halloc.alloc_cell(120000); |
| 57 | z.slice_mut()[0] = 6; |
| 58 | assert_eq!(y.slice()[0], 5); |
| 59 | halloc.free_cell(y); |
| 60 | assert_eq!(x.slice()[0], 4); |
| 61 | assert_eq!(x.slice()[9], 0); |
| 62 | assert_eq!(z.slice()[0], 6); |
| 63 | } |
| 64 | |
| 65 | } |
| 66 | |
| 67 | #[cfg(feature="stdlib")] |
| 68 | #[test] |
nothing calls this directly
no test coverage detected