Re: [JGIT PATCH 4/5] Define Patch to parse a sequence of patch FileHeaders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



torsdag 11 december 2008 19:39:54 skrev Shawn O. Pearce:
> Robin Rosenberg <robin.rosenberg.lists@xxxxxxxxxx> wrote:
> > > +		assertEquals(572, fRepositoryConfigTest.startOffset);
> > > +		assertEquals(1490, fRepositoryConfig.startOffset);
> >
> > 1487 here
> 
> Really?  1490 is the only value that the test vector passes with.
> What's the 3 bytes you think I'm off by?

...Quick, quick, find something else to pick on..  :->

Yes. Very little of the code in TemporaryBuffer is covered by the unit tests
and number of conditionals in there are rather large. I tried messing with
the constants in there to improve that and then PatchTest started to fail.

Here are the changes I tried with. I think it should still work with thes
changes. Rather than changing the other tests, we might want to create
a special test for only the buffer class.

-- robin

diff --git a/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java b/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
index 27f6444..556ab71 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
@@ -60,7 +60,7 @@
  * after this stream has been properly closed by {@link #close()}.
  */
 public class TemporaryBuffer extends OutputStream {
-       private static final int DEFAULT_IN_CORE_LIMIT = 1024 * 1024;
+       private static final int DEFAULT_IN_CORE_LIMIT = 1024;

        /** Chain of data, if we are still completely in-core; otherwise null. */
        private ArrayList<Block> blocks;
@@ -315,7 +315,7 @@ public void destroy() {
        }

        private static class Block {
-               static final int SZ = 8 * 1024;
+               static final int SZ = 512;

                final byte[] buffer = new byte[SZ];

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux