os/kernelhwsrv/kerneltest/e32test/emul/t_jit.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/emul/t_jit.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,57 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\emul\t_jit.cpp
    1.18 +// Overview:
    1.19 +// Test that User::JustInTime() initially corresponds to the JustInTime setting
    1.20 +// in epoc.ini.
    1.21 +// This is a manual test, and must be run by hand with an argument of 0 or 1 to
    1.22 +// specify the expected result, eg:
    1.23 +// t_jit -- 1
    1.24 +// t_jit -DJustInTime=none -- 0
    1.25 +// API Information:
    1.26 +// Emulator
    1.27 +// Details:
    1.28 +// Test User::JustInTime corresponds to command line argument.
    1.29 +// Platforms/Drives/Compatibility:
    1.30 +// Emulator.
    1.31 +// Assumptions/Requirement/Pre-requisites:
    1.32 +// Failures and causes:
    1.33 +// Base Port information:
    1.34 +// 
    1.35 +//
    1.36 +
    1.37 +#include <e32test.h>
    1.38 +
    1.39 +RTest test(_L("t_jit"));
    1.40 +
    1.41 +GLDEF_C TInt E32Main()
    1.42 +	{
    1.43 +	test.Title();
    1.44 +	test.Start(_L("Just in time"));
    1.45 +
    1.46 +	test(User::CommandLineLength() == 1);
    1.47 +	TBuf<1> cmd;
    1.48 +	User::CommandLine(cmd);
    1.49 +	TLex lex(cmd);
    1.50 +	TInt val;
    1.51 +	test(lex.Val(val) == KErrNone);
    1.52 +	test (val == 0 || val == 1);
    1.53 +	TBool expected = val == 1;
    1.54 +	
    1.55 +	test(User::JustInTime() == expected);
    1.56 +	
    1.57 +	test.End();
    1.58 +	test.Close();
    1.59 +	return KErrNone;
    1.60 +	}