diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-02 16:20:28 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2015-06-03 04:27:22 +0000 |
commit | 21674735ccd029c17dc8b36211e9b5bc3595ba34 (patch) | |
tree | fa3ebdc8da62854a8072a25e681b7d038332ecc0 /tests | |
parent | eea10943492473bae7f048f8c59e35fb1bff36ca (diff) |
Rename QTextStream::readLine(QString *, qint64) into readLineInto
As discussed on the development mailing list, the new overload is ambiguous
and breaks source compatibility. Therefore this function that is new in 5.5
shall be called readLineInto.
Change-Id: I2aecb8441af4edb72f16d0bc6dabf10cdabf32e2
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index aa7a3762ce..36da3b8770 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -81,7 +81,7 @@ private slots: void readLineMaxlen_data(); void readLineMaxlen(); void readLinesFromBufferCRCR(); - void readLineOverload(); + void readLineInto(); // all void readAllFromDevice_data(); @@ -612,22 +612,22 @@ protected: } }; -void tst_QTextStream::readLineOverload() +void tst_QTextStream::readLineInto() { QByteArray data = "1\n2\n3"; QTextStream ts(&data); QString line; - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("1")); - ts.readLine(Q_NULLPTR, 0); // read the second line, but don't store it + ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("3")); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); QFile file(m_rfc3261FilePath); @@ -637,7 +637,7 @@ void tst_QTextStream::readLineOverload() line.reserve(1); int maxLineCapacity = line.capacity(); - while (ts.readLine(&line)) { + while (ts.readLineInto(&line)) { QVERIFY(line.capacity() >= maxLineCapacity); maxLineCapacity = line.capacity(); } @@ -647,7 +647,7 @@ void tst_QTextStream::readLineOverload() QVERIFY(errorDevice.open(QIODevice::ReadOnly)); ts.setDevice(&errorDevice); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); } @@ -1025,7 +1025,7 @@ void tst_QTextStream::performance() QTextStream stream2(&file3); QString line; - while (stream2.readLine(&line)) + while (stream2.readLineInto(&line)) ++nlines3; elapsed[2] = stopWatch.elapsed(); |