1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/utilitylibraries/libutils/tsrc/src/integration_test_scenario4.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,87 @@
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 + char* src1 = "Hello Char String";
1.29 + TBufC8<30> buf;
1.30 + TPtr8 des1= buf.Des();
1.31 + int ret, retval1,retval2,retval3,retval4,retval5,retval6,retval7,retval8;
1.32 + retval1 = CharpToTptr8(src1,des1);
1.33 + printf("retval1 value is %d\n", retval1);
1.34 +
1.35 + __UHEAP_MARK;
1.36 + {
1.37 + string des2="";
1.38 + TPtr8 src2 = des1;
1.39 + retval2 = Tptr8ToString(src2, des2);
1.40 + printf("retval2 value is %d\n", retval2);
1.41 +
1.42 + string src3=des2;
1.43 + TBuf8 <30> des3;
1.44 + retval3 = StringToTbuf8(src3,des3);
1.45 + printf("retval3 value is %d\n", retval3);
1.46 +
1.47 + TBuf8<20>src4= des3;
1.48 + wchar_t * des4= new wchar_t [30];
1.49 + int size1=30;
1.50 + retval4= Tbuf8ToWchar(src4,des4,size1);
1.51 + printf("retval4 value is %d\n", retval4);
1.52 +
1.53 + wchar_t* src5 = des4;
1.54 + TBuf8<50> des5;
1.55 + retval5 = WcharToTbuf8(src5,des5);
1.56 + printf("retval5 value is %d\n", retval5);
1.57 +
1.58 + TBuf8 <50> src6 = des5;
1.59 + string des6="";
1.60 + retval6 = Tbuf8ToString(src6,des6);
1.61 + printf("retval6 value is %d\n", retval6);
1.62 +
1.63 + string src7=des6;
1.64 + TPtrC8 des7;
1.65 + retval7 = StringToTptrc8(src7,des7);
1.66 + printf("retval7 value is %d\n", retval7);
1.67 +
1.68 + TPtrC8 src8 = des7;
1.69 + char *des8= new char[30];
1.70 + int size2=30;
1.71 + retval8= Tptrc8ToCharp(src8,des8,size2);
1.72 + printf("retval8 value is %d\n", retval8);
1.73 +
1.74 + ret= strncmp("Hello Char String",(char*)des8,17);
1.75 + if(ret == ESuccess)
1.76 + {
1.77 + printf("integration_test4 passed\n");
1.78 + }
1.79 + else
1.80 + {
1.81 + printf("integration_test4 FAILURE\n");
1.82 + assert_failed = true;
1.83 + }
1.84 + delete[] des4;
1.85 + delete[] des8;
1.86 + }
1.87 + __UHEAP_MARKEND;
1.88 + testResultXml("integration_test_scenario4");
1.89 + return 0;
1.90 +}