|
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 void main() |
|
24 { |
|
25 __UHEAP_MARK; |
|
26 { |
|
27 TBufC8<10> src1((unsigned char*)"testing"); |
|
28 char * des1= new char[10]; |
|
29 int size1=50,ret,retval1,retval2,retval3,retval4,retval5,retval6; |
|
30 retval1= Tbufc8ToChar(src1,des1,size1); |
|
31 |
|
32 char * src2= des1; |
|
33 TPtr16 des2 ((unsigned short*)" ",30); |
|
34 wchar_t *aPtr = new wchar_t[50]; |
|
35 retval2= CharpToTptr16(src2,aPtr,des2); |
|
36 |
|
37 TPtr16 src3= des2; |
|
38 string des3; |
|
39 retval3= Tptr16ToString(src3,des3); |
|
40 |
|
41 string src4= des3; |
|
42 RBuf16 des4; |
|
43 retval4= StringToRbuf16(src4,des4); |
|
44 |
|
45 RBuf16 src5; |
|
46 src5.Create(des4); |
|
47 char *des5= new char [50]; |
|
48 retval5 = Rbuf16ToChar(src5,des5,size1); |
|
49 |
|
50 ret= strncmp("testing",(char*)des5,7); |
|
51 if(ret == ESuccess) |
|
52 { |
|
53 printf("integration_test8 PASSED\n"); |
|
54 } |
|
55 else |
|
56 { |
|
57 printf("integration_test8 FAILED\n"); |
|
58 assert_failed=true; |
|
59 } |
|
60 delete[] des5; |
|
61 des4.Close(); |
|
62 src5.Close(); |
|
63 delete[] aPtr; |
|
64 delete[] des1; |
|
65 } |
|
66 __UHEAP_MARKEND; |
|
67 testResultXml("integration_test_scenario8"); |
|
68 } |