| 262 | } |
| 263 | |
| 264 | void iteratorSubscriptTest() { |
| 265 | std::vector<std::vector<std::optional<int32_t>>> intArray{ |
| 266 | {1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 15}}; |
| 267 | auto arrayVector = makeNullableArrayVector(intArray); |
| 268 | DecodedVector decoded; |
| 269 | exec::VectorReader<Array<int32_t>> reader( |
| 270 | decode(decoded, *arrayVector.get())); |
| 271 | |
| 272 | for (auto i = 0; i < arrayVector->size(); i++) { |
| 273 | auto arrayView = read(reader, i); |
| 274 | auto it = arrayView.begin(); |
| 275 | |
| 276 | for (int j = 0; j < arrayView.size(); j++) { |
| 277 | auto it2 = arrayView.begin(); |
| 278 | for (int k = 0; k < arrayView.size(); k++) { |
| 279 | ASSERT_EQ(*it, it2[j - k]); |
| 280 | it2++; |
| 281 | } |
| 282 | it++; |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | }; |
| 287 | |
| 288 | class NullableArrayViewTest : public ArrayViewTest<true> {}; |