diff options
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index d7b6cf53..67e316e4 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3970,7 +3970,7 @@ def process(filename): #include <stdio.h> #include <emscripten.h> - int main() { + int main(int argc, char **argv) { EM_ASM(Module.print('hello dere1')); EM_ASM( Module.print('hello dere2'); @@ -3981,11 +3981,19 @@ def process(filename): Module.print('hello dere' + 4); ); } + int sum = 0; + for (int i = 0; i < argc*3; i++) { + sum += EM_ASM_INT({ + Module.print('i: ' + [$0, ($1).toFixed(2)]); + return $0*2; + }, i, double(i)/12); + } + printf("sum: %d\n", sum); return 0; } ''' - self.do_run(src, 'hello dere1\nhello dere2\nhello dere3\nhello dere4\nhello dere3\nhello dere4\nhello dere3\nhello dere4\n') + self.do_run(src, 'hello dere1\nhello dere2\nhello dere3\nhello dere4\nhello dere3\nhello dere4\nhello dere3\nhello dere4\ni: 0,0.00\ni: 1,0.08\ni: 2,0.17\nsum: 6\n') def test_memorygrowth(self): if Settings.USE_TYPED_ARRAYS == 0: return self.skip('memory growth is only supported with typed arrays') |