Skip to content

Commit

Permalink
Don't use assert() in browser.test_modularize test, which is not visi…
Browse files Browse the repository at this point in the history
…ble in all test code. Fixes a noisy 'assert is undefined' print during the test.
  • Loading branch information
juj committed Nov 10, 2017
1 parent ff680cd commit 3e70fb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/browser_test_hello_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2955,7 +2955,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
});
});
'''),
Expand Down

0 comments on commit 3e70fb9

Please sign in to comment.