Skip to content

Commit

Permalink
Assert that INCOMPLETE still makes progress
Browse files Browse the repository at this point in the history
  • Loading branch information
rroelke committed Sep 17, 2024
1 parent 32d6dad commit 72a750e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/c_api/aggregates_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* of the string dimension using aggregates.
*/

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <tiledb/tiledb.h>
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 72a750e

Please sign in to comment.