1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/utilitylibraries/libutils/tsrc/nft/src/test_wchartotbuf8_positive.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,53 @@
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 +void main()
1.27 +{
1.28 + __UHEAP_MARK;
1.29 + int retval =ESuccess;
1.30 + wchar_t* mystr = L"hello";
1.31 + TBuf8 <45> f;
1.32 + int i=0;
1.33 + while (i<=1000)
1.34 + {
1.35 + retval = WcharToTbuf8 (mystr, f);
1.36 + i++;
1.37 + printf("%d\n",i);
1.38 + }
1.39 +
1.40 + wchar_t* temp = new wchar_t[5];
1.41 + temp[1]= L'\0';
1.42 + mbstowcs(temp, (const char*)f.Ptr(),1);
1.43 + if (retval ==ESuccess)
1.44 + {
1.45 + printf("wchartotbuf8 positive0 Passed\n");
1.46 + }
1.47 + else
1.48 + {
1.49 + assert_failed = true;
1.50 + printf("wchartotbuf8 positive0 Failed\n");
1.51 + }
1.52 + delete[] temp;
1.53 + temp = NULL;
1.54 + __UHEAP_MARKEND;
1.55 + testResultXml("test_WcharToTbuf8_positive");
1.56 +}