|
1 // Copyright (c) 2007-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 "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 // This process will rendezvous then keep running until terminated by an external intervention. |
|
15 // Count is kept of the number of times the process has been run (based on the name of the executable the process is launched from. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @test |
|
22 @internalComponent - Internal Symbian test code |
|
23 */ |
|
24 |
|
25 #include "sysmontesthelper.h" |
|
26 |
|
27 void MainL() |
|
28 { |
|
29 RProcess::Rendezvous(KErrNone); |
|
30 |
|
31 CCommandLineArguments* args = CCommandLineArguments::NewLC(); |
|
32 CSysMonTestHelper::IncrementRunCountL(args->Arg(0)); |
|
33 CleanupStack::PopAndDestroy(args); |
|
34 |
|
35 while (ETrue) |
|
36 { |
|
37 User::After(5000000); // 5 seconds |
|
38 } |
|
39 |
|
40 } |
|
41 |
|
42 |
|
43 |
|
44 // Global Functions |
|
45 |
|
46 TInt E32Main() |
|
47 { |
|
48 // Create cleanup stack |
|
49 RDebug::Print(_L("slaveprocess: E32Main")); |
|
50 __UHEAP_MARK; |
|
51 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
52 |
|
53 // Run application code inside TRAP harness |
|
54 TRAPD(testError, MainL()); |
|
55 if (testError) |
|
56 { |
|
57 User::Panic(_L("Test failure"), testError); |
|
58 } |
|
59 |
|
60 delete cleanup; |
|
61 __UHEAP_MARKEND; |
|
62 RDebug::Print(_L("slaveprocess: E32Main end")); |
|
63 return KErrNone; |
|
64 } //lint -e714 Suppress 'not referenced' |