Replace variable arrays in tests with VARIABLE_ARRAY

This commit is contained in:
Mike Hommey 2014-05-21 17:24:08 +09:00 committed by Jason Evans
parent d6fd11413e
commit f41f143668
2 changed files with 3 additions and 3 deletions

View File

@ -64,8 +64,8 @@ hash_variant_verify(hash_variant_t variant)
{
const size_t hashbytes = hash_variant_bits(variant) / 8;
uint8_t key[256];
uint8_t hashes[hashbytes * 256];
uint8_t final[hashbytes];
VARIABLE_ARRAY(uint8_t, hashes, hashbytes * 256);
VARIABLE_ARRAY(uint8_t, final, hashbytes);
unsigned i;
uint32_t computed, expected;

View File

@ -285,7 +285,7 @@ TEST_BEGIN(test_arenas_initialized)
assert_d_eq(mallctl("arenas.narenas", &narenas, &sz, NULL, 0), 0,
"Unexpected mallctl() failure");
{
bool initialized[narenas];
VARIABLE_ARRAY(bool, initialized, narenas);
sz = narenas * sizeof(bool);
assert_d_eq(mallctl("arenas.initialized", initialized, &sz,