You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rw...@apache.org on 2009/04/04 20:58:52 UTC

svn commit: r761985 - /commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java

Author: rwinston
Date: Sat Apr  4 18:58:52 2009
New Revision: 761985

URL: http://svn.apache.org/viewvc?rev=761985&view=rev
Log:
Add /0 netmask check

Modified:
    commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java

Modified: commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java?rev=761985&r1=761984&r2=761985&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java (original)
+++ commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java Sat Apr  4 18:58:52 2009
@@ -58,4 +58,14 @@
         assertFalse(info.isInRange("192.168.1.1"));
         assertFalse(info.isInRange("192.168.0.255"));
     }
+    
+    public void testZeroNetmaskBits() {
+    	try {
+    		SubnetUtils utils = new SubnetUtils("192.168.0.1/0");
+    		assertTrue("/0 should be an invalid mask", false);
+    	}
+    	catch (Exception e) {
+    		;
+    	}
+    }
 }