kerneltest/e32test/emul/t_jit.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\emul\t_jit.cpp
       
    15 // Overview:
       
    16 // Test that User::JustInTime() initially corresponds to the JustInTime setting
       
    17 // in epoc.ini.
       
    18 // This is a manual test, and must be run by hand with an argument of 0 or 1 to
       
    19 // specify the expected result, eg:
       
    20 // t_jit -- 1
       
    21 // t_jit -DJustInTime=none -- 0
       
    22 // API Information:
       
    23 // Emulator
       
    24 // Details:
       
    25 // Test User::JustInTime corresponds to command line argument.
       
    26 // Platforms/Drives/Compatibility:
       
    27 // Emulator.
       
    28 // Assumptions/Requirement/Pre-requisites:
       
    29 // Failures and causes:
       
    30 // Base Port information:
       
    31 // 
       
    32 //
       
    33 
       
    34 #include <e32test.h>
       
    35 
       
    36 RTest test(_L("t_jit"));
       
    37 
       
    38 GLDEF_C TInt E32Main()
       
    39 	{
       
    40 	test.Title();
       
    41 	test.Start(_L("Just in time"));
       
    42 
       
    43 	test(User::CommandLineLength() == 1);
       
    44 	TBuf<1> cmd;
       
    45 	User::CommandLine(cmd);
       
    46 	TLex lex(cmd);
       
    47 	TInt val;
       
    48 	test(lex.Val(val) == KErrNone);
       
    49 	test (val == 0 || val == 1);
       
    50 	TBool expected = val == 1;
       
    51 	
       
    52 	test(User::JustInTime() == expected);
       
    53 	
       
    54 	test.End();
       
    55 	test.Close();
       
    56 	return KErrNone;
       
    57 	}