Skip to content

Commit c826af7

Browse files
devsnekaddaleax
authored andcommitted
test: clean up wasm fixtures
PR-URL: #25360 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent c1aa5f0 commit c826af7

13 files changed

+27
-22
lines changed

test/fixtures/shared-memory.wasm

26 Bytes
Binary file not shown.

test/fixtures/shared-memory.wat

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt)
2+
;; $ wat2wasm --enable-threads shared-memory.wat -o shared-memory.wasm
3+
4+
(module
5+
;; Create shared memory with initial 1 page (64KiB) and max 1 page
6+
(memory $mem 1 1 shared)
7+
(export "memory" (memory $mem))
8+
)

test/fixtures/simple.wasm

41 Bytes
Binary file not shown.

test/fixtures/simple.wat

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt)
2+
;; $ wat2wasm simple.wat -o simple.wasm
3+
4+
(module
5+
(func $add (param $a i32) (param $b i32) (result i32)
6+
;; return $a + $b
7+
(i32.add (get_local $a) (get_local $b))
8+
)
9+
10+
(export "add" (func $add))
11+
)

test/fixtures/test.wasm

-50 Bytes
Binary file not shown.

test/fixtures/test.wat

-10
This file was deleted.
-36 Bytes
Binary file not shown.

test/fixtures/wasm-threads-shared-memory.wat

-4
This file was deleted.

test/parallel/test-util-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding');
99
const { JSStream } = internalBinding('js_stream');
1010

1111
const external = (new JSStream())._externalStream;
12-
const wasmBuffer = fixtures.readSync('test.wasm');
12+
const wasmBuffer = fixtures.readSync('simple.wasm');
1313

1414
for (const [ value, _method ] of [
1515
[ external, 'isExternal' ],

test/parallel/test-v8-serdes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const os = require('os');
1212
const circular = {};
1313
circular.circular = circular;
1414

15-
const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm'));
15+
const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));
1616

1717
const objects = [
1818
{ foo: 'bar' },
@@ -238,5 +238,5 @@ const deserializerTypeError =
238238
{
239239
const deserializedWasmModule = v8.deserialize(v8.serialize(wasmModule));
240240
const instance = new WebAssembly.Instance(deserializedWasmModule);
241-
assert.strictEqual(instance.exports.addTwo(10, 20), 30);
241+
assert.strictEqual(instance.exports.add(10, 20), 30);
242242
}

test/parallel/test-wasm-simple.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ require('../common');
44
const assert = require('assert');
55
const fixtures = require('../common/fixtures');
66

7-
const buffer = fixtures.readSync('test.wasm');
7+
const buffer = fixtures.readSync('simple.wasm');
88

99
assert.ok(WebAssembly.validate(buffer), 'Buffer should be valid WebAssembly');
1010

1111
WebAssembly.instantiate(buffer, {}).then((results) => {
1212
// Exported function should add two numbers.
1313
assert.strictEqual(
14-
results.instance.exports.addTwo(10, 20),
14+
results.instance.exports.add(10, 20),
1515
30
1616
);
1717
});

test/parallel/test-worker-message-port-wasm-module.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const assert = require('assert');
55
const fixtures = require('../common/fixtures');
66

77
const { Worker } = require('worker_threads');
8-
const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm'));
8+
const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));
99

1010
const worker = new Worker(`
1111
const { parentPort } = require('worker_threads');
1212
parentPort.once('message', ({ wasmModule }) => {
1313
const instance = new WebAssembly.Instance(wasmModule);
14-
parentPort.postMessage(instance.exports.addTwo(10, 20));
14+
parentPort.postMessage(instance.exports.add(10, 20));
1515
});
1616
`, { eval: true });
1717

test/parallel/test-worker-message-port-wasm-threads.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { MessageChannel, Worker } = require('worker_threads');
88
// through MessageChannels (without crashing).
99

1010
const fixtures = require('../common/fixtures');
11-
const wasmSource = fixtures.readSync('wasm-threads-shared-memory.wasm');
11+
const wasmSource = fixtures.readSync('shared-memory.wasm');
1212
const wasmModule = new WebAssembly.Module(wasmSource);
1313
const instance = new WebAssembly.Instance(wasmModule);
1414

0 commit comments

Comments
 (0)