|
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 _LIT8(Kname,"testing"); |
|
28 HBufC8 *src1=HBufC8::NewL(20); |
|
29 *src1=Kname; |
|
30 char *des1 = new char[30]; |
|
31 int size1=30,retval1,retval2,retval3,retval4,ret; |
|
32 retval1= Hbufc8ToChar(src1,des1,size1); |
|
33 printf("retval1 value is %d\n", retval1); |
|
34 |
|
35 char *src2=des1; |
|
36 TPtrC16 des2((unsigned short *)"",20); |
|
37 wchar_t *aPtr=new wchar_t[20]; |
|
38 retval2=CharpToTptrc16(src2,aPtr,des2); |
|
39 printf("retval2 value is %d\n", retval2); |
|
40 |
|
41 TPtrC16 src3= des2; |
|
42 char *des3= new char[20]; |
|
43 retval3= Tptrc16ToCharp(src3,des3,size1); |
|
44 printf("retval3 value is %d\n", retval3); |
|
45 |
|
46 char *src4=des3; |
|
47 HBufC16 *des4=HBufC16::NewMaxL(20); |
|
48 retval4= CharToHbufc16(src4,des4); |
|
49 printf("retval4 value is %d\n", retval4); |
|
50 |
|
51 char *temp = new char [des4->Length()]; |
|
52 wcstombs(temp, (const wchar_t *)des4->Ptr() , 7); |
|
53 temp[7] = '\0'; |
|
54 ret=strcmp(temp, "testing"); |
|
55 if(ret == 0) |
|
56 { |
|
57 printf("integration_test13 PASSED\n"); |
|
58 } |
|
59 else |
|
60 { |
|
61 printf("integration_tes13 FAILED\n"); |
|
62 assert_failed = true; |
|
63 } |
|
64 delete[] des1; |
|
65 delete[] aPtr; |
|
66 delete[] temp; |
|
67 delete[] des3; |
|
68 delete src1; |
|
69 delete des4; |
|
70 } |
|
71 __UHEAP_MARKEND; |
|
72 testResultXml("integration_test_scenario13"); |
|
73 return 0; |
|
74 } |