From 24f65ab1c36d3642f028c608705121833997a80b Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Fri, 23 Aug 2024 18:31:42 -0500 Subject: [PATCH] Change wasm call method --- docs/_static/test-c.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/_static/test-c.html b/docs/_static/test-c.html index ba12787e..b1521a3b 100644 --- a/docs/_static/test-c.html +++ b/docs/_static/test-c.html @@ -20,8 +20,7 @@ for (let p = 1; p < 10000; p++) { if ([12, ].includes(p)) continue; const formattedQuestion = `${p}`.padStart(4, '0'); - const func = wasm[`_p${formattedQuestion}`]; - if (func === undefined) continue; + if (wasm[`_p${formattedQuestion}`] === undefined) continue; let expected = get_js_answer(p); if (typeof expected === 'bigint') { expected = Number(expected); @@ -29,10 +28,7 @@ describe(`run test ${p}`, function() { this.timeout(Infinity); it(`should return ${expected}`, () => { - let answer = func(); - if (typeof expected === 'string') { - answer = wasm.UTF8ToString(answer); - } + let answer = wasm.ccall(`p${formattedQuestion}`, typeof expected, [], []); console.log(p, answer, expected); if (answer !== expected) { throw new Error();