sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\misc\t_add2p.cpp sl@0: // Overview: sl@0: // Test RProcess creation, notification. sl@0: // API Information: sl@0: // RProcess. sl@0: // Details: sl@0: // - Start a new process with specified name, set specified priority to it, sl@0: // request notification when this process dies, make the main thread sl@0: // in the process eligible for execution, kill the process and check sl@0: // notification is as expected. sl@0: // Platforms/Drives/Compatibility: sl@0: // All. sl@0: // Assumptions/Requirement/Pre-requisites: sl@0: // Failures and causes: sl@0: // Base Port information: sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: RTest test(_L("T_ADD2P")); sl@0: sl@0: _LIT(KLitExe2Name, "T_ADD2P2"); sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: sl@0: sl@0: if (User::CommandLineLength()) sl@0: return 0; sl@0: test.Title(); sl@0: RProcess p; sl@0: TInt r=p.Create(KLitExe2Name, KLitExe2Name); sl@0: test.Printf(_L("Returns %d\n"),r); sl@0: test(r==KErrNone); sl@0: p.SetPriority(EPriorityBackground); sl@0: TRequestStatus s; sl@0: p.Logon(s); sl@0: p.Resume(); sl@0: User::AfterHighRes(2000); sl@0: p.Kill(1); sl@0: p.Close(); sl@0: User::WaitForRequest(s); sl@0: test.Printf(_L("Exit code %d\n"),s.Int()); sl@0: return 0; sl@0: }