Skip to content

Commit

Permalink
ringbuffer test: dump failed value to stderr before aborting
Browse files Browse the repository at this point in the history
  • Loading branch information
salcock committed May 9, 2024
1 parent 06fc90d commit ccca04c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test-datastruct-ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ static void * consumer(void * a) {
void *value;
for (i = NULL; i < TEST_SIZE; i++) {
value = libtrace_ringbuffer_read(rb);
if (value != i) {
fprintf(stderr, "value: %p i: %p\n", value, i);
}
assert(value == i);
}
return 0;
Expand All @@ -40,6 +43,9 @@ static void * consumer_bulk(void * a) {
void *value;
for (i = NULL; i < TEST_SIZE; i++) {
assert (libtrace_ringbuffer_read_bulk(rb, &value, 1, 1) == 1);
if (value != i) {
fprintf(stderr, "value: %p i: %p\n", value, i);
}
assert(value == i);
}
return 0;
Expand Down

0 comments on commit ccca04c

Please sign in to comment.