diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2018-05-18 14:30:46 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-05-29 15:44:09 -0400 |
commit | a166a390e16f229f1eb77406a1bfcc841bc1b781 (patch) | |
tree | 47b591adfbc800c1201ef5f751fa90f31d109118 /src/usr | |
parent | f1186fdef28f6e23a9bda17bbef1d0e217c0430d (diff) | |
download | talos-hostboot-a166a390e16f229f1eb77406a1bfcc841bc1b781.tar.gz talos-hostboot-a166a390e16f229f1eb77406a1bfcc841bc1b781.zip |
Move existing tests to use new helper function
There was some common code in this test file that was being
repeated in each test case. Move those functions over to the new
helper interface.
Change-Id: I4fe5a44ed50633116ed11258ae453b23b26abfbc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59074
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/fapi2/test/fapi2GetChildrenTest.H | 83 |
1 files changed, 21 insertions, 62 deletions
diff --git a/src/usr/fapi2/test/fapi2GetChildrenTest.H b/src/usr/fapi2/test/fapi2GetChildrenTest.H index 5d2fac45f..12af3432f 100644 --- a/src/usr/fapi2/test/fapi2GetChildrenTest.H +++ b/src/usr/fapi2/test/fapi2GetChildrenTest.H @@ -131,29 +131,16 @@ void test_fapi2GetChildren() TARGETING::Target * l_proc = nullptr; do { - // Create a vector of TARGETING::Target pointers - TARGETING::TargetHandleList l_chipList; - - // Get a list of all of the proc chips - TARGETING::getAllChips(l_chipList, TARGETING::TYPE_PROC, false); - - //Take the first proc and use it - for(uint32_t i = 0; i < l_chipList.size(); i++) + numTests++; + l_err = getProc(l_nimbusProc, l_cumulusProc); + if(l_err) { - if(TARGETING::MODEL_NIMBUS == - l_chipList[i]->getAttr<TARGETING::ATTR_MODEL>()) - { - l_nimbusProc = l_chipList[i]; - break; - } - if(TARGETING::MODEL_CUMULUS == - l_chipList[i]->getAttr<TARGETING::ATTR_MODEL>()) - { - l_cumulusProc = l_chipList[i]; - break; - } + errlCommit(l_err,HWPF_COMP_ID); + numFails++; + TS_FAIL("test_fapi2GetChildren Fail: could not find any proc, skipping tests"); + break; } - numTests++; + if (l_nimbusProc != nullptr) { l_proc = l_nimbusProc; @@ -164,24 +151,10 @@ void test_fapi2GetChildren() } else //both are nullptr { - // Send an errorlog because we cannot find any NIMBUS procs. - FAPI_ERR("FAPI2_GETCHILDREN:: could not find any procs, skipping tests"); + // Should never get here since error should have been returned + // above + FAPI_ERR("test_fapi2GetChildren: Never Should Happen"); numFails++; - /*@ - * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE - * @moduleid fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_TEST - * @reasoncode fapi2::RC_NO_PROCS_FOUND - * @userdata1 Model Type we looked for - * @userdata2 Other Model Type we looked for - * @devdesc Could not find any procs in system model - */ - l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_TEST, - fapi2::RC_NO_PROCS_FOUND, - TARGETING::MODEL_NIMBUS, - TARGETING::MODEL_CUMULUS, - true/*SW Error*/); - errlCommit(l_err,HWPF_COMP_ID); break; } @@ -739,29 +712,15 @@ void test_fapi2GetChildrenFilter() { FAPI_DBG("start of test_fapi2GetChildrenFilter()"); - // Create a vector of TARGETING::Target pointers - TARGETING::TargetHandleList l_chipList; - - // Get a list of all of the proc chips - TARGETING::getAllChips(l_chipList, TARGETING::TYPE_PROC, false); - - //Take the first NIMBUS proc and use it - for(uint32_t i = 0; i < l_chipList.size(); i++) + numTests++; + l_err = getProc(l_nimbusProc, l_cumulusProc); + if(l_err) { - if(TARGETING::MODEL_NIMBUS == - l_chipList[i]->getAttr<TARGETING::ATTR_MODEL>()) - { - l_nimbusProc = l_chipList[i]; - break; - } - if(TARGETING::MODEL_CUMULUS == - l_chipList[i]->getAttr<TARGETING::ATTR_MODEL>()) - { - l_cumulusProc = l_chipList[i]; - break; - } + errlCommit(l_err,HWPF_COMP_ID); + numFails++; + TS_FAIL("test_fapi2GetChildrenFilter Fail: could not find any proc, skipping tests"); + break; } - numTests++; if (l_nimbusProc != nullptr) { @@ -773,10 +732,10 @@ void test_fapi2GetChildrenFilter() } else //both are nullptr { - // Send an errorlog because we cannot find any procs. - FAPI_ERR("FAPI2_GETCHILDREN:: could not find any proc, skipping tests"); + // Should never get here since error should have been returned + // above + FAPI_ERR("test_fapi2GetChildrenFilter: Never Should Happen"); numFails++; - TS_FAIL("test_fapi2GetChildrenFilter Fail: could not find any proc, skipping tests"); break; } |