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

Give Qtest priviledges to reset all QGlobalStatic

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Testing: qtestlib
    • None

    Description

      Hi,

      I'am encountering the following scenario:

      • I have various singletons declared through Q_GLOBAL_STATIC,
      • An instance of the class A uses several of these singletons,
      • I want to test the functionalities of class A by creating test cases under QTest,
      • So, when a test case needs an access to one singleton, this one is automatically created.

      The problem comes for the following tests. If they need access to this singleton, they will obtain an object that is in unknown state. Because it has been created, and modified, by the previous test(s).

       

      So, is it possible to add in Qtest a function to cleanup all the QGlobalStatic to be sure that each test works in a clean environment?

      Attachments

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

        Activity

          People

            macadder Jason McDonald
            alakauf Alain Kaufmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes