Details
-
Task
-
Resolution: Done
-
P1: Critical
-
None
-
None
-
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
- relates to
-
QTBUG-89687 QMultiHash::equal_range crashes when called in a const member function
- Closed
-
QTBUG-91704 QMultiHash::count(key) crashes on empty container
- Closed