utilitylibraries/libutils/tsrc/src/integration_test_scenario18.cpp
changeset 31 ce057bb09d0b
child 34 5fae379060a7
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 
       
    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 int main()
       
    24 {
       
    25     __UHEAP_MARK;
       
    26     {
       
    27     wchar_t* mycharstring = L"hellohello";
       
    28     int retval[10];
       
    29     RBuf8 buf;
       
    30     retval[1]= WcharToRbuf8(mycharstring,buf);
       
    31 
       
    32     wstring str;
       
    33     retval[2]= Rbuf8ToWstring(buf,str);
       
    34 
       
    35     TBuf8 <30> tbuf;
       
    36     retval[3]= WstringToTbuf8(str,tbuf);
       
    37 
       
    38     wchar_t* myfinalstring= new wchar_t[35];
       
    39     int size=35;
       
    40     retval[4]= Tbuf8ToWchar(tbuf,myfinalstring,size);
       
    41     
       
    42     for(int i=1; i<=4; i++)
       
    43         {
       
    44         if (retval[i]!= 0)
       
    45                 printf("Conversion failed for retval\n",retval[i]);
       
    46         }
       
    47 
       
    48     if(!wcscmp(mycharstring,myfinalstring))
       
    49     {
       
    50     printf("\nintegration_test_scenario18 case passed");
       
    51     }
       
    52     else
       
    53     {
       
    54     printf("\nintegration_test_scenario18 case failed");
       
    55     assert_failed = true;
       
    56     }
       
    57     buf.Close();
       
    58     delete[] myfinalstring;	
       
    59     }
       
    60     __UHEAP_MARKEND;
       
    61     testResultXml("integration_test_scenario18");
       
    62     return 0;
       
    63 }