diff options
author | Mike Jones <mjjones@us.ibm.com> | 2011-10-17 16:50:16 -0500 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-10-17 17:18:09 -0500 |
commit | c90b9bb32581d9d512160ef06cb2c60d34b41a1b (patch) | |
tree | 07ea29ace5b340db582f94c04e77fc7f640d1202 /src/usr/hwpf/hwp/fapiTestHwpAttr.C | |
parent | ed476565dd6a2881c3823e92372e2fdee672478c (diff) | |
download | blackbird-hostboot-c90b9bb32581d9d512160ef06cb2c60d34b41a1b.tar.gz blackbird-hostboot-c90b9bb32581d9d512160ef06cb2c60d34b41a1b.zip |
HWPF: Add support for attribute enum values
Change-Id: Ie11b36684ecd7c4029dddfb90f1a0ff97a33dce1
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/439
Tested-by: Jenkins Server
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/fapiTestHwpAttr.C')
-rwxr-xr-x | src/usr/hwpf/hwp/fapiTestHwpAttr.C | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/usr/hwpf/hwp/fapiTestHwpAttr.C b/src/usr/hwpf/hwp/fapiTestHwpAttr.C index dd07721a5..b5e07296f 100755 --- a/src/usr/hwpf/hwp/fapiTestHwpAttr.C +++ b/src/usr/hwpf/hwp/fapiTestHwpAttr.C @@ -35,8 +35,8 @@ * mjjones 09/07/2011 Update to test scratch attrs * mjjones 10/06/2011 Updates traces * mjjones 10/07/2011 Removed target param - * Test scratch attributes - * + * mjjones 10/15/2011 Test scratch attributes + * mjjones 10/17/2011 Update scratch test */ #include <fapiTestHwpAttr.H> @@ -962,6 +962,48 @@ fapi::ReturnCode hwpTestAttributes() } //---------------------------------------------------------------------- + // Test setting and getting an enum value from a scratch attribute + //---------------------------------------------------------------------- + { + uint64_t l_uint64 = fapi::ATTR_SCRATCH_UINT64_2_VAL_C; + + // Test set + l_rc = FAPI_ATTR_SET(ATTR_SCRATCH_UINT64_2, NULL, l_uint64); + if (l_rc) + { + FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. Error from SET (enum)"); + break; + } + + // Test get + l_uint64 = 0; + l_rc = FAPI_ATTR_GET(ATTR_SCRATCH_UINT64_2, NULL, l_uint64); + if (l_rc) + { + FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. Error from GET (enum)"); + break; + } + + // Check value + if (l_uint64 != fapi::ATTR_SCRATCH_UINT64_2_VAL_C) + { + l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL; + FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. GET returned %d (enum)", + static_cast<uint32_t>(l_uint64)); + break; + } + + // Set to zero + l_uint64 = 0; + l_rc = FAPI_ATTR_SET(ATTR_SCRATCH_UINT64_2, NULL, l_uint64); + if (l_rc) + { + FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. Error from SET (enum2)"); + break; + } + } + + //---------------------------------------------------------------------- // Test getting scratch attributes with the fapiGetInitFileAttr function //---------------------------------------------------------------------- uint64_t l_val = 0; @@ -1007,7 +1049,8 @@ fapi::ReturnCode hwpTestAttributes() } //---------------------------------------------------------------------- - // Test getting an invalid scratch attribute + // Test getting an invalid scratch attribute with the + // fapiGetInitFileAttr function //---------------------------------------------------------------------- fapi::AttributeId l_badId = static_cast<fapi::AttributeId>(0xff); l_rc = fapiGetInitFileAttr(l_badId, NULL, l_val); |