diff options
Diffstat (limited to 'documentapi/src/tests/messages/messages60test.cpp')
-rw-r--r-- | documentapi/src/tests/messages/messages60test.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/documentapi/src/tests/messages/messages60test.cpp b/documentapi/src/tests/messages/messages60test.cpp index c7bb1015e02..8b895fb2b59 100644 --- a/documentapi/src/tests/messages/messages60test.cpp +++ b/documentapi/src/tests/messages/messages60test.cpp @@ -323,6 +323,7 @@ Messages60Test::testGetDocumentMessage() { GetDocumentMessage tmp(document::DocumentId("id:ns:testdoc::"), "foo bar"); + EXPECT_EQUAL(360u, sizeof(GetDocumentMessage)); EXPECT_EQUAL(MESSAGE_BASE_LENGTH + (size_t)31, serialize("GetDocumentMessage", tmp)); for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { @@ -400,6 +401,7 @@ Messages60Test::testPutDocumentMessage() msg.setTimestamp(666); msg.setCondition(TestAndSetCondition("There's just one condition")); + EXPECT_EQUAL(280u, sizeof(PutDocumentMessage)); EXPECT_EQUAL(MESSAGE_BASE_LENGTH + 45u + serializedLength(msg.getCondition().getSelection()), @@ -447,6 +449,7 @@ Messages60Test::testPutDocumentReply() reply.setHighestModificationTimestamp(30); EXPECT_EQUAL(13u, serialize("PutDocumentReply", reply)); + EXPECT_EQUAL(112u, sizeof(WriteDocumentReply)); for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { mbus::Routable::UP obj = deserialize("PutDocumentReply", DocumentProtocol::REPLY_PUTDOCUMENT, lang); @@ -466,6 +469,7 @@ Messages60Test::testUpdateDocumentReply() reply.setHighestModificationTimestamp(30); EXPECT_EQUAL(14u, serialize("UpdateDocumentReply", reply)); + EXPECT_EQUAL(120u, sizeof(UpdateDocumentReply)); for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { mbus::Routable::UP obj = deserialize("UpdateDocumentReply", DocumentProtocol::REPLY_UPDATEDOCUMENT, lang); @@ -485,12 +489,13 @@ Messages60Test::testRemoveDocumentMessage() msg.setCondition(TestAndSetCondition("There's just one condition")); + EXPECT_EQUAL(360u, sizeof(RemoveDocumentMessage)); EXPECT_EQUAL(MESSAGE_BASE_LENGTH + size_t(20) + serializedLength(msg.getCondition().getSelection()), serialize("RemoveDocumentMessage", msg)); for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { auto routablePtr = deserialize("RemoveDocumentMessage", DocumentProtocol::MESSAGE_REMOVEDOCUMENT, lang); - if (EXPECT_TRUE(routablePtr.get() != nullptr)) { + if (EXPECT_TRUE(routablePtr)) { auto & ref = static_cast<RemoveDocumentMessage &>(*routablePtr); EXPECT_EQUAL(string("id:ns:testdoc::"), ref.getDocumentId().toString()); EXPECT_EQUAL(msg.getCondition().getSelection(), ref.getCondition().getSelection()); @@ -506,6 +511,7 @@ Messages60Test::testRemoveDocumentReply() std::vector<uint64_t> ts; reply.setWasFound(false); reply.setHighestModificationTimestamp(30); + EXPECT_EQUAL(120u, sizeof(RemoveDocumentReply)); EXPECT_EQUAL(14u, serialize("RemoveDocumentReply", reply)); @@ -663,12 +669,13 @@ Messages60Test::testUpdateDocumentMessage() msg.setNewTimestamp(777u); msg.setCondition(TestAndSetCondition("There's just one condition")); + EXPECT_EQUAL(288u, sizeof(UpdateDocumentMessage)); EXPECT_EQUAL(MESSAGE_BASE_LENGTH + 93u + serializedLength(msg.getCondition().getSelection()), serialize("UpdateDocumentMessage", msg)); for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { auto routableUp = deserialize("UpdateDocumentMessage", DocumentProtocol::MESSAGE_UPDATEDOCUMENT, lang); - if (EXPECT_TRUE(routableUp.get() != nullptr)) { + if (EXPECT_TRUE(routableUp)) { auto & deserializedMsg = static_cast<UpdateDocumentMessage &>(*routableUp); EXPECT_EQUAL(msg.getDocumentUpdate(), deserializedMsg.getDocumentUpdate()); EXPECT_EQUAL(msg.getOldTimestamp(), deserializedMsg.getOldTimestamp()); |