utilitylibraries/libutils/tsrc/src/integration_test_scenario16.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     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     buf.CreateL(30);
    30     retval[0]= WcharToRbuf16(mycharstring,buf);
    31     retval[0]= WcharToRbuf16(mycharstring,buf);
       
    32     printf("The first value in retval array is %d\n", retval[0]);
    31 
    33 
    32     wstring str;
    34     wstring str;
    33     retval[1]= Rbuf16ToWstring(buf,str);
    35     retval[1]= Rbuf16ToWstring(buf,str);
       
    36     printf("The second value in retval array is %d\n", retval[1]);
    34 
    37 
    35     TBuf16 <15> tbuf;
    38     TBuf16 <15> tbuf;
    36     retval[2]= WstringToTbuf16(str,tbuf);
    39     retval[2]= WstringToTbuf16(str,tbuf);
       
    40     printf("The third value in retval array is %d\n", retval[2]);
    37 
    41 
    38     wchar_t* myfinalstring= new wchar_t[15];
    42     wchar_t* myfinalstring= new wchar_t[15];
    39     int size=15;
    43     int size=15;
    40     retval[3]= Tbuf16ToWchar(tbuf,myfinalstring,size);
    44     retval[3]= Tbuf16ToWchar(tbuf,myfinalstring,size);
       
    45     printf("The fourth value in retval array is %d\n", retval[3]);
    41 
    46 
    42     if(!wcscmp(mycharstring,myfinalstring))
    47     if(!wcscmp(mycharstring,myfinalstring))
    43     {
    48     {
    44     printf("\nintegration_test_scenario16 case passed");
    49     printf("\nintegration_test_scenario16 case passed");
    45     }
    50     }
    51     buf.Close();
    56     buf.Close();
    52     delete[] myfinalstring;	
    57     delete[] myfinalstring;	
    53     }
    58     }
    54     __UHEAP_MARKEND;
    59     __UHEAP_MARKEND;
    55     testResultXml("integration_test_scenario16");
    60     testResultXml("integration_test_scenario16");
       
    61     return 0;
    56 }
    62 }