|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <stdio.h> |
|
19 #include<e32std.h> |
|
20 #include "libutils.h" |
|
21 #include"std_log_result.h" |
|
22 #define LOG_FILENAME_LINE __FILE__, __LINE__ |
|
23 int main() |
|
24 { |
|
25 __UHEAP_MARK; |
|
26 { |
|
27 string src1="!@#$%^&"; |
|
28 TPtrC8 des1((unsigned char*)" ",30); |
|
29 int retval1, retval2,retval3,retval4,retval5,retval6,ret,size1=20; |
|
30 retval1= StringToTptrc8(src1,des1); |
|
31 printf("retval1 value is %d\n", retval1); |
|
32 |
|
33 TPtrC8 src2 = des1; |
|
34 char *des2= new char[20]; |
|
35 retval2= Tptrc8ToCharp(src2,des2,size1); |
|
36 printf("retval2 value is %d\n", retval2); |
|
37 |
|
38 char * src3= des2; |
|
39 TPtr16 des3((unsigned short*)"",30); |
|
40 wchar_t *aPtr1 = new wchar_t[20]; |
|
41 retval3= CharpToTptr16(src3,aPtr1,des3); |
|
42 printf("retval3 value is %d\n", retval3); |
|
43 |
|
44 TPtr16 src4= des3; |
|
45 string des4; |
|
46 retval4= Tptr16ToString(src4,des4); |
|
47 printf("retval4 value is %d\n", retval4); |
|
48 |
|
49 string src5= des4; |
|
50 TPtrC16 des5((unsigned short*)"",30); |
|
51 wchar_t *aPtr2= new wchar_t[20]; |
|
52 retval5= StringToTptrc16(src5,aPtr2,des5); |
|
53 printf("retval5 value is %d\n", retval5); |
|
54 |
|
55 TPtrC16 src6= des5; |
|
56 char *des6= new char[30]; |
|
57 retval6= Tptrc16ToCharp(src6,des6,size1); |
|
58 printf("retval6 value is %d\n", retval6); |
|
59 |
|
60 ret= strncmp("!@#$%^&",(const char*)des6,7); |
|
61 if(ret == ESuccess) |
|
62 { |
|
63 printf("integration_test15 PASSED\n"); |
|
64 } |
|
65 else |
|
66 { |
|
67 printf("integration_tes15 FAILED\n"); |
|
68 assert_failed = true; |
|
69 } |
|
70 delete[] des2; |
|
71 delete[] aPtr1; |
|
72 delete[] aPtr2; |
|
73 delete[] des6; |
|
74 } |
|
75 __UHEAP_MARKEND; |
|
76 testResultXml("integration_test_scenario15"); |
|
77 return 0; |
|
78 } |