diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-05-02 02:05:08 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-05-02 16:05:08 +1000 |
commit | b59476e03da04c68622775830c0968a6ab160aaf (patch) | |
tree | 9597ff97c47f1447627c57c1748dfde808be76a7 /test/bloom | |
parent | 701e83d37a3363fa02c54677586dd5b2b097ed43 (diff) | |
download | mongo-b59476e03da04c68622775830c0968a6ab160aaf.tar.gz |
WT-2600: clean up test program includes (#2708)
Clean up test program #includes and add generic handling to memory allocation failures.
Now the test programs include <wt_internal.h>, the local includes
aren't necessary, and it makes lint sad.
Diffstat (limited to 'test/bloom')
-rw-r--r-- | test/bloom/test_bloom.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c index f95bc7faaf9..6955813dc68 100644 --- a/test/bloom/test_bloom.c +++ b/test/bloom/test_bloom.c @@ -189,9 +189,7 @@ run(void) * ensure the value doesn't overlap with existing values. */ item.size = g.c_key_max + 10; - item.data = calloc(item.size, 1); - if (item.data == NULL) - testutil_die(ENOMEM, "value buffer malloc"); + item.data = dcalloc(item.size, 1); memset((void *)item.data, 'a', item.size); for (i = 0, fp = 0; i < g.c_ops; i++) { ((uint8_t *)item.data)[i % item.size] = @@ -232,14 +230,10 @@ populate_entries(void) srand(g.c_srand); - entries = calloc(g.c_ops, sizeof(uint8_t *)); - if (entries == NULL) - testutil_die(ENOMEM, "key buffer malloc"); + entries = dcalloc(g.c_ops, sizeof(uint8_t *)); for (i = 0; i < g.c_ops; i++) { - entries[i] = calloc(g.c_key_max, sizeof(uint8_t)); - if (entries[i] == NULL) - testutil_die(ENOMEM, "key buffer malloc 2"); + entries[i] = dcalloc(g.c_key_max, sizeof(uint8_t)); for (j = 0; j < g.c_key_max; j++) entries[i][j] = 'a' + ((uint8_t)rand() % 26); } |