commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r950163 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
Date Tue, 01 Jun 2010 16:58:22 GMT
Author: sebb
Date: Tue Jun  1 16:58:22 2010
New Revision: 950163

URL: http://svn.apache.org/viewvc?rev=950163&view=rev
Log:
Must have trailing space/NUL

Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java?rev=950163&r1=950162&r2=950163&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
Tue Jun  1 16:58:22 2010
@@ -50,7 +50,13 @@ public class TarUtilsTest extends TestCa
         buffer[buffer.length-1]=0;
         value = TarUtils.parseOctal(buffer,0, buffer.length);
         assertEquals(MAX_OCTAL, value);
-        buffer = "abcdef".getBytes("UTF-8"); // Invalid input
+        buffer = "abcdef ".getBytes("UTF-8"); // Invalid input
+        try {
+            TarUtils.parseOctal(buffer,0, buffer.length);
+            fail("Expected IllegalArgumentException");
+        } catch (IllegalArgumentException expected) {
+        }
+        buffer = "77777777777".getBytes("UTF-8"); // Invalid input
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException");



Mime
View raw message