Gather association maps into a single structure
The AssociationOwners and AssociationIntefaces maps are passed around
separately in the mapper, but usually they are always used together.
Gather them into a structure to make it easier to write code to use
them, especially because soon there will be another entry in it.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ibd5b622c7c1240ff8e23846368cbfd56e5bba24d
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index a48c254..4f0d2c4 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -35,14 +35,13 @@
TEST_F(TestInterfacesAdded, InterfacesAddedGoodPath)
{
interface_map_type interfaceMap;
- AssociationOwnersType assocOwners;
- AssociationInterfaces assocInterfaces;
+ AssociationMaps assocMaps;
+
auto intfAdded = createInterfacesAdded(
assocDefsInterface, getAssocDefPropName(assocDefsInterface));
processInterfaceAdded(interfaceMap, DEFAULT_SOURCE_PATH, intfAdded,
- DEFAULT_DBUS_SVC, assocOwners, assocInterfaces,
- *server);
+ DEFAULT_DBUS_SVC, assocMaps, *server);
// Interface map will get the following:
// /logging/entry/1 /logging/entry /logging/ /
@@ -51,25 +50,24 @@
// New association ower created so ensure it now contains a single entry
// dump_AssociationOwnersType(assocOwners);
- EXPECT_EQ(assocOwners.size(), 1);
+ EXPECT_EQ(assocMaps.owners.size(), 1);
// Ensure the 2 association interfaces were created
// dump_AssociationInterfaces(assocInterfaces);
- EXPECT_EQ(assocInterfaces.size(), 2);
+ EXPECT_EQ(assocMaps.ifaces.size(), 2);
}
TEST_F(TestInterfacesAdded, OrgOpenBmcInterfacesAddedGoodPath)
{
interface_map_type interfaceMap;
- AssociationOwnersType assocOwners;
- AssociationInterfaces assocInterfaces;
+ AssociationMaps assocMaps;
+
auto intfAdded = createInterfacesAdded(
orgOpenBMCAssocDefsInterface,
getAssocDefPropName(orgOpenBMCAssocDefsInterface));
processInterfaceAdded(interfaceMap, DEFAULT_SOURCE_PATH, intfAdded,
- DEFAULT_DBUS_SVC, assocOwners, assocInterfaces,
- *server);
+ DEFAULT_DBUS_SVC, assocMaps, *server);
// Interface map will get the following:
// /logging/entry/1 /logging/entry /logging/ /
@@ -78,9 +76,9 @@
// New association ower created so ensure it now contains a single entry
// dump_AssociationOwnersType(assocOwners);
- EXPECT_EQ(assocOwners.size(), 1);
+ EXPECT_EQ(assocMaps.owners.size(), 1);
// Ensure the 2 association interfaces were created
// dump_AssociationInterfaces(assocInterfaces);
- EXPECT_EQ(assocInterfaces.size(), 2);
+ EXPECT_EQ(assocMaps.ifaces.size(), 2);
}