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

QByteArray::replace() is inconsistent with QString::replace() when *this isNull() and needle is empty

    XMLWordPrintable

Details

    • 5
    • 5fc1e9fa0 (dev), c653cf117 (6.9), 7637203f8 (6.8), 0c9786989 (tqtc/lts-6.5), 57d91d802 (dev), eeefa8c27 (dev)
    • Foundation Sprint 126, Foundation Sprint 127

    Description

      The following succeeds for String == QString, but fails for String == QByteArray:

      {
          String h, n, rep = "a", res = rep;
          h.replace(n, rep);
         QCOMPARE(h, res);
      }
      {
          String h, n = "", rep = "a", res = rep;
          h.replace(n, rep);
          QCOMPARE(h, res);
      }
      

      Expected behaviour: QByteArray is consistent with QString (and tokenize()/split() + join() for that matter).

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: