kerneltest/e32test/misc/t_add2p.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-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\misc\t_add2p.cpp
       
    15 // Overview:
       
    16 // Test RProcess creation, notification.
       
    17 // API Information:
       
    18 // RProcess.	
       
    19 // Details:
       
    20 // - Start a new process with specified name, set specified priority to it, 
       
    21 // request notification when this process dies, make the main thread 
       
    22 // in the process eligible for execution, kill the process and check 
       
    23 // notification is as expected.
       
    24 // Platforms/Drives/Compatibility:
       
    25 // All.
       
    26 // Assumptions/Requirement/Pre-requisites:
       
    27 // Failures and causes:
       
    28 // Base Port information:
       
    29 // 
       
    30 //
       
    31 
       
    32 #include <e32test.h>
       
    33 
       
    34 RTest test(_L("T_ADD2P"));
       
    35 
       
    36 _LIT(KLitExe2Name, "T_ADD2P2");
       
    37 
       
    38 GLDEF_C TInt E32Main()
       
    39 	{
       
    40 
       
    41 
       
    42 	if (User::CommandLineLength())
       
    43 		return 0;
       
    44 	test.Title();
       
    45 	RProcess p;
       
    46 	TInt r=p.Create(KLitExe2Name, KLitExe2Name);
       
    47 	test.Printf(_L("Returns %d\n"),r);
       
    48 	test(r==KErrNone);
       
    49 	p.SetPriority(EPriorityBackground);
       
    50 	TRequestStatus s;
       
    51 	p.Logon(s);
       
    52 	p.Resume();
       
    53 	User::AfterHighRes(2000);
       
    54 	p.Kill(1);
       
    55 	p.Close();
       
    56 	User::WaitForRequest(s);
       
    57 	test.Printf(_L("Exit code %d\n"),s.Int());
       
    58 	return 0;
       
    59 	}