Remove Object from testcase

Currently the testcase and the application both define their
own Object type.  Move to a common header.

Change-Id: I05dba67dca7855f522be299fcfd361913ed73fbc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/manager.hpp b/manager.hpp
index 616e45d..33980b9 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -8,6 +8,7 @@
 #include "xyz/openbmc_project/Inventory/Manager/server.hpp"
 #include "events.hpp"
 #include "actions.hpp"
+#include "types.hpp"
 
 namespace phosphor
 {
@@ -76,9 +77,6 @@
          */
         Manager(sdbusplus::bus::bus&&, const char*, const char*, const char*);
 
-        using Object = std::map <
-                       std::string, std::map <
-                       std::string, sdbusplus::message::variant<int64_t, std::string >>>;
         using EventInfo = std::tuple <
                           std::vector<details::EventBasePtr>,
                           std::vector<details::ActionBasePtr >>;
diff --git a/test/test.cpp b/test/test.cpp
index e4b6a45..21f89e2 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -91,6 +91,8 @@
     sdbusplus::server::manager::manager objmgr;
 };
 
+using Object = phosphor::inventory::manager::Object;
+
 /** @class SignalQueue
  *  @brief Store DBus signals in a queue.
  */
@@ -136,18 +138,10 @@
         sdbusplus::message::message _next;
 };
 
-template <typename ...T>
-using Object = std::map <
-               std::string,
-               std::map <
-               std::string,
-               sdbusplus::message::variant<T... >>>;
-
 /**@brief Find a subset of interfaces and properties in an object. */
-template <typename ...T>
-auto hasProperties(const Object<T...>& l, const Object<T...>& r)
+auto hasProperties(const Object& l, const Object& r)
 {
-    Object<T...> result;
+    Object result;
     std::set_difference(
         r.cbegin(),
         r.cend(),
@@ -158,8 +152,7 @@
 }
 
 /**@brief Check an object for one or more interfaces. */
-template <typename ...T>
-auto hasInterfaces(const std::vector<std::string>& l, const Object<T...>& r)
+auto hasInterfaces(const std::vector<std::string>& l, const Object& r)
 {
     std::vector<std::string> stripped, interfaces;
     std::transform(
@@ -201,7 +194,7 @@
                    "Set");
     };
 
-    Object<std::string> obj
+    Object obj
     {
         {
             "xyz.openbmc_project.Example.Iface1",
@@ -229,11 +222,11 @@
         auto sig{queue.pop()};
         assert(sig);
         sdbusplus::message::object_path signalPath;
-        Object<std::string> signalObject;
+        Object signalObjectType;
         sig.read(signalPath);
         assert(path == signalPath.str);
-        sig.read(signalObject);
-        assert(hasProperties(signalObject, obj));
+        sig.read(signalObjectType);
+        assert(hasProperties(signalObjectType, obj));
         auto moreSignals{queue.pop()};
         assert(!moreSignals);
     }
diff --git a/types.hpp b/types.hpp
new file mode 100644
index 0000000..3643bb1
--- /dev/null
+++ b/types.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <map>
+#include <string>
+#include <sdbusplus/message.hpp>
+
+namespace phosphor
+{
+namespace inventory
+{
+namespace manager
+{
+
+/** @brief Inventory manager supported property types. */
+using InterfaceVariantType = sdbusplus::message::variant<int64_t, std::string>;
+
+template <typename T>
+using InterfaceType = std::map<std::string, T>;
+
+template <typename T>
+using ObjectType = std::map<std::string, InterfaceType<T>>;
+
+using Interface = InterfaceType<InterfaceVariantType>;
+using Object = ObjectType<InterfaceVariantType>;
+
+} // namespace manager
+} // namespace inventory
+} // namespace phosphor
+
+// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4