os/ossrv/utilitylibraries/libutils/tsrc/src/integration_test_scenario6.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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     des1.CreateL(30);
    32     retval1= CharToRbuf8(src1,des1);
    33     printf("retval1 value is %d\n", retval1);
    34 
    35     RBuf8 src2;
    36     src2.Create(des1);
    37     string des2;
    38     retval2= Rbuf8ToString(src2,des2);
    39     printf("retval2 value is %d\n", retval2);
    40 
    41     string src3=des2;
    42     HBufC8 *des3= HBufC8::NewMaxL(20);
    43     retval3= StringToHbufc8(src3,des3);
    44     printf("retval3 value is %d\n", retval3);
    45 
    46     HBufC8 *src4=des3;
    47     string des4;
    48     retval4= Hbufc8ToString(src4,des4);
    49     printf("retval4 value is %d\n", retval4);
    50 
    51     string src5=des4;
    52     TBuf16<20> des5;
    53     retval5= StringToTbuf16(src5,des5);
    54     printf("retval5 value is %d\n", retval5);
    55 
    56     TBuf16<20>	src6=des5;
    57     char *des6= new char[39];
    58     retval6= Tbuf16ToChar(src6,des6,size1);		
    59     printf("retval6 value is %d\n", retval6);
    60     
    61     ret= strncmp((char*)src1,(char*)des6,17);
    62     if(ret == ESuccess)
    63     {
    64     printf("integration_test6 PASSED\n");
    65     }
    66     else
    67     {
    68     printf("integration_test6 FAILED\n");
    69     assert_failed = true;
    70     }
    71     delete des3;
    72     delete[]des6;
    73     des1.Close();
    74     src2.Close();	
    75     }
    76     __UHEAP_MARKEND;
    77     testResultXml("integration_test_scenario6");
    78     return 0;
    79 }