Mercurial > hg4j
diff test/org/tmatesoft/hg/test/TestStatus.java @ 399:fdc1db8f7f61 smartgit3
Issue 25: Underflow in InflaterDataAccess; test and fix for hang up when reading past end of compressed data (or zero-length data)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sat, 25 Feb 2012 19:31:57 +0100 |
parents | 5e95b0da26f2 |
children | 528b6780a8bd |
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/TestStatus.java Thu Feb 23 15:31:57 2012 +0100 +++ b/test/org/tmatesoft/hg/test/TestStatus.java Sat Feb 25 19:31:57 2012 +0100 @@ -537,6 +537,10 @@ * b) That FilterDataAccess (with 0 size represents patch more or less relevantly, but didn't represent actual revision) get successfully * reassigned as lastUserData for the next iteration. And at the next step attempt to apply patch recorded in the next revision failed * because baseRevisionData is 0 length FilterDataAccess + * + * Same applies for + * Issue 25: IOException: Underflow. Rewind past end of the slice in InflaterDataAccess + * with the difference in separate .i and .d (thus not 0 but 'x' first byte was read) * * Sample: * status-5/file1 has 3 revisions, second is zero-length patch: @@ -551,10 +555,12 @@ @Test public void testZeroLengthPatchAgainstNonEmptyBaseRev() throws Exception{ repo = Configuration.get().find("status-5"); - // pretend we modified file in the working copy + // pretend we modified files in the working copy // for HgWorkingCopyStatusCollector to go and retrieve its content from repository File f1 = new File(repo.getWorkingDir(), "file1"); f1.setLastModified(System.currentTimeMillis()); + File f3 = new File(repo.getWorkingDir(), "file3"); + f3.setLastModified(System.currentTimeMillis()); // HgStatusCommand cmd = new HgStatusCommand(repo); cmd.all();