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 |
wchar_t* mycharstring = L"hellohello"; |
|
28 |
int retval[10]; |
|
29 |
RBuf16 buf; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
30 |
buf.CreateL(30); |
31 | 31 |
retval[1]= WcharToRbuf16(mycharstring,buf); |
32 |
||
33 |
wstring str; |
|
34 |
retval[2]= Rbuf16ToWstring(buf,str); |
|
35 |
||
36 |
TBuf16 <15> tbuf; |
|
37 |
retval[3]= WstringToTbuf16(str,tbuf); |
|
38 |
||
39 |
buf.Close(); |
|
40 |
wchar_t* myfinalstring= new wchar_t[25]; |
|
41 |
int size=15; |
|
42 |
retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size); |
|
43 |
||
44 |
RBuf8 buf8; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
45 |
buf8.CreateL(50); |
31 | 46 |
retval[5]= WcharToRbuf8(myfinalstring,buf8); |
47 |
||
48 |
wstring str1; |
|
49 |
retval[6]= Rbuf8ToWstring(buf8,str1); |
|
50 |
||
51 |
TBuf8 <30> tbuf1; |
|
52 |
retval[7]= WstringToTbuf8(str1,tbuf1); |
|
53 |
||
54 |
buf8.Close(); |
|
55 |
int size8=35; |
|
56 |
retval[8]= Tbuf8ToWchar(tbuf1,myfinalstring,size8); |
|
57 |
||
58 |
for(int i=1; i<=8; i++) |
|
59 |
{ |
|
60 |
if (retval[i]!= 0) |
|
61 |
printf("Conversion failed for retval\n",retval[i]); |
|
62 |
} |
|
63 |
||
64 |
if(!wcscmp(mycharstring,myfinalstring)) |
|
65 |
{ |
|
66 |
printf("integration_test_scenario19 case passed\n"); |
|
67 |
} |
|
68 |
else |
|
69 |
{ |
|
70 |
printf("integration_test_scenario19 case failed\n"); |
|
71 |
assert_failed = true; |
|
72 |
} |
|
73 |
delete[] myfinalstring; |
|
74 |
} |
|
75 |
__UHEAP_MARKEND; |
|
76 |
testResultXml("integration_test_scenario19"); |
|
77 |
return 0; |
|
78 |
} |