From d7be8423e5f8b88f5c8f8ab2724664d8eac9ee9b Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Fri, 23 Aug 2024 21:34:38 +0300 Subject: [PATCH] Add test coverage. --- test/src/test-cppapi-aggregates.cc | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/test/src/test-cppapi-aggregates.cc b/test/src/test-cppapi-aggregates.cc index e2286a87932..5136decc3e1 100644 --- a/test/src/test-cppapi-aggregates.cc +++ b/test/src/test-cppapi-aggregates.cc @@ -173,7 +173,7 @@ void CppAggregatesFx::generate_test_params() { nullable_ = GENERATE(true, false); allow_dups_ = GENERATE(true, false); set_qc_values_ = {false}; - layout_values_ = {TILEDB_UNORDERED}; + layout_values_ = {TILEDB_ROW_MAJOR, TILEDB_UNORDERED}; use_dim_values_ = {true, false}; if (nullable_ || !std::is_same::value) { use_dim_values_ = {false}; @@ -195,6 +195,11 @@ void CppAggregatesFx::run_all_combinations(std::function fn) { for (bool set_qc : set_qc_values_) { set_qc_ = set_qc; for (tiledb_layout_t layout : layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!dense_ && request_data && layout != TILEDB_UNORDERED) + continue; layout_ = layout; fn(); } @@ -1444,6 +1449,11 @@ TEST_CASE_METHOD( for (bool set_qc : set_qc_values_) { set_qc_ = set_qc; for (tiledb_layout_t layout : layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!dense_ && request_data && layout != TILEDB_UNORDERED) + continue; layout_ = layout; Query query(ctx_, array, TILEDB_READ); @@ -1824,6 +1834,11 @@ TEMPLATE_LIST_TEST_CASE( for (bool set_qc : fx.set_qc_values_) { fx.set_qc_ = set_qc; for (tiledb_layout_t layout : fx.layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!fx.dense_ && request_data && layout != TILEDB_UNORDERED) + continue; fx.layout_ = layout; Query query(fx.ctx_, array, TILEDB_READ); @@ -2048,6 +2063,11 @@ TEST_CASE_METHOD( for (bool set_qc : set_qc_values_) { set_qc_ = set_qc; for (tiledb_layout_t layout : layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!dense_ && request_data && layout != TILEDB_UNORDERED) + continue; layout_ = layout; Query query(ctx_, array, TILEDB_READ); @@ -2146,6 +2166,11 @@ TEST_CASE_METHOD( for (bool set_qc : set_qc_values_) { set_qc_ = set_qc; for (tiledb_layout_t layout : layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!dense_ && layout != TILEDB_UNORDERED) + continue; layout_ = layout; Query query(ctx_, array, TILEDB_READ); @@ -2285,6 +2310,11 @@ TEST_CASE_METHOD( for (bool set_qc : set_qc_values_) { set_qc_ = set_qc; for (tiledb_layout_t layout : layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (layout != TILEDB_UNORDERED) + continue; layout_ = layout; Query query(ctx_, array, TILEDB_READ); @@ -2365,6 +2395,11 @@ TEMPLATE_LIST_TEST_CASE_METHOD( for (bool set_qc : CppAggregatesFx::set_qc_values_) { CppAggregatesFx::set_qc_ = set_qc; for (tiledb_layout_t layout : CppAggregatesFx::layout_values_) { + // Filter invalid combination. The legacy reader does not support + // aggregates, and we cannot automatically switch to unordered + // reads if we are requesting both the aggregates and the data. + if (!CppAggregatesFx::dense_ && layout != TILEDB_UNORDERED) + continue; CppAggregatesFx::layout_ = layout; Query query(CppAggregatesFx::ctx_, array, TILEDB_READ);