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

QVERIFY_EXCEPTION_THROWN does not work with a temporary

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.9.0
    • Testing: qtestlib
    • None
    • Qt 5.9.0, mingw5.3.0

    Description

      While calling a member function that throws is correctly tested,
      QVERIFY_EXCEPTION_THROWN(object.methodThrowing(), std::runtime_error);

      verifying that a constructor fails is not possible as such
      QVERIFY_EXCEPTION_THROWN(ObjectConstructorThrowing(), std::runtime_error);

      It appears the latter is optimised out in release mode. Should the macro expression be wrapped in a Q_UNUSED?

      Attachments

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

        Activity

          People

            macadder Jason McDonald
            koen.poppe koen.poppe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes