本文整理汇总了C++中TBuf8::CompareF方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::CompareF方法的具体用法?C++ TBuf8::CompareF怎么用?C++ TBuf8::CompareF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf8
的用法示例。
在下文中一共展示了TBuf8::CompareF方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CTestUtilClass::TestUtilClass_Step3point1L()
{
//
// Test reading of SCA form a PDU (no removal)
//
// Create a PDU
RMobilePhone::TMobileAddress addr;
addr.iTypeOfNumber=RMobilePhone::EInternationalNumber;
addr.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
addr.iTelNumber.Copy(_L("44 7785 016 005"));
TBuf8<400> buf;
buf.Zero();
TESTL(KErrNone == CATSmsUtils::AppendAddressToAscii(buf,addr));
if(buf.CompareF(_L8("0c91447758100650"))!=0)
TESTL(KErrCorrupt);
// fill data with garbage
addr.iTypeOfNumber=RMobilePhone::ESubscriberNumber;
addr.iNumberPlan=RMobilePhone::EDataNumberPlan;
addr.iTelNumber.Copy(KTelNumberGarbage);
// Get SCA from PDU and validate the output
INFO_PRINTF1(_L(".."));
TESTL(KErrNone == CATSmsUtils::ReadAddressFromAscii(buf,addr));
if(addr.iTypeOfNumber!=RMobilePhone::EInternationalNumber ||
addr.iNumberPlan!=RMobilePhone::EIsdnNumberPlan ||
addr.iTelNumber.Compare(_L("01632960000"))!=0 ||
buf.Length()!=16)
TESTL(KErrCorrupt);
// Create a PDU
addr.iTypeOfNumber=RMobilePhone::EInternationalNumber;
addr.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
addr.iTelNumber.Copy(_L("44 7785 016 005"));
buf.Zero();
TESTL(KErrNone == CATSmsUtils::AppendAddressToAscii(buf,addr));
if(buf.CompareF(_L8("0c91447758100650"))!=0)
TESTL(KErrCorrupt);
// Modify PDU so it uses 03.40 SCA length format
buf[1]=static_cast<TUint8>(TChar('7'));
// fill data with garbage
addr.iTypeOfNumber=RMobilePhone::ESubscriberNumber;
addr.iNumberPlan=RMobilePhone::EDataNumberPlan;
addr.iTelNumber.Copy(KTelNumberGarbage);
// Get SCA from PDU (specifying PDU is in 03.40 format) and validate the output
INFO_PRINTF1(_L(".."));
TESTL(KErrNone == CATSmsUtils::ReadAddressFromAscii(buf,addr,ETrue));
if(addr.iTypeOfNumber!=RMobilePhone::EInternationalNumber ||
addr.iNumberPlan!=RMobilePhone::EIsdnNumberPlan ||
addr.iTelNumber.Compare(_L("01632960000"))!=0 ||
buf.Length()!=16)
TESTL(KErrCorrupt);
}
示例2: UT_CMceSecureDesStream_GenerateCryptoSuiteLineL
void UT_CMceSecureDesStream::UT_CMceSecureDesStream_GenerateCryptoSuiteLineL()
{
TMceSecureCryptoInfo crypto;
TBuf8< KCryptoLineMaxLength > cryptoLine;
/*=============Test case 1 ====================================================*/
crypto.iEncAlgms = ESrtpNullAlg;
iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto );
EUNIT_ASSERT( iSecureStream->iGnoreSdpMsg );
cryptoLine.Zero();
iSecureStream->iGnoreSdpMsg = EFalse;
/*=============Test case 2 ====================================================*/
crypto.iTagLen = KAuthTagLength80;
crypto.iEncAlgms = ESrtpEncAES_CM;
EUNIT_ASSERT_SPECIFIC_LEAVE( iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto ), KErrArgument);
cryptoLine.Zero();
/*=============Test case 3 ====================================================*/
crypto.iTagLen = KAuthTagLength80;
crypto.iEncodedKey = KEncodedKey;
crypto.iMKIUsed = ETrue;
crypto.iMKI = KMKI1 ;
cryptoLine.Copy( KNullDesC8);
iSecureStream->GenerateCryptoSuiteLineL( cryptoLine, crypto );
EUNIT_ASSERT ( cryptoLine.CompareF( KCryptoLine2 )==0 );
EUNIT_ASSERT( !iSecureStream->iGnoreSdpMsg );
cryptoLine.Zero();
crypto.CryptoDestruct();
}
示例3: CheckVariantValue
TBool CHttpClientTestParams::CheckVariantValue(const THttpHeaderValueVariant& aVariant, const TDesC8& aValueToMatch)
{
TBool ret = EFalse;
switch(aVariant.Type())
{
case THttpHeaderValueVariant::EIntType:
{
_LIT8(KIntType, "%d");
TBuf8<16> buf;
buf.Format(KIntType(), aVariant.Int());
ret = (buf.CompareF(aValueToMatch) == 0);
}
break;
case THttpHeaderValueVariant::EStrType:
{
ret = (aVariant.Str().CompareF(aValueToMatch) == 0);
}
break;
case THttpHeaderValueVariant::EDateTimeType:
{
TInternetDate internetDate(aVariant.DateTime());
HBufC8* dateTimeStr = internetDate.InternetDateTimeL(TInternetDate::ERfc1123Format);
ret = aValueToMatch.CompareF(*dateTimeStr) == 0;
delete dateTimeStr;
}
break;
default:
User::Invariant();
}
return ret;
}
示例4: ReadNextLineL
TInt CTmsTestStep::ReadNextLineL( RFile &aFile, TDes8 &aLine )
// read a cr/lf limiited line from the file, assumes file is a valid file
// and that aLine is of sufficient length to hold the data
{
aLine.Zero();
TBuf8<1> chr;
for (;;)
{
aFile.Read(chr);
if ( chr.Length() == 0 )
{
break;
}
if (chr.CompareF(KRet) == 0)
{
// got a line, exctract newline as well
aFile.Read(chr);
break;
}
else
{
aLine.Append(chr);
}
}
return aLine.Length();
}