当前位置: 首页>>代码示例>>C++>>正文


C++ TBuf8::CompareF方法代码示例

本文整理汇总了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);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:59,代码来源:Te_SimSms.cpp

示例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();
	}
开发者ID:piashishi,项目名称:mce,代码行数:28,代码来源:UT_CMceSecureDesStream.cpp

示例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;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:34,代码来源:chttpclienttestparams.cpp

示例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();
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:27,代码来源:appfwk_tmsteststep.cpp


注:本文中的TBuf8::CompareF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。