utilitylibraries/libutils/tsrc/src/integration_test_scenario15.cpp
changeset 0 e4d67989cc36
child 22 ddc455616bd6
child 56 acd3cd4aaceb
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     string src1="!@#$%^&";
       
    28     TPtrC8 des1((unsigned char*)" ",30);
       
    29     int retval1, retval2,retval3,retval4,retval5,retval6,ret,size1=20;
       
    30     retval1= StringToTptrc8(src1,des1);
       
    31 
       
    32     TPtrC8 src2 = des1;
       
    33     char *des2= new char[20];
       
    34     retval2= Tptrc8ToCharp(src2,des2,size1);
       
    35 
       
    36     char * src3= des2;
       
    37     TPtr16 des3((unsigned short*)"",30);
       
    38     wchar_t *aPtr1 = new wchar_t[20];
       
    39     retval3= CharpToTptr16(src3,aPtr1,des3);
       
    40 
       
    41     TPtr16 src4= des3;
       
    42     string des4;
       
    43     retval4= Tptr16ToString(src4,des4);
       
    44 
       
    45     string src5= des4;
       
    46     TPtrC16 des5((unsigned short*)"",30);
       
    47     wchar_t *aPtr2= new wchar_t[20];
       
    48     retval5= StringToTptrc16(src5,aPtr2,des5);
       
    49 
       
    50     TPtrC16 src6= des5;
       
    51     char *des6= new char[30];
       
    52     retval6= Tptrc16ToCharp(src6,des6,size1);
       
    53 
       
    54     ret= strncmp("!@#$%^&",(const char*)des6,7);
       
    55     if(ret == ESuccess)
       
    56     {
       
    57     printf("integration_test15 PASSED\n");
       
    58     }
       
    59     else
       
    60     {
       
    61     printf("integration_tes15 FAILED\n");
       
    62     assert_failed = true;
       
    63     }	
       
    64     delete[] des2;
       
    65     delete[] aPtr1;
       
    66     delete[] aPtr2;
       
    67     delete[] des6;	
       
    68     }
       
    69     __UHEAP_MARKEND;
       
    70     testResultXml("integration_test_scenario15");
       
    71 }