This is the mail archive of the mauve-discuss@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Killer bug in gnu.testlet.java.io.RandomAccessFile.raf


I think this has been recently patched in Classpath.  Thanks very much
for the bug report.  It would probably be useful to change the Mauve
test to detect when it has skipped further than it should be possible
to skip and indicate the error.

Brian

Stephen Crawley <crawley@dstc.edu.au> writes:

> Folks,
> 
> There is a bug in this testcase that puts it into an infinite loop
> when you run it against the Classpath libraries.
> 
> The problem is here:
> 
>         int skipped;
> 	while ((skipped = raf.skipBytes(1)) == 1)
> 	  harness.debug("skipped 1 byte");
> 
> This is fine with the Sun JDK implementation of skipBytes.  After 6
> iterations, the skipBytes reaches the end of file and returns zero,
> and the loop exits.
> 
> But Classpath behaves differently (incorrectly, IMO).  Here, skipBytes
> will happily seek past the end of file, so the loop in the testcase
> keeps going and going and ...
> 
> Can someone fix the Mauve testcase to avoid the infinite loop?  For
> example, change the above code to the following:
> 
> 	int skipped = 0;
>         for (int i = 0; i <= "foobar".length(); i++) {
> 	  skipped = raf.skipBytes(1);
>           if (skipped != 1) {
> 	    break;
>           }
> 	  harness.debug("skipped 1 byte");
>         }
> 
> -- Steve
> 

-- 
Brian Jones <cbj@gnu.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]