()
| 1153 | |
| 1154 | #[test] |
| 1155 | fn test_ree_array_accessor() { |
| 1156 | let input_array = build_input_array(256); |
| 1157 | |
| 1158 | // Encode the input_array to ree_array |
| 1159 | let mut builder = |
| 1160 | PrimitiveRunBuilder::<Int16Type, Int32Type>::with_capacity(input_array.len()); |
| 1161 | builder.extend(input_array.iter().copied()); |
| 1162 | let run_array = builder.finish(); |
| 1163 | let typed = run_array.downcast::<PrimitiveArray<Int32Type>>().unwrap(); |
| 1164 | |
| 1165 | // Access every index and check if the value in the input array matches returned value. |
| 1166 | for (i, inp_val) in input_array.iter().enumerate() { |
| 1167 | if let Some(val) = inp_val { |
| 1168 | let actual = typed.value(i); |
| 1169 | assert_eq!(*val, actual) |
| 1170 | } else { |
| 1171 | let physical_ix = run_array.get_physical_index(i); |
| 1172 | assert!(typed.values().is_null(physical_ix)); |
| 1173 | }; |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | #[test] |
| 1178 | #[cfg_attr(miri, ignore)] // Takes too long |
nothing calls this directly
no test coverage detected