author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 15:26:22 +0300 | |
changeset 34 | 5fae379060a7 |
parent 31 | ce057bb09d0b |
child 45 | 4b03adbd26ca |
permissions | -rw-r--r-- |
31 | 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 |
TBufC8<10> src1((unsigned char*)"testing"); |
|
28 |
char * des1= new char[10]; |
|
29 |
int size1=50,ret,retval1,retval2,retval3,retval4,retval5; |
|
30 |
retval1= Tbufc8ToChar(src1,des1,size1); |
|
31 |
printf("retval1 value is %d\n", retval1); |
|
32 |
||
33 |
char * src2= des1; |
|
34 |
TPtr16 des2 ((unsigned short*)" ",30); |
|
35 |
wchar_t *aPtr = new wchar_t[50]; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
36 |
retval2= CharpToTptr16(src2,des2); |
31 | 37 |
printf("retval2 value is %d\n", retval2); |
38 |
||
39 |
TPtr16 src3= des2; |
|
40 |
string des3; |
|
41 |
retval3= Tptr16ToString(src3,des3); |
|
42 |
printf("retval3 value is %d\n", retval3); |
|
43 |
||
44 |
string src4= des3; |
|
45 |
RBuf16 des4; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
46 |
des4.CreateL(30); |
31 | 47 |
retval4= StringToRbuf16(src4,des4); |
48 |
printf("retval4 value is %d\n", retval4); |
|
49 |
||
50 |
RBuf16 src5; |
|
51 |
src5.Create(des4); |
|
52 |
char *des5= new char [50]; |
|
53 |
retval5 = Rbuf16ToChar(src5,des5,size1); |
|
54 |
printf("retval5 value is %d\n", retval5); |
|
55 |
||
56 |
ret= strncmp("testing",(char*)des5,7); |
|
57 |
if(ret == ESuccess) |
|
58 |
{ |
|
59 |
printf("integration_test8 PASSED\n"); |
|
60 |
} |
|
61 |
else |
|
62 |
{ |
|
63 |
printf("integration_test8 FAILED\n"); |
|
64 |
assert_failed=true; |
|
65 |
} |
|
66 |
delete[] des5; |
|
67 |
des4.Close(); |
|
68 |
src5.Close(); |
|
69 |
delete[] aPtr; |
|
70 |
delete[] des1; |
|
71 |
} |
|
72 |
__UHEAP_MARKEND; |
|
73 |
testResultXml("integration_test_scenario8"); |
|
74 |
return 0; |
|
75 |
} |