utilitylibraries/libutils/tsrc/src/integration_test_scenario27.cpp
branchRCL_3
changeset 57 2efc27d87e1c
parent 56 acd3cd4aaceb
equal deleted inserted replaced
56:acd3cd4aaceb 57:2efc27d87e1c
    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 int main()
    23 void 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);
       
    35     retval[1] = WcharToRbuf8(myWchar,buf);
    34     retval[1] = WcharToRbuf8(myWchar,buf);
    36 
    35 
    37     wstring str;
    36     wstring str;
    38     retval[2] = Rbuf8ToWstring(buf,str);
    37     retval[2] = Rbuf8ToWstring(buf,str);
    39 
    38 
    41     retval[3]= WstringToTbuf16(str,tbuf);
    40     retval[3]= WstringToTbuf16(str,tbuf);
    42 
    41 
    43     wchar_t* myfinalstring= new wchar_t[15];
    42     wchar_t* myfinalstring= new wchar_t[15];
    44     int size_new=15;
    43     int size_new=15;
    45     retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size_new);
    44     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         }
       
    52 
    45 
    53     if(!wcscmp(myWchar,myfinalstring))
    46     if(!wcscmp(myWchar,myfinalstring))
    54     {
    47     {
    55     printf("\n\n\nintegration_test_scenario27 success");
    48     printf("\n\n\nintegration_test_scenario27 success");
    56     }
    49     }
    63     buf.Close();
    56     buf.Close();
    64     delete[] myfinalstring;       	
    57     delete[] myfinalstring;       	
    65     }
    58     }
    66     __UHEAP_MARKEND;
    59     __UHEAP_MARKEND;
    67     testResultXml("integration_test_scenario27");
    60     testResultXml("integration_test_scenario27");
    68     return 0;
       
    69 }
    61 }