test-tcp-wrap dont assume port 80 priveleged'
authorHenry Rawas <henryr@schakra.com>
Thu, 14 Jul 2011 20:59:37 +0000 (13:59 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Thu, 14 Jul 2011 21:18:47 +0000 (14:18 -0700)
test/simple/test-tcp-wrap.js

index 32208ef..58d3ac1 100644 (file)
@@ -5,14 +5,14 @@ var TCP = process.binding('tcp_wrap').TCP;
 
 var handle = new TCP();
 
-// Cannot bind to port 80 because of access rights.
-var r = handle.bind("0.0.0.0", 80);
-assert.equal(-1, r);
-console.log(errno);
-assert.equal(errno, "EACCESS");
-
 // Should be able to bind to the common.PORT
 var r = handle.bind("0.0.0.0", common.PORT);
 assert.equal(0, r);
 
+// Should not be able to bind to the same port again
+var r = handle.bind("0.0.0.0", common.PORT);
+assert.equal(-1, r);
+console.log(errno);
+assert.equal(errno, "EINVAL");
+
 handle.close();