utilitylibraries/libutils/tsrc/src/test_tlit16tochar_reliability.cpp
changeset 31 ce057bb09d0b
child 45 4b03adbd26ca
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     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 int main()
       
    24 {
       
    25 	_LIT16(Kname,"tbuf16tochar");
       
    26 	//int count = 2;
       
    27 	bool err = false;
       
    28 	__UHEAP_MARK;
       
    29 	__UHEAP_FAILNEXT(2);
       
    30 	while(!err)
       
    31 	{
       
    32 	int retval =ESuccess;
       
    33 	char* myChar = new char[40];
       
    34 	int size =40;
       
    35 
       
    36 	retval = Tlitc16ToChar(Kname,myChar,size);
       
    37   
       
    38   if (retval ==EInsufficientSystemMemory)
       
    39     {
       
    40 
       
    41     	printf("tlit16tochar_reliability Passed\n");
       
    42     	err = true;
       
    43     	//Logging to some file can be done here
       
    44     }
       
    45   else
       
    46     {
       
    47 			assert_failed = true;
       
    48 			err = true;
       
    49     	printf("tlit16tochar_reliability Failed\n");
       
    50     	//Logging to some file can be done here
       
    51     }      
       
    52   delete[] myChar;
       
    53 	}
       
    54 	__UHEAP_MARKEND;
       
    55 	__UHEAP_RESET;
       
    56 
       
    57   testResultXml("test_tlit16tochar_reliability");
       
    58 	return 0;
       
    59 }