commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1552979 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java
Date Sun, 22 Dec 2013 11:29:52 GMT
Author: bodewig
Date: Sun Dec 22 11:29:52 2013
New Revision: 1552979

URL: http://svn.apache.org/r1552979
Log:
the modulus logic doesn't work for arbitrary pairs of size and empty files

Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java?rev=1552979&r1=1552978&r2=1552979&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java
Sun Dec 22 11:29:52 2013
@@ -218,12 +218,14 @@ public class SevenZOutputFileTest extend
         int nonEmptyModulus = numberOfNonEmptyFiles != 0
             ? numberOfFiles / numberOfNonEmptyFiles
             : numberOfFiles + 1;
+        int nonEmptyFilesAdded = 0;
         output = new File(dir, "COMPRESS252-" + numberOfFiles + "-" + numberOfNonEmptyFiles
+ ".7z");
         SevenZOutputFile archive = new SevenZOutputFile(output);
         try {
             addDir(archive);
             for (int i = 0; i < numberOfFiles; i++) {
-                addFile(archive, i, (i + 1) % nonEmptyModulus == 0);
+                addFile(archive, i,
+                        (i + 1) % nonEmptyModulus == 0 && nonEmptyFilesAdded++ <
numberOfNonEmptyFiles);
             }
         } finally {
             archive.close();



Mime
View raw message