summaryrefslogtreecommitdiffstats
path: root/storageapi/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'storageapi/src/tests')
-rw-r--r--storageapi/src/tests/mbusprot/storageprotocoltest.cpp35
-rw-r--r--storageapi/src/tests/messageapi/storage_message_address_test.cpp8
2 files changed, 22 insertions, 21 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
index e413a62ae39..e807ab673d5 100644
--- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
+++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
@@ -115,7 +115,8 @@ namespace {
}
TEST_F(StorageProtocolTest, testAddress50) {
- StorageMessageAddress address("foo", lib::NodeType::STORAGE, 3);
+ vespalib::string cluster("foo");
+ StorageMessageAddress address(&cluster, lib::NodeType::STORAGE, 3);
EXPECT_EQ(vespalib::string("storage/cluster.foo/storage/3/default"),
address.to_mbus_route().toString());
}
@@ -816,25 +817,25 @@ TEST_P(StorageProtocolTest, serialized_size_is_used_to_set_approx_size_of_storag
}
TEST_P(StorageProtocolTest, track_memory_footprint_for_some_messages) {
- EXPECT_EQ(64u, sizeof(StorageMessage));
- EXPECT_EQ(80u, sizeof(StorageReply));
- EXPECT_EQ(104u, sizeof(BucketReply));
+ EXPECT_EQ(72u, sizeof(StorageMessage));
+ EXPECT_EQ(88u, sizeof(StorageReply));
+ EXPECT_EQ(112u, sizeof(BucketReply));
EXPECT_EQ(8u, sizeof(document::BucketId));
EXPECT_EQ(16u, sizeof(document::Bucket));
EXPECT_EQ(32u, sizeof(BucketInfo));
- EXPECT_EQ(136u, sizeof(BucketInfoReply));
- EXPECT_EQ(280u, sizeof(PutReply));
- EXPECT_EQ(264u, sizeof(UpdateReply));
- EXPECT_EQ(256u, sizeof(RemoveReply));
- EXPECT_EQ(344u, sizeof(GetReply));
- EXPECT_EQ(80u, sizeof(StorageCommand));
- EXPECT_EQ(104u, sizeof(BucketCommand));
- EXPECT_EQ(104u, sizeof(BucketInfoCommand));
- EXPECT_EQ(104u + sizeof(std::string), sizeof(TestAndSetCommand));
- EXPECT_EQ(136u + sizeof(std::string), sizeof(PutCommand));
- EXPECT_EQ(136u + sizeof(std::string), sizeof(UpdateCommand));
- EXPECT_EQ(216u + sizeof(std::string), sizeof(RemoveCommand));
- EXPECT_EQ(288u, sizeof(GetCommand));
+ EXPECT_EQ(144u, sizeof(BucketInfoReply));
+ EXPECT_EQ(288u, sizeof(PutReply));
+ EXPECT_EQ(272u, sizeof(UpdateReply));
+ EXPECT_EQ(264u, sizeof(RemoveReply));
+ EXPECT_EQ(352u, sizeof(GetReply));
+ EXPECT_EQ(88u, sizeof(StorageCommand));
+ EXPECT_EQ(112u, sizeof(BucketCommand));
+ EXPECT_EQ(112u, sizeof(BucketInfoCommand));
+ EXPECT_EQ(112u + sizeof(std::string), sizeof(TestAndSetCommand));
+ EXPECT_EQ(144u + sizeof(std::string), sizeof(PutCommand));
+ EXPECT_EQ(144u + sizeof(std::string), sizeof(UpdateCommand));
+ EXPECT_EQ(224u + sizeof(std::string), sizeof(RemoveCommand));
+ EXPECT_EQ(296u, sizeof(GetCommand));
}
} // storage::api
diff --git a/storageapi/src/tests/messageapi/storage_message_address_test.cpp b/storageapi/src/tests/messageapi/storage_message_address_test.cpp
index f7f254e9119..edcf795368a 100644
--- a/storageapi/src/tests/messageapi/storage_message_address_test.cpp
+++ b/storageapi/src/tests/messageapi/storage_message_address_test.cpp
@@ -9,8 +9,8 @@ namespace storage::api {
namespace {
-size_t hash_of(vespalib::stringref cluster, const lib::NodeType& type, uint16_t index) {
- return StorageMessageAddress(cluster, type, index).internal_storage_hash();
+size_t hash_of(const vespalib::string & cluster, const lib::NodeType& type, uint16_t index) {
+ return StorageMessageAddress(&cluster, type, index).internal_storage_hash();
}
}
@@ -32,8 +32,8 @@ TEST(StorageMessageAddressTest, storage_hash_covers_all_expected_fields) {
EXPECT_NE(hash_of("foo", lib::NodeType::STORAGE, 0),
hash_of("foo", lib::NodeType::STORAGE, 1));
- EXPECT_EQ(88u, sizeof(StorageMessageAddress));
- EXPECT_EQ(64u, sizeof(StorageMessage));
+ EXPECT_EQ(16u, sizeof(StorageMessageAddress));
+ EXPECT_EQ(72u, sizeof(StorageMessage));
EXPECT_EQ(16u, sizeof(mbus::Trace));
}