bmc: move data handler to owned object
To handle the case where one cannot have complex static or global
objects, the object must be owned. In this case, it is reasonable to
pass ownership to the only object that will use the data handler.
Alternatively, singletons can be used to get around this, but just using
ownership is more appropriate.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I47b291d1cd01af9d4b7287c1411ed9ba37aa7a4c
diff --git a/bmc/test/firmware_open_unittest.cpp b/bmc/test/firmware_open_unittest.cpp
index a2e3d95..ba0ac87 100644
--- a/bmc/test/firmware_open_unittest.cpp
+++ b/bmc/test/firmware_open_unittest.cpp
@@ -20,11 +20,10 @@
TEST_P(FirmwareOpenFailTest, WithFlags)
{
- std::vector<DataHandlerPack> data = {
- {FirmwareFlags::UpdateFlags::ipmi, nullptr},
- {FirmwareFlags::UpdateFlags::p2a, nullptr},
- {FirmwareFlags::UpdateFlags::lpc, nullptr},
- };
+ std::vector<DataHandlerPack> data;
+ data.emplace_back(FirmwareFlags::UpdateFlags::ipmi, nullptr);
+ data.emplace_back(FirmwareFlags::UpdateFlags::p2a, nullptr);
+ data.emplace_back(FirmwareFlags::UpdateFlags::lpc, nullptr);
std::vector<HandlerPack> blobs;
blobs.push_back(std::move(