sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: #include "libutils.h" sl@0: #include"std_log_result.h" sl@0: #define LOG_FILENAME_LINE __FILE__, __LINE__ sl@0: int main() sl@0: { sl@0: __UHEAP_MARK; sl@0: { sl@0: int retval[10]; sl@0: wchar_t* mycharstring = L"hello"; sl@0: RBuf16 buf; sl@0: buf.CreateL(30); sl@0: retval[0]= WcharToRbuf16(mycharstring,buf); sl@0: sl@0: wstring str; sl@0: retval[1]= Rbuf16ToWstring(buf,str); sl@0: sl@0: TPtr8 tptr8((unsigned char*)"",10,20); sl@0: char* temp_c = new char[20]; sl@0: retval[2]= WstringToTptr8(str,temp_c,tptr8); sl@0: sl@0: char* mychar = new char[30]; sl@0: int size=30; sl@0: retval[3]= Tptr8ToChar(tptr8,mychar,size); sl@0: sl@0: HBufC16 *hbufc = HBufC16::NewMaxL(20); sl@0: retval[4]= CharToHbufc16(mychar,hbufc); sl@0: sl@0: string mystring; sl@0: int size_hbufc=55; sl@0: retval[5]= Hbufc16ToString(hbufc,mystring,size_hbufc); sl@0: sl@0: wchar_t* temp = new wchar_t[50]; sl@0: TPtrC16 tptrc; sl@0: retval[6]= StringToTptrc16(mystring,temp,tptrc); sl@0: sl@0: for(int i=1; i<=6; i++) sl@0: { sl@0: if (retval[i]!= 0) sl@0: printf("Conversion failed for retval\n",retval[i]); sl@0: } sl@0: sl@0: wchar_t* myfinalstring = new wchar_t[50]; sl@0: int size_fin=55; sl@0: retval[7]= Tptrc16ToWcharp(tptrc,myfinalstring,size_fin); sl@0: sl@0: if(!wcsncmp(mycharstring,myfinalstring,5)) sl@0: { sl@0: printf("\nintegration_test_scenario20 case passed"); sl@0: } sl@0: else sl@0: { sl@0: printf("\nintegration_test_scenario20 case failed"); sl@0: assert_failed = true; sl@0: } sl@0: buf.Close(); sl@0: delete[] temp_c; sl@0: delete[] mychar; sl@0: delete hbufc; sl@0: delete[] temp; sl@0: delete[] myfinalstring; sl@0: } sl@0: __UHEAP_MARKEND; sl@0: testResultXml("integration_test_scenario20"); sl@0: return 0; sl@0: }