void CTestLtsyPhbkWrite::WriteEntryL(TInt aIndex)
	{
	TRequestStatus status;
	TBuf8<800> pbData; // Client reserved space for phonebook data
	TInt ret;
	    
	_LIT16(KTel,"123456%03d");
	_LIT16(KText,"TelNo %03d");
	TBuf16<20> text(KTel), number(KText);

	CPhoneBookBuffer* pbBuffer = new(ELeave) CPhoneBookBuffer(); // used to write phonebook data
	CleanupStack::PushL(pbBuffer);
	pbBuffer->Set(&pbData); // Set it to point to the Client buffer
	pbBuffer->AddNewEntryTag();
	// convert number into TLV format and append it to allocated buffer
	TInt index = aIndex;
	ret = pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBAdnIndex,(TUint16)index);
	if( ret != KErrNone )
		{
		CleanupStack::PopAndDestroy();
		SetTestStepResult(EFail);
		}
	number.Format(KTel(), index);
	ret=pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBNumber, number);
//	ret=pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBNewEntry, number);
	if( ret != KErrNone )
		{
		CleanupStack::PopAndDestroy();
		SetTestStepResult(EFail);
		}
	// convert number type into TLV format and append it to allocated buffer
	TUint8 tonNpi=KTypeOfNumber; 
	ret=pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBTonNpi, tonNpi);
	if(ret!=KErrNone)
		{
		CleanupStack::PopAndDestroy();
		SetTestStepResult(EFail);
		}

	text.Format(KText(), index);
// convert text into TLV format and append it to allocated buffer
	ret=pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBText, text);
	if(ret != KErrNone)
		{
		CleanupStack::PopAndDestroy();
		SetTestStepResult(EFail);
		}
	PhoneBookStore().Write(status, pbData,index);
	User::WaitForRequest(status);
	TInt r=status.Int();
	INFO_PRINTF2(_L("Write() request status = %d"),r);
	CleanupStack::PopAndDestroy();
	}
// Generation
// -----------------------------------------------------------------------------
// XIMPTestPresenceDataUtils::GenerateIdentityLC()
// -----------------------------------------------------------------------------
//
EXPORT_C CXIMPIdentityImp*
    XIMPTestPresenceDataUtils::GenerateIdentityLC(
                            const TDesC8* aPrefix,
                            TPresenceDataGroup aGroup )
    {
    // According to Group:
    //   Generate uri
    _LIT16( KUri, "http://google.com" );

    //   Generate protocolAddr
    _LIT16( KProtocolAddress, "protocollll" );
    
    CXIMPIdentityImp* pres = CXIMPIdentityImp::NewLC( KUri );
    return pres;    
    }
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"tbuf16tochar");
    TBuf16<20>src(Kname);
    wchar_t * des= NULL; 
    int size=50;
    int retval =ESuccess;
    retval= Tbuf16ToWchar(src,des,size);

    if(retval == EInvalidPointer)
    {
    printf(" Test_tbuf16towchar_invalidpointer PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tbuf16towchar_invalidpointer FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16towchar_nullcheck");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    {
    int retval =ESuccess;
    string str((const char*)"hihihihihihihihi");
    _LIT16(KTxt, "hellohello");
    HBufC16* buff = HBufC16::NewL(10);
    *buff = KTxt;
    CleanupStack::PushL(buff);
    int size = 24;
    retval = Hbufc16ToString(buff,str,size);

    if (retval ==ESuccess)
    {
    printf("hbufc16tostring Passed");
    }
    else
    {
    assert_failed = true;
    printf("hbufc16tostring failed");
    }      
    CleanupStack::PopAndDestroy(1);
    }
    __UHEAP_MARKEND;
    testResultXml("test_hbufc16tostring_positive");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"\xAE");
    TBuf16<20>src(Kname);
    wchar_t * des= new wchar_t [30]; 
    int size=50;
    int retval =ESuccess;
    retval= Tbuf16ToWchar(src,des,size);

    if(retval ==ESuccess)
    {
    printf(" Test_tbuf16towchar_unicode PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tbuf16towchar_unicode FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16towchar_unicode");
	return 0;
}
// -----------------------------------------------------------------------------
// COMASuplWapListener::PrintHex
// 
// -----------------------------------------------------------------------------
//
void COMASuplWapListener::PrintHex(const TDesC8& aBuffer,TInt aLine)
	{
			TBuf<256> buffer;
			TBuf<2> buff;
			_LIT16(KFormat1,"%02x");
			TInt len = aBuffer.Length();
			
			//The buffer is usually larger than what can be logged in a single line in the log file.  As such this should only attempt
			// to log 27 hex blocks to each log line.
			const TInt KNumberOfBlocks = 27;
			TInt blockNumber = KNumberOfBlocks;
			
			for(TInt i = 0 ; i <len; i++)
				{
					//Check to see if the buffer should be logged and then emptied
                    if(i == blockNumber)
                        {
                        //Trace the buffer as it currently is
                        iTrace->Trace(buffer, KTraceFileName, aLine);
                        //Reset the buffer for the next log line
                        buffer.Zero();
                        blockNumber += KNumberOfBlocks;
                        }
					
					buff.Zero();
					buff.Format(KFormat1,aBuffer[i]);
					buffer.Append(buff);	
					buffer.Append(_L(" "));	
				}

				iTrace->Trace(buffer, KTraceFileName, aLine); 											
	}
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"tbuf16tochar");
    TBuf16<20>src(Kname);
    char * des= new char [20]; 
    int size=10;
    int retval =ESuccess;
    retval= Tbuf16ToChar(src,des,size);

    if(retval == EInvalidSize)
    {
    printf(" Test_tbuf16tochar_invalidsize PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tbuf16tochar_invalidsize FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16tochar_invalidsize");
	return 0;
}
TInt CFloggerTest012_01::DoHeapTestWrite()
	{

	_LIT16(KTestMessageOne,"TEST 12.04: Heap Test: The value of test integer variable :%d"); //unicode test decriptor
	RFileLogger::WriteFormat(KStdSubsysTag8, KStdCompTag8, KTestMessageOne, 100);
	return KErrNone;
	}
/**
   @SYMTestCaseID UIF-ETUL-0024

   @SYMREQ DEF114388
 
   @SYMTestCaseDesc Test of CTulAddressStringTokenizer::SearchPhoneNumberL( const TDesC& aText )
                    with all the phone number separators.
  
   @SYMTestPriority Normal 
 
   @SYMTestStatus Implemented
  
   @SYMTestActions There should be 5 phone numbers separators:
                      - KCharLinefeed = 0x000A 
                      - KCharFormfeed = 0x000C
                      - KCharCarriageReturn = 0x000D
                      - KCharLineSeparator = 0x2028
                      - KCharParagraphSeparator = 0x2029
                   With a simple string _LIT16(KTestPhoneSeparator, "11111%c22222")
                   and with all the separators above, we apply the tested function:
                   CTulAddressStringTokenizer::SearchPhoneNumberL( const TDesC& aText )
                      
  
   @SYMTestExpectedResults On the 5 cases, the function should find 2 phone numbers
                           i.e: multiSearch->ItemCount() should be equal to 2
                           otherwise the test fail.
 */
void CT_AddressStringTokenizerStep::TestPhoneSearchSeparatorsL()
	{
	TInt KCharLinefeed = 0x000A;
	TInt KCharFormfeed = 0x000C;
	TInt KCharCarriageReturn = 0x000D;
	TInt KCharLineSeparator = 0x2028;
	TInt KCharParagraphSeparator = 0x2029;
	TInt KSeparators[5]={KCharLinefeed,KCharFormfeed,KCharCarriageReturn,KCharLineSeparator,KCharParagraphSeparator};
	_LIT16(KTestPhoneSeparator, "11111%c22222");
	TBool succeed=ETrue;
	TBuf16<16> str;
	for (TInt k=0;k<5;k++)
		{
		str.Format(KTestPhoneSeparator,KSeparators[k]);
		CTulAddressStringTokenizer* multiSearch = CTulAddressStringTokenizer::NewL(str,
				CTulAddressStringTokenizer::EFindItemSearchPhoneNumberBin);

		 if (multiSearch->ItemCount()!=2)
			 {
			 succeed=EFalse;
			 }
		 delete multiSearch;
		 if (succeed==EFalse)
			 {
			 break;
			 }
		}
	TEST(succeed);	
	}
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"");
    TBuf16<3>src(Kname);
    wchar_t * des= new wchar_t [3]; 
    int size=3;
    int retval =ESuccess;
    retval= Tbuf16ToWchar(src,des,size);

    if(retval == EDescriptorNoData)
    {
    printf(" Test_tbuf16towchar_nodata PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tbuf16towchar_nodata FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16towchar_nodata");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    int retval =ESuccess;
    wchar_t* mycharstring = new wchar_t[30];
    _LIT16(KTxt, "");
    HBufC16* buff = HBufC16::NewL(10);
    *buff = KTxt;
    CleanupStack::PushL(buff);
    int size = 30;
    retval = Hbufc16ToWchar(buff,mycharstring,size);

    if (retval ==EDescriptorNoData)
    {
    printf("hbufc16towchar Passed");
    }
    else
    {
    assert_failed = true;
    printf("hbufc16towchar failed");
    }      
    CleanupStack::PopAndDestroy(1);
    delete []mycharstring;
    mycharstring = NULL; 
    __UHEAP_MARKEND;
    testResultXml("test_hbufc16towchar_negative1");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"helloaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    TBuf16<300>src(Kname);
    char * des=new char[300]; 
    int size=20000;
    int retval =ESuccess;
    retval= Tbufc16ToChar(src,des,size);

    if(retval ==ESuccess)
    {
    printf(" Test_tbufc16tochar_maxsize PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tbufc16tochar_maxsize FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND;
    testResultXml("test_tbufc16tochar_maxsize");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"123");
    TBuf <3>src;
    src.Copy(Kname);
    wchar_t * des= new wchar_t [4]; 
    int size=4;
    int retval =ESuccess;
    retval= Tlitc16ToWchar(src,des,size);

    if(retval ==ESuccess)
    {
    printf(" Test_tlit16towchar_minsize PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tlit16towchar_minsize FAILURE\n");
    }
    delete[] des;
    des = NULL;	
    __UHEAP_MARKEND;
    testResultXml("Test_tlit16towchar_minsize");
	return 0;
}
void main()
{
    __UHEAP_MARK;
    _LIT16(Kname,"tbuf16tochar");
    char * des= new char [20]; 
    int size=50;
    int retval =ESuccess;
    int i=0;
    while (i<=1000)
    {
  	retval= Tlitc16ToChar(Kname,des,size);
    i++;
    printf("%d\n",i);
    }    

    if(retval ==ESuccess)
    {
    printf(" Test_tlit16tochar_positive PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Test_tlit16tochar_positive FAILURE\n");
    }
    delete[] des;
    des = NULL;
    __UHEAP_MARKEND; 
    testResultXml("test_tlit16tochar_positive");
}
int main()
{
    __UHEAP_MARK;
    {
    _LIT16(Kname,"");
    TBuf <20>src;
    src.Copy(Kname);
    string str;
    //int size=10;
    int retval =ESuccess;
    retval= Tlit16ToString(src,str);

    if(retval == EDescriptorNoData)
    {
    printf(" Testtlit16tostring PASSED\n");
    }
    else
    {
    assert_failed = true;
    printf(" Testtlit16tostring FAILURE\n");
    }
    }
    __UHEAP_MARKEND;
    testResultXml("test_tlit16tostring_negative1");
	return 0;
}
void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001bL()
	{
	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();
	OpenSatL();
	
	RSat::TSetUpCallRspV2 resp;
	RSat::TSetUpCallRspV2Pckg respPck(resp);
	RSat::TSetUpCallV6 setupCallData;

	const TUint8 KAddress = 0x91; //10010001

	TData data;
	data.iCommandNumber = 1;
	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
	data.iSourceDevice = KSim;
	data.iDestinationDevice = KNetwork;
	data.iAddress = KAddress;
	data.iCommandType = KSetUpCall;

	//
	// Expected Sequence 2.1 (SET UP CALL, two alpha identifiers)
	//

	data.iCallNumber.Append(0x10);
	data.iCallNumber.Append(0x32);
	data.iCallNumber.Append(0x04);
	data.iCallNumber.Append(0x21);
	data.iCallNumber.Append(0x43);
	data.iCallNumber.Append(0x65);
	data.iCallNumber.Append(0x1C);
	data.iCallNumber.Append(0x2C);

	_LIT8(KAlphaIdentifier8_1, "CONFIRMATION");
	_LIT16(KAlphaIdentifier16, "CONFIRMATION");

	_LIT8(KAlphaIdentifier8_2, "CALL");

	data.iDuration.iIfUse = EFalse;
	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_1, KErrNone, KAlphaIdentifier8_2 );

	DataCompareL(setupCallData, 
			     data.iCommandQualifier,
			     KAlphaIdentifier16, 
			     RSat::EInternationalNumber, 
			     RSat::EIsdnNumberPlan);

	resp.iInfoType = RSat::KNoAdditionalInfo;
	resp.iAdditionalInfo.Zero();
	resp.iGeneralResult = RSat::KSuccess;
	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
	AssertMockLtsyStatusL();

	CleanupStack::PopAndDestroy(1, this); // this
	}
/**
@SYMTestCaseID				SYSLIB-CHARCONV-UT-4020
@SYMTestCaseDesc			Convert out of range characters from foreign character set to Unicode 
@SYMTestPriority			High
@SYMTestActions				Test for ConvertToUnicode() for some out of range foreign characters 0x80 - 0xFF
@SYMTestExpectedResults		Test must not fail
@SYMPREQ					PREQ22265
@SYMREQ						REQ10670
*/
void CT_TURKISHLOCKING::ConvertOutOfRangeForeignCharacters()
	{
	//test foreign chararcter point which is not in the scope, e.g. 0x80 in GSM03.38, which should always mapped to 0xFFFD
	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-UT-4020 Testing Characters not in the Scope "));	
	generatedForeign.SetLength(1);
	generatedForeign[0] = 0x80;
	TInt state=CCnvCharacterSetConverter::KStateDefault;
	_LIT16(KExpected2, "\xfffd"); 	//the expected foreign
	test( 0 == characterSetConverter->ConvertToUnicode(generatedUnicode, generatedForeign, state));
	test( generatedUnicode == KExpected2 );
	}
TInt CFloggerTest012_02::DoTestWrite()
	{
	
	//unicode test decriptor
	_LIT16(KTestMessageTwo,"TEST 12.02: The value of first test integer variable :%d The value of second test integer variable : %d");

	RFileLogger ::WriteFormat(KStdSubsysTag8, KStdCompTag8, KTestMessageTwo, 100, 200);
	
	
	return KErrNone;
	}
TVerdict CSysUtilsGetLangSWVersionNoNewLinesStep::doTestStepL()
	{
	TInt err = SetTestPath(ETrue);
	if( err != KErrNone )
		{
		ERR_PRINTF2(_L("Could not turn test path on. Error = %d"), err);
		SetTestStepResult(EAbort);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("Test path turned on."));
	
	err = DeletePSProperties();
	if( err != KErrNone )
		{
		ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
		SetTestStepResult(EAbort);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("Deleted P&S properties successfully."));

	_LIT16(KDummy,"xxxxx");

	TBuf16<KSysUtilVersionTextLength> version;
	version.Insert(0,KDummy);

	err = SysUtil::GetLangSWVersion( version );
	
	if ( err == KErrNone)
		{
		_LIT(KLangSw, "LangSW");
		TPtrC16 line;
		TESTL( GetStringFromConfig(ConfigSection(), KLangSw, line) );
		TBuf16<KSysUtilVersionTextLength> testBuf(line);
		if (version.Compare(testBuf)==0)
			{
			INFO_PRINTF1(_L("Got version "));
			INFO_PRINTF1(version);
			}
		else
			{
			ERR_PRINTF1(_L("Version not correct"));
			INFO_PRINTF1(version);
			SetTestStepResult(EFail);
			}

		}
	else 
		{
		ERR_PRINTF2(_L("Error code = %d"), err);
		SetTestStepResult(EFail);
		}

	return TestStepResult();
	}
TInt CFloggerTest012_01::DoTestWrite()
	{
	_LIT16(KTestMessageOne,"TEST 12.01: The value of test integer variable :%d"); //unicode test decriptor
	RFileLogger::WriteFormat(KStdSubsysTag8, KStdCompTag8, KTestMessageOne, 100);

	// connect so we can flush file buffer for heap check
	RFileLogger theFlogger;
	theFlogger.Connect();
	theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
	ForceLogFlush(theFlogger);
	theFlogger.Close();	
	
	return KErrNone; 
	}
/*
@SYMTestCaseID GRAPHICS-FREETYPE-0001
@SYMTestCaseDesc Supplementary characters rasterization Test
@SYMTestPriority High
@SYMTestActions  This test checks that the free type rasterizer rasterizes supplementary characters
properly.
It prints the descriptor containing supplementary characters with 2 Fonts. One font does not support
supplementary characters and the other does.
@SYMTestExpectedResults This step should be executed without error and the user should be able to see the
above descriptor is displayed as a square with the first font and in the correct shape with the other font.
@SYMDEF DEF120018 Security issue in FreeType rasterizer! Supplementary characters rendered as BMP
*/
void CTestHarness::SurrogateRasterizedTestsL()
{
    // The literal descriptor consisting of common letter 'A' and Supplementary character 0x20000
    // which is represented by surrogate pair 0xD840 0xDC00
    _LIT16(KSurrogatePairCode, "A\xD840\xDC00");

    // Testing Fonts: DejaVu Sans Condensed does not support Supplementary character.
    // Test2 only supports letter "A" and Supplementary character 0x20000
    TFontSpec fsDejaVuSans(_L("DejaVu Sans Condensed"), 16 * 20);
    TFontSpec fsTest2(_L("Test2"), 16 * 20);

    Clear();

    // Prints test descriptor with font SwissA
    iTestFont = NULL;
    TInt error = iDev->GetNearestFontToDesignHeightInTwips((CFont*&)iTestFont,fsDejaVuSans);
    iStep->TESTL(KErrNone == error);

    if (!iTestFont->IsOpenFont())
    {
        iDev->ReleaseFont(iTestFont);
        iTestFont = NULL;
        User::Leave(KErrGeneral);
    }
    PrintMetrics(EFalse);

    UseFont(iTestFont);
    Print(KSurrogatePairCode);
    iDev->ReleaseFont(iTestFont);

    // Prints test descriptor with font Test2
    iTestFont = NULL;
    error = iDev->GetNearestFontToDesignHeightInTwips((CFont*&)iTestFont,fsTest2);
    iStep->TESTL(KErrNone == error);

    if (!iTestFont->IsOpenFont())
    {
        iDev->ReleaseFont(iTestFont);
        iTestFont = NULL;
        User::Leave(KErrGeneral);
    }
    PrintMetrics(EFalse);

    UseFont(iTestFont);
    Print(KSurrogatePairCode);
    iDev->ReleaseFont(iTestFont);
    iTestFont = NULL;

//	User::After(10000000);
}
TInt TMD5Checker::CheckFileL(class RFs& aFs, const TDesC& aFile, const TDesC16& aHash)
{
   TInt ret = ReadAndHashFileL(aFs, aFile);

   _LIT16(KMd5Prefix, "md5:");
   TInt offset = 0;
   if(aHash.Left(KMd5Prefix().Length()).CompareF(KMd5Prefix) == 0){
      offset = KMd5Prefix().Length();
   }

   for(TUint i = 0; i < sizeof(m_hex_md5_checksum) && ret == KErrNone; ++i){
      ret = (aHash[i+offset] == m_hex_md5_checksum[i]) ? KErrNone :KMd5NoMatch;
   }
   return ret;
}
void CSendAsSender::SendMessageL(const RMessage2 aMessage, TBool aHasCapability)
	{
	__ASSERT_ALWAYS( iState == ESenderIdle, User::Invariant() );
	__ASSERT_ALWAYS( iClientMtm != NULL, User::Invariant() );
	
	iState = ESenderAuthoriseSend;
	// Serialise the recipient list
	const CMsvRecipientList& rcptList = iClientMtm->AddresseeList();
	const MDesC16Array& recipient = rcptList.RecipientList();
	
	TInt rcptCount = recipient.MdcaCount();
	TInt size = 0;
	for(TInt i=0;i<rcptCount; ++i)
		{
		size += recipient.MdcaPoint(i).Length();
		}		
	
 	_LIT16(KComma, ",");
 		
 	RBuf16 buffer;
 	buffer.CreateL(size+ rcptCount);
 	CleanupClosePushL(buffer);
 	if(rcptCount > 0)
 		{
 		buffer.Append(recipient.MdcaPoint(0));	
 		}
 		
 	for(TInt i=1;i<rcptCount; ++i)
 		{
 		buffer.Append(KComma);
 		buffer.Append(recipient.MdcaPoint(i));
 		}
   	
   	RThread clientThread;
   	aMessage.Client(clientThread);
   	
   	// Connect to UPS service.....
   	User::LeaveIfError(iUpsSession.Connect());
 	
 	User::LeaveIfError(iUpsSubsession.Initialise(iUpsSession, clientThread));
   	
   	iDecision = EUpsDecNo;
 	iUpsSubsession.Authorise(aHasCapability, KUidSendAs2Service, buffer, iDecision, iStatus);
   	SetActive();
 	CleanupStack::PopAndDestroy(&buffer);
	}
/**
@SYMTestCaseID		SYSLIB-BAFL-CT-4022 
@SYMREQ  	    	REQ8170
@SYMDEF			DEF141094
@SYMTestCaseDesc    GetVersionInsufficientBuffer
@SYMTestPriority    HIGH
@SYMTestStatus      Implemented
@SYMTestActions    	Use  the SysUtil::GetSWVersion method with its descriptor 
@SYMTestActions    	parameter’s size smaller than the length of the software version text 
@SYMTestActions    	Repeat for SysUtil::GetLangSWVersion 
@SYMTestExpectedResults KErrTooBig is returned because not all the software version text can 
@SYMTestExpectedResults	be read into the buffer supplied. 
*/
TVerdict CSysUtilsGetVersionInsufficienBufferStep::doTestStepL()
	{
	TInt err=KErrNone;
	const TInt bufSize = 6;
	
	_LIT16(kDummy,"xxxxx");

	TBuf16<bufSize> version;
	version.Insert(0,kDummy);
	
	err = SysUtil::GetSWVersion( version );
	ProcessError(err);
	err = SysUtil::GetLangSWVersion( version );
	ProcessError(err);
	err = SysUtil::GetPRInformation( version );
	ProcessError(err);
	
	return TestStepResult();
	}
Beispiel #25
0
void CSdlAppUi::AddCmdLineParamsL(CDesC8Array& aArgs)
    {       
    _LIT8(KAddonParam, "--addondir=?:\\uqm-addons");
    _LIT16(KTestFolder, "?:\\uqm-addons");
    RFs fs;
    
    fs.Connect();   
    for (TInt8 c = 'e'; c < 'z'; ++c)
        {
        TBuf16<32> buf(KTestFolder);
        buf[0] = c;
        if (BaflUtils::FolderExists(fs, buf))
            {
            TBuf8<32> arg(KAddonParam);
            arg[11] = c;
            aArgs.AppendL(arg);
            break;
            }
        }
    fs.Close();
    }
int main()
{
	//int count = 2;
	bool err = false;
	__UHEAP_MARK;
	__UHEAP_FAILNEXT(2);
	while(!err)
	{
	int retval =ESuccess;
	char* myChar = new char[30];
	_LIT16(KTxt, "hellohello");
  TBufC16<30> buf(KTxt);	
	TPtrC src = buf.Des();
	int size = 30;

	retval = Tptrc16ToCharp(src,myChar,size);
  
   if (retval ==EInsufficientSystemMemory)
    {

    	printf("tptrc16tochar_reliability Passed\n");
    	err = true;
    	//Logging to some file can be done here
    }
    else
    {
			assert_failed = true;
    	printf("tptrc16tochar_reliability Failed\n");
    	//Logging to some file can be done here
    }     
    delete[] myChar; 
	}
	__UHEAP_MARKEND;
	__UHEAP_RESET;

    testResultXml("test_tptrc16tochar_reliability");
	
	return 0;
}
TVerdict CSysUtilsGetLangSWVersionUnreadableStep::doTestStepL()
	{
	TInt err = SetTestPath(ETrue);
	if( err != KErrNone )
		{
		ERR_PRINTF2(_L("Could not turn test path on. Error = %d"), err);
		SetTestStepResult(EAbort);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("Test path turned on."));
	
	err = DeletePSProperties();
	if( err != KErrNone )
		{
		ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
		SetTestStepResult(EAbort);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("Deleted P&S properties successfully."));
	
	_LIT16(KDummy,"xxxxx");

	TBuf16<KSysUtilVersionTextLength> version;
	version.Insert(0,KDummy);

	err = SysUtil::GetLangSWVersion( version );
	
	if ( err == KErrCorrupt)
		{
		INFO_PRINTF1(_L("KErrCorrupt returned this is expected"));
		}
	else 
		{
		ERR_PRINTF2(_L("Other error code  = %d"), err);
		SetTestStepResult(EFail);
		}
	return TestStepResult();
	}
int main()
{
	_LIT16(Kname,"tbuf16tochar");
	//int count = 2;
	bool err = false;
	__UHEAP_MARK;
	__UHEAP_FAILNEXT(2);
	while(!err)
	{
	int retval =ESuccess;
	char* myChar = new char[40];
	int size =40;

	retval = Tlitc16ToChar(Kname,myChar,size);
  
  if (retval ==EInsufficientSystemMemory)
    {

    	printf("tlit16tochar_reliability Passed\n");
    	err = true;
    	//Logging to some file can be done here
    }
  else
    {
			assert_failed = true;
			err = true;
    	printf("tlit16tochar_reliability Failed\n");
    	//Logging to some file can be done here
    }      
  delete[] myChar;
	}
	__UHEAP_MARKEND;
	__UHEAP_RESET;

  testResultXml("test_tlit16tochar_reliability");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    {
    int retval =ESuccess;
    string str((const char*)"");
    _LIT16(KTxt, "hellohellohellohellohellohellohehellohellohehelloh");
    TBuf16<300> tbuf(KTxt);
    retval = Tbuf16ToString(tbuf,str);

    if (retval ==ESuccess)
    {
    printf("tbuf16tostring Passed");
    }
    else
    {
    assert_failed = true;
    printf("tbuf16tostring failed");
    }      
    }
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16tostring_boundary1");
	return 0;
}
int main()
{
    __UHEAP_MARK;
    {
    int retval =ESuccess;
    wstring str;
    _LIT16(KTxt, "");
    TBuf<30> tbuf(KTxt);
    retval = Tbuf16ToWstring(tbuf,str);

    if (retval ==EDescriptorNoData)
    {
    printf("tbuf16towstring Passed");
    }
    else
    {
    assert_failed = true;
    printf("tbuf16towstring failed");
    }      
    }
    __UHEAP_MARKEND;
    testResultXml("test_tbuf16towstring_negative1");
	return 0;
}