misleading output "PASS: Error: ..."

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

misleading output "PASS: Error: ..."

Edwin Steiner-2
Hallo!

During my work with tgolem I found many lines in the mauve output like
this:

PASS: gnu.testlet.java.lang.Byte.ByteTest: Error: test_Basics failed - 1 (number 1)

They are produced by such code:

                harness.check(!( Byte.MIN_VALUE != -128 ),
                        "Error: test_Basics failed - 1" );

Would you accept patches turning this into

                harness.check(!( Byte.MIN_VALUE != -128 ),
                        "test_Basics - 1" );

? (Only changing the string. Changing the double negation seems too
error prone for the many cases I found.)

BTW I already promised patches for a similar problem. Unfortunately I
had very little spare time recently. I hope this will get better now.

Cheers,
-Edwin

Reply | Threaded
Open this post in threaded view
|

Re: misleading output "PASS: Error: ..."

Mark Wielaard
Hi Edwin,

On Fri, 2006-01-20 at 20:59 +0100, Edwin Steiner wrote:

> During my work with tgolem I found many lines in the mauve output like
> this:
>
> PASS: gnu.testlet.java.lang.Byte.ByteTest: Error: test_Basics failed - 1 (number 1)
>
> They are produced by such code:
>
>                 harness.check(!( Byte.MIN_VALUE != -128 ),
>                         "Error: test_Basics failed - 1" );
>
> Would you accept patches turning this into
>
>                 harness.check(!( Byte.MIN_VALUE != -128 ),
>                         "test_Basics - 1" );
>
> ? (Only changing the string. Changing the double negation seems too
> error prone for the many cases I found.)
Yes please! I have found these message strings confusing myself in the
past. If you do decide to change the double negation then please rewrite
these as actual checks:

    harness.check(Byte.MIN_VALUE, -128, "test_Basics - 1" );

That way one sees the expected value if the the test would ever fail.
But just changing the message strings would already be an improvement.

Cheers,

Mark

signature.asc (196 bytes) Download Attachment