Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include"std_log_result.h"
22 #define LOG_FILENAME_LINE __FILE__, __LINE__
23 #pragma diag_suppress 550
26 bool assert_failed = false;
29 string src1="testing";
31 TPtr8 des1((unsigned char*)tempChar,20);
32 int ret,size1=30,size2=42;
34 retval[0] = StringToTptr8(src1, des1);
37 char *des2= new char[20];
38 retval[1]= Tptr8ToChar(src2,des2,size1);
41 wchar_t *aPtr= new wchar_t[20];
43 TPtrC16 des3((unsigned short *)temp,30);
44 retval[2]= CharpToTptrc16(src3,aPtr,des3);
48 retval[3]=Tptrc16ToString(src4,des4);
51 HBufC16 *des5=HBufC16::NewMaxL(20);
52 retval[4]= StringToHbufc16(src5,des5);
56 retval[5]= Hbufc16ToString(src6,des6,size1);
59 HBufC8 *des7=HBufC8::NewMaxL(20);
60 retval[6]= StringToHbufc8(src7,des7);
63 char *des8=new char[20];
64 retval[7]= Hbufc8ToChar(src8,des8,size1);
67 HBufC16 *des9=HBufC16::NewMaxL(20);
68 retval[8]=CharToHbufc16(src9,des9);
72 retval[9]= Hbufc16ToString(src10,des10,size2);
77 retval[10]= StringToRbuf16(src11,des11);
81 src12.Copy((unsigned short*)des11.Ptr(), 14);
83 char *des12=new char[30];
85 retval[11]= Rbuf16ToChar(src12,des12,size3);
90 retval[12]=CharToRbuf16(src13,des13);
93 retval[13]=Rbuf16ToString(des13,des14);
98 retval[14]= StringToRbuf8(src15,des15);
102 char * des16= new char[61];
103 retval[15]=Rbuf8ToChar(src16,des16,size1);
108 retval[16]=CharToRbuf16(src17,des17);
112 wchar_t *des18= new wchar_t[70];
113 retval[17]=Rbuf16ToWchar(src18,des18,size1);
115 wchar_t *src19=des18;
118 retval[18]=WcharToRbuf8(src19,des19);
121 retval[19] = Rbuf8ToWstring(des19,src20);
124 retval[20] = WstringToTbuf16(src20,des20);
126 wchar_t* src21= new wchar_t[100];
128 retval[21] = Tbuf16ToWchar(des20,src21,size_new);
132 retval[22]= WcharToRbuf16(src21,des21);
135 retval[23]= Rbuf16ToWstring(des21,src22);
138 retval[24]= WstringToTbuf16(src22,des22);
140 wchar_t* src23= new wchar_t[100];
142 retval[25]= Tbuf16ToWchar(des22,src23,size);
146 retval[26]= WcharToRbuf8(src23,des23);
149 retval[27]= Rbuf8ToWstring(des23,src24);
153 retval[28]= WstringToTbuf8(src24,des24);
155 wchar_t* des25 = new wchar_t[150];
157 retval[29]= Tbuf8ToWchar(des24,des25,size8);
159 for(int i=1; i<=29; i++)
162 printf("Conversion failed for retval\n",retval[i]);
165 ret= strncmp((char *)src1.c_str(),(char *)des24.Ptr(),7);
168 printf("integration_test_scenario_29 PASSED\n");
172 printf("integration_test_scenario_29 FAILED\n");
197 testResultXml("integration_test_scenario29");