From 3fd70a51b397987f839af987287f5afbb2fc087f Mon Sep 17 00:00:00 2001 From: Elizabeth Liner Date: Wed, 4 Nov 2015 14:27:10 -0600 Subject: 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 --- src/usr/targeting/test/testtargeting.H | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/usr/targeting/test') 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(signedAttr)) + { + TS_TRACE("testSignedAttribute: Attribute is %d",signedAttr); + } + else + { + TS_FAIL("testSignedAttribute: Attribute failed during set"); + } + + signedAttr = 0; + + l_sys->tryGetAttr(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 -- cgit v1.2.3