Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3869

QTest is missing a cleanup function to recover from uncaught exceptions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.0
    • 4.5.0
    • Testing: qtestlib
    • None
    • 467fdd578e6787497f2b702dca0cf38afdc0e6de

    Description

      If an uncaught exception occurs during QTest::runTests(), QTestCase, a custom exception handler can not clean up after self. Continuing with additional test runs causes an assertion:

      QFATAL : ::UnknownTestFunction ASSERT !currentTestObject in qtestcase.cpp line 1160

      The custom handler needs to call a cleanup function, something like [derived from qtestcase.cpp]

      QTestResult::finishedCurrentTestFunction();
      QTestResult::setCurrentTestFunction(0);
      QTestTable::clearGlobalTestTable();
      QTestLog::stopLogging();
      currentTestObject = 0;

      Attachments

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

        Activity

          People

            marco.alanen Marco Alanen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes