commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r761985 - /commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
Date Sat, 04 Apr 2009 18:58:52 GMT
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) {
+    		;
+    	}
+    }
 }



Mime
View raw message