utilitylibraries/libutils/tsrc/src/integration_test_scenario16.cpp
changeset 22 ddc455616bd6
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 71 28ccaba883f4
equal deleted inserted replaced
18:47c74d1534e1 22:ddc455616bd6
    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     int retval[10];
    27     int retval[10];
    28     wchar_t* mycharstring = L"hellohello";
    28     wchar_t* mycharstring = L"hellohello";
    29     RBuf16 buf;
    29     RBuf16 buf;
    30     retval[0]= WcharToRbuf16(mycharstring,buf);
    30     retval[0]= WcharToRbuf16(mycharstring,buf);
       
    31     printf("The first value in retval array is %d\n", retval[0]);
    31 
    32 
    32     wstring str;
    33     wstring str;
    33     retval[1]= Rbuf16ToWstring(buf,str);
    34     retval[1]= Rbuf16ToWstring(buf,str);
       
    35     printf("The second value in retval array is %d\n", retval[1]);
    34 
    36 
    35     TBuf16 <15> tbuf;
    37     TBuf16 <15> tbuf;
    36     retval[2]= WstringToTbuf16(str,tbuf);
    38     retval[2]= WstringToTbuf16(str,tbuf);
       
    39     printf("The third value in retval array is %d\n", retval[2]);
    37 
    40 
    38     wchar_t* myfinalstring= new wchar_t[15];
    41     wchar_t* myfinalstring= new wchar_t[15];
    39     int size=15;
    42     int size=15;
    40     retval[3]= Tbuf16ToWchar(tbuf,myfinalstring,size);
    43     retval[3]= Tbuf16ToWchar(tbuf,myfinalstring,size);
       
    44     printf("The fourth value in retval array is %d\n", retval[3]);
    41 
    45 
    42     if(!wcscmp(mycharstring,myfinalstring))
    46     if(!wcscmp(mycharstring,myfinalstring))
    43     {
    47     {
    44     printf("\nintegration_test_scenario16 case passed");
    48     printf("\nintegration_test_scenario16 case passed");
    45     }
    49     }
    51     buf.Close();
    55     buf.Close();
    52     delete[] myfinalstring;	
    56     delete[] myfinalstring;	
    53     }
    57     }
    54     __UHEAP_MARKEND;
    58     __UHEAP_MARKEND;
    55     testResultXml("integration_test_scenario16");
    59     testResultXml("integration_test_scenario16");
       
    60     return 0;
    56 }
    61 }