os/security/cryptoservices/filebasedcertificateandkeystores/test/ttesttools/ttesttoolstep.cpp
First public contribution.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * test tool step implementation
26 #include "ttesttoolstep.h"
28 _LIT8(KLabel,"label");
30 const TChar KCarriageReturn = '\r';
31 const TChar KLineReturn = '\n';
32 const TChar KDelemeter = ':';
34 HBufC8* ParseOutputFileLC(const TPtrC& aFileName);
35 TInt ReadWordL(const TDesC8& aBuffer, TInt& aPos, TPtrC8& aLine);
36 void ConstuctExpectedArrayL(RPointerArray<HBufC>& aArray, const TDesC8& aBuffer,TBool aCheck, TBool aException = EFalse);
37 void ResetAndDestroyHBufCList(TAny* aList);
40 // CTestToolListCertStep
43 CTestToolListCertStep::~CTestToolListCertStep()
49 CTestToolListCertStep::CTestToolListCertStep()
51 // Call base class method to set up the human readable name for logging
52 SetTestStepName(KTestToolListCertStep);
56 * Override of base class virtual. Prepares for the test run of Filetokens
57 * @return TVerdict code
59 TVerdict CTestToolListCertStep::doTestStepPreambleL()
61 _LIT(KActualOutput, "actualoutput");
62 GetStringFromConfig(ConfigSection(), KActualOutput, iActualOutput);
64 // construct name of the cert
65 if (GetStringFromConfig(ConfigSection(), KExpectedOwner, iExpectedOwner))
69 if (!GetIntFromConfig(ConfigSection(), KExpectedListStore, iListStoreExist))
73 if(!GetIntFromConfig(ConfigSection(), KStore, iExpectedStore))
77 if(!GetIntFromConfig(ConfigSection(), KExpectedNumLabel, iExpectedNumLabel))
79 iExpectedNumLabel = 1;
81 if (GetStringFromConfig(ConfigSection(), KExpectedLabel1, iExpectedLabel1))
85 if (GetStringFromConfig(ConfigSection(), KExpectedLabel2, iExpectedLabel2))
89 return TestStepResult();
93 * Override of base class pure virtual
94 * Demonstrates reading configuration parameters from an ini file section
95 * @return TVerdict code
97 TVerdict CTestToolListCertStep::doTestStepL()
99 if (TestStepResult() != EPass)
101 return TestStepResult();
104 CActiveScheduler* sched = NULL;
105 sched = new (ELeave) CActiveScheduler;
106 CleanupStack::PushL(sched);
107 CActiveScheduler::Install(sched);
108 CTestToolEngine* activeEngine = CTestToolEngine::NewLC();
110 if (iLabel1Exist && !iLabel2Exist)
112 iVerdict = activeEngine->ListCerts(iExpectedLabel1, iExpectedNumLabel);
114 else if (iLabel2Exist && iLabel1Exist)
116 iVerdict = activeEngine->ListCerts(iExpectedLabel1, iExpectedLabel2, iExpectedNumLabel);
120 RPointerArray<HBufC> CertList;
121 CleanupStack::PushL(TCleanupItem(ResetAndDestroyHBufCList, &CertList));
122 HBufC8* fileContents = ParseOutputFileLC(iActualOutput);
125 _LIT8(KLabel1, "label:");
126 TLex8 lex(*fileContents);
129 TPtrC8 token = lex.NextToken();
130 if(token.CompareF(KLabel1) == KErrNone)
132 TInt offset = lex.Offset();
134 while(c != KCarriageReturn && c != KLineReturn)
138 TInt end = lex.Offset();
140 TInt tokenLen = end-offset-1;
141 newtoken.Set(&fileContents->Des()[offset], tokenLen);
143 HBufC* tmp = HBufC::NewLC(tokenLen);
144 tmp->Des().Copy(newtoken);
146 CertList.Append(tmp);
147 CleanupStack::Pop(tmp);
150 CleanupStack::PopAndDestroy(fileContents);
151 iVerdict = activeEngine->ListStore(CertList);
155 ConstuctExpectedArrayL(CertList, fileContents->Des(), ETrue);
156 CleanupStack::PopAndDestroy(fileContents);
159 iVerdict = activeEngine->ListCerts(CertList, iExpectedOwner);
161 else if (iExpectedStore != -1)
163 iVerdict = activeEngine->ListCerts(CertList, iExpectedStore);
167 iVerdict = activeEngine->ListCerts(CertList);
170 CleanupStack::PopAndDestroy(&CertList);
174 CleanupStack::PopAndDestroy(2, sched);
176 if (iVerdict == EFail)
178 INFO_PRINTF1(_L("Expected Certificate does not Exist"));
180 SetTestStepResult(iVerdict);
182 return TestStepResult();
186 * Override of base class virtual
187 * @return TVerdict code
189 TVerdict CTestToolListCertStep::doTestStepPostambleL()
191 CActiveScheduler::Install(NULL);
192 return TestStepResult();
197 // CTestToolGetTrustAppsStep
200 CTestToolGetTrustAppsStep::~CTestToolGetTrustAppsStep()
202 iApps.ResetAndDestroy();
206 CTestToolGetTrustAppsStep::CTestToolGetTrustAppsStep()
208 // Call base class method to set up the human readable name for logging
209 SetTestStepName(KTestToolGetTrustAppsStep);
213 * Override of base class virtual. Prepares for the test run of Filetokens
214 * @return TVerdict code
216 TVerdict CTestToolGetTrustAppsStep::doTestStepPreambleL()
218 _LIT(KNumApps, "numapps"); // this specifies how many commands to read
219 _LIT(KAppsBase, "apps"); // + number (0-based) = file to check for
221 if (!GetStringFromConfig(ConfigSection(), KExpectedLabel1, iExpectedLabel))
223 INFO_PRINTF1(_L("label name is missing"));
224 SetTestStepResult(EFail);
227 if (GetIntFromConfig(ConfigSection(), KNumApps, numApps) && numApps!=0)
230 for (TInt i=0; i<numApps; i++)
232 // construct name of the key
233 const TInt KKeyBufSize=64;
234 TBuf<KKeyBufSize> keyBuf(KAppsBase);
237 if (GetStringFromConfig(ConfigSection(), keyBuf, appName))
239 HBufC* apps = appName.AllocLC();
241 CleanupStack::Pop(apps);
245 SetTestStepResult(EFail);
246 // the string must exist, otherwise the config is invalid
247 ERR_PRINTF2(_L("Missing apps name for key '%S'"), &keyBuf);
251 return TestStepResult();
255 * Override of base class pure virtual
256 * Demonstrates reading configuration parameters from an ini file section
257 * @return TVerdict code
259 TVerdict CTestToolGetTrustAppsStep::doTestStepL()
261 if (TestStepResult() != EPass)
263 return TestStepResult();
266 CActiveScheduler* sched = NULL;
267 sched = new (ELeave) CActiveScheduler;
268 CleanupStack::PushL(sched);
269 CActiveScheduler::Install(sched);
270 CTestToolEngine* activeEngine = CTestToolEngine::NewLC();
271 iVerdict = activeEngine->CheckApps(iApps, iExpectedLabel);
273 CleanupStack::PopAndDestroy(2, sched);
274 if (iVerdict == EFail)
276 INFO_PRINTF1(_L("Certificate is not trusted for the applicaion"));
278 SetTestStepResult(iVerdict);
280 return TestStepResult();
284 * Override of base class virtual
285 * @return TVerdict code
287 TVerdict CTestToolGetTrustAppsStep::doTestStepPostambleL()
289 CActiveScheduler::Install(NULL);
290 return TestStepResult();
294 // CTestToolListKeyStep
297 CTestToolListKeyStep::~CTestToolListKeyStep()
302 CTestToolListKeyStep::CTestToolListKeyStep()
304 // Call base class method to set up the human readable name for logging
305 SetTestStepName(KTestToolListKeyStep);
309 * Override of base class virtual. Prepares for the test run of Filetokens
310 * @return TVerdict code
312 TVerdict CTestToolListKeyStep::doTestStepPreambleL()
314 // construct name of the key
316 GetStringFromConfig(ConfigSection(), KActualOutput, iActualOutput);
317 if (!GetIntFromConfig(ConfigSection(), KExpectedListStore, iListStoreExist))
321 if(!GetIntFromConfig(ConfigSection(), KStore, iExpectedStore))
325 if(!GetIntFromConfig(ConfigSection(), KExpectedNumLabel, iExpectedNumLabel))
327 iExpectedNumLabel = 1;
329 if (GetStringFromConfig(ConfigSection(), KExpectedLabel1, iExpectedLabel1))
333 if (GetStringFromConfig(ConfigSection(), KExpectedLabel2, iExpectedLabel2))
337 return TestStepResult();
341 * Override of base class pure virtual
342 * Demonstrates reading configuration parameters from an ini file section
343 * @return TVerdict code
345 TVerdict CTestToolListKeyStep::doTestStepL()
347 if (TestStepResult() != EPass)
349 return TestStepResult();
352 CActiveScheduler* sched = NULL;
353 sched = new (ELeave) CActiveScheduler;
354 CleanupStack::PushL(sched);
355 CActiveScheduler::Install(sched);
356 CTestToolEngine* activeEngine = CTestToolEngine::NewLC();
357 if (iLabel1Exist && !iLabel2Exist)
359 iVerdict = activeEngine->ListKeys(iExpectedLabel1, iExpectedNumLabel);
361 else if (iLabel2Exist && iLabel1Exist)
363 iVerdict = activeEngine->ListKeys(iExpectedLabel1, iExpectedLabel2, iExpectedNumLabel);
367 RPointerArray<HBufC> KeyList;
368 CleanupStack::PushL(TCleanupItem(ResetAndDestroyHBufCList, &KeyList));
369 HBufC8* fileContents = ParseOutputFileLC(iActualOutput);
372 _LIT8(KLabel1, "label:");
373 TLex8 lex(*fileContents);
376 TPtrC8 token = lex.NextToken();
377 if(token.CompareF(KLabel1) == KErrNone)
379 TInt offset = lex.Offset();
381 while(c != KCarriageReturn && c != KLineReturn)
385 TInt end = lex.Offset();
387 TInt tokenLen = end-offset-1;
388 newtoken.Set(&fileContents->Des()[offset], tokenLen);
390 HBufC* tmp = HBufC::NewLC(tokenLen);
391 tmp->Des().Copy(newtoken);
394 CleanupStack::Pop(tmp);
397 CleanupStack::PopAndDestroy(fileContents);
398 iVerdict = activeEngine->ListStoreKey(KeyList);
402 ConstuctExpectedArrayL(KeyList, fileContents->Des(), EFalse);
403 CleanupStack::PopAndDestroy(fileContents);
404 if (iExpectedStore != -1)
406 iVerdict = activeEngine->ListKeys(KeyList, iExpectedStore);
410 iVerdict = activeEngine->ListKeys(KeyList);
413 CleanupStack::PopAndDestroy(&KeyList);
416 CleanupStack::PopAndDestroy(2, sched);
418 if (iVerdict == EFail)
420 INFO_PRINTF1(_L("Expected Keys do not Exist"));
422 SetTestStepResult(iVerdict);
424 return TestStepResult();
428 * Override of base class virtual
429 * @return TVerdict code
431 TVerdict CTestToolListKeyStep::doTestStepPostambleL()
433 CActiveScheduler::Install(NULL);
434 return TestStepResult();
439 // CTestToolGetPolicyStep
442 CTestToolGetPolicyStep::~CTestToolGetPolicyStep()
447 CTestToolGetPolicyStep::CTestToolGetPolicyStep()
449 // Call base class method to set up the human readable name for logging
450 SetTestStepName(KTestToolGetPolicyStep);
454 * Override of base class virtual. Prepares for the test run of Filetokens
455 * @return TVerdict code
457 TVerdict CTestToolGetPolicyStep::doTestStepPreambleL()
459 // construct name of the key
460 if (GetStringFromConfig(ConfigSection(), KExpectedLabel1, iExpectedLabel))
464 if (!GetStringFromConfig(ConfigSection(), KExpectedUser, iExpectedUser))
466 INFO_PRINTF1(_L("policy user name is missing"));
467 SetTestStepResult(EFail);
469 if (!GetIntFromConfig(ConfigSection(), KExpectedUserExist, iExpectedUserExist))
471 iExpectedUserExist = 0;
473 return TestStepResult();
477 * Override of base class pure virtual
478 * Demonstrates reading configuration parameters from an ini file section
479 * @return TVerdict code
481 TVerdict CTestToolGetPolicyStep::doTestStepL()
483 if (TestStepResult() != EPass)
485 return TestStepResult();
488 CActiveScheduler* sched = NULL;
489 sched = new (ELeave) CActiveScheduler;
490 CleanupStack::PushL(sched);
491 CActiveScheduler::Install(sched);
492 CTestToolEngine* activeEngine = CTestToolEngine::NewLC();
495 iVerdict = activeEngine->GetPolicy(iExpectedLabel, iExpectedUser, iExpectedUserExist);
498 CleanupStack::PopAndDestroy(2, sched);
499 if (iVerdict == EFail)
501 INFO_PRINTF1(_L("Exptected Keys are not Exist"));
503 SetTestStepResult(iVerdict);
505 return TestStepResult();
509 * Override of base class virtual
510 * @return TVerdict code
512 TVerdict CTestToolGetPolicyStep::doTestStepPostambleL()
514 CActiveScheduler::Install(NULL);
515 return TestStepResult();
521 // CTestToolParseFileStep
524 CTestToolParseFileStep::~CTestToolParseFileStep()
526 iArgs.ResetAndDestroy();
530 CTestToolParseFileStep::CTestToolParseFileStep()
532 // Call base class method to set up the human readable name for logging
533 SetTestStepName(KTestToolParseFileStep);
537 * Override of base class virtual. Prepares for the test run of Filetokens
538 * @return TVerdict code
540 TVerdict CTestToolParseFileStep::doTestStepPreambleL()
542 _LIT(KNumLines, "numlines"); // this specifies how many commands to read
543 _LIT(KLineBase, "line"); // + number (0-based) = file to check for
547 if (GetIntFromConfig(ConfigSection(), KNumLines, numlines) && numlines!=0)
550 for (TInt i=0; i<numlines; i++)
552 // construct name of the key
553 const TInt KKeyBufSize=64;
554 TBuf<KKeyBufSize> keyBuf(KLineBase);
557 if (GetStringFromConfig(ConfigSection(), keyBuf, lineContent))
559 HBufC* line = lineContent.AllocLC();
562 CleanupStack::Pop(line);
566 SetTestStepResult(EFail);
567 // the string must exist, otherwise the config is invalid
568 ERR_PRINTF2(_L("Missing apps name for key '%S'"), &keyBuf);
572 if (!GetStringFromConfig(ConfigSection(), KActualOutput, iActualOutput))
574 INFO_PRINTF1(_L("actual output filename is missing"));
575 SetTestStepResult(EFail);
579 if (!GetStringFromConfig(ConfigSection(), KExpectedError, iExpectedError))
581 INFO_PRINTF1(_L("error value is missing"));
582 SetTestStepResult(EFail);
585 return TestStepResult();
589 * Override of base class pure virtual
590 * Demonstrates reading configuration parameters from an ini file section
591 * @return TVerdict code
593 TVerdict CTestToolParseFileStep::doTestStepL()
595 if (TestStepResult() != EPass)
597 return TestStepResult();
599 if (iArgs.Count() == 0)
601 HBufC8* fileContents = ParseOutputFileLC(iActualOutput);
602 HBufC8* actualError = GetErrorFromOutputFileLC(*fileContents);
603 if (actualError == NULL)
605 INFO_PRINTF1(_L("Failed to parse the output File"));
606 SetTestStepResult(EFail);
609 HBufC* actual16 = HBufC::NewLC(actualError->Length());
610 actual16->Des().Copy(*actualError);
612 if (iExpectedError.CompareF(*actual16) != KErrNone)
614 INFO_PRINTF1(_L("Expected Error is Different from Actual"));
615 SetTestStepResult(EFail);
617 CleanupStack::PopAndDestroy(3, fileContents); //actual16, actualError, fileContents
621 HBufC8* fileContents = ParseOutputFileLC(iActualOutput);
622 RPointerArray<HBufC> actualoutput;
623 CleanupStack::PushL(TCleanupItem(ResetAndDestroyHBufCList, &actualoutput));
624 ConstuctExpectedArrayL(actualoutput, fileContents->Des(), EFalse, ETrue);
625 TBool result = EFalse;
626 for (TInt i = 0; i < iArgs.Count(); i++)
629 for (TInt j = 5; j < actualoutput.Count(); j++)
631 if (iArgs[i]->Des().CompareF(actualoutput[j]->Des()) == KErrNone)
644 INFO_PRINTF1(_L("expected output and actual output is not matching"));
645 SetTestStepResult(EFail);
647 CleanupStack::PopAndDestroy(2, fileContents); // fileContents ,actualoutput
650 return TestStepResult();
654 HBufC8* CTestToolParseFileStep::GetErrorFromOutputFileLC(const TDesC8& aBuffer)
656 _LIT8(KOutput, "output");
660 HBufC8* wordBuf = NULL;
661 while (!ReadWordL(aBuffer, readPos, wordContents))
663 wordBuf = wordContents.AllocLC();
664 wordBuf->Des().Trim();
665 if (wordBuf->Des().CompareF(KOutput) == KErrNone)
668 if (!ReadWordL(aBuffer, readPos, wordContents))
670 CleanupStack::PopAndDestroy(wordBuf);
671 wordBuf = wordContents.AllocLC();
672 wordBuf->Des().Trim();
676 CleanupStack::PopAndDestroy(wordBuf);
682 * Override of base class virtual
683 * @return TVerdict code
685 TVerdict CTestToolParseFileStep::doTestStepPostambleL()
687 CActiveScheduler::Install(NULL);
688 return TestStepResult();
694 // global public methods
697 // Reads the words from the Buffer either ended with : or \n
698 // if the word is "label", then read the next word and add to the array
699 // if the word is not label read upto the end of the line then go to next loop
700 // if exception is on , reads the entire line
701 void ConstuctExpectedArrayL(RPointerArray<HBufC>& aArray, const TDesC8& aBuffer,TBool aCheck, TBool aException)
706 TInt bufferLength = aBuffer.Length();
707 while (!ReadWordL(aBuffer, readPos, wordContents))
709 HBufC8* wordBuf = wordContents.AllocLC();
710 wordBuf->Des().Trim();
713 HBufC* currentLabel = HBufC::NewLC(wordBuf->Length());
714 currentLabel->Des().Copy(*wordBuf);
715 currentLabel->Des().Trim();
716 aArray.AppendL(currentLabel);
717 CleanupStack::Pop(currentLabel);
719 else if (wordBuf->Des().CompareF(KLabel) == KErrNone)
721 if (!ReadWordL(aBuffer, readPos, wordContents))
724 TInt len = wordContents.Length();
725 // aCheck is on for reading the certool output file,because the output will be like this
726 // label: abc format:.... , so we need to exclude format
727 if (aCheck) // certdetails
731 word.Set(wordContents.Ptr(), len);
732 HBufC* currentLabel = HBufC::NewLC(word.Length());
733 currentLabel->Des().Copy(word);
734 currentLabel->Des().Trim();
735 aArray.AppendL(currentLabel);
736 CleanupStack::Pop(currentLabel);
746 while (readPos < bufferLength)
748 TChar c = aBuffer[readPos];
750 if (c == KCarriageReturn || c == KLineReturn)
758 CleanupStack::PopAndDestroy(wordBuf);
762 // Reads the output file and return into the buffer.
763 HBufC8* ParseOutputFileLC(const TPtrC& aFileName)
767 User::LeaveIfError(fs.Connect());
768 CleanupClosePushL(fs);
769 User::LeaveIfError(file.Open(fs, aFileName, EFileRead));
770 CleanupClosePushL(file);
774 HBufC8* fileContents = HBufC8::NewLC(fSize);
775 TPtr8 ptr(fileContents->Des());
776 ptr.SetLength(fSize);
778 // create file stream and Read the content from the file
779 RFileReadStream inputFileStream(file);
780 CleanupClosePushL(inputFileStream);
781 inputFileStream.ReadL(ptr, fSize);
782 CleanupStack::PopAndDestroy(&inputFileStream);
783 CleanupStack::Pop(fileContents);
784 CleanupStack::PopAndDestroy(2, &fs);
785 CleanupStack::PushL(fileContents);
790 // Reads the words from the aBuffer either ended with : or \n or \r
791 TInt ReadWordL(const TDesC8& aBuffer, TInt& aPos, TPtrC8& aLine)
793 TBool endOfBuffer = EFalse;
795 TInt bufferLength = aBuffer.Length();
796 if ( aPos > bufferLength || aPos < 0 )
798 return ETrue; // End of buffer
802 // find the position of the next delimeter
804 while (endPos < bufferLength)
806 TChar c = aBuffer[endPos];
808 if (c == KCarriageReturn || c == KLineReturn || c == KDelemeter)
810 // exception when comes like c:\filename
811 if ((bufferLength > (endPos + 1)) && aBuffer[endPos+1] != '\\')
821 TInt tokenLen = endPos - aPos;
822 aLine.Set(&aBuffer[aPos], tokenLen);
825 else if (endPos == bufferLength)
827 return ETrue; // End of buffer
838 void ResetAndDestroyHBufCList(TAny* aList)
840 RPointerArray<HBufC>* list = static_cast<RPointerArray<HBufC>*>(aList);
842 list->ResetAndDestroy();
855 // CTestToolGetTrustStep
858 CTestToolGetTrustStep::~CTestToolGetTrustStep()
864 CTestToolGetTrustStep::CTestToolGetTrustStep()
866 // Call base class method to set up the human readable name for logging
867 SetTestStepName(KTestToolGetTrustStep);
871 * Override of base class virtual. Prepares for the test run of Filetokens
872 * @return TVerdict code
874 TVerdict CTestToolGetTrustStep::doTestStepPreambleL()
877 if (!GetStringFromConfig(ConfigSection(), KExpectedLabel1, iExpectedLabel))
879 INFO_PRINTF1(_L("label name is missing"));
880 SetTestStepResult(EFail);
882 if (!GetIntFromConfig(ConfigSection(), KExpectedTrust, iExpectedTrust))
884 INFO_PRINTF1(_L("Expected trust is missing"));
885 SetTestStepResult(EFail);
887 return TestStepResult();
891 * Override of base class pure virtual
892 * Demonstrates reading configuration parameters from an ini file section
893 * @return TVerdict code
895 TVerdict CTestToolGetTrustStep::doTestStepL()
897 if (TestStepResult() != EPass)
899 return TestStepResult();
902 CActiveScheduler* sched = NULL;
903 sched = new (ELeave) CActiveScheduler;
904 CleanupStack::PushL(sched);
905 CActiveScheduler::Install(sched);
906 CTestToolEngine* activeEngine = CTestToolEngine::NewLC();
907 iVerdict = activeEngine->CheckTrust(iExpectedLabel,iExpectedTrust);
908 CleanupStack::PopAndDestroy(2, sched);
909 if (iVerdict == EFail)
911 INFO_PRINTF1(_L("Certificate is not trusted for the applicaion"));
913 SetTestStepResult(iVerdict);
915 return TestStepResult();
919 * Override of base class virtual
920 * @return TVerdict code
922 TVerdict CTestToolGetTrustStep::doTestStepPostambleL()
924 CActiveScheduler::Install(NULL);
925 return TestStepResult();
928 CTestToolCheckFileStep::CTestToolCheckFileStep()
931 CTestToolCheckFileStep::~CTestToolCheckFileStep()
934 TVerdict CTestToolCheckFileStep::doTestStepPreambleL()
936 if (!GetStringFromConfig(ConfigSection(), KFileName,iFileName))
938 INFO_PRINTF1(_L("file name is missing"));
939 SetTestStepResult(EFail);
941 if (!GetStringFromConfig(ConfigSection(), KCheckType,iCheckType))
943 INFO_PRINTF1(_L("chek type for file is missing"));
944 SetTestStepResult(EFail);
946 return TestStepResult();
949 TVerdict CTestToolCheckFileStep::doTestStepPostambleL()
951 return TestStepResult();
954 TVerdict CTestToolCheckFileStep::doTestStepL()
956 if (TestStepResult() != EPass)
958 return TestStepResult();
962 User::LeaveIfError(fs.Connect());
963 CleanupClosePushL(fs);
965 CleanupClosePushL(file);
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 )
972 SetTestStepResult(EPass);
976 SetTestStepResult(EFail);
979 CleanupStack::PopAndDestroy(2,&fs); // file
980 return TestStepResult();