utilitylibraries/libutils/tsrc/src/integration_test_scenario27.cpp
branchRCL_3
changeset 56 acd3cd4aaceb
parent 0 e4d67989cc36
child 57 2efc27d87e1c
equal deleted inserted replaced
54:4332f0f7be53 56:acd3cd4aaceb
    18 #include <stdio.h>
    18 #include <stdio.h>
    19 #include<e32std.h>
    19 #include<e32std.h>
    20 #include "libutils.h"
    20 #include "libutils.h"
    21 #include"std_log_result.h"
    21 #include"std_log_result.h"
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
    23 void main()
    23 int main()
    24 {
    24 {
    25     __UHEAP_MARK;
    25     __UHEAP_MARK;
    26     {
    26     {
    27     _LIT(myTlitc,"hellohello");
    27     _LIT(myTlitc,"hellohello");
    28     wchar_t* myWchar = new wchar_t[30];
    28     wchar_t* myWchar = new wchar_t[30];
    29     int size = 30;
    29     int size = 30;
    30     int retval[10];
    30     int retval[10];
    31     retval[0] = Tlitc16ToWchar(myTlitc,myWchar,size);
    31     retval[0] = Tlitc16ToWchar(myTlitc,myWchar,size);
    32 
    32 
    33     RBuf8 buf;
    33     RBuf8 buf;
       
    34     buf.CreateL(60);
    34     retval[1] = WcharToRbuf8(myWchar,buf);
    35     retval[1] = WcharToRbuf8(myWchar,buf);
    35 
    36 
    36     wstring str;
    37     wstring str;
    37     retval[2] = Rbuf8ToWstring(buf,str);
    38     retval[2] = Rbuf8ToWstring(buf,str);
    38 
    39 
    40     retval[3]= WstringToTbuf16(str,tbuf);
    41     retval[3]= WstringToTbuf16(str,tbuf);
    41 
    42 
    42     wchar_t* myfinalstring= new wchar_t[15];
    43     wchar_t* myfinalstring= new wchar_t[15];
    43     int size_new=15;
    44     int size_new=15;
    44     retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size_new);
    45     retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size_new);
       
    46     
       
    47     for(int i=1; i<=4; i++)
       
    48         {
       
    49         if (retval[i]!= 0)
       
    50                 printf("Conversion failed for retval\n",retval[i]);
       
    51         }
    45 
    52 
    46     if(!wcscmp(myWchar,myfinalstring))
    53     if(!wcscmp(myWchar,myfinalstring))
    47     {
    54     {
    48     printf("\n\n\nintegration_test_scenario27 success");
    55     printf("\n\n\nintegration_test_scenario27 success");
    49     }
    56     }
    56     buf.Close();
    63     buf.Close();
    57     delete[] myfinalstring;       	
    64     delete[] myfinalstring;       	
    58     }
    65     }
    59     __UHEAP_MARKEND;
    66     __UHEAP_MARKEND;
    60     testResultXml("integration_test_scenario27");
    67     testResultXml("integration_test_scenario27");
       
    68     return 0;
    61 }
    69 }