diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 2 | ||||
-rw-r--r-- | tests/sdl_audio.c | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/runner.py b/tests/runner.py index 1f0cba23..97ca87e8 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6799,7 +6799,7 @@ elif 'browser' in str(sys.argv): browser.harness_queue.put('http://localhost:8888/' + html_file) output = '[no http server activity]' start = time.time() - while time.time() - start < 5: + while time.time() - start < 60: if not queue.empty(): output = queue.get() break diff --git a/tests/sdl_audio.c b/tests/sdl_audio.c index 4927d868..938df3c4 100644 --- a/tests/sdl_audio.c +++ b/tests/sdl_audio.c @@ -10,14 +10,23 @@ void play2(); void play() { int channel = Mix_PlayChannel(-1, sound, 1); - assert(channel >= 0); + assert(channel == 0); emscripten_run_script("setTimeout(Module['_play2'], 500)"); } +void done(int channel) { + assert(channel == 1); + + int result = 1; + REPORT_RESULT(); +} + void play2() { + Mix_ChannelFinished(done); + int channel2 = Mix_PlayChannel(-1, sound2, 1); - assert(channel2 >= 0); + assert(channel2 == 1); } int main(int argc, char **argv) { @@ -42,9 +51,6 @@ int main(int argc, char **argv) { printf("you should hear two sounds. press the button to replay!\n"); - int result = 1; - REPORT_RESULT(); - return 0; } |