diff --git a/test/node_modules/duplicate_symbols/common.h b/test/node_modules/duplicate_symbols/common.h index 2fbc3058bb..1c51a214d3 100644 --- a/test/node_modules/duplicate_symbols/common.h +++ b/test/node_modules/duplicate_symbols/common.h @@ -28,7 +28,8 @@ Something::PointerCheck(const Nan::FunctionCallbackInfo& info) { } else { // If no argument was passed in, we wrap the pointer to the `PointerCheck` // method in this addon into a `v8::External` and pass it into JavaScript. - v8result = Nan::New(reinterpret_cast(Something::PointerCheck)); + v8result = Nan::New( + reinterpret_cast(Something::PointerCheck)); } info.GetReturnValue().Set(v8result); } diff --git a/test/node_modules/duplicate_symbols/package.json b/test/node_modules/duplicate_symbols/package.json index 2b899ee565..89f80cbdf6 100644 --- a/test/node_modules/duplicate_symbols/package.json +++ b/test/node_modules/duplicate_symbols/package.json @@ -5,7 +5,8 @@ "main": "index.js", "private": true, "dependencies": { - "bindings": "~1.2.1" + "bindings": "~1.2.1", + "nan": "^2.0.0" }, "scripts": { "test": "node index.js" diff --git a/test/test-addon.js b/test/test-addon.js index 2c4befcace..12687de2ac 100644 --- a/test/test-addon.js +++ b/test/test-addon.js @@ -19,10 +19,8 @@ function runHello(hostProcess) { return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString() } -function runDuplicateBindings(hostProcess) { - if (!hostProcess) { - hostProcess = process.execPath - } +function runDuplicateBindings() { + const hostProcess = process.execPath; var testCode = "console.log((function(bindings) {" + "return bindings.pointerCheck1(bindings.pointerCheck2());" + @@ -70,15 +68,13 @@ test('make sure addon symbols do not overlap', function (t) { var addonPath = path.resolve(__dirname, 'node_modules', 'duplicate_symbols') // Set the loglevel otherwise the output disappears when run via 'npm test' var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - var logLines = stderr.toString().trim().split(/\r?\n/) + execFile(process.execPath, cmd, function (err, stdout, stderr) { + var logLines = stderr.trim().split(/\r?\n/) var lastLine = logLines[logLines.length-1] t.strictEqual(err, null) t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') t.strictEqual(runDuplicateBindings().trim(), 'not equal') }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') }) test('build simple addon in path with non-ascii characters', function (t) {