kerneltest/e32test/dll/t_import_ldd.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2006-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // \f32test\loader\t_import_ldd.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #define __E32TEST_EXTENSION__
       
    19 
       
    20 #include <e32test.h>
       
    21 #include "d_export.h"
       
    22 #include "d_import.h"
       
    23 
       
    24 static RTest test(_L("t_import_ldd"));
       
    25 
       
    26 
       
    27 TInt E32Main()
       
    28 	{
       
    29 	test.Title();
       
    30 	test.Start(_L("Testing ldd importing"));
       
    31 	
       
    32 	test.Next(_L("Load the exporting ldd"));
       
    33 	TInt r=User::LoadLogicalDevice(KExportTestLddName);
       
    34 	test_Equal(KErrNone, r);	// Don't allow KErrAlreadyExists as don't want ldd to be XIP.
       
    35 
       
    36 	RExportLdd exportLdd;
       
    37 	test_KErrNone(exportLdd.Open());
       
    38 	// The exported function multiplies the 2 arguments.
       
    39 	test_Equal(12, exportLdd.RunExport(3, 4));
       
    40 	
       
    41 	test.Next(_L("Load the importing ldd"));
       
    42 	r=User::LoadLogicalDevice(KImportTestLddName);
       
    43 	test_Equal(KErrNone, r);	// Don't allow KErrAlreadyExists as don't want ldd to be XIP.
       
    44 
       
    45 
       
    46 	RImportLdd importLdd;
       
    47 	test_KErrNone(importLdd.Open());
       
    48 	// The imported function multiplies the 2 arguments.
       
    49 	test_Equal(12, importLdd.RunImport(3, 4));
       
    50 	
       
    51 	exportLdd.Close();
       
    52 	importLdd.Close();
       
    53 
       
    54 	test_KErrNone(User::FreeLogicalDevice(KExportTestLddName));
       
    55 	test_KErrNone(User::FreeLogicalDevice(KImportTestLddName));
       
    56 
       
    57 	test.End();
       
    58 	return KErrNone;
       
    59     }
       
    60 
       
    61