From: Ben Noordhuis Date: Mon, 12 Aug 2013 15:28:38 +0000 (+0200) Subject: test: fix up internet/test-dns after api change X-Git-Tag: v0.11.6~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ffa943c3f25d801bb89744c94850484dc99231b;p=platform%2Fupstream%2Fnodejs.git 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. --- 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);