1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/utilitylibraries/libutils/tsrc/src/integration_test_scenario7.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,76 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +#include <stdio.h>
1.22 +#include<e32std.h>
1.23 +#include "libutils.h"
1.24 +#include"std_log_result.h"
1.25 +#define LOG_FILENAME_LINE __FILE__, __LINE__
1.26 +int main()
1.27 +{
1.28 + __UHEAP_MARK;
1.29 + {
1.30 + TBuf8<20>src1((unsigned char*)"testing");
1.31 + char * des1= new char [20];
1.32 + int size1=20,ret,retval1,retval2,retval3,retval4,retval5,retval6;
1.33 + retval1= Tbuf8ToChar(src1,des1,size1);
1.34 + printf("retval1 value is %d\n", retval1);
1.35 +
1.36 + char * src2= des1;
1.37 + TPtr8 des2((unsigned char*)" ",7);
1.38 + retval2=CharpToTptr8(src2,des2);
1.39 + printf("retval2 value is %d\n", retval2);
1.40 +
1.41 + TPtrC8 src3= des2;
1.42 + string des3;
1.43 + retval3= Tptrc8ToString(src3,des3);
1.44 + printf("retval3 value is %d\n", retval3);
1.45 +
1.46 + string src4=des3;
1.47 + HBufC16 *des4= HBufC16::NewMaxL(20);
1.48 + retval4= StringToHbufc16(src4,des4);
1.49 + printf("retval4 value is %d\n", retval4);
1.50 +
1.51 + HBufC16 *src5= des4;
1.52 + string des5="";
1.53 + int size2=40;
1.54 + retval5= Hbufc16ToString(src5,des5,size2);
1.55 + printf("retval5 value is %d\n", retval5);
1.56 +
1.57 + string src6=des5;
1.58 + TBuf8<50> des6;
1.59 + retval6= StringToTbuf8(src6,des6);
1.60 + printf("retval6 value is %d\n", retval6);
1.61 +
1.62 + ret= strncmp((char *)src1.Ptr(),(char *)des6.Ptr(),7);
1.63 + if(ret == ESuccess)
1.64 + {
1.65 + printf("integration_test7 PASSED\n");
1.66 + }
1.67 + else
1.68 + {
1.69 + printf("integration_test7 FAILED\n");
1.70 + assert_failed = true;
1.71 + }
1.72 + delete des4;
1.73 + delete[] des1;
1.74 + des1= NULL;
1.75 + }
1.76 + __UHEAP_MARKEND;
1.77 + testResultXml("integration_test_scenario7");
1.78 + return 0;
1.79 +}