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_sessionstat_unittest.cpp b/bmc/test/firmware_sessionstat_unittest.cpp
index 0e2796c..896dd70 100644
--- a/bmc/test/firmware_sessionstat_unittest.cpp
+++ b/bmc/test/firmware_sessionstat_unittest.cpp
@@ -47,7 +47,7 @@
      * P2A to for now.  Later, LPC may have reason to provide data, and can by
      * simply implementing read().
      */
-    EXPECT_CALL(dataMock, open()).WillOnce(Return(true));
+    EXPECT_CALL(*dataMock, open()).WillOnce(Return(true));
     EXPECT_CALL(*imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
@@ -56,7 +56,7 @@
     int size = 512;
     EXPECT_CALL(*imageMock, getSize()).WillOnce(Return(size));
     std::vector<std::uint8_t> mBytes = {0x01, 0x02};
-    EXPECT_CALL(dataMock, readMeta()).WillOnce(Return(mBytes));
+    EXPECT_CALL(*dataMock, readMeta()).WillOnce(Return(mBytes));
 
     blobs::BlobMeta meta;
     EXPECT_TRUE(handler->stat(0, &meta));