Takes too long
()
| 1177 | #[test] |
| 1178 | #[cfg_attr(miri, ignore)] // Takes too long |
| 1179 | fn test_get_physical_indices() { |
| 1180 | // Test for logical lengths starting from 10 to 250 increasing by 10 |
| 1181 | for logical_len in (0..250).step_by(10) { |
| 1182 | let input_array = build_input_array(logical_len); |
| 1183 | |
| 1184 | // create run array using input_array |
| 1185 | let mut builder = PrimitiveRunBuilder::<Int32Type, Int32Type>::new(); |
| 1186 | builder.extend(input_array.clone().into_iter()); |
| 1187 | |
| 1188 | let run_array = builder.finish(); |
| 1189 | let physical_values_array = run_array.values().as_primitive::<Int32Type>(); |
| 1190 | |
| 1191 | // create an array consisting of all the indices repeated twice and shuffled. |
| 1192 | let mut logical_indices: Vec<u32> = (0_u32..(logical_len as u32)).collect(); |
| 1193 | // add same indices once more |
| 1194 | logical_indices.append(&mut logical_indices.clone()); |
| 1195 | let mut rng = rng(); |
| 1196 | logical_indices.shuffle(&mut rng); |
| 1197 | |
| 1198 | let physical_indices = run_array.get_physical_indices(&logical_indices).unwrap(); |
| 1199 | |
| 1200 | assert_eq!(logical_indices.len(), physical_indices.len()); |
| 1201 | |
| 1202 | // check value in logical index in the input_array matches physical index in typed_run_array |
| 1203 | compare_logical_and_physical_indices( |
| 1204 | &logical_indices, |
| 1205 | &input_array, |
| 1206 | &physical_indices, |
| 1207 | physical_values_array, |
| 1208 | ); |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | #[test] |
| 1213 | #[cfg_attr(miri, ignore)] // Takes too long |
nothing calls this directly
no test coverage detected