chiark / gitweb /
packetframe: Tests: Fold first read_all into lumpreader test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Apr 2021 11:56:01 +0000 (12:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Apr 2021 18:32:07 +0000 (19:32 +0100)
With a buffer of len+1 this is equivalent.  This will make it easier
to change the way FrameReader is constructed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/packetframe.rs

index 0d60ad51f74faf54899eba3fb788a7ad301ff1d5..7fd71717025969e748a0503451965854af516c40 100644 (file)
@@ -489,12 +489,11 @@ fn write_test(){
     expect_good(&mut rd, b"longer!");
     expect_good_eof(&mut rd);
   };
-  read_all(&mut &*msg.buf);
 
   // try lumpy reads (ie, short reads) at every plausible boundary size
   // this approach is not very principled but ought to test every boundary
   #[cfg(not(miri))]
-  for lumpsize in 1..=msg.buf.len() {
+  for lumpsize in 1..=msg.buf.len()+1 {
     #[derive(Debug)]
     struct LumpReader<R: Read> {
       inner: R,