summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/test/fapi2TestUtils.H
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-03-30 20:59:51 -0500
committerStephen Cprek <smcprek@us.ibm.com>2016-04-21 13:51:41 -0500
commit75fc7001ace168ef7c687d3b938d58c9e5adf48f (patch)
tree9ccb0814f8b30245523ffc108da66181f1add71d /src/usr/fapi2/test/fapi2TestUtils.H
parent43b31e59ca4f20d8172c8daff89eb0f648d14238 (diff)
downloadtalos-hostboot-75fc7001ace168ef7c687d3b938d58c9e5adf48f.tar.gz
talos-hostboot-75fc7001ace168ef7c687d3b938d58c9e5adf48f.zip
Fix format of fapi2 test cases
Refactoring some tests now so it follows what the other cases are doing. Note: I am pulling in some code from an abandoned commit in for toString test so it looks like new code is being added but really things are just moving around Change-Id: I7706c304f3ef3369e56516ac81f88dc91d059bf2 RTC:150514 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22692 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test/fapi2TestUtils.H')
-rw-r--r--src/usr/fapi2/test/fapi2TestUtils.H20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/usr/fapi2/test/fapi2TestUtils.H b/src/usr/fapi2/test/fapi2TestUtils.H
index 2fafc296b..c2f6d2649 100644
--- a/src/usr/fapi2/test/fapi2TestUtils.H
+++ b/src/usr/fapi2/test/fapi2TestUtils.H
@@ -118,6 +118,26 @@ enum PERVASIVE_RANGE {
void generateTargets(TARGETING::Target* i_pMasterProcChip,
TARGETING::Target* o_targetList[]);
+/**
+* @brief Helper to get the parent pervasive of the given target
+*
+* @tparam K Input target's FAPI2 type
+* @tparam V Platform target handle type
+*
+* @param[in] i_pTarget Targeting target
+*
+* @return Platform target handle giving the pervasive of the input target
+* @retval NULL No parent found
+* @retval !NULL Parent found, equal to the retval
+ */
+template< TargetType K, typename V = plat_target_handle_t >
+inline V getPervasiveParent(V i_pTarget)
+{
+ Target<K,V> fapi2_target(i_pTarget);
+ return static_cast<V>(
+ fapi2_target.template getParent<TARGET_TYPE_PERV>());
+}
+
} // End namespace fapi2
#endif
OpenPOWER on IntegriCloud