utilitylibraries/libutils/tsrc/src/integration_test_scenario7.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     TBuf8<20>src1((unsigned char*)"testing");
       
    28     char * des1= new char [20]; 
       
    29     int size1=20,ret,retval1,retval2,retval3,retval4,retval5,retval6;
       
    30     retval1= Tbuf8ToChar(src1,des1,size1);
       
    31 
       
    32     char * src2= des1;
       
    33     TPtr8 des2((unsigned char*)" ",7);
       
    34     retval2=CharpToTptr8(src2,des2);			
       
    35 
       
    36     TPtrC8 src3= des2;
       
    37     string des3;
       
    38     retval3= Tptrc8ToString(src3,des3);
       
    39 
       
    40     string src4=des3;
       
    41     HBufC16 *des4= HBufC16::NewMaxL(20);
       
    42     retval4= StringToHbufc16(src4,des4);
       
    43 
       
    44     HBufC16 *src5= des4;
       
    45     string des5="";
       
    46     int size2=40;		
       
    47     retval5= Hbufc16ToString(src5,des5,size2);
       
    48 
       
    49     string src6=des5;
       
    50     TBuf8<50> des6;
       
    51     retval6= StringToTbuf8(src6,des6);
       
    52 
       
    53     ret= strncmp((char *)src1.Ptr(),(char *)des6.Ptr(),7);		
       
    54     if(ret == ESuccess)
       
    55     {
       
    56     printf("integration_test7 PASSED\n");
       
    57     }
       
    58     else
       
    59     {
       
    60     printf("integration_test7 FAILED\n");
       
    61     assert_failed = true;
       
    62     }
       
    63     delete des4;
       
    64     delete[] des1;
       
    65     des1= NULL;
       
    66     }
       
    67     __UHEAP_MARKEND;				
       
    68     testResultXml("integration_test_scenario7");
       
    69 }