diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2017-04-03 12:50:49 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2017-04-03 12:50:49 -0700 |
commit | dced510997cc7a116dc42127603b1d604a3c35a2 (patch) | |
tree | 82189ca92d6b5db157190c6bed61359a2f2721d5 /test/core/support | |
parent | d26250be35a0e0921cb97f43b13ce14343ee4c7d (diff) |
Fix arena_test on 32-bit platforms (includes Windows)
Diffstat (limited to 'test/core/support')
-rw-r--r-- | test/core/support/arena_test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/core/support/arena_test.c b/test/core/support/arena_test.c index 35b2bbd1b1..ab45fac4c2 100644 --- a/test/core/support/arena_test.c +++ b/test/core/support/arena_test.c @@ -83,9 +83,13 @@ static void test(const char *name, size_t init_size, const size_t *allocs, static const size_t allocs_##name[] = {__VA_ARGS__}; \ test(#name, init_size, allocs_##name, GPR_ARRAY_SIZE(allocs_##name)) -#define CONCURRENT_TEST_ITERATIONS 100000 #define CONCURRENT_TEST_THREADS 100 +size_t concurrent_test_iterations() { + if (sizeof(void*) < 8) return 1000; + return 100000; +} + typedef struct { gpr_event ev_start; gpr_arena *arena; @@ -94,7 +98,7 @@ typedef struct { static void concurrent_test_body(void *arg) { concurrent_test_args *a = arg; gpr_event_wait(&a->ev_start, gpr_inf_future(GPR_CLOCK_REALTIME)); - for (size_t i = 0; i < CONCURRENT_TEST_ITERATIONS; i++) { + for (size_t i = 0; i < concurrent_test_iterations(); i++) { *(char *)gpr_arena_alloc(a->arena, 1) = (char)i; } } |