First public contribution.
2 * Copyright (c) 2005-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 * Implements default base classes for captestframework
26 #ifndef CAPTESTUTILITY_H__
27 #define CAPTESTUTILITY_H__
31 #include "captestframework.h"
33 // CDefaultCapabilityTest
34 class CDefaultCapabilityTest : public CBase, public MCapabilityTest
37 IMPORT_C const TDesC& Name() const;
38 IMPORT_C const TDesC& SubName() const;
40 IMPORT_C TCapabilitySet CapabilitiesRequired() const;
41 IMPORT_C TUid VidRequired() const;
42 IMPORT_C TUid SidRequired() const;
44 IMPORT_C ~CDefaultCapabilityTest();
47 IMPORT_C void SetNameL(const TDesC& aName);
48 void SetExpectPermissionDenied(TBool aExpectPermissionDenied = ETrue);
50 IMPORT_C void SetCapabilityRequired(const TCapability& aCapability);
51 IMPORT_C void SetSidRequired(const TUid& aSid);
52 IMPORT_C void SetVidRequired(const TUid& aVid);
54 IMPORT_C TInt CheckFailL(TInt aResult, const TDesC& aTestName);
55 IMPORT_C void RunTestL(RFile& aLogFile);
57 void SetFail() { iFail = ETrue;}
58 virtual void RunTestL() =0;
64 RFileWriteStream* iLogWriteStream;
65 TBool iExpectPermissionDenied;
66 TCapabilitySet iCapabilitySet;
72 // CDefaultCapabilityTestFactory
73 class CDefaultCapabilityTestFactory : public CBase, public MCapabilityTestFactory
77 IMPORT_C virtual TInt NumberOfTests();
78 IMPORT_C virtual MCapabilityTest* Test(TInt aTestNumber);
80 IMPORT_C void AddTestL(CDefaultCapabilityTest* aTest);
82 IMPORT_C ~CDefaultCapabilityTestFactory();
85 RPointerArray<CDefaultCapabilityTest> iTests;
88 // inline functions from CSwiCapabilityTest
90 inline void CDefaultCapabilityTest::SetExpectPermissionDenied(TBool aExpectPermissionDenied)
92 iExpectPermissionDenied = aExpectPermissionDenied;
95 #endif //#ifndef CAPTESTUTILITY_H__