utilitylibraries/libutils/tsrc/src/test_tbufc8towstring_reliability.cpp
changeset 0 e4d67989cc36
child 22 ddc455616bd6
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #include <stdio.h>
       
    18 #include<e32std.h>
       
    19 #include "libutils.h"
       
    20 #include"std_log_result.h"
       
    21 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    22 
       
    23 void main()
       
    24 {
       
    25 	int count = 2;
       
    26 	bool err = false;
       
    27 	__UHEAP_MARK;
       
    28 	__UHEAP_FAILNEXT(count);
       
    29 	{
       
    30 	wstring myString;
       
    31 	while(!err)
       
    32 	{
       
    33 	int retval =ESuccess;
       
    34 	_LIT8(KTxt, "hellohello");
       
    35   TBufC8<30> tbuf1(KTxt);
       
    36 
       
    37 	retval = Tbufc8ToWstring(tbuf1,myString);
       
    38   
       
    39   if (retval ==EInsufficientSystemMemory)
       
    40     {
       
    41 
       
    42     	printf("tbufc8towstring_reliability Passed\n");
       
    43     	err = true;
       
    44     	//Logging to some file can be done here
       
    45     }
       
    46   else
       
    47     {
       
    48 			assert_failed = true;
       
    49     	printf("tbufc8towstring_reliability Failed\n");
       
    50     	//Logging to some file can be done here
       
    51     }      
       
    52 	}
       
    53 }
       
    54 	__UHEAP_MARKEND;
       
    55 	__UHEAP_RESET;
       
    56 
       
    57     testResultXml("test_tbufc8towstring_reliability");
       
    58 }