symport/bldtest/teststatic.cpp
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32base.h>
       
    17 #include <e32std.h>
       
    18 #include <e32debug.h>
       
    19 
       
    20 #include "teststatic.h"
       
    21 
       
    22 EXPORT_C void TestStatic::LeaveL()
       
    23 	{
       
    24 	User::Leave(-666);
       
    25 	}
       
    26 
       
    27 EXPORT_C TInt TestStatic::ArrayL()
       
    28 	{
       
    29 	RArray<TInt> array;
       
    30 	array.Append(1);
       
    31 	array.Append(2);
       
    32 	array.Append(3);
       
    33 
       
    34 	TInt count = array.Count();
       
    35 	array.Close();
       
    36 	return count;
       
    37 	}
       
    38 
       
    39 EXPORT_C void TestStatic::DescriptorL()
       
    40 	{
       
    41 	TBuf<256> des1;
       
    42 	TBuf<256> des2(_L("... TBuf descriptors are okay\n"));
       
    43 	des1.Format(_L("%S"), &des2);	
       
    44 	RDebug::Print(des1);
       
    45 	
       
    46 	HBufC8* hbuf1 = HBufC8::NewLC(76);
       
    47 	hbuf1->Des().Copy(_L8("... Heap descriptors are okay\n"));
       
    48 	des1.Copy(*hbuf1);
       
    49 	RDebug::Print(des1);
       
    50 
       
    51 	des1.Zero();
       
    52 	des1.AppendNum(TReal(3.14), TRealFormat());
       
    53 	RDebug::Print(_L("... The value of PI=%S\n"), &des1);
       
    54 	
       
    55 	des1.Zero();
       
    56 	des1.AppendFormat(_L("... More accurate value of PI=%e\n"), TReal(3.14159));
       
    57 	RDebug::Print(des1);
       
    58 
       
    59 	CleanupStack::PopAndDestroy(hbuf1);
       
    60 	}