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 <stdio.h>
sl@0: #include<e32std.h>
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:     TBufC<30> buf;
sl@0:     TPtrC16 myTptr=buf.Des();
sl@0:     wchar_t* myWchar =L"hellohello";
sl@0:     retval[0] = WcharpToTptrc16(myWchar,myTptr);
sl@0: 
sl@0:     wstring myWstring(L"gfgfdfdafggffghghf");
sl@0:     retval[1] = Tptrc16ToWstring(myTptr,myWstring);
sl@0: 
sl@0:     HBufC16 *hbufc = HBufC16::NewMaxL(20);
sl@0:     retval[2] = WstringToHbufc16(myWstring,hbufc);
sl@0: 
sl@0:     wstring myFinWstring(L"aghfgafdsgfg");
sl@0:     retval[3] = Hbufc16ToWstring(hbufc,myFinWstring);
sl@0: 
sl@0:     char* temp = new char[30];
sl@0:     TBufC8<30> buf8;
sl@0:     TPtrC8 myTptr8 = buf8.Des();
sl@0:     retval[4] = WstringToTptrc8(myFinWstring,temp,myTptr8);
sl@0: 
sl@0:     wchar_t* myFinWchar = new wchar_t[21];
sl@0:     int size = 20;
sl@0:     retval[5] = Tptrc8ToWcharp(myTptr8,myFinWchar,size);
sl@0:     
sl@0:     for(int i=1; i<=5; 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(!wcscmp(myWchar,myFinWchar))
sl@0:     {
sl@0:     printf("\n\nintegration_test_scenario22 case passed");
sl@0:     }
sl@0:     else
sl@0:     {
sl@0:     printf("\n\nintegration_test_scenario22 case failed");
sl@0:     assert_failed = true;
sl@0:     }
sl@0:     delete[] temp;
sl@0:     delete hbufc;
sl@0:     delete[] myFinWchar;
sl@0:     }
sl@0:     __UHEAP_MARKEND;
sl@0:     testResultXml("integration_test_scenario22");
sl@0:     return 0;
sl@0: }