utilitylibraries/libutils/tsrc/src/integration_test_scenario8.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     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,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;
       
    46     des4.CreateL(30);
    43     retval4= StringToRbuf16(src4,des4);
    47     retval4= StringToRbuf16(src4,des4);
       
    48     printf("retval4 value is %d\n", retval4);
    44 
    49 
    45     RBuf16 src5;
    50     RBuf16 src5;
    46     src5.Create(des4);		
    51     src5.Create(des4);		
    47     char *des5= new char [50];
    52     char *des5= new char [50];
    48     retval5 = Rbuf16ToChar(src5,des5,size1);
    53     retval5 = Rbuf16ToChar(src5,des5,size1);
       
    54     printf("retval5 value is %d\n", retval5);
    49 
    55 
    50     ret= strncmp("testing",(char*)des5,7);
    56     ret= strncmp("testing",(char*)des5,7);
    51     if(ret == ESuccess)
    57     if(ret == ESuccess)
    52     {
    58     {
    53     printf("integration_test8 PASSED\n");
    59     printf("integration_test8 PASSED\n");
    63     delete[] aPtr;
    69     delete[] aPtr;
    64     delete[] des1;
    70     delete[] des1;
    65     }
    71     }
    66     __UHEAP_MARKEND;
    72     __UHEAP_MARKEND;
    67     testResultXml("integration_test_scenario8");
    73     testResultXml("integration_test_scenario8");
       
    74     return 0;
    68 }
    75 }