From 8142a2c92fcb963a3839b65b55e2d753912f6bf3 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Wed, 13 Feb 2019 00:09:57 +0100 Subject: [PATCH] Fix wrong size being passed (QString::size -> QFile::size) Fixes test --- tests/sendfiletest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sendfiletest.cpp b/tests/sendfiletest.cpp index 914e1d309..f95265b3a 100644 --- a/tests/sendfiletest.cpp +++ b/tests/sendfiletest.cpp @@ -109,7 +109,8 @@ class TestSendFile : public QObject QSharedPointer f(new QFile(aFile)); NetworkPacket np(PACKET_TYPE_SHARE_REQUEST); - np.setPayload(f, aFile.size()); + np.setPayload(f, f->size()); + CompositeUploadJob* job = new CompositeUploadJob(deviceId, false); UploadJob* uj = new UploadJob(np); job->addSubjob(uj); @@ -119,7 +120,7 @@ class TestSendFile : public QObject f->open(QIODevice::ReadWrite); - FileTransferJob* ft = new FileTransferJob(f, aFile.size(), QUrl::fromLocalFile(destFile)); + FileTransferJob* ft = np.createPayloadTransferJob(QUrl::fromLocalFile(destFile)); QSignalSpy spyTransfer(ft, &KJob::result);