| 50 | } |
| 51 | |
| 52 | fn find_funcs(store: &mut Store<()>, instance: &Instance) -> Vec<TestFunc> { |
| 53 | let list = instance |
| 54 | .exports(&mut *store) |
| 55 | .map(|export| { |
| 56 | let name = export.name(); |
| 57 | let mut parts = name.split_whitespace(); |
| 58 | ( |
| 59 | parts.next().unwrap().parse().unwrap(), |
| 60 | parts.next().unwrap().parse().unwrap(), |
| 61 | export.into_func().unwrap(), |
| 62 | ) |
| 63 | }) |
| 64 | .collect::<Vec<_>>(); |
| 65 | list.into_iter() |
| 66 | .map(|(width, offset, func)| TestFunc { |
| 67 | width, |
| 68 | offset, |
| 69 | func: func.typed(&store).unwrap(), |
| 70 | }) |
| 71 | .collect() |
| 72 | } |
| 73 | |
| 74 | fn test_traps(store: &mut Store<()>, funcs: &[TestFunc], addr: u32, mem: &Memory) { |
| 75 | let mem_size = mem.data_size(&store) as u64; |