Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25888

Actual msg of failed death tests is ignored

    XMLWordPrintable

Details

    • Linux/X11
    • cb2febdaae383928c9a6c640aac49dcdf65af985 (qt-creator/qt-creator/master)

    Description

      I am using Google Test to do some unit testing. Some steps include death tests that trigger assertions. Test snippet here:

       EXPECT_DEBUG_DEATH({ Q_ASSERT(false); }, "wrong match"); 

      In case the regexp matcher  does not match, I get a test failure in the test plugin results. The failure description contains the "Actual msg:" label but it does not include the actual message itself:

      ../coretest_range.hpp:409: Failure
      Death test: { ((false) ? static_cast<void>(0) : qt_assert("false", "../coretest_range.hpp", 409)); }
       Result: died but not with expected error.
       Expected: contains regular expression "wrong match"
      Actual msg:

      However I can see the actual message in the console output when running the test code without test plugin (see last line):

      [ RUN      ] UT_Core_Range.cutOffUsingRangeT_Bad
      ../coretest_range.hpp:409: Failure
      Death test: { ((false) ? static_cast<void>(0) : qt_assert("false", "../coretest_range.hpp", 409)); }
          Result: died but not with expected error.
        Expected: contains regular expression "wrong match"
      Actual msg:
      [  DEATH   ] ASSERT: "false" in file ../coretest_range.hpp, line 409

      Obviously the test plugin das not catch the Actual msg. However the actual msg is essential to understand why the test failed

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cstenger Christian Stenger
            silicomancer Bernhard Lindner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes