utilitylibraries/libutils/tsrc/src/integration_test_scenario26.cpp
changeset 0 e4d67989cc36
child 22 ddc455616bd6
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <stdio.h>
       
    19 #include<e32std.h>
       
    20 #include "libutils.h"
       
    21 #include"std_log_result.h"
       
    22 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    23 void main()
       
    24 {
       
    25     __UHEAP_MARK;
       
    26     {
       
    27     int retval[10];
       
    28     _LIT8(KTxt, "HelloHello");
       
    29     HBufC8* buffer = HBufC8::NewL(10);
       
    30     *buffer = KTxt;
       
    31     wstring myWstring(L"gfsdfdufhuhfhfsfsfsdf");
       
    32     retval[0] = Hbufc8ToWstring(buffer,myWstring);
       
    33 
       
    34     TPtrC8 myTptr8(KTxt);
       
    35     char* temp = new char[30];
       
    36     retval[2] = WstringToTptrc8(myWstring,temp,myTptr8);
       
    37 
       
    38     char* myChar = new char[40];
       
    39     int size = 40;
       
    40     retval[3] = Tptrc8ToCharp(myTptr8,myChar,size);
       
    41 
       
    42     TBufC8<30> buf8;
       
    43     TPtr8 myTptr = buf8.Des();  
       
    44     retval[4] = CharpToTptr8(myChar,myTptr);
       
    45 
       
    46     wchar_t* Wstr_fin = new wchar_t[36];
       
    47     int size_char=36;
       
    48     retval[5] = Tptr8ToWcharp(myTptr,Wstr_fin,size_char);
       
    49 
       
    50     _LIT8(text_fin, "fgdsgfgdsg");
       
    51     HBufC8* finBuffer = HBufC8::NewL(10);
       
    52     *finBuffer = text_fin;
       
    53     retval[6] = WcharToHbufc8(Wstr_fin,finBuffer);
       
    54 
       
    55     if(!buffer->Compare(finBuffer->Des()))
       
    56     {
       
    57     printf("\n\nintegration_test_scenario26 case passed");
       
    58     }
       
    59     else
       
    60     {
       
    61     printf("\n\nintegration_test_scenario26 case failed");
       
    62     assert_failed = true;
       
    63     }
       
    64     delete buffer;
       
    65     delete[] temp;
       
    66     delete[] myChar;
       
    67     delete[] Wstr_fin;
       
    68     delete 	finBuffer;
       
    69     }
       
    70     __UHEAP_MARKEND;
       
    71     testResultXml("integration_test_scenario26");
       
    72 }