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

tst_QSettings::testErrorHandling() is silently passing because of broken #if logic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 4.6.0, 6.8
    • Core: I/O
    • None
    • 25
    • 713926eb6 (dev), 24424fa93 (dev)
    • Foundation Sprint 115

    Description

      This test was accidentally disabled in Qt 4.6 commit 31e358f2290c145b839fc5b7b277922c1ab6e19b ("fix tests for QT_NO_PROCESS and when running tests as root"), which introduced an #else that disabled the entire meat of the test (that is, the test was for everything that is neither Unix nor Windows, which is an empty set).

      Attempting to re-enable it shows it's broken:

      FAIL!  : tst_QSettings::testErrorHandling(0600 0100) Compared values are not the same
         Actual   ((int)settings.status()): 1
         Expected (statusAfterSetAndSync) : 0
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(941)]
      FAIL!  : tst_QSettings::testErrorHandling(0600 0100) 'settingsDir.removeRecursively()' returned FALSE. ()
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(314)]
      FAIL!  : tst_QSettings::testErrorHandling(  -1 0300) 'settingsDir.removeRecursively()' returned FALSE. ()
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(314)]
      FAIL!  : tst_QSettings::testErrorHandling(0600 0300) 'settingsDir.removeRecursively()' returned FALSE. ()
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(314)]
      FAIL!  : tst_QSettings::testErrorHandling(0600 0500) Compared values are not the same
         Actual   ((int)settings.status()): 1
         Expected (statusAfterSetAndSync) : 0
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(941)]
      FAIL!  : tst_QSettings::testErrorHandling(0600 0500) 'settingsDir.removeRecursively()' returned FALSE. ()
         Loc: [tests/auto/corelib/io/qsettings/tst_qsettings.cpp(314)]
      

      It appears the majority of the failures are in the cleanup code, after the test has executed, so it's possible it's actually passing, but the clean up fails because some files or directories are left without reading permissions.

      Attachments

        For Gerrit Dashboard: QTBUG-126008
        # Subject Branch Project Status CR V

        Activity

          People

            tatiana.borisova Tatiana Borisova
            thiago Thiago Macieira
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes