author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:48:56 +0100 | |
branch | GCC_SURGE |
changeset 45 | 4b03adbd26ca |
parent 22 | ddc455616bd6 |
parent 34 | 5fae379060a7 |
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 |
TPtr8 src1((unsigned char*)"openc_test",15,30); |
|
28 |
char *des1= new char[20]; |
|
29 |
int ret,retval1,retval2,retval3,retval4,retval5,retval6,size1=20,size2=80; |
|
30 |
retval1= Tptr8ToChar(src1,des1,size1); |
|
31 |
printf("retval1 value is %d\n", retval1); |
|
32 |
||
33 |
char *src2= des1; |
|
34 |
RBuf8 des2; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
35 |
des2.CreateL(30); |
31 | 36 |
retval2= CharToRbuf8(src2,des2); |
37 |
printf("retval2 value is %d\n", retval2); |
|
38 |
||
39 |
RBuf8 src3; |
|
40 |
src3.CreateL(des2,10); |
|
41 |
string des3; |
|
42 |
retval3= Rbuf8ToString(src3,des3); |
|
43 |
printf("retval3 value is %d\n", retval3); |
|
44 |
||
45 |
string src4=des3; |
|
46 |
wchar_t temp[30]; |
|
47 |
TPtr16 des4((unsigned short *)temp,30); |
|
48 |
wchar_t *aPtr= new wchar_t[30]; |
|
49 |
retval4= StringToTptr16(src4,aPtr,des4); |
|
50 |
printf("retval4 value is %d\n", retval4); |
|
51 |
||
52 |
TPtr16 src5=des4; |
|
53 |
char *des5= new char[50]; |
|
54 |
retval5= Tptr16ToCharp(src5,des5,size2); |
|
55 |
printf("retval5 value is %d\n", retval5); |
|
56 |
||
57 |
char *src6= des5; |
|
58 |
TPtr8 des6((unsigned char*)" ",20); |
|
59 |
retval6= CharpToTptr8(src6,des6); |
|
60 |
printf("retval6 value is %d\n", retval6); |
|
61 |
||
62 |
ret= strncmp((const char *)src1.Ptr(),(const char *) des6.Ptr(),10); |
|
63 |
if(ret==ESuccess) |
|
64 |
{ |
|
65 |
printf("integration_test10 PASSED\n"); |
|
66 |
} |
|
67 |
else |
|
68 |
{ |
|
69 |
printf("integration_tes10 FAILED\n"); |
|
70 |
assert_failed = true; |
|
71 |
} |
|
72 |
delete[] des1; |
|
73 |
delete[] des5; |
|
74 |
delete[] aPtr; |
|
75 |
src3.Close(); |
|
76 |
des2.Close(); |
|
77 |
} |
|
78 |
__UHEAP_MARKEND; |
|
79 |
testResultXml("integration_test_scenario10"); |
|
80 |
return 0; |
|
81 |
} |