From: Janne H. <jjh...@gm...> - 2007-11-27 20:24:08
|
I applied your patch for the write_i16 but I didn't apply the Unzip fix yet. I also added both the Unzip and IO test cases into the test suite (/cvsroot/ocaml-lib/extlib-test). Applying your second unzip change to extlib-dev does make the test case pass. Rob, how extensively have you tested your Unzip change? I'm not doubting that your change wouldn't work, I just don't have any test coverage to support your case. :( Janne On Nov 27, 2007 9:28 PM, Janne Hellsten <jjh...@gm...> wrote: > Hi Rob, > > Thanks for the test case, I agree that the write_i16 range check is > indeed erroneous, -32768 should be accepted as it can be represented a > signed 16-bit integer. > > (* Bug was that write_i16 did not accept -0x8000 *) > let out = IO.output_string () in > print_string "Test IO.write_i16: "; > let () = > try IO.write_i16 out (-0x8000); print_string "OK\n" > with IO.Overflow _ -> print_string "FAIL\n" > > I'm not familiar with the Unzip module, but it seems like you know > what the problem is. I'll let Nicolas answer this one. > > I'll integrate your test, let's see if we'll incorporate the patch as well. > > Janne > > > On Nov 27, 2007 4:36 PM, Robert Atkey <bob...@ed...> wrote: > > > > > > On Mon, 2007-11-26 at 20:51 +0200, Janne Hellsten wrote: > > > Hi, > > > > > > > We've found some tiny bugs in extlib-1.5: > > > > > > > > - off by one error in IO.ml for writing 16 bit integers > > > > - off by one error in unzip.ml in reading of uncompressed blocks > > > > - fix possible under-reading in unzip.ml > > > > > > > > Patch attached. > > > > > > Do you happen to have test cases for these failures? I'd like to add > > > test cases for these into the extlib test suite. > > > > Actually, looking at it again, I'm not sure the third one is a bug: the > > code that is already present handles the case of under-reading. > > > > I've attached a short ocaml program with test cases for the other two. > > > > Bob > > > |