This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk 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: TestCase.fail() bug


This is an example of ecj being just a bit to single minded about how the code should be written. If the code is changed to use junit.Assert.assert* instead of frysk.junit.TestCase then we miss the opportunity change the behavior. In fact, I'd like to suggest modifying frysk.junit.TestCase along these lines:

public static void assertNull (String what, Object o)
{
Assert.assertNull(what,o);
logger.log(Level.FINE, "assertNull {0} {1}\n", new Object[] {what, null});
}
public static void assertNull(Object o)
{
fail("called nameless assert method");
}


the second would obviously take some cleanning up before it passed :-)

Andrew


Chris Moller wrote:
Hello, Fryskers, wherever you are!

Per the attached exchange between Andrew and me, does anyone have any
idea how to fix this kind of bug?  I'm not a Java guy and haven't a
clue, and the suggestions I got from Phil on IRC regarding similar uses
of TestCase.fail() in frysk weren't similar enough to the uses in
AttachedSelf.java that I could apply them.

Any advice/suggestions/sympathy would be greatly appreciated,
Chris

-------- Original Message --------

Chris,

It's the new more pedantic ECJ; Mark's mentioned this on irc and frysk@. I'd send it to frysk@ asking for suggestions :-)

Andrew

Hey, Andrew,

The following bug just popped up on some code you added on Friday.  It's
coming from a rawhide machine, so I don't know if it's a real bug or a
gcj/ecj gotcha.  Anyway, FWIW:

/home/moller/tinkering/frysk/04-16/build/frysk-imports/../../frysk/frysk-imports/frysk/testbed/AttachedSelf.java:66:
error: The static method fail(String) from the type Assert should be
accessed directly
        TestCase.fail (why);
        ^^^^^^^^^^^^^^^^^^^
/home/moller/tinkering/frysk/04-16/build/frysk-imports/../../frysk/frysk-imports/frysk/testbed/AttachedSelf.java:77:
error: The static method fail(String) from the type Assert should be
accessed directly
        TestCase.fail ("unexpected signal " + sig);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 problems (2 errors)
make[3]: *** [frysk/sys/TestPtraceServer.o] Error 1









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