| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8cdc59b commit 3a77d1e
58 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,85 +1,84 @@ | |||
| 1 | - /* | ||
| 2 | - * Test Steps Explained | ||
| 3 | - * ==================== | ||
| 4 | - * | ||
| 5 | - * Initializing hooks: | ||
| 6 | - * | ||
| 7 | - * We initialize 3 hooks. For hook2 and hook3 we register a callback for the | ||
| 8 | - * "before" and in case of hook3 also for the "after" invocations. | ||
| 9 | - * | ||
| 10 | - * Enabling hooks initially: | ||
| 11 | - * | ||
| 12 | - * We only enable hook1 and hook3 initially. | ||
| 13 | - * | ||
| 14 | - * Enabling hook2: | ||
| 15 | - * | ||
| 16 | - * When hook3's "before" invocation occurs we enable hook2. Since this | ||
| 17 | - * happens right before calling `onfirstImmediate` hook2 will miss all hook | ||
| 18 | - * invocations until then, including the "init" and "before" of the first | ||
| 19 | - * Immediate. | ||
| 20 | - * However afterwards it collects all invocations that follow on the first | ||
| 21 | - * Immediate as well as all invocations on the second Immediate. | ||
| 22 | - * | ||
| 23 | - * This shows that a hook can enable another hook inside a life time event | ||
| 24 | - * callback. | ||
| 25 | - * | ||
| 26 | - * | ||
| 27 | - * Disabling hook1 | ||
| 28 | - * | ||
| 29 | - * Since we registered the "before" callback for hook2 it will execute it | ||
| 30 | - * right before `onsecondImmediate` is called. | ||
| 31 | - * At that point we disable hook1 which is why it will miss all invocations | ||
| 32 | - * afterwards and thus won't include the second "after" as well as the | ||
| 33 | - * "destroy" invocations | ||
| 34 | - * | ||
| 35 | - * This shows that a hook can disable another hook inside a life time event | ||
| 36 | - * callback. | ||
| 37 | - * | ||
| 38 | - * Disabling hook3 | ||
| 39 | - * | ||
| 40 | - * When the second "after" invocation occurs (after onsecondImmediate), hook3 | ||
| 41 | - * disables itself. | ||
| 42 | - * As a result it will not receive the "destroy" invocation. | ||
| 43 | - * | ||
| 44 | - * This shows that a hook can disable itself inside a life time event callback. | ||
| 45 | - * | ||
| 46 | - * Sample Test Log | ||
| 47 | - * =============== | ||
| 48 | - * | ||
| 49 | - * - setting up first Immediate | ||
| 50 | - * hook1.init.uid-5 | ||
| 51 | - * hook3.init.uid-5 | ||
| 52 | - * - finished setting first Immediate | ||
| 53 | - | ||
| 54 | - * hook1.before.uid-5 | ||
| 55 | - * hook3.before.uid-5 | ||
| 56 | - * - enabled hook2 | ||
| 57 | - * - entering onfirstImmediate | ||
| 58 | - | ||
| 59 | - * - setting up second Immediate | ||
| 60 | - * hook1.init.uid-6 | ||
| 61 | - * hook3.init.uid-6 | ||
| 62 | - * hook2.init.uid-6 | ||
| 63 | - * - finished setting second Immediate | ||
| 1 | + // Test Steps Explained | ||
| 2 | + // ==================== | ||
| 3 | + // | ||
| 4 | + // Initializing hooks: | ||
| 5 | + // | ||
| 6 | + // We initialize 3 hooks. For hook2 and hook3 we register a callback for the | ||
| 7 | + // "before" and in case of hook3 also for the "after" invocations. | ||
| 8 | + // | ||
| 9 | + // Enabling hooks initially: | ||
| 10 | + // | ||
| 11 | + // We only enable hook1 and hook3 initially. | ||
| 12 | + // | ||
| 13 | + // Enabling hook2: | ||
| 14 | + // | ||
| 15 | + // When hook3's "before" invocation occurs we enable hook2. Since this | ||
| 16 | + // happens right before calling `onfirstImmediate` hook2 will miss all hook | ||
| 17 | + // invocations until then, including the "init" and "before" of the first | ||
| 18 | + // Immediate. | ||
| 19 | + // However afterwards it collects all invocations that follow on the first | ||
| 20 | + // Immediate as well as all invocations on the second Immediate. | ||
| 21 | + // | ||
| 22 | + // This shows that a hook can enable another hook inside a life time event | ||
| 23 | + // callback. | ||
| 24 | + // | ||
| 25 | + // | ||
| 26 | + // Disabling hook1 | ||
| 27 | + // | ||
| 28 | + // Since we registered the "before" callback for hook2 it will execute it | ||
| 29 | + // right before `onsecondImmediate` is called. | ||
| 30 | + // At that point we disable hook1 which is why it will miss all invocations | ||
| 31 | + // afterwards and thus won't include the second "after" as well as the | ||
| 32 | + // "destroy" invocations | ||
| 33 | + // | ||
| 34 | + // This shows that a hook can disable another hook inside a life time event | ||
| 35 | + // callback. | ||
| 36 | + // | ||
| 37 | + // Disabling hook3 | ||
| 38 | + // | ||
| 39 | + // When the second "after" invocation occurs (after onsecondImmediate), hook3 | ||
| 40 | + // disables itself. | ||
| 41 | + // As a result it will not receive the "destroy" invocation. | ||
| 42 | + // | ||
| 43 | + // This shows that a hook can disable itself inside a life time event callback. | ||
| 44 | + // | ||
| 45 | + // Sample Test Log | ||
| 46 | + // =============== | ||
| 47 | + // | ||
| 48 | + // - setting up first Immediate | ||
| 49 | + // hook1.init.uid-5 | ||
| 50 | + // hook3.init.uid-5 | ||
| 51 | + // - finished setting first Immediate | ||
| 52 | + // | ||
| 53 | + // hook1.before.uid-5 | ||
| 54 | + // hook3.before.uid-5 | ||
| 55 | + // - enabled hook2 | ||
| 56 | + // - entering onfirstImmediate | ||
| 57 | + // | ||
| 58 | + // - setting up second Immediate | ||
| 59 | + // hook1.init.uid-6 | ||
| 60 | + // hook3.init.uid-6 | ||
| 61 | + // hook2.init.uid-6 | ||
| 62 | + // - finished setting second Immediate | ||
| 63 | + // | ||
| 64 | + // - exiting onfirstImmediate | ||
| 65 | + // hook1.after.uid-5 | ||
| 66 | + // hook3.after.uid-5 | ||
| 67 | + // hook2.after.uid-5 | ||
| 68 | + // hook1.destroy.uid-5 | ||
| 69 | + // hook3.destroy.uid-5 | ||
| 70 | + // hook2.destroy.uid-5 | ||
| 71 | + // hook1.before.uid-6 | ||
| 72 | + // hook3.before.uid-6 | ||
| 73 | + // hook2.before.uid-6 | ||
| 74 | + // - disabled hook1 | ||
| 75 | + // - entering onsecondImmediate | ||
| 76 | + // - exiting onsecondImmediate | ||
| 77 | + // hook3.after.uid-6 | ||
| 78 | + // - disabled hook3 | ||
| 79 | + // hook2.after.uid-6 | ||
| 80 | + // hook2.destroy.uid-6 | ||
| 64 | 81 | ||
| 65 | - * - exiting onfirstImmediate | ||
| 66 | - * hook1.after.uid-5 | ||
| 67 | - * hook3.after.uid-5 | ||
| 68 | - * hook2.after.uid-5 | ||
| 69 | - * hook1.destroy.uid-5 | ||
| 70 | - * hook3.destroy.uid-5 | ||
| 71 | - * hook2.destroy.uid-5 | ||
| 72 | - * hook1.before.uid-6 | ||
| 73 | - * hook3.before.uid-6 | ||
| 74 | - * hook2.before.uid-6 | ||
| 75 | - * - disabled hook1 | ||
| 76 | - * - entering onsecondImmediate | ||
| 77 | - * - exiting onsecondImmediate | ||
| 78 | - * hook3.after.uid-6 | ||
| 79 | - * - disabled hook3 | ||
| 80 | - * hook2.after.uid-6 | ||
| 81 | - * hook2.destroy.uid-6 | ||
| 82 | - */ | ||
| 83 | 82 | ||
| 84 | 83 | 'use strict'; | |
| 85 | 84 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -194,11 +194,9 @@ const PIPE = (() => { | |||
| 194 | 194 | return path.join(pipePrefix, pipeName); | |
| 195 | 195 | })(); | |
| 196 | 196 | ||
| 197 | - /* | ||
| 198 | - * Check that when running a test with | ||
| 199 | - * `$node --abort-on-uncaught-exception $file child` | ||
| 200 | - * the process aborts. | ||
| 201 | - */ | ||
| 197 | + // Check that when running a test with | ||
| 198 | + // `$node --abort-on-uncaught-exception $file child` | ||
| 199 | + // the process aborts. | ||
| 202 | 200 | function childShouldThrowAndAbort() { | |
| 203 | 201 | let testCmd = ''; | |
| 204 | 202 | if (!isWindows) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,19 +103,18 @@ TEST(async function test_lookup_ipv6_explicit(done) { | |||
| 103 | 103 | checkWrap(req); | |
| 104 | 104 | }); | |
| 105 | 105 | ||
| 106 | - /* This ends up just being too problematic to test | ||
| 107 | - TEST(function test_lookup_ipv6_implicit(done) { | ||
| 108 | - var req = dns.lookup(addresses.INET6_HOST, function(err, ip, family) { | ||
| 109 | - assert.ifError(err); | ||
| 110 | - assert.ok(net.isIPv6(ip)); | ||
| 111 | - assert.strictEqual(family, 6); | ||
| 106 | + // This ends up just being too problematic to test | ||
| 107 | + // TEST(function test_lookup_ipv6_implicit(done) { | ||
| 108 | + // var req = dns.lookup(addresses.INET6_HOST, function(err, ip, family) { | ||
| 109 | + // assert.ifError(err); | ||
| 110 | + // assert.ok(net.isIPv6(ip)); | ||
| 111 | + // assert.strictEqual(family, 6); | ||
| 112 | 112 | ||
| 113 | - done(); | ||
| 114 | - }); | ||
| 113 | + // done(); | ||
| 114 | + // }); | ||
| 115 | 115 | ||
| 116 | - checkWrap(req); | ||
| 117 | - }); | ||
| 118 | - */ | ||
| 116 | + // checkWrap(req); | ||
| 117 | + // }); | ||
| 119 | 118 | ||
| 120 | 119 | TEST(async function test_lookup_ipv6_explicit_object(done) { | |
| 121 | 120 | function validateResult(res) { | |
@@ -233,15 +232,15 @@ TEST(function test_lookupservice_ip_ipv6(done) { | |||
| 233 | 232 | checkWrap(req); | |
| 234 | 233 | }); | |
| 235 | 234 | ||
| 236 | - /* Disabled because it appears to be not working on linux. */ | ||
| 237 | - /* TEST(function test_lookup_localhost_ipv6(done) { | ||
| 238 | - var req = dns.lookup('localhost', 6, function(err, ip, family) { | ||
| 239 | - assert.ifError(err); | ||
| 240 | - assert.ok(net.isIPv6(ip)); | ||
| 241 | - assert.strictEqual(family, 6); | ||
| 242 | - | ||
| 243 | - done(); | ||
| 244 | - }); | ||
| 245 | - | ||
| 246 | - checkWrap(req); | ||
| 247 | - }); */ | ||
| 235 | + // Disabled because it appears to be not working on Linux. | ||
| 236 | + // TEST(function test_lookup_localhost_ipv6(done) { | ||
| 237 | + // var req = dns.lookup('localhost', 6, function(err, ip, family) { | ||
| 238 | + // assert.ifError(err); | ||
| 239 | + // assert.ok(net.isIPv6(ip)); | ||
| 240 | + // assert.strictEqual(family, 6); | ||
| 241 | + // | ||
| 242 | + // done(); | ||
| 243 | + // }); | ||
| 244 | + // | ||
| 245 | + // checkWrap(req); | ||
| 246 | + // }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,10 +20,9 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - /* | ||
| 24 | - * Repeated requests for a domain that fails to resolve | ||
| 25 | - * should trigger the error event after each attempt. | ||
| 26 | - */ | ||
| 23 | + | ||
| 24 | + // Repeated requests for a domain that fails to resolve | ||
| 25 | + // should trigger the error event after each attempt. | ||
| 27 | 26 | ||
| 28 | 27 | const common = require('../common'); | |
| 29 | 28 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,28 +31,28 @@ assert.strictEqual(makeCallback(this, | |||
| 31 | 31 | ||
| 32 | 32 | // TODO(node-api): napi_make_callback needs to support | |
| 33 | 33 | // strings passed for the func argument | |
| 34 | - /* | ||
| 35 | - const recv = { | ||
| 36 | - one: common.mustCall(function() { | ||
| 37 | - assert.strictEqual(0, arguments.length); | ||
| 38 | - assert.strictEqual(this, recv); | ||
| 39 | - return 42; | ||
| 40 | - }), | ||
| 41 | - two: common.mustCall(function(x) { | ||
| 42 | - assert.strictEqual(1, arguments.length); | ||
| 43 | - assert.strictEqual(this, recv); | ||
| 44 | - assert.strictEqual(x, 1337); | ||
| 45 | - return 42; | ||
| 46 | - }), | ||
| 47 | - }; | ||
| 34 | + // | ||
| 35 | + // const recv = { | ||
| 36 | + // one: common.mustCall(function() { | ||
| 37 | + // assert.strictEqual(0, arguments.length); | ||
| 38 | + // assert.strictEqual(this, recv); | ||
| 39 | + // return 42; | ||
| 40 | + // }), | ||
| 41 | + // two: common.mustCall(function(x) { | ||
| 42 | + // assert.strictEqual(1, arguments.length); | ||
| 43 | + // assert.strictEqual(this, recv); | ||
| 44 | + // assert.strictEqual(x, 1337); | ||
| 45 | + // return 42; | ||
| 46 | + // }), | ||
| 47 | + // }; | ||
| 48 | + // | ||
| 49 | + // assert.strictEqual(makeCallback(recv, 'one'), 42); | ||
| 50 | + // assert.strictEqual(makeCallback(recv, 'two', 1337), 42); | ||
| 51 | + // | ||
| 52 | + // // Check that callbacks on a receiver from a different context works. | ||
| 53 | + // const foreignObject = vm.runInNewContext('({ fortytwo() { return 42; } })'); | ||
| 54 | + // assert.strictEqual(makeCallback(foreignObject, 'fortytwo'), 42); | ||
| 48 | 55 | ||
| 49 | - assert.strictEqual(makeCallback(recv, 'one'), 42); | ||
| 50 | - assert.strictEqual(makeCallback(recv, 'two', 1337), 42); | ||
| 51 | - | ||
| 52 | - // Check that callbacks on a receiver from a different context works. | ||
| 53 | - const foreignObject = vm.runInNewContext('({ fortytwo() { return 42; } })'); | ||
| 54 | - assert.strictEqual(makeCallback(foreignObject, 'fortytwo'), 42); | ||
| 55 | - */ | ||
| 56 | 56 | ||
| 57 | 57 | // Check that the callback is made in the context of the receiver. | |
| 58 | 58 | const target = vm.runInNewContext(` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,9 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - /* | ||
| 4 | - * Fix for https://github.com/nodejs/node/issues/8266 | ||
| 5 | - * | ||
| 6 | - * Zero length Buffer objects should expose the `buffer` property of the | ||
| 7 | - * TypedArrays, via the `parent` property. | ||
| 8 | - */ | ||
| 3 | + // Fix for https://github.com/nodejs/node/issues/8266 | ||
| 4 | + // | ||
| 5 | + // Zero length Buffer objects should expose the `buffer` property of the | ||
| 6 | + // TypedArrays, via the `parent` property. | ||
| 9 | 7 | require('../common'); | |
| 10 | 8 | const assert = require('assert'); | |
| 11 | 9 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,13 +3,11 @@ | |||
| 3 | 3 | require('../common'); | |
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | ||
| 6 | - /* | ||
| 7 | - * We need to check the following things: | ||
| 8 | - * - We are correctly resolving big endian (doesn't mean anything for 8 bit) | ||
| 9 | - * - Correctly resolving little endian (doesn't mean anything for 8 bit) | ||
| 10 | - * - Correctly using the offsets | ||
| 11 | - * - Correctly interpreting values that are beyond the signed range as unsigned | ||
| 12 | - */ | ||
| 6 | + // We need to check the following things: | ||
| 7 | + // - We are correctly resolving big endian (doesn't mean anything for 8 bit) | ||
| 8 | + // - Correctly resolving little endian (doesn't mean anything for 8 bit) | ||
| 9 | + // - Correctly using the offsets | ||
| 10 | + // - Correctly interpreting values that are beyond the signed range as unsigned | ||
| 13 | 11 | ||
| 14 | 12 | { // OOB | |
| 15 | 13 | const data = Buffer.alloc(8); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,11 +27,9 @@ tmpdir.refresh(); | |||
| 27 | 27 | const assert = require('assert'); | |
| 28 | 28 | const { spawn } = require('child_process'); | |
| 29 | 29 | ||
| 30 | - /* | ||
| 31 | - Spawns 'pwd' with given options, then test | ||
| 32 | - - whether the exit code equals expectCode, | ||
| 33 | - - optionally whether the trimmed stdout result matches expectData | ||
| 34 | - */ | ||
| 30 | + // Spawns 'pwd' with given options, then test | ||
| 31 | + // - whether the exit code equals expectCode, | ||
| 32 | + // - optionally whether the trimmed stdout result matches expectData | ||
| 35 | 33 | function testCwd(options, expectCode = 0, expectData) { | |
| 36 | 34 | const child = spawn(...common.pwdCommand, options); | |
| 37 | 35 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,15 +47,13 @@ if (isWindows) { | |||
| 47 | 47 | echo = spawn('echo', ['hello\nnode\nand\nworld\n']); | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | - /* | ||
| 51 | - * grep and sed hang if the spawn function leaks file descriptors to child | ||
| 52 | - * processes. | ||
| 53 | - * This happens when calling pipe(2) and then forgetting to set the | ||
| 54 | - * FD_CLOEXEC flag on the resulting file descriptors. | ||
| 55 | - * | ||
| 56 | - * This test checks child processes exit, meaning they don't hang like | ||
| 57 | - * explained above. | ||
| 58 | - */ | ||
| 50 | + // If the spawn function leaks file descriptors to subprocesses, grep and sed | ||
| 51 | + // hang. | ||
| 52 | + // This happens when calling pipe(2) and then forgetting to set the | ||
| 53 | + // FD_CLOEXEC flag on the resulting file descriptors. | ||
| 54 | + // | ||
| 55 | + // This test checks child processes exit, meaning they don't hang like | ||
| 56 | + // explained above. | ||
| 59 | 57 | ||
| 60 | 58 | ||
| 61 | 59 | // pipe echo | grep | |
| Back | FazBrowse Home | New Git URL |
0 commit comments