diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2015-11-04 14:27:10 -0600 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-02-19 17:06:05 -0600 |
commit | 3fd70a51b397987f839af987287f5afbb2fc087f (patch) | |
tree | 1646db363a6b0101aa3cccb44acdff790396187d /src/usr/targeting/test | |
parent | 630c8445144892228a297278c5647222484e0563 (diff) | |
download | talos-hostboot-3fd70a51b397987f839af987287f5afbb2fc087f.tar.gz talos-hostboot-3fd70a51b397987f839af987287f5afbb2fc087f.zip |
Adding support for signed attributes.
Change-Id: I38d54a0d27346e73a7ba568df1cd47350cf56e33
RTC:137559
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23058
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/test')
-rw-r--r-- | src/usr/targeting/test/testtargeting.H | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/usr/targeting/test/testtargeting.H b/src/usr/targeting/test/testtargeting.H index fdd4702da..73f7c0d1b 100644 --- a/src/usr/targeting/test/testtargeting.H +++ b/src/usr/targeting/test/testtargeting.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -273,6 +273,45 @@ class TargetingTestSuite : public CxxTest::TestSuite #endif TS_TRACE(EXIT_MRK "testL4Target" ); } + + /** + * @brief Testing Hostboot support for negative attributes + */ + void testSignedAttribute() + { + TS_TRACE(ENTER_MRK "testSignedAttribute"); + + // TODO RTC 144142 + + TARGETING::Target* l_sys = NULL; + TARGETING::targetService().getTopLevelTarget(l_sys); + int8_t signedAttr = -5; + + // Attempt to set the attribute to a negative number + if(l_sys->trySetAttr<TARGETING::ATTR_TEST_NEGATIVE_FCN>(signedAttr)) + { + TS_TRACE("testSignedAttribute: Attribute is %d",signedAttr); + } + else + { + TS_FAIL("testSignedAttribute: Attribute failed during set"); + } + + signedAttr = 0; + + l_sys->tryGetAttr<TARGETING::ATTR_TEST_NEGATIVE_FCN>(signedAttr); + if(signedAttr < 0) + { + TS_TRACE("testSignedAttribute: Attribute is %d",signedAttr); + } + else + { + TS_FAIL("testSignedAttribute: Attribute is incorrectly positive"); + } + + TS_TRACE(EXIT_MRK "testSignedAttribute"); + } + }; #endif // End __TARGETING_TESTTARGETING_H |