Skip to content

Commit bd13512

Browse files
committed
Files missed from previous commit...
1 parent 8ad0c4a commit bd13512

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

test/test_interactive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,14 @@ def test_audio_worklet_stereo_io_2gb(self):
339339
os.mkdir('audio_files')
340340
shutil.copy(test_file('webaudio/audio_files/emscripten-beat.mp3'), 'audio_files/')
341341
shutil.copy(test_file('webaudio/audio_files/emscripten-bass.mp3'), 'audio_files/')
342-
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMEMORY64', '-sINITIAL_MEMORY=2164260864', '-DTEST_OFFSET_GB=2'])
342+
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMEMORY64', '-sINITIAL_MEMORY=4200mb', '-DTEST_OFFSET_GB=2'])
343343

344344
# Same as 'test_audio_worklet_stereo_io_2gb' but with a 4GB offset
345345
def test_audio_worklet_stereo_io_4gb(self):
346346
os.mkdir('audio_files')
347347
shutil.copy(test_file('webaudio/audio_files/emscripten-beat.mp3'), 'audio_files/')
348348
shutil.copy(test_file('webaudio/audio_files/emscripten-bass.mp3'), 'audio_files/')
349-
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMEMORY64', '-sINITIAL_MEMORY=4311744512', '-DTEST_OFFSET_GB=4'])
349+
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sMEMORY64', '-sINITIAL_MEMORY=4200mb', '-DTEST_OFFSET_GB=4'])
350350

351351

352352
class interactive64(interactive):

test/webaudio/audioworklet_test_shared.inc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// Shared code for the audio worklet mixer tests.
22

3-
// Defines an offset in GB from where to start the stack (for testing >2GB and
4-
// >4GB heaps). See _main_().
5-
#ifndef TEST_OFFSET_GB
6-
#define TEST_OFFSET_GB 0
7-
#endif
8-
93
// Helper for MEMORY64 to cast an audio context or type to a void*
104
#define WA_2_VOIDP(ctx) ((void*) (intptr_t) ctx)
115
// Helper for MEMORY64 to cast a void* to an audio context or type
@@ -126,9 +120,16 @@ bool _main_(int stackSize) {
126120
return true;
127121
}
128122

123+
// Common entry point for the mixer tests
129124
int main() {
130-
if (_main_(AUDIO_STACK_SIZE)) {
131-
return EXIT_SUCCESS;
132-
}
133-
return EXIT_FAILURE;
125+
char* const workletStack = memalign(16, AUDIO_STACK_SIZE);
126+
printf("Audio worklet stack at 0x%p\n", workletStack);
127+
assert(workletStack);
128+
EMSCRIPTEN_WEBAUDIO_T context = emscripten_create_audio_context(NULL);
129+
emscripten_start_wasm_audio_worklet_thread_async(context, workletStack, AUDIO_STACK_SIZE, &initialised, NULL);
130+
#ifndef BROWSER_TEST
131+
// Special case: browser tests need to exit instantly, interactive tests need to wait
132+
emscripten_runtime_keepalive_push();
133+
#endif
134+
return EXIT_SUCCESS;
134135
}

0 commit comments

Comments
 (0)