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