From 71760a55aea3929bdeea24d9f0f01d24f04395ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Fri, 13 Oct 2017 20:17:08 +0300 Subject: [PATCH] Don't use assert() in browser.test_modularize test, which is not visible in all test code. Fixes a noisy 'assert is undefined' print during the test. --- tests/browser_test_hello_world.c | 4 ++-- tests/test_browser.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/browser_test_hello_world.c b/tests/browser_test_hello_world.c index 9e4234db1d373..fa7e76eba5ac5 100644 --- a/tests/browser_test_hello_world.c +++ b/tests/browser_test_hello_world.c @@ -15,8 +15,8 @@ int main() { }); printf("hello, world!\n"); EM_ASM({ - assert(Module.prints.length === 1, 'bad length'); - assert(Module.prints[0] == 'hello, world!', 'bad contents: ' + Module.prints[0]); + if (Module.prints.length !== 1) throw 'bad length ' + Module.prints.length; + if (Module.prints[0] !== 'hello, world!') throw 'bad contents: ' + Module.prints[0]; }); REPORT_RESULT(0); return 0; diff --git a/tests/test_browser.py b/tests/test_browser.py index 46909d6302e38..8fdc04f5902d3 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -2938,7 +2938,7 @@ def test_modularize(self): var helloOutside = HelloWorld({ noInitialRun: true }).then(function(hello) { setTimeout(function() { hello._main(); - assert(hello === helloOutside); // as we are async, helloOutside must have been set + if (hello !== helloOutside) throw 'helloOutside has not been set!'; // as we are async, helloOutside must have been set }); }); '''),