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

Ensure Qt containers behave correctly when empty

    XMLWordPrintable

Details

    • 13
    • Qt6_Foundation_Sprint 37, Qt6_Foundation_Sprint 38, Qt6_Foundation_Sprint 39

    Description

      Given recent findings like QTBUG-89687 and QTBUG-91704 it seems essential to verify that containers behave correctly in an edge case of being empty.
      Thus, we need a comprehensive test coverage for such scenarios.
      Containers list (may not be complete):

      • QList, QString, QByteArray
      • QVarLengthArray
      • QStack, QQueue
      • QSet, QMap, QMultiMap
      • QHash, QMultiHash

      The following should be tested:
      1. At least, no operation on an empty container causes a crash or UB (see related bug reports for an example)
      2. At most, no operation on an empty container causes it to allocate memory - this is a soft requirement as some operations could detach straight away and we accept it (e.g. having an explicit if-statement would harm the performance)

      Attachments

        Issue Links

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

          Activity

            People

              ivan.solovev Ivan Solovev
              agolubev Andrei Golubev
              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