Menu

#18 show actual and expected value when test fails

open
nobody
5
2015-10-11
2011-07-12
sawi
No

Hi All,

I like CUnit very much. That's why I suggest to further improve the output in case of a test fails.

As a developer I'd like to see the actual and expected values as fast as possible without using debugger.

Currently the output in case of a test failing is:

Suite TestSuit, Test1 had failures:
1. ./Cunit_Test.c:70 - CU_ASSERT_EQUAL(actual, 1)

For me it would be a huge improvement seeing additional information:

Suite TestSuit, Test1 had failures:
1. ./Cunit_Test.c:70 - CU_ASSERT_EQUAL(actual, 1)
actual: 2,
expected: 1

Would be nice if you could add this.

Keep going!

sawi

Discussion

  • sawi

    sawi - 2011-07-12

    I know it's difficult to implement since you dont'know what types are given for actual and expected. But I would think something like CU_ASSERT_EQUAL_INT would be a good starting and it helps a lot.

    cya sawi

     
  • Anonymous

    Anonymous - 2015-02-12

    +1, knowing the actual value helps a lot

     
  • Anonymous

    Anonymous - 2015-09-25
    Post awaiting moderation.
  • Anonymous

    Anonymous - 2015-10-11
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel