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

Cannot make destroy() work in TestCase

    XMLWordPrintable

Details

    • 7fe2b4a4d9b2c082d08c9380bbcce46ed7527585

    Description

      In test cases, objects can be created using createQmlObject. The problem is if you create an object in one test function and call destroy() on the object before the function returns, the object is not deleted when the next function starts.

      I try putting the destroy call inside a slot but that did not help.

      See attached testcase: qmltestcase_destroy.tar.gz.

      This is a problem for example when test functions use mouseClicks/keyPress because the non deleted object(s) can interfere with the current test. The order in which the tests are run can also change the tests results.

      Nb: I saw QTBUG-14950 saying the the object is deleted when the script block returns. The example works (see attached destroytest3.qml) but only when using mouse click. This is not applicable for testcases.

      Attachments

        1. destroytest3.qml
          1.0 kB
          Caroline Chao
        2. qmltestcase_destroy.tar.gz
          0.7 kB
          Caroline Chao
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            carochao Caroline Chao (Inactive)
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes