diff --git a/test/test_other.py b/test/test_other.py index a80e34bafa37e..bd8a0bc9ffa93 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -6426,28 +6426,21 @@ def test_file_packager_huge(self): self.assertContained(MESSAGE, err) self.clear() - @parameterized({ - '': (True,), - 'wasm2js': (False,), - }) - def test_massive_alloc(self, wasm): + @also_with_wasm2js + def test_memory_growth(self): create_file('main.c', r''' -#include +#include #include int main() { - volatile long x = (long)malloc(1024 * 1024 * 1400); - return x == 0; // can't alloc it, but don't fail catastrophically, expect null + void* x = malloc(256 * 1024 * 1024); + assert(x != NULL); + return 0; } - ''') - cmd = [EMCC, 'main.c', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=16MB'] - if not wasm: - cmd += ['-sWASM=0'] - self.run_process(cmd) - # just care about message regarding allocating over 1GB of memory - output = self.run_js('a.out.js') - if not wasm: - self.assertContained('Warning: Enlarging memory arrays, this is not fast! 16777216,1468137472\n', output) +''') + output = self.do_runf('main.c', cflags=['-sALLOW_MEMORY_GROWTH']) + if self.is_wasm2js(): + self.assertContained('Warning: Enlarging memory arrays, this is not fast! 16908288,268566528\n', output) @also_with_wasm2js @parameterized({