Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // DBMS security policy - testing new APIs - utility functions
18 #ifndef T_DBPLATSECUTL_H
19 #define T_DBPLATSECUTL_H
22 #include "t_dbsecuritypolicy.h"
24 //Forward declarations
27 //Table column definition structure.
35 typedef void (*TCleanupFunc)();
37 //Test utility class. Define TheDbscUtils instance somewhere in your test code.
41 TDBSCUtils(RTest& aTest, TCleanupFunc aFunc);
43 static CDbColSet* CreateColSetLC(const TColDef* aColDef);
44 static CDbKey* CreateKeyLC(const TDesC& aColName);
45 static void CreateTableL(RDbNamedDatabase& aDb, const TDesC& aTblName, const TColDef* aColDef);
47 static RDbNamedDatabase CreateDatabase(RDbs& aDbs, TUid aPolicyUid, const TDesC& aDbName);
48 static TInt DeleteDatabase(RDbs& aDbs, TUid aPolicyUid, const TDesC& aDbName);
50 static TBool IsDatabaseThereL(RDbs& aDbs, TUid aPolicyUid, TDriveNumber aDriveNumber, const TDesC& aDatabaseName);
51 static TBool HasCapability(const TCompiledSecurityPolicy& aPolicy, TCapability aCapability);
53 static void Check(TInt aValue, TInt aLine);
54 static void Check(TInt aValue, TInt aExpected, TInt aLine);
61 #define TEST(arg) TDBSCUtils::Check((arg), __LINE__)
62 #define TEST2(aValue, aExpected) TDBSCUtils::Check(aValue, aExpected, __LINE__)
64 extern TDBSCUtils TheDbscUtils;
66 #endif//T_DBPLATSECUTL_H