summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-05-05 17:45:58 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-08-01 10:51:21 +0200
commit246e7125485570416560d6a8503f785a31be1b3e (patch)
tree916d2786cb0725fbd117def18e372d2b1772f941 /tests/auto/corelib
parent5d7be66fd742e694576ce722aa6e0766c23942f7 (diff)
Move-enable QByteDataBuffer::{append,prepend}
Change-Id: I2fd342465475e3a694c8459a54957149f8b418a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp b/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp
index 59f4d153e6..7ef163349a 100644
--- a/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp
+++ b/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp
@@ -38,6 +38,7 @@ private Q_SLOTS:
void canReadLine();
void positionHandling();
void appendBuffer();
+ void moveAppendBuffer();
void readCompleteBuffer_data();
void readCompleteBuffer();
void readPartialBuffer_data();
@@ -91,7 +92,8 @@ void tst_QByteDataBuffer::positionHandling()
void tst_QByteDataBuffer::appendBuffer()
{
QByteDataBuffer buf;
- buf.append(QByteArray("\1\2\3"));
+ QByteArray local("\1\2\3");
+ buf.append(local);
buf.getChar();
QByteDataBuffer tmp;
@@ -99,6 +101,17 @@ void tst_QByteDataBuffer::appendBuffer()
QCOMPARE(tmp.readAll(), buf.readAll());
}
+void tst_QByteDataBuffer::moveAppendBuffer()
+{
+ QByteDataBuffer buf;
+ buf.append(QByteArray("hello world"));
+ QCOMPARE(buf.getChar(), 'h');
+
+ QByteDataBuffer tmp;
+ tmp.append(std::move(buf));
+ QCOMPARE(tmp.readAll(), "ello world");
+}
+
static QByteArray makeByteArray(int size)
{
QByteArray array;