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 |
_LIT(myTlitc,"hellohello"); |
|
28 |
wchar_t* myWchar = new wchar_t[30]; |
|
29 |
int size = 30; |
|
30 |
int retval[10]; |
|
31 |
retval[0] = Tlitc16ToWchar(myTlitc,myWchar,size); |
|
32 |
||
33 |
RBuf8 buf; |
|
34
5fae379060a7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
34 |
buf.CreateL(60); |
31 | 35 |
retval[1] = WcharToRbuf8(myWchar,buf); |
36 |
||
37 |
wstring str; |
|
38 |
retval[2] = Rbuf8ToWstring(buf,str); |
|
39 |
||
40 |
TBuf16 <30> tbuf; |
|
41 |
retval[3]= WstringToTbuf16(str,tbuf); |
|
42 |
||
43 |
wchar_t* myfinalstring= new wchar_t[15]; |
|
44 |
int size_new=15; |
|
45 |
retval[4]= Tbuf16ToWchar(tbuf,myfinalstring,size_new); |
|
46 |
||
47 |
for(int i=1; i<=4; i++) |
|
48 |
{ |
|
49 |
if (retval[i]!= 0) |
|
50 |
printf("Conversion failed for retval\n",retval[i]); |
|
51 |
} |
|
52 |
||
53 |
if(!wcscmp(myWchar,myfinalstring)) |
|
54 |
{ |
|
55 |
printf("\n\n\nintegration_test_scenario27 success"); |
|
56 |
} |
|
57 |
else |
|
58 |
{ |
|
59 |
assert_failed = true; |
|
60 |
printf("\n\n\nintegration_test_scenario27 failure"); |
|
61 |
} |
|
62 |
delete[] myWchar; |
|
63 |
buf.Close(); |
|
64 |
delete[] myfinalstring; |
|
65 |
} |
|
66 |
__UHEAP_MARKEND; |
|
67 |
testResultXml("integration_test_scenario27"); |
|
68 |
return 0; |
|
69 |
} |