| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a80f660 commit efd6630
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,12 +6,14 @@ const { Worker } = require('worker_threads'); | |||
| 6 | 6 | const binding = path.resolve(__dirname, `./build/${common.buildType}/binding`); | |
| 7 | 7 | const { getFreeCallCount } = require(binding); | |
| 8 | 8 | ||
| 9 | + // getFreeCallCount initial value is 0 | ||
| 10 | + assert.strictEqual(getFreeCallCount(), 0); | ||
| 11 | + | ||
| 9 | 12 | // Test that buffers allocated with a free callback through our APIs are | |
| 10 | 13 | // released when a Worker owning it exits. | |
| 11 | 14 | ||
| 12 | 15 | const w = new Worker(`require(${JSON.stringify(binding)})`, { eval: true }); | |
| 13 | 16 | ||
| 14 | - assert.strictEqual(getFreeCallCount(), 0); | ||
| 15 | 17 | w.on('exit', common.mustCall(() => { | |
| 16 | 18 | assert.strictEqual(getFreeCallCount(), 1); | |
| 17 | 19 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments