harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko" <mloe...@gmail.com>
Subject Re: [classlib][test]Is this test necessary?
Date Wed, 23 Aug 2006 08:55:03 GMT
it would be great

2006/8/23, Paulex Yang <paulex.yang@gmail.com>:
> So I will rewrite it to *really* test the constructor if no one objects.
>
> Paulex Yang wrote:
> > The test case
> > below(org.apache.harmony.luni.tests.java.lang.OutOfMemoryErrorTest)
> > generally needs > 250 seconds on my thinkpad:
> >      public void test_Constructor() {
> >        // Test for method java.lang.OutOfMemoryError()
> >        try {
> >            StringBuffer large[] = new StringBuffer[100000];
> >
> >            for (int i = 0; i < large.length; i++)
> >                large[i] = new StringBuffer(1000000);
> >        } catch (OutOfMemoryError e) {
> >            return;
> >        }
> >        fail("No error generated");
> >    }
> >
> > IMO it is not a unit test of OutOfMemoryError constructor like its
> > name, actually what it tries to test is the JVM memory management
> >
> > I suggest to remove this testcase, at least it can be written like
> > below to get same error thrown much quickly:
> >
> >    StringBuffer large = new StringBuffer(Integer.MAX_VALUE);
> >
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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