symport/bldtest/testdll.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 "testdll.h"
       
    21 
       
    22 EXPORT_C CTestDll::CTestDll()
       
    23 	{
       
    24 	}
       
    25 
       
    26 EXPORT_C CTestDll::~CTestDll()
       
    27 	{
       
    28 	}
       
    29 
       
    30 void LeavingFuncL()
       
    31 	{
       
    32 	User::Leave(-777);
       
    33 	}
       
    34 
       
    35 EXPORT_C void CTestDll::LeaveL()
       
    36 	{
       
    37 	TRAPD(err, LeavingFuncL());
       
    38 	User::Leave(err);
       
    39 	}
       
    40 
       
    41 EXPORT_C TInt CTestDll::ArrayL()
       
    42 	{
       
    43 	RArray<TInt> array;
       
    44 	array.Append(1);
       
    45 	array.Append(2);
       
    46 	array.Append(3);
       
    47 
       
    48 	TInt count = array.Count();
       
    49 	array.Close();
       
    50 	return count;
       
    51 	}
       
    52 
       
    53 EXPORT_C void CTestDll::DescriptorL()
       
    54 	{
       
    55 	TBuf<256> des1;
       
    56 	TBuf<256> des2(_L("... TBuf descriptors are okay\n"));
       
    57 	des1.Format(_L("%S"), &des2);	
       
    58 	RDebug::Print(des1);
       
    59 	
       
    60 	HBufC8* hbuf1 = HBufC8::NewLC(76);
       
    61 	hbuf1->Des().Copy(_L8("... Heap descriptors are okay\n"));
       
    62 	des1.Copy(*hbuf1);
       
    63 	RDebug::Print(des1);
       
    64 
       
    65 	des1.Zero();
       
    66 	des1.AppendNum(TReal(3.14), TRealFormat());
       
    67 	RDebug::Print(_L("... The value of PI=%S\n"), &des1);
       
    68 	
       
    69 	des1.Zero();
       
    70 	des1.AppendFormat(_L("... More accurate value of PI=%e\n"), TReal(3.14159));
       
    71 	RDebug::Print(des1);
       
    72 
       
    73 	// DEF132478: libsymport.a is out of date
       
    74 	RThread().Id();
       
    75 
       
    76 	CleanupStack::PopAndDestroy(hbuf1);
       
    77 	}