Skip to content

Commit

Permalink
Add add'l checks in test-restart-stopped-zarr-resets-threadpool.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Dec 11, 2023
1 parent b2f2cc5 commit 9ed928e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/restart-stopped-zarr-resets-threadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ configure(struct Storage* zarr)
}

void
acquire_one_frame(struct Storage* zarr)
start_write_stop(struct Storage* zarr)
{
CHECK(DeviceState_Running == zarr->start(zarr));
struct ImageShape shape = {
Expand All @@ -119,14 +119,16 @@ acquire_one_frame(struct Storage* zarr)

auto* frame = (struct VideoFrame*)malloc(sizeof(VideoFrame) + 64 * 48);
frame->bytes_of_frame = sizeof(*frame) + 64 * 48;

frame->shape = shape;
frame->frame_id = 0;
frame->hardware_frame_id = 0;
frame->timestamps = { 0, 0 };

// if the thread pool is not available, this will fail
size_t nbytes{ frame->bytes_of_frame };
zarr->append(zarr, frame, &nbytes);
CHECK(DeviceState_Running == zarr->append(zarr, frame, &nbytes));
CHECK(nbytes == 64 * 48 + sizeof(*frame));

free(frame);

Expand All @@ -145,8 +147,8 @@ main()

configure(zarr);

acquire_one_frame(zarr);
acquire_one_frame(zarr); // thread pool should reset here
start_write_stop(zarr);
start_write_stop(zarr); // thread pool should reset here

lib_close(&lib);
return 0;
Expand Down

0 comments on commit 9ed928e

Please sign in to comment.