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: _LIT(KTxt, "HelloHello"); sl@0: HBufC* buffer = HBufC::NewL(10); sl@0: *buffer = KTxt; sl@0: wstring myWstring; sl@0: retval[0] = Hbufc16ToWstring(buffer,myWstring); sl@0: sl@0: TPtrC myTptr16(KTxt); sl@0: retval[2] = WstringToTptrc16(myWstring,myTptr16); sl@0: sl@0: char* myChar = new char[40]; sl@0: int size = 40; sl@0: retval[3] = Tptrc16ToCharp(myTptr16,myChar,size); sl@0: sl@0: TBufC8<30> buf8; sl@0: TPtr8 myTptr = buf8.Des(); sl@0: retval[4] = CharpToTptr8(myChar,myTptr); sl@0: sl@0: wchar_t* Wstr_fin = new wchar_t[36]; sl@0: int size_char=36; sl@0: retval[5] = Tptr8ToWcharp(myTptr,Wstr_fin,size_char); sl@0: sl@0: HBufC16* finBuffer = HBufC16::NewMaxL(20); sl@0: retval[6] = WcharToHbufc16(Wstr_fin,finBuffer); 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: if(!buffer->Compare(finBuffer->Des())) sl@0: { sl@0: printf("\n\nintegration_test_scenario25 case passed"); sl@0: } sl@0: else sl@0: { sl@0: printf("\n\nintegration_test_scenario25 case failed"); sl@0: assert_failed = true; sl@0: } sl@0: delete buffer; sl@0: delete[] myChar; sl@0: delete[] Wstr_fin; sl@0: delete finBuffer; sl@0: } sl@0: __UHEAP_MARKEND; sl@0: testResultXml("integration_test_scenario25"); sl@0: return 0; sl@0: }