utilitylibraries/libutils/tsrc/src/integration_test_scenario8.cpp
changeset 22 ddc455616bd6
parent 0 e4d67989cc36
child 44 97b0fb8a2cc2
child 45 4b03adbd26ca
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     TBufC8<10> src1((unsigned char*)"testing");
    27     TBufC8<10> src1((unsigned char*)"testing");
    28     char * des1= new char[10];
    28     char * des1= new char[10];
    29     int size1=50,ret,retval1,retval2,retval3,retval4,retval5,retval6;
    29     int size1=50,ret,retval1,retval2,retval3,retval4,retval5;
    30     retval1= Tbufc8ToChar(src1,des1,size1);
    30     retval1= Tbufc8ToChar(src1,des1,size1);
       
    31     printf("retval1 value is %d\n", retval1);
    31 
    32 
    32     char * src2= des1;
    33     char * src2= des1;
    33     TPtr16 des2 ((unsigned short*)" ",30);
    34     TPtr16 des2 ((unsigned short*)" ",30);
    34     wchar_t *aPtr = new wchar_t[50];
    35     wchar_t *aPtr = new wchar_t[50];
    35     retval2= CharpToTptr16(src2,aPtr,des2);
    36     retval2= CharpToTptr16(src2,aPtr,des2);
       
    37     printf("retval2 value is %d\n", retval2);
    36 
    38 
    37     TPtr16 src3= des2;
    39     TPtr16 src3= des2;
    38     string des3;
    40     string des3;
    39     retval3= Tptr16ToString(src3,des3);
    41     retval3= Tptr16ToString(src3,des3);
       
    42     printf("retval3 value is %d\n", retval3);
    40 
    43 
    41     string src4= des3;
    44     string src4= des3;
    42     RBuf16 des4;
    45     RBuf16 des4;
    43     retval4= StringToRbuf16(src4,des4);
    46     retval4= StringToRbuf16(src4,des4);
       
    47     printf("retval4 value is %d\n", retval4);
    44 
    48 
    45     RBuf16 src5;
    49     RBuf16 src5;
    46     src5.Create(des4);		
    50     src5.Create(des4);		
    47     char *des5= new char [50];
    51     char *des5= new char [50];
    48     retval5 = Rbuf16ToChar(src5,des5,size1);
    52     retval5 = Rbuf16ToChar(src5,des5,size1);
       
    53     printf("retval5 value is %d\n", retval5);
    49 
    54 
    50     ret= strncmp("testing",(char*)des5,7);
    55     ret= strncmp("testing",(char*)des5,7);
    51     if(ret == ESuccess)
    56     if(ret == ESuccess)
    52     {
    57     {
    53     printf("integration_test8 PASSED\n");
    58     printf("integration_test8 PASSED\n");
    63     delete[] aPtr;
    68     delete[] aPtr;
    64     delete[] des1;
    69     delete[] des1;
    65     }
    70     }
    66     __UHEAP_MARKEND;
    71     __UHEAP_MARKEND;
    67     testResultXml("integration_test_scenario8");
    72     testResultXml("integration_test_scenario8");
       
    73     return 0;
    68 }
    74 }