aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/tst-arc4random-thread.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/stdlib/tst-arc4random-thread.c b/stdlib/tst-arc4random-thread.c
index b7889b653f..cb7c3514af 100644
--- a/stdlib/tst-arc4random-thread.c
+++ b/stdlib/tst-arc4random-thread.c
@@ -49,7 +49,7 @@ static const int sizes[] = { 12, 15, 16, 17, 24, 31, max_size };
struct blob
{
unsigned int size;
- int thread_id;
+ int thread_id; /* -1 means after fork. */
unsigned int index;
unsigned char bytes[max_size];
};
@@ -323,6 +323,20 @@ do_test_func (const char *fname, void (*func)(unsigned char *, size_t))
}
}
+ for (struct blob *p = dynarray_blob_begin (&global_result);
+ p < end; ++p)
+ {
+ unsigned int sum = 0;
+ for (unsigned int i = 0; i < p->size; ++i)
+ sum += p->bytes[i];
+ if (sum == 0)
+ {
+ support_record_failure ();
+ printf ("error: all-zero result of length %u on thread %d\n",
+ p->size, p->thread_id);
+ }
+ }
+
dynarray_blob_free (&global_result);
return 0;