Browse Source

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.
v0.11.6-release
Ben Noordhuis 12 years ago
parent
commit
4ffa943c3f
  1. 11
      test/internet/test-dns.js

11
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);

Loading…
Cancel
Save