kerneltest/e32test/bench/t_userasmbm.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2005-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 // e32test\bench\t_userasmbm.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "t_userbm.h"
       
    19 #include <e32test.h>
       
    20 #include <e32std.h>
       
    21 #include <e32std_private.h>
       
    22 
       
    23 /**
       
    24  @SYMTestCaseID				KBASE-0047-t_userasmbm
       
    25  @SYMPREQ					PREQ521
       
    26  @SYMREQ                  	REQ4891
       
    27  @SYMTestCaseDesc 			This is a performance test used to get a relative indication
       
    28  							of the speed of assmbler functions in euser
       
    29  @SYMTestPriority   	 	Medium
       
    30  @SYMTestActions  	 		Runs benchmarks for euser functions
       
    31  @SYMTestExpectedResults  	Results are for information - no specific results expected
       
    32 */
       
    33 
       
    34 #define FailIfError(EXPR) \
       
    35 	{ \
       
    36 	TInt aErr = (EXPR); \
       
    37 	if (aErr != KErrNone) \
       
    38 		{ \
       
    39 		test.Printf(_L("Return code == %d\n"), aErr); \
       
    40 		test(EFalse); \
       
    41 		} \
       
    42 	}
       
    43 
       
    44 RTest test(_L("T_USERASMBM"));
       
    45 
       
    46 TInt E32Main()
       
    47 //
       
    48 // Benchmark for euser assmblerised functions
       
    49 //
       
    50     {
       
    51 	CTrapCleanup* trapHandler=CTrapCleanup::New();
       
    52 	test(trapHandler!=NULL);
       
    53 
       
    54     test.Title();
       
    55     test.Start(_L("Benchmarks for assemblerised euser functions"));
       
    56 
       
    57 	TUserBenchmarkList bms;
       
    58 	TRAPD(err, RunBenchmarkTestsL(bms));
       
    59 	if (err != KErrNone)
       
    60 		test.Printf(_L("TestMainL left with %d\n"), err);
       
    61 
       
    62 	FailIfError(err);
       
    63 	
       
    64 	test.End();
       
    65 	
       
    66 	delete trapHandler;
       
    67 	return(KErrNone);
       
    68     }