From 4ffa943c3f25d801bb89744c94850484dc99231b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 12 Aug 2013 17:28:38 +0200 Subject: [PATCH] test: fix up internet/test-dns after api change * The test calls an internal API that changed in commit ca9eb71. * Trying to reverse-lookup a bogus hostname now returns EINVAL rather than the (bogus!) status code ENOTIMP. --- test/internet/test-dns.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 7777223..5f360b4 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -145,7 +145,7 @@ TEST(function test_reverse_bogus(done) { } assert.ok(error instanceof Error); - assert.strictEqual(error.errno, 'ENOTIMP'); + assert.strictEqual(error.errno, 'EINVAL'); done(); }); @@ -410,9 +410,12 @@ TEST(function test_lookup_localhost_ipv4(done) { var getaddrinfoCallbackCalled = false; console.log('looking up nodejs.org...'); -var req = process.binding('cares_wrap').getaddrinfo('nodejs.org'); -req.oncomplete = function(domains) { +var req = {}; +var err = process.binding('cares_wrap').getaddrinfo(req, 'nodejs.org', 4); + +req.oncomplete = function(err, domains) { + assert.strictEqual(err, 0); console.log('nodejs.org = ', domains); assert.ok(Array.isArray(domains)); assert.ok(domains.length >= 1); @@ -420,8 +423,6 @@ req.oncomplete = function(domains) { getaddrinfoCallbackCalled = true; }; - - process.on('exit', function() { console.log(completed + ' tests completed'); assert.equal(running, false); -- 2.7.4