utilitylibraries/libutils/tsrc/src/integration_test_scenario27.cpp
changeset 0 e4d67989cc36
child 22 ddc455616bd6
child 56 acd3cd4aaceb
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 
       
    18 #include <stdio.h>
       
    19 #include<e32std.h>
       
    20 #include "libutils.h"
       
    21 #include"std_log_result.h"
       
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    23 void main()
       
    24 {
       
    25     __UHEAP_MARK;
       
    26     {
       
    27     _LIT(myTlitc,"hellohello");
       
    28     wchar_t* myWchar = new wchar_t[30];
       
    29     int size = 30;
       
    30     int retval[10];
       
    31     retval[0] = Tlitc16ToWchar(myTlitc,myWchar,size);
       
    32 
       
    33     RBuf8 buf;
       
    34     retval[1] = WcharToRbuf8(myWchar,buf);
       
    35 
       
    36     wstring str;
       
    37     retval[2] = Rbuf8ToWstring(buf,str);
       
    38 
       
    39     TBuf16 <30> tbuf;
       
    40     retval[3]= WstringToTbuf16(str,tbuf);
       
    41 
       
    42     wchar_t* myfinalstring= new wchar_t[15];
       
    43     int size_new=15;
       
    44     retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size_new);
       
    45 
       
    46     if(!wcscmp(myWchar,myfinalstring))
       
    47     {
       
    48     printf("\n\n\nintegration_test_scenario27 success");
       
    49     }
       
    50     else
       
    51     {
       
    52     assert_failed = true;
       
    53     printf("\n\n\nintegration_test_scenario27 failure");
       
    54     }
       
    55     delete[] myWchar;
       
    56     buf.Close();
       
    57     delete[] myfinalstring;       	
       
    58     }
       
    59     __UHEAP_MARKEND;
       
    60     testResultXml("integration_test_scenario27");
       
    61 }