diff options
Diffstat (limited to 'tests/arthur/common/baselineprotocol.cpp')
-rw-r--r-- | tests/arthur/common/baselineprotocol.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp index 88cea36..8879b78 100644 --- a/tests/arthur/common/baselineprotocol.cpp +++ b/tests/arthur/common/baselineprotocol.cpp @@ -374,7 +374,7 @@ bool BaselineProtocol::connect(const QString &testCase, bool *dryrun) Command cmd = UnknownError; if (!receiveBlock(&cmd, &block)) { - errMsg += QLS("Failed to get response from server."); + errMsg.prepend(QLS("Failed to get response from server. ")); return false; } @@ -424,15 +424,17 @@ bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, Ima it->testFunction = testFunction; QByteArray block; - QDataStream ds(&block, QIODevice::ReadWrite); + QDataStream ds(&block, QIODevice::WriteOnly); ds << *itemList; if (!sendBlock(RequestBaselineChecksums, block)) return false; + Command cmd; - if (!receiveBlock(&cmd, &block)) + QByteArray rcvBlock; + if (!receiveBlock(&cmd, &rcvBlock) || cmd != BaselineProtocol::Ack) return false; - ds.device()->seek(0); - ds >> *itemList; + QDataStream rds(&rcvBlock, QIODevice::ReadOnly); + rds >> *itemList; return true; } |