1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2010 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". |
17 #include <f32file.h> |
17 #include <f32file.h> |
18 #include "logservsecurity.h" |
18 #include "logservsecurity.h" |
19 #include "LogServResourceInterpreter.h" |
19 #include "LogServResourceInterpreter.h" |
20 #include <logeng.h> |
20 #include <logeng.h> |
21 #include <logengevents.h> |
21 #include <logengevents.h> |
22 #include "SecurityPolicy.h" |
22 #include "t_logsecuritypolicy.h" |
23 |
23 #include "t_logutil.h" |
24 static RTest TheTest(_L("T_LogSecurity")); |
24 |
|
25 RTest TheTest(_L("t_logsecurity")); |
25 static RFs TheFileSess; |
26 static RFs TheFileSess; |
26 |
27 |
27 /////////////////////////////////////////////////////////////////////////////////////// |
|
28 /////////////////////////////////////////////////////////////////////////////////////// |
|
29 //Test macross and functions |
|
30 |
|
31 static void Check(TInt aValue, TInt aLine) |
|
32 { |
|
33 if(!aValue) |
|
34 { |
|
35 TheTest(EFalse, aLine); |
|
36 } |
|
37 } |
|
38 static void Check(TInt aValue, TInt aExpected, TInt aLine) |
|
39 { |
|
40 if(aValue != aExpected) |
|
41 { |
|
42 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
|
43 TheTest(EFalse, aLine); |
|
44 } |
|
45 } |
|
46 #define TEST(arg) ::Check((arg), __LINE__) |
|
47 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) |
|
48 |
|
49 /////////////////////////////////////////////////////////////////////////////////////// |
28 /////////////////////////////////////////////////////////////////////////////////////// |
50 // |
29 // |
51 |
30 |
52 //Check if supplied aPolicy parameter has aCapability capability. |
31 //Check if supplied aPolicy parameter has aCapability capability. |
53 static TBool HasCapability(const TCompiledSecurityPolicy& aPolicy, TCapability aCapability) |
32 static TBool HasCapability(const TCompiledSecurityPolicy& aPolicy, TCapability aCapability) |