cryptoservices/filebasedcertificateandkeystores/test/ttesttools/ttesttoolstep.cpp
changeset 8 35751d3474b7
parent 0 2c201484c85f
child 29 ece3df019add
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
    13 *
    13 *
    14 * Description: 
    14 * Description: 
    15 * test tool step implementation
    15 * test tool step implementation
    16 *
    16 *
    17 */
    17 */
    18 
       
    19 
       
    20 
    18 
    21 
    19 
    22 /**
    20 /**
    23  @file
    21  @file
    24 */
    22 */
   175 	
   173 	
   176 	CleanupStack::PopAndDestroy(2, sched);
   174 	CleanupStack::PopAndDestroy(2, sched);
   177 
   175 
   178 	if (iVerdict == EFail)
   176 	if (iVerdict == EFail)
   179 		{
   177 		{
   180 		INFO_PRINTF1(_L("Exptected Certificate is not Exist"));
   178 		INFO_PRINTF1(_L("Expected Certificate does not Exist"));
   181 		}
   179 		}
   182 	SetTestStepResult(iVerdict);
   180 	SetTestStepResult(iVerdict);
   183 
   181 
   184 	return TestStepResult();
   182 	return TestStepResult();
   185 	}
   183 	}
   417 	
   415 	
   418 	CleanupStack::PopAndDestroy(2, sched);
   416 	CleanupStack::PopAndDestroy(2, sched);
   419 
   417 
   420 	if (iVerdict == EFail)
   418 	if (iVerdict == EFail)
   421 		{
   419 		{
   422 		INFO_PRINTF1(_L("Exptected Keys are not Exist"));
   420 		INFO_PRINTF1(_L("Expected Keys do not Exist"));
   423 		}
   421 		}
   424 	SetTestStepResult(iVerdict);
   422 	SetTestStepResult(iVerdict);
   425 	
   423 	
   426 	return TestStepResult();
   424 	return TestStepResult();
   427 	}
   425 	}
   925 	{
   923 	{
   926 	CActiveScheduler::Install(NULL);
   924 	CActiveScheduler::Install(NULL);
   927 	return TestStepResult();
   925 	return TestStepResult();
   928 	}
   926 	}
   929 
   927 
   930 ;
   928 CTestToolCheckFileStep::CTestToolCheckFileStep()
   931 
   929 	{}
       
   930 
       
   931 CTestToolCheckFileStep::~CTestToolCheckFileStep()
       
   932 	{}
       
   933 
       
   934 TVerdict CTestToolCheckFileStep::doTestStepPreambleL()
       
   935 	{
       
   936 	if (!GetStringFromConfig(ConfigSection(), KFileName,iFileName))
       
   937 		{
       
   938 		INFO_PRINTF1(_L("file name is missing"));
       
   939 		SetTestStepResult(EFail);
       
   940 		}
       
   941 	if (!GetStringFromConfig(ConfigSection(), KCheckType,iCheckType))
       
   942 		{
       
   943 		INFO_PRINTF1(_L("chek type for file is missing"));
       
   944 		SetTestStepResult(EFail);
       
   945 		}
       
   946 	return TestStepResult();
       
   947 	}
       
   948 
       
   949 TVerdict CTestToolCheckFileStep::doTestStepPostambleL()
       
   950 	{
       
   951 	return TestStepResult();
       
   952 	}
       
   953 
       
   954 TVerdict CTestToolCheckFileStep::doTestStepL()
       
   955 	{
       
   956 	if (TestStepResult() != EPass)
       
   957 		{
       
   958 		return TestStepResult();
       
   959 		}
       
   960 	
       
   961 	RFs fs;
       
   962 	User::LeaveIfError(fs.Connect());
       
   963 	CleanupClosePushL(fs);
       
   964 	RFile file;
       
   965 	CleanupClosePushL(file);
       
   966 	
       
   967 	TInt error = file.Open(fs,iFileName,EFileRead);
       
   968 	if( ( iCheckType.Compare(_L("present")) == 0 && error == KErrNone ) || 	
       
   969 		( iCheckType.Compare(_L("absent")) == 0 && error == KErrNotFound )
       
   970 		)
       
   971 		{
       
   972 		SetTestStepResult(EPass);
       
   973 		}
       
   974 	else
       
   975 		{
       
   976 		SetTestStepResult(EFail);
       
   977 		}
       
   978 	
       
   979 	CleanupStack::PopAndDestroy(2,&fs); // file
       
   980 	return TestStepResult();
       
   981 	}
   932 // End of file
   982 // End of file