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: _LIT8(KTxt, "HelloHello"); sl@0: HBufC8* buffer = HBufC8::NewL(10); sl@0: *buffer = KTxt; sl@0: wstring myWstring(L"gfsdfdufhuhfhfsfsfsdf"); sl@0: retval[0] = Hbufc8ToWstring(buffer,myWstring); sl@0: sl@0: TPtrC8 myTptr8(KTxt); sl@0: char* temp = new char[30]; sl@0: retval[2] = WstringToTptrc8(myWstring,temp,myTptr8); sl@0: sl@0: char* myChar = new char[40]; sl@0: int size = 40; sl@0: retval[3] = Tptrc8ToCharp(myTptr8,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: _LIT8(text_fin, "fgdsgfgdsg"); sl@0: HBufC8* finBuffer = HBufC8::NewL(10); sl@0: *finBuffer = text_fin; sl@0: retval[6] = WcharToHbufc8(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_scenario26 case passed"); sl@0: } sl@0: else sl@0: { sl@0: printf("\n\nintegration_test_scenario26 case failed"); sl@0: assert_failed = true; sl@0: } sl@0: delete buffer; sl@0: delete[] temp; sl@0: delete[] myChar; sl@0: delete[] Wstr_fin; sl@0: delete finBuffer; sl@0: } sl@0: __UHEAP_MARKEND; sl@0: testResultXml("integration_test_scenario26"); sl@0: return 0; sl@0: }