harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov" <alexei.zakha...@gmail.com>
Subject Re: [classlib][test] "fail" statements omitted in many exception catching test cases
Date Thu, 28 Sep 2006 13:31:16 GMT
May be you can look at my JIRA too? Thanks :)
HARMONY-1604

2006/9/28, Tim Ellison <t.p.ellison@gmail.com>:
> Fixed.
>
> Rui Hu wrote:
> > Thanks Richard.
> > I've looked at luni module and raised HARMONY-1618 about some bugs of those
> > kind.
> >
> >
> >
> > On 9/28/06, Richard Liang <richard.liangyx@gmail.com> wrote:
> >>
> >> Great job, Robert. ;-)
> >>
> >> I will have a look at sql.
> >>
> >> On 9/28/06, Rui Hu <roberthurui@gmail.com> wrote:
> >> > Great Mark!
> >> > I've merged your code into my script. The script can be downloaded at
> >> [1].
> >> >
> >> > Usage:
> >> > perl failFinder.pl root_of_module
> >> >
> >> > e.g. Search out all related lines in luni module and redirect it to
> >> > result.txt
> >> >
> >> > perl failFinder.pl trunk/modules/luni > result.txt
> >> >
> >> > e.g. Search out all related lines in all modules and redirect it to
> >> > result.txt
> >> >
> >> > perl failFinder.pl trunk/modules/ > result.txt
> >> >
> >> > Anyone can find out the related lines of any modules.
> >> >
> >> > [1]:
> >> >
> >> http://wiki.apache.org/harmony-data/attachments/failstatementsomitted/attachments/failFinder.pl
> >>
> >> >
> >> >
> >> >
> >> > On 9/27/06, Mark Hindess <mark.hindess@googlemail.com> wrote:
> >> > >
> >> > >
> >> > > This perl script does a marginally better job by being slightly
> >> stricter
> >> > > on matching context around 'catch'/'fail', by handling comments
> >> slightly
> >> > > better and by handling 'catch (...) { }' appearing on a single line.
> >> > >
> >> > > It also finds a few more hits such as:
> >> > >
> >> > > sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java
> >> +208
> >> > >
> >> > > which is a false positive but which uses "assertTrue(false);" which
> >> > > should be fixed anyway.
> >> > >
> >> > > -Mark.
> >> > >
> >> > > #!/usr/bin/perl -w
> >> > > use strict;
> >> > >
> >> > > my $previous_line = "";
> >> > > my $possible_line_number;
> >> > > while (<>) {
> >> > > next if (/^\s*$/); # skip blank lines
> >> > > if ($possible_line_number) {
> >> > >    if (m!^\s*(//|/\*|})!) {
> >> > >      print $ARGV, ' +', $possible_line_number, "\n";
> >> > >    }
> >> > >    undef $possible_line_number;
> >> > > }
> >> > > if (!m!^\s*(/?\*|//)! && /\bcatch\s*\(/ && $previous_line
!~
> >> > > /\bfail\s*\(/) {
> >> > >    $possible_line_number = $.;
> >> > >    if (/catch\s*\([^\)]+\)\s*{\s*}/) {
> >> > >      print $ARGV, ' +', $possible_line_number, "\n";
> >> > >      undef $possible_line_number;
> >> > >    }
> >> > > }
> >> > > $previous_line = $_;
> >> > > }



-- 
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message