Skip to content

Commit ca92aaf

Browse files
authored
[WasmFS] Generalize test_dlmalloc_partial so it doesn't fail on extra WasmFS allocs (#16128)
The test did a printf inside a hook for each malloc. WasmFS has more allocations (it allocates internal buffers) so it would actually infinite loop here. To avoid this issue, which is not what the test cares about, use a lower-level logging function and don't care about the size of the allocation.
1 parent 1ac2418 commit ca92aaf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5982,14 +5982,15 @@ def test_dlmalloc_large(self):
59825982
def test_dlmalloc_partial(self):
59835983
# present part of the symbols of dlmalloc, not all
59845984
src = read_file(test_file('new.cpp')).replace('{{{ NEW }}}', 'new int').replace('{{{ DELETE }}}', 'delete') + '''
5985+
#include <emscripten/console.h>
59855986
#include <new>
59865987
59875988
void* operator new(size_t size) {
5988-
printf("new %zu!\\n", size);
5989+
emscripten_console_log("new!");
59895990
return malloc(size);
59905991
}
59915992
'''
5992-
self.do_run(src, 'new 4!\n*1,0*')
5993+
self.do_run(src, 'new!\n*1,0*')
59935994

59945995
@no_asan('asan also changes malloc, and that ends up linking in new twice')
59955996
@no_lsan('lsan also changes malloc, and that ends up linking in new twice')

0 commit comments

Comments
 (0)