Author: nextgens
Date: 2008-08-17 16:03:48 +0000 (Sun, 17 Aug 2008)
New Revision: 21972

Modified:
   trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java
Log:
bug #2501: expose one of the two problems

Modified: trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java
===================================================================
--- trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java       
2008-08-17 15:56:16 UTC (rev 21971)
+++ trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java       
2008-08-17 16:03:48 UTC (rev 21972)
@@ -55,6 +55,11 @@
                        instance.readLineWithoutMarking(LENGTH_CHECKING_LINE_LF 
- 1, BUFFER_SIZE, true);
                        fail();
                } catch (TooLongException e) {}
+               
+               // Same test shouldn't throw
+               is = new ByteArrayInputStream(LENGTH_CHECKING_LINE.getBytes());
+               instance = new LineReadingInputStream(is);
+               assertEquals(LENGTH_CHECKING_LINE.substring(0, 
LENGTH_CHECKING_LINE_LF), 
instance.readLineWithoutMarking(LENGTH_CHECKING_LINE_LF, BUFFER_SIZE, true));
        }

        public void testReadLine() throws Exception {
@@ -85,6 +90,11 @@
                        instance.readLine(LENGTH_CHECKING_LINE_LF - 1, 
BUFFER_SIZE, true);
                        fail();
                } catch (TooLongException e) {}
+               
+               // Same test shouldn't throw
+               is = new ByteArrayInputStream(LENGTH_CHECKING_LINE.getBytes());
+               instance = new LineReadingInputStream(is);
+               assertEquals(LENGTH_CHECKING_LINE.substring(0, 
LENGTH_CHECKING_LINE_LF), instance.readLine(LENGTH_CHECKING_LINE_LF, 
BUFFER_SIZE, true));
        }

        public void testBothImplementation() throws Exception {


Reply via email to