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 TPtr8 src1((unsigned char*)"openc_test",15,30); |
27 TPtr8 src1((unsigned char*)"openc_test",15,30); |
28 char *des1= new char[20]; |
28 char *des1= new char[20]; |
29 int ret,retval1,retval2,retval3,retval4,retval5,retval6,size1=20,size2=80; |
29 int ret,retval1,retval2,retval3,retval4,retval5,retval6,size1=20,size2=80; |
30 retval1= Tptr8ToChar(src1,des1,size1); |
30 retval1= Tptr8ToChar(src1,des1,size1); |
31 |
31 printf("retval1 value is %d\n", retval1); |
|
32 |
32 char *src2= des1; |
33 char *src2= des1; |
33 RBuf8 des2; |
34 RBuf8 des2; |
34 retval2= CharToRbuf8(src2,des2); |
35 retval2= CharToRbuf8(src2,des2); |
|
36 printf("retval2 value is %d\n", retval2); |
35 |
37 |
36 RBuf8 src3; |
38 RBuf8 src3; |
37 src3.CreateL(des2,10); |
39 src3.CreateL(des2,10); |
38 string des3; |
40 string des3; |
39 retval3= Rbuf8ToString(src3,des3); |
41 retval3= Rbuf8ToString(src3,des3); |
40 |
42 printf("retval3 value is %d\n", retval3); |
|
43 |
41 string src4=des3; |
44 string src4=des3; |
42 wchar_t temp[30]; |
45 wchar_t temp[30]; |
43 TPtr16 des4((unsigned short *)temp,30); |
46 TPtr16 des4((unsigned short *)temp,30); |
44 wchar_t *aPtr= new wchar_t[30]; |
47 wchar_t *aPtr= new wchar_t[30]; |
45 retval4= StringToTptr16(src4,aPtr,des4); |
48 retval4= StringToTptr16(src4,aPtr,des4); |
46 |
49 printf("retval4 value is %d\n", retval4); |
|
50 |
47 TPtr16 src5=des4; |
51 TPtr16 src5=des4; |
48 char *des5= new char[50]; |
52 char *des5= new char[50]; |
49 retval5= Tptr16ToCharp(src5,des5,size2); |
53 retval5= Tptr16ToCharp(src5,des5,size2); |
50 |
54 printf("retval5 value is %d\n", retval5); |
|
55 |
51 char *src6= des5; |
56 char *src6= des5; |
52 TPtr8 des6((unsigned char*)" ",20); |
57 TPtr8 des6((unsigned char*)" ",20); |
53 retval6= CharpToTptr8(src6,des6); |
58 retval6= CharpToTptr8(src6,des6); |
|
59 printf("retval6 value is %d\n", retval6); |
54 |
60 |
55 ret= strncmp((const char *)src1.Ptr(),(const char *) des6.Ptr(),10); |
61 ret= strncmp((const char *)src1.Ptr(),(const char *) des6.Ptr(),10); |
56 if(ret==ESuccess) |
62 if(ret==ESuccess) |
57 { |
63 { |
58 printf("integration_test10 PASSED\n"); |
64 printf("integration_test10 PASSED\n"); |