systemhealthmanagement/systemhealthmgr/test/tsysmon/src/tsysmon_step_run_count_check.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".
    35 	{
    35 	{
    36 	TPtrC filename;
    36 	TPtrC filename;
    37 	TInt expectedRunCount = 0;
    37 	TInt expectedRunCount = 0;
    38 	TInt expectedRegisterCount = 0;
    38 	TInt expectedRegisterCount = 0;
    39 	TInt expectedRestartCount = 0;
    39 	TInt expectedRestartCount = 0;
    40 	TInt processArguments = 0;
       
    41 	if (!GetStringFromConfig(ConfigSection(), KTSysMonServerFilename, filename) ||
    40 	if (!GetStringFromConfig(ConfigSection(), KTSysMonServerFilename, filename) ||
    42 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRunCount, expectedRunCount) ||
    41 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRunCount, expectedRunCount) ||
    43 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRegisterCount, expectedRegisterCount) ||
    42 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRegisterCount, expectedRegisterCount) ||
    44 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRestartCount, expectedRestartCount) ||
    43 		!GetIntFromConfig(ConfigSection(), KTSysMonServerExpectedRestartCount, expectedRestartCount))
    45 		!GetIntFromConfig(ConfigSection(), KTSysMonServerProcessArguments, processArguments))
       
    46 		{
    44 		{
    47 		ERR_PRINTF1(_L("Error reading ini file data"));
    45 		ERR_PRINTF1(_L("Error reading ini file data"));
    48 		User::Leave(KErrNotFound);
    46 		User::Leave(KErrNotFound);
    49 		}
    47 		}
    50 
    48 
    51 
    49 
    52 	TInt actualRunCount = 0;
    50 	TInt actualRunCount = 0;
    53 	TInt actualRegisterCount = 0;
    51 	TInt actualRegisterCount = 0;
    54 	TInt actualRestartCount = 0;
    52 	TInt actualRestartCount = 0;
    55 	actualRunCount = CSysMonTestHelper::ReadRunCountL(filename);
    53 	actualRunCount = CSysMonTestHelper::ReadRunCountL(filename);
    56 	actualRegisterCount = CSysMonTestHelper::GetRegisterCount(processArguments);
    54 	actualRegisterCount = CSysMonTestHelper::GetRegisterCountL();
    57 	actualRestartCount = CSysMonTestHelper::GetRestartCountL();
    55 	actualRestartCount = CSysMonTestHelper::GetRestartCountL();
    58 
    56 
    59 	INFO_PRINTF2(_L("Actual run count: %d"), actualRunCount);
    57 	INFO_PRINTF2(_L("Actual run count: %d"), actualRunCount);
    60 	TEST(actualRunCount == expectedRunCount);
    58 	TEST(actualRunCount == expectedRunCount);
    61 	INFO_PRINTF2(_L("Actual register count: %d"), actualRegisterCount);
    59 	INFO_PRINTF2(_L("Actual register count: %d"), actualRegisterCount);