blobs: s/struct BlobMeta/BlobMeta/g
Because this structure is not anything special, simply use the cpp
idiomatic way of referencing the object.
Consistently, structures that are packed still have "struct" used in
declarations. However, this distinction is only clear through its usage
and nothing in the language. Perhaps a better approach would be
notational naming struct PackedXYZ {};. However, that can get out of
control quickly.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I3b7e48e4b6687ef2e15e9d07c0eeba96eb5d2552
diff --git a/test/blob_mock.hpp b/test/blob_mock.hpp
index b70d3d1..7ec7d15 100644
--- a/test/blob_mock.hpp
+++ b/test/blob_mock.hpp
@@ -15,7 +15,7 @@
MOCK_METHOD1(canHandleBlob, bool(const std::string&));
MOCK_METHOD0(getBlobIds, std::vector<std::string>());
MOCK_METHOD1(deleteBlob, bool(const std::string&));
- MOCK_METHOD2(stat, bool(const std::string&, struct BlobMeta*));
+ MOCK_METHOD2(stat, bool(const std::string&, BlobMeta*));
MOCK_METHOD3(open, bool(uint16_t, uint16_t, const std::string&));
MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t));
MOCK_METHOD3(write, bool(uint16_t, uint32_t, const std::vector<uint8_t>&));
@@ -23,7 +23,7 @@
bool(uint16_t, uint32_t, const std::vector<uint8_t>&));
MOCK_METHOD2(commit, bool(uint16_t, const std::vector<uint8_t>&));
MOCK_METHOD1(close, bool(uint16_t));
- MOCK_METHOD2(stat, bool(uint16_t, struct BlobMeta*));
+ MOCK_METHOD2(stat, bool(uint16_t, BlobMeta*));
MOCK_METHOD1(expire, bool(uint16_t));
};
} // namespace blobs
diff --git a/test/ipmi_sessionstat_unittest.cpp b/test/ipmi_sessionstat_unittest.cpp
index 875b6a8..2f407a1 100644
--- a/test/ipmi_sessionstat_unittest.cpp
+++ b/test/ipmi_sessionstat_unittest.cpp
@@ -33,8 +33,8 @@
dataLen = sizeof(struct BmcBlobSessionStatTx);
- EXPECT_CALL(mgr, stat(Matcher<uint16_t>(req->sessionId),
- Matcher<struct BlobMeta*>(_)))
+ EXPECT_CALL(mgr,
+ stat(Matcher<uint16_t>(req->sessionId), Matcher<BlobMeta*>(_)))
.WillOnce(Return(false));
EXPECT_EQ(IPMI_CC_UNSPECIFIED_ERROR,
@@ -63,8 +63,8 @@
rep.metadataLen = 0x00;
EXPECT_CALL(mgr, stat(Matcher<uint16_t>(req->sessionId),
- Matcher<struct BlobMeta*>(NotNull())))
- .WillOnce(Invoke([&](uint16_t session, struct BlobMeta* meta) {
+ Matcher<BlobMeta*>(NotNull())))
+ .WillOnce(Invoke([&](uint16_t session, BlobMeta* meta) {
meta->blobState = rep.blobState;
meta->size = rep.size;
return true;
@@ -91,7 +91,7 @@
dataLen = sizeof(struct BmcBlobSessionStatTx);
- struct BlobMeta lmeta;
+ BlobMeta lmeta;
lmeta.blobState = 0x01;
lmeta.size = 0x100;
lmeta.metadata.push_back(0x01);
@@ -106,8 +106,8 @@
rep.metadataLen = lmeta.metadata.size();
EXPECT_CALL(mgr, stat(Matcher<uint16_t>(req->sessionId),
- Matcher<struct BlobMeta*>(NotNull())))
- .WillOnce(Invoke([&](uint16_t session, struct BlobMeta* meta) {
+ Matcher<BlobMeta*>(NotNull())))
+ .WillOnce(Invoke([&](uint16_t session, BlobMeta* meta) {
(*meta) = lmeta;
return true;
}));
diff --git a/test/ipmi_stat_unittest.cpp b/test/ipmi_stat_unittest.cpp
index b4f542d..5002e69 100644
--- a/test/ipmi_stat_unittest.cpp
+++ b/test/ipmi_stat_unittest.cpp
@@ -63,7 +63,7 @@
dataLen = sizeof(struct BmcBlobStatTx) + blobId.length() + 1;
EXPECT_CALL(mgr, stat(Matcher<const std::string&>(StrEq(blobId)),
- Matcher<struct BlobMeta*>(_)))
+ Matcher<BlobMeta*>(_)))
.WillOnce(Return(false));
EXPECT_EQ(IPMI_CC_UNSPECIFIED_ERROR,
@@ -96,8 +96,8 @@
rep.metadataLen = 0x00;
EXPECT_CALL(mgr, stat(Matcher<const std::string&>(StrEq(blobId)),
- Matcher<struct BlobMeta*>(NotNull())))
- .WillOnce(Invoke([&](const std::string& path, struct BlobMeta* meta) {
+ Matcher<BlobMeta*>(NotNull())))
+ .WillOnce(Invoke([&](const std::string& path, BlobMeta* meta) {
meta->blobState = rep.blobState;
meta->size = rep.size;
return true;
@@ -128,7 +128,7 @@
dataLen = sizeof(struct BmcBlobStatTx) + blobId.length() + 1;
- struct BlobMeta lmeta;
+ BlobMeta lmeta;
lmeta.blobState = 0x01;
lmeta.size = 0x100;
lmeta.metadata.push_back(0x01);
@@ -143,8 +143,8 @@
rep.metadataLen = lmeta.metadata.size();
EXPECT_CALL(mgr, stat(Matcher<const std::string&>(StrEq(blobId)),
- Matcher<struct BlobMeta*>(NotNull())))
- .WillOnce(Invoke([&](const std::string& path, struct BlobMeta* meta) {
+ Matcher<BlobMeta*>(NotNull())))
+ .WillOnce(Invoke([&](const std::string& path, BlobMeta* meta) {
(*meta) = lmeta;
return true;
}));
diff --git a/test/manager_mock.hpp b/test/manager_mock.hpp
index 73d4d07..bfb3348 100644
--- a/test/manager_mock.hpp
+++ b/test/manager_mock.hpp
@@ -20,8 +20,8 @@
MOCK_METHOD0(buildBlobList, uint32_t());
MOCK_METHOD1(getBlobId, std::string(uint32_t));
MOCK_METHOD3(open, bool(uint16_t, const std::string&, uint16_t*));
- MOCK_METHOD2(stat, bool(const std::string&, struct BlobMeta*));
- MOCK_METHOD2(stat, bool(uint16_t, struct BlobMeta*));
+ MOCK_METHOD2(stat, bool(const std::string&, BlobMeta*));
+ MOCK_METHOD2(stat, bool(uint16_t, BlobMeta*));
MOCK_METHOD2(commit, bool(uint16_t, const std::vector<uint8_t>&));
MOCK_METHOD1(close, bool(uint16_t));
MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t));
diff --git a/test/manager_sessionstat_unittest.cpp b/test/manager_sessionstat_unittest.cpp
index 6ae27d3..015a079 100644
--- a/test/manager_sessionstat_unittest.cpp
+++ b/test/manager_sessionstat_unittest.cpp
@@ -14,7 +14,7 @@
// Calling Stat on a session that doesn't exist should return false.
BlobManager mgr;
- struct BlobMeta meta;
+ BlobMeta meta;
uint16_t sess = 1;
EXPECT_FALSE(mgr.stat(sess, &meta));
@@ -36,7 +36,7 @@
EXPECT_CALL(*m1ptr, open(_, flags, path)).WillOnce(Return(true));
EXPECT_TRUE(mgr.open(flags, path, &sess));
- struct BlobMeta meta;
+ BlobMeta meta;
EXPECT_CALL(*m1ptr, stat(sess, &meta)).WillOnce(Return(false));
EXPECT_FALSE(mgr.stat(sess, &meta));
@@ -58,7 +58,7 @@
EXPECT_CALL(*m1ptr, open(_, flags, path)).WillOnce(Return(true));
EXPECT_TRUE(mgr.open(flags, path, &sess));
- struct BlobMeta meta;
+ BlobMeta meta;
EXPECT_CALL(*m1ptr, stat(sess, &meta)).WillOnce(Return(true));
EXPECT_TRUE(mgr.stat(sess, &meta));
diff --git a/test/manager_stat_unittest.cpp b/test/manager_stat_unittest.cpp
index a13a66d..4f66278 100644
--- a/test/manager_stat_unittest.cpp
+++ b/test/manager_stat_unittest.cpp
@@ -17,7 +17,7 @@
auto m1ptr = m1.get();
EXPECT_TRUE(mgr.registerHandler(std::move(m1)));
- struct BlobMeta meta;
+ BlobMeta meta;
std::string path = "/asdf/asdf";
EXPECT_CALL(*m1ptr, canHandleBlob(path)).WillOnce(Return(false));
@@ -33,7 +33,7 @@
auto m1ptr = m1.get();
EXPECT_TRUE(mgr.registerHandler(std::move(m1)));
- struct BlobMeta meta;
+ BlobMeta meta;
std::string path = "/asdf/asdf";
EXPECT_CALL(*m1ptr, canHandleBlob(path)).WillOnce(Return(true));
EXPECT_CALL(*m1ptr, stat(path, &meta)).WillOnce(Return(false));
@@ -50,7 +50,7 @@
auto m1ptr = m1.get();
EXPECT_TRUE(mgr.registerHandler(std::move(m1)));
- struct BlobMeta meta;
+ BlobMeta meta;
std::string path = "/asdf/asdf";
EXPECT_CALL(*m1ptr, canHandleBlob(path)).WillOnce(Return(true));
EXPECT_CALL(*m1ptr, stat(path, &meta)).WillOnce(Return(true));