utilitylibraries/libutils/tsrc/src/integration_test_scenario6.cpp
changeset 31 ce057bb09d0b
child 34 5fae379060a7
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     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 int main()
       
    24 {
       
    25     __UHEAP_MARK;
       
    26     { 
       
    27     char* src1="integration_test6";
       
    28     RBuf8 des1;
       
    29     int ret,retval1,retval2,retval3,retval4,retval5,retval6;
       
    30     int size1=39;
       
    31     retval1= CharToRbuf8(src1,des1);
       
    32     printf("retval1 value is %d\n", retval1);
       
    33 
       
    34     RBuf8 src2;
       
    35     src2.Create(des1);
       
    36     string des2;
       
    37     retval2= Rbuf8ToString(src2,des2);
       
    38     printf("retval2 value is %d\n", retval2);
       
    39 
       
    40     string src3=des2;
       
    41     HBufC8 *des3= HBufC8::NewMaxL(20);
       
    42     retval3= StringToHbufc8(src3,des3);
       
    43     printf("retval3 value is %d\n", retval3);
       
    44 
       
    45     HBufC8 *src4=des3;
       
    46     string des4;
       
    47     retval4= Hbufc8ToString(src4,des4);
       
    48     printf("retval4 value is %d\n", retval4);
       
    49 
       
    50     string src5=des4;
       
    51     TBuf16<20> des5;
       
    52     retval5= StringToTbuf16(src5,des5);
       
    53     printf("retval5 value is %d\n", retval5);
       
    54 
       
    55     TBuf16<20>	src6=des5;
       
    56     char *des6= new char[39];
       
    57     retval6= Tbuf16ToChar(src6,des6,size1);		
       
    58     printf("retval6 value is %d\n", retval6);
       
    59     
       
    60     ret= strncmp((char*)src1,(char*)des6,17);
       
    61     if(ret == ESuccess)
       
    62     {
       
    63     printf("integration_test6 PASSED\n");
       
    64     }
       
    65     else
       
    66     {
       
    67     printf("integration_test6 FAILED\n");
       
    68     assert_failed = true;
       
    69     }
       
    70     delete des3;
       
    71     delete[]des6;
       
    72     des1.Close();
       
    73     src2.Close();	
       
    74     }
       
    75     __UHEAP_MARKEND;
       
    76     testResultXml("integration_test_scenario6");
       
    77     return 0;
       
    78 }