os/kernelhwsrv/kerneltest/e32test/misc/t_add2p.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/misc/t_add2p.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,59 @@
     1.4 +// Copyright (c) 1997-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\misc\t_add2p.cpp
    1.18 +// Overview:
    1.19 +// Test RProcess creation, notification.
    1.20 +// API Information:
    1.21 +// RProcess.	
    1.22 +// Details:
    1.23 +// - Start a new process with specified name, set specified priority to it, 
    1.24 +// request notification when this process dies, make the main thread 
    1.25 +// in the process eligible for execution, kill the process and check 
    1.26 +// notification is as expected.
    1.27 +// Platforms/Drives/Compatibility:
    1.28 +// All.
    1.29 +// Assumptions/Requirement/Pre-requisites:
    1.30 +// Failures and causes:
    1.31 +// Base Port information:
    1.32 +// 
    1.33 +//
    1.34 +
    1.35 +#include <e32test.h>
    1.36 +
    1.37 +RTest test(_L("T_ADD2P"));
    1.38 +
    1.39 +_LIT(KLitExe2Name, "T_ADD2P2");
    1.40 +
    1.41 +GLDEF_C TInt E32Main()
    1.42 +	{
    1.43 +
    1.44 +
    1.45 +	if (User::CommandLineLength())
    1.46 +		return 0;
    1.47 +	test.Title();
    1.48 +	RProcess p;
    1.49 +	TInt r=p.Create(KLitExe2Name, KLitExe2Name);
    1.50 +	test.Printf(_L("Returns %d\n"),r);
    1.51 +	test(r==KErrNone);
    1.52 +	p.SetPriority(EPriorityBackground);
    1.53 +	TRequestStatus s;
    1.54 +	p.Logon(s);
    1.55 +	p.Resume();
    1.56 +	User::AfterHighRes(2000);
    1.57 +	p.Kill(1);
    1.58 +	p.Close();
    1.59 +	User::WaitForRequest(s);
    1.60 +	test.Printf(_L("Exit code %d\n"),s.Int());
    1.61 +	return 0;
    1.62 +	}