util: create util object for bmc and tool
Create a common util object for the BMC library and host tool. Place in
blobs namespace favoring BMC.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I036fd65d924c65fcfa71aba5cd76275a2941ff14
diff --git a/test/firmware_handler_unittest.cpp b/test/firmware_handler_unittest.cpp
index 1457a3b..020d7ff 100644
--- a/test/firmware_handler_unittest.cpp
+++ b/test/firmware_handler_unittest.cpp
@@ -1,5 +1,6 @@
#include "firmware_handler.hpp"
#include "image_mock.hpp"
+#include "util.hpp"
#include <algorithm>
#include <sdbusplus/test/sdbus_mock.hpp>
@@ -28,7 +29,7 @@
ImageHandlerMock imageMock;
std::vector<HandlerPack> blobs = {
- {FirmwareBlobHandler::hashBlobID, &imageMock},
+ {hashBlobId, &imageMock},
{"asdf", &imageMock},
};
@@ -58,16 +59,14 @@
std::move(bus_mock), blobs, data);
EXPECT_EQ(handler, nullptr);
- blobs.push_back({FirmwareBlobHandler::hashBlobID, &imageMock});
+ blobs.push_back({hashBlobId, &imageMock});
handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
std::move(bus_mock), blobs, data);
auto result = handler->getBlobIds();
EXPECT_EQ(3, result.size());
EXPECT_EQ(3, std::count(result.begin(), result.end(), "asdf") +
- std::count(result.begin(), result.end(),
- FirmwareBlobHandler::hashBlobID) +
- std::count(result.begin(), result.end(),
- FirmwareBlobHandler::verifyBlobID));
+ std::count(result.begin(), result.end(), hashBlobId) +
+ std::count(result.begin(), result.end(), verifyBlobId));
}
} // namespace blobs