From 72a750ece6b3432373748a1bcb5dd28ff9d78fbf Mon Sep 17 00:00:00 2001 From: Ryan Roelke Date: Tue, 17 Sep 2024 10:58:04 -0400 Subject: [PATCH] Assert that INCOMPLETE still makes progress --- examples/c_api/aggregates_string.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/c_api/aggregates_string.c b/examples/c_api/aggregates_string.c index 9437eb26681..00044cc3798 100644 --- a/examples/c_api/aggregates_string.c +++ b/examples/c_api/aggregates_string.c @@ -33,6 +33,7 @@ * of the string dimension using aggregates. */ +#include #include #include #include @@ -291,8 +292,15 @@ void read_array(tiledb_ctx_t* ctx) { tiledb_query_status_t status; TRY(ctx, tiledb_query_get_status(ctx, query, &status)); while (status == TILEDB_INCOMPLETE) { + const uint64_t num_results = a_size / sizeof(int32_t); + + // NB: this is not generically a valid assertion + // (see reading_incomplete.c) + // but is true by construction in this example + assert(num_results); + print_cells( - a_size / sizeof(int32_t), + num_results, rows_offsets, rows_data_size, rows_data,