()
| 7 | use alloc_stdlib::HeapAllocUninitialized; |
| 8 | #[test] |
| 9 | fn heap_test() { |
| 10 | let mut halloc : HeapAlloc<u8> = HeapAlloc::<u8>{default_value: 0}; |
| 11 | for _i in 1..10 { // heap test |
| 12 | let mut x = halloc.alloc_cell(100000); |
| 13 | x.slice_mut()[0] = 4; |
| 14 | let mut y = halloc.alloc_cell(110000); |
| 15 | y.slice_mut()[0] = 5; |
| 16 | let mut z = halloc.alloc_cell(120000); |
| 17 | z.slice_mut()[0] = 6; |
| 18 | assert_eq!(y.slice()[0], 5); |
| 19 | halloc.free_cell(y); |
| 20 | assert_eq!(x.slice()[0], 4); |
| 21 | assert_eq!(x.slice()[9], 0); |
| 22 | assert_eq!(z.slice()[0], 6); |
| 23 | } |
| 24 | |
| 25 | } |
| 26 | |
| 27 | #[test] |
| 28 | fn std_test() { |
nothing calls this directly
no test coverage detected