systemhealthmanagement/systemhealthmgr/test/tsysmon/src/tsysmon_app_failcount2failwait_slave.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
equal deleted inserted replaced
21:ccb4f6b3db21 22:8cb079868133
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    39 	
    39 	
    40     switch (runCount)
    40     switch (runCount)
    41         {
    41         {
    42 		case 1:
    42 		case 1:
    43 			{
    43 			{
       
    44 			RProcess::Rendezvous(KErrNone);
    44 			User::After(KWaitTime);
    45 			User::After(KWaitTime);
    45 			time1.HomeTime();
    46 			time1.HomeTime();
    46 			datetime1 = time1.DateTime();
    47 			datetime1 = time1.DateTime();
    47 			millisecs = (datetime1.MicroSecond() / 1000) + 
    48 			millisecs = (datetime1.MicroSecond() / 1000) + 
    48 						(datetime1.Second() * 1000) + 
    49 						(datetime1.Second() * 1000) + 
    49 						(datetime1.Minute() * 60 * 1000) +
    50 						(datetime1.Minute() * 60 * 1000) +
    50 						(datetime1.Hour() * 60 * 60 * 1000);
    51 						(datetime1.Hour() * 60 * 60 * 1000);
    51 	
    52 	
    52 			helper = CSysMonTestHelper::NewLC();
    53 			helper = CSysMonTestHelper::NewLC();
    53 			helper->WriteResultL(millisecs);
    54 			helper->WriteResultL(millisecs);
    54 			RProcess::Rendezvous(KErrNone);
       
    55 			CleanupStack::PopAndDestroy(helper);
    55 			CleanupStack::PopAndDestroy(helper);
    56 			break;
    56 			break;
    57 			}
    57 			}
    58 		case 2:
    58 		case 2:
    59 			{
    59 			{
       
    60 			RProcess::Rendezvous(KErrNone);
    60 			time1.HomeTime();
    61 			time1.HomeTime();
    61 			datetime1 = time1.DateTime();
    62 			datetime1 = time1.DateTime();
    62 			millisecs = (datetime1.MicroSecond() / 1000) + 
    63 			millisecs = (datetime1.MicroSecond() / 1000) + 
    63 						(datetime1.Second() * 1000) + 
    64 						(datetime1.Second() * 1000) + 
    64 						(datetime1.Minute() * 60 * 1000) +
    65 						(datetime1.Minute() * 60 * 1000) +
    65 						(datetime1.Hour() * 60 * 60 * 1000);
    66 						(datetime1.Hour() * 60 * 60 * 1000);
    66 											
    67 											
    67 			TInt secondRunTime;
    68 			TInt secondRunTime;
    68 			CSysMonTestHelper::GetResultIntL(_L("38"), secondRunTime);
    69 			CSysMonTestHelper::GetResultIntL(_L("APPFWK-SYSMON-0038"), secondRunTime);
    69 			CSysMonTestHelper* helper = CSysMonTestHelper::NewLC();
    70 			CSysMonTestHelper* helper = CSysMonTestHelper::NewLC();
    70 			
    71 			
    71 			if ( (secondRunTime - millisecs)  < 2000 )
    72 			if ( (secondRunTime - millisecs)  < 2000 )
    72 				{
    73 				{
    73 				helper->WriteResultL(1);
    74 				helper->WriteResultL(1);
    74 				}
    75 				}
    75 			else
    76 			else
    76 				{
    77 				{
    77 				helper->WriteResultL(0);
    78 				helper->WriteResultL(0);
    78 				}
    79 				}
    79 			RProcess::Rendezvous(KErrNone);
       
    80 			CleanupStack::PopAndDestroy(helper);
    80 			CleanupStack::PopAndDestroy(helper);
    81 			keepRunning = ETrue;
    81 			keepRunning = ETrue;
    82 			break;
    82 			break;
    83 			}
    83 			}
    84         default: //Run normally
    84         default: //Run normally