Skip to content

Commit fd12c4f

Browse files
committed
tiledb::test::templates::query::resize_fields
1 parent f6e24f6 commit fd12c4f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

test/src/unit-sparse-global-order-reader.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3714,15 +3714,7 @@ CSparseGlobalOrderFx::run_execute(Instance& instance) {
37143714
// Clean up.
37153715
tiledb_query_free(&query);
37163716

3717-
std::apply(
3718-
[outcursor](auto&... outfield) {
3719-
std::apply(
3720-
[&](const auto&... field_cursor) {
3721-
(outfield.finish_multipart_read(field_cursor), ...);
3722-
},
3723-
outcursor);
3724-
},
3725-
std::tuple_cat(outdims, outatts));
3717+
templates::query::resize_fields<Asserter>(out, outcursor);
37263718

37273719
ASSERTER(expect.dimensions() == outdims);
37283720

test/support/src/array_templates.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,19 @@ uint64_t num_cells(const F& fragment, const auto& field_sizes) {
13791379
}(std::tuple_cat(fragment.dimensions(), fragment.attributes()));
13801380
}
13811381

1382+
template <typename Asserter, FragmentType F>
1383+
void resize_fields(F& fragment, const auto& field_sizes) {
1384+
std::apply(
1385+
[field_sizes](auto&... outfield) {
1386+
std::apply(
1387+
[&](const auto&... field_cursor) {
1388+
(outfield.finish_multipart_read(field_cursor), ...);
1389+
},
1390+
field_sizes);
1391+
},
1392+
std::tuple_cat(fragment.dimensions(), fragment.attributes()));
1393+
}
1394+
13821395
} // namespace query
13831396

13841397
} // namespace tiledb::test::templates

0 commit comments

Comments
 (0)