utilitylibraries/libutils/tsrc/src/integration_test_scenario11.cpp
changeset 31 ce057bb09d0b
child 45 4b03adbd26ca
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     TPtrC8 src1((unsigned const char*)"openc",10);
       
    28     char *des1=new char[10];
       
    29     int ret,retval1,retval2,retval3,retval4,retval5,retval6,size1=20,size2=40;
       
    30     retval1=Tptrc8ToCharp(src1,des1,size1);
       
    31     printf("retval1 value is %d\n", retval1);
       
    32     
       
    33     char *src2=des1;
       
    34     TBuf16<20> des2;
       
    35     retval2=CharToTbuf16(src2,des2);
       
    36     printf("retval2 value is %d\n", retval2);
       
    37     
       
    38     TBuf16<20>src3=des2;
       
    39     string des3;
       
    40     retval3=Tbuf16ToString(src3,des3);
       
    41     printf("retval3 value is %d\n", retval3);
       
    42     
       
    43     string src4=des3;
       
    44     TBuf16<20>des4;
       
    45     retval4= StringToTbuf16(src4,des4);
       
    46     printf("retval4 value is %d\n", retval4);
       
    47     
       
    48     TBuf16<40>src5=des4;
       
    49     char *des5= new char[40];
       
    50     retval5=Tbuf16ToChar(des4,des5,size2);
       
    51     printf("retval5 value is %d\n", retval5);
       
    52     
       
    53     char *src6=des5;
       
    54     TPtrC8 des6;
       
    55     retval6=CharpToTptrc8(src6,des6);
       
    56     printf("retval6 value is %d\n", retval6);
       
    57     
       
    58     ret= strncmp((char*)src1.Ptr(),(char*) des6.Ptr(),5);
       
    59     if(ret == ESuccess)
       
    60     {
       
    61     printf("integration_test11 PASSED\n");
       
    62     }
       
    63     else
       
    64     {
       
    65     printf("integration_tes11 FAILED\n");
       
    66     assert_failed = true;
       
    67     }
       
    68     delete[] des1;
       
    69     delete[] des5;
       
    70     }
       
    71     __UHEAP_MARKEND;
       
    72     testResultXml("integration_test_scenario11");
       
    73     return 0;
       
    74 }