Update pldm_entity_association_tree_add method
Update to the signature changes for
pldm_entity_association_tree_add method to
pldm_entity_association_tree_add_entity and add necessary
arguments for the same as per the libpldm changes done for
the method.
Reference: https://gerrit.openbmc.org/c/openbmc/libpldm/+/65484
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Iaf233da29d4250c9139d2dd7e630fe796a62719c
diff --git a/host-bmc/test/utils_test.cpp b/host-bmc/test/utils_test.cpp
index 45653ec..d686dc0 100644
--- a/host-bmc/test/utils_test.cpp
+++ b/host-bmc/test/utils_test.cpp
@@ -12,7 +12,7 @@
TEST(EntityAssociation, addObjectPathEntityAssociations1)
{
- pldm_entity entities[41]{};
+ pldm_entity entities[8]{};
entities[0].entity_type = 45;
entities[0].entity_container_id = 0;
@@ -36,26 +36,34 @@
auto tree = pldm_entity_association_tree_init();
- auto l1 = pldm_entity_association_tree_add(tree, &entities[0], 1, nullptr,
- PLDM_ENTITY_ASSOCIAION_PHYSICAL);
+ auto l1 = pldm_entity_association_tree_add_entity(
+ tree, &entities[0], 1, nullptr, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true,
+ true, 0xFFFF);
- auto l2 = pldm_entity_association_tree_add(tree, &entities[1], 1, l1,
- PLDM_ENTITY_ASSOCIAION_PHYSICAL);
+ auto l2 = pldm_entity_association_tree_add_entity(
+ tree, &entities[1], 1, l1, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
- auto l3a = pldm_entity_association_tree_add(
- tree, &entities[2], 0, l2, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
- auto l3b = pldm_entity_association_tree_add(
- tree, &entities[3], 1, l2, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
+ auto l3a = pldm_entity_association_tree_add_entity(
+ tree, &entities[2], 0, l2, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
+ auto l3b = pldm_entity_association_tree_add_entity(
+ tree, &entities[3], 1, l2, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
- auto l4a = pldm_entity_association_tree_add(
- tree, &entities[4], 0, l3a, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
- auto l4b = pldm_entity_association_tree_add(
- tree, &entities[5], 1, l3a, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
+ auto l4a = pldm_entity_association_tree_add_entity(
+ tree, &entities[4], 0, l3a, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
+ auto l4b = pldm_entity_association_tree_add_entity(
+ tree, &entities[5], 1, l3a, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
- auto l5a = pldm_entity_association_tree_add(
- tree, &entities[6], 0, l3b, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
- auto l5b = pldm_entity_association_tree_add(
- tree, &entities[7], 1, l3b, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
+ auto l5a = pldm_entity_association_tree_add_entity(
+ tree, &entities[6], 0, l3b, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
+ auto l5b = pldm_entity_association_tree_add_entity(
+ tree, &entities[7], 1, l3b, PLDM_ENTITY_ASSOCIAION_PHYSICAL, true, true,
+ 0xFFFF);
EntityAssociations entityAssociations = {
{l1, l2}, {l2, l3a, l3b}, {l3a, l4a, l4b}, {l3b, l5a, l5b}};
@@ -64,12 +72,12 @@
{"/xyz/openbmc_project/inventory/chassis1", l1},
{"/xyz/openbmc_project/inventory/chassis1/motherboard1", l2},
{"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm0", l3a},
- {"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm1", l3b},
{"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm0/cpu0", l4a},
{"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm0/cpu1", l4b},
+ {"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm1", l3b},
{"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm1/cpu0", l5a},
- {"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm1/cpu1", l5b},
- };
+ {"/xyz/openbmc_project/inventory/chassis1/motherboard1/dcm1/cpu1",
+ l5b}};
ObjectPathMaps objPathMap;
updateEntityAssociation(entityAssociations, tree, objPathMap);