utilitylibraries/libutils/tsrc/src/integration_test_scenario20.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"hello";
    28     wchar_t* mycharstring = L"hello";
    29     RBuf16 buf;
    29     RBuf16 buf;
       
    30     buf.CreateL(30);
    30     retval[0]= WcharToRbuf16(mycharstring,buf);
    31     retval[0]= WcharToRbuf16(mycharstring,buf);
    31 
    32 
    32     wstring str;
    33     wstring str;
    33     retval[1]= Rbuf16ToWstring(buf,str);
    34     retval[1]= Rbuf16ToWstring(buf,str);
    34 
    35 
    48     retval[5]= Hbufc16ToString(hbufc,mystring,size_hbufc);
    49     retval[5]= Hbufc16ToString(hbufc,mystring,size_hbufc);
    49 
    50 
    50     wchar_t* temp = new wchar_t[50];
    51     wchar_t* temp = new wchar_t[50];
    51     TPtrC16 tptrc;
    52     TPtrC16 tptrc;
    52     retval[6]= StringToTptrc16(mystring,temp,tptrc);
    53     retval[6]= StringToTptrc16(mystring,temp,tptrc);
       
    54     
       
    55     for(int i=1; i<=6; i++)
       
    56         {
       
    57         if (retval[i]!= 0)
       
    58                 printf("Conversion failed for retval\n",retval[i]);
       
    59         }
    53 
    60 
    54     wchar_t* myfinalstring = new wchar_t[50];
    61     wchar_t* myfinalstring = new wchar_t[50];
    55     int size_fin=55;
    62     int size_fin=55;
    56     retval[7]= Tptrc16ToWcharp(tptrc,myfinalstring,size_fin);
    63     retval[7]= Tptrc16ToWcharp(tptrc,myfinalstring,size_fin);
    57 
    64 
    71     delete[] temp;
    78     delete[] temp;
    72     delete[] myfinalstring;
    79     delete[] myfinalstring;
    73     }
    80     }
    74     __UHEAP_MARKEND;
    81     __UHEAP_MARKEND;
    75     testResultXml("integration_test_scenario20");
    82     testResultXml("integration_test_scenario20");
       
    83     return 0;
    76 }
    84 }