/** Test MSdpElementBuilder::BuildIntL() */ void CT_DataSdpElementBuilder::DoCmdBuildIntL(MSdpElementBuilder& aElementBuilder, const TDesC& aSection) { iDataWrapper.INFO_PRINTF1(_L("MSdpElementBuilder BuildIntL Call")); TPtrC theString; TPtrC sdpIntBufName; TBool foundParameter=EFalse; if( iDataWrapper.GetStringFromConfig(aSection, KInt(), theString) ) { foundParameter=ETrue; HBufC8* theString8 = HBufC8::NewLC(theString.Length()); theString8->Des().Copy(theString); TPtrC8 stringPtr = theString8->Des(); TRAPD(err, aElementBuilder.BuildIntL(stringPtr)); if(err != KErrNone) { iDataWrapper.ERR_PRINTF2(_L("MSdpElementBuilder BuildIntL failed with error %d"), err); iDataWrapper.SetError(err); } CleanupStack::PopAndDestroy(theString8); } if ( iDataWrapper.GetStringFromConfig(aSection, KSdpIntBufObj(), sdpIntBufName) ) { foundParameter=ETrue; TAny* object=iDataWrapper.GetDataObjectL(sdpIntBufName); TSdpIntBuf<TUint8>* sdpIntBuf = static_cast<TSdpIntBuf<TUint8>*>(object); TSdpIntBuf<TUint8> sdpIntObj = *sdpIntBuf; const TUint8 *tmp=&sdpIntObj[0]; TPtrC8 bufferPtr(tmp, sdpIntObj.Length()); TRAPD(err, aElementBuilder.BuildIntL(bufferPtr)); if ( err!=KErrNone ) { iDataWrapper.ERR_PRINTF2(_L("MSdpElementBuilder BuildIntL failed with error %d"), err); iDataWrapper.SetError(err); } } if (!foundParameter) { iDataWrapper.ERR_PRINTF2(_L("Missing parameter %S"), &KSdpIntBufObj()); iDataWrapper.SetBlockResult(EFail); } }