* Matthew Toseland <toad at amphibian.dyndns.org> [2008-08-22 14:29:52]:

> On Sunday 17 August 2008 19:24, nextgens at freenetproject.org wrote:
> > Author: nextgens
> > Date: 2008-08-17 18:24:10 +0000 (Sun, 17 Aug 2008)
> > New Revision: 21976
> > 
> > Added:
> >    trunk/freenet/src/freenet/support/io/MockInputStream.java
> > Modified:
> >    trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java
> > Log:
> > bug #2501: fix the test
> > 
> > Added: trunk/freenet/src/freenet/support/io/MockInputStream.java
> > ===================================================================
> > --- trunk/freenet/src/freenet/support/io/MockInputStream.java               
> >                 
> (rev 0)
> > +++ trunk/freenet/src/freenet/support/io/MockInputStream.java       
> > 2008-08-17 
> 18:24:10 UTC (rev 21976)
> > @@ -0,0 +1,20 @@
> > +/* This code is part of Freenet. It is distributed under the GNU General
> > + * Public License, version 2 (or at your option any later version). See
> > + * http://www.gnu.org/ for further details of the GPL. */
> > +package freenet.support.io;
> > +
> > +import java.io.InputStream;
> > +
> > +public class MockInputStream extends InputStream {
> > +
> > +   public MockInputStream() {
> > +   }
> > +
> > +   public int read() {
> > +           return -1;
> > +   }
> > +
> > +   public int read(byte[] data, int offset, int len) {
> > +           return len;
> 
> Return -1 here, surely?

No, it needs to be 0 if len is 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080822/3a2fdc97/attachment.pgp>

Reply via email to