1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2004-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". |
30 //Test macros and functions |
30 //Test macros and functions |
31 static void Check(TInt aValue, TInt aLine) |
31 static void Check(TInt aValue, TInt aLine) |
32 { |
32 { |
33 if(!aValue) |
33 if(!aValue) |
34 { |
34 { |
|
35 TheTest.Printf(_L("*** Expression evaluated to false\r\n")); |
35 TheTest(EFalse, aLine); |
36 TheTest(EFalse, aLine); |
36 } |
37 } |
37 } |
38 } |
38 static void Check(TInt aValue, TInt aExpected, TInt aLine) |
39 static void Check(TInt aValue, TInt aExpected, TInt aLine) |
39 { |
40 { |
40 if(aValue != aExpected) |
41 if(aValue != aExpected) |
41 { |
42 { |
42 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
43 TheTest.Printf(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
43 TheTest(EFalse, aLine); |
44 TheTest(EFalse, aLine); |
44 } |
45 } |
45 } |
46 } |
46 #define TEST(arg) Check((arg), __LINE__) |
47 #define TEST(arg) Check((arg), __LINE__) |
47 #define TEST2(aValue, aExpected) Check(aValue, aExpected, __LINE__) |
48 #define TEST2(aValue, aExpected) Check(aValue, aExpected, __LINE__) |
154 TEST2(err, KErrNone); |
155 TEST2(err, KErrNone); |
155 TEST(paths != NULL); |
156 TEST(paths != NULL); |
156 for(TInt i=0;i<paths->Count();++i) |
157 for(TInt i=0;i<paths->Count();++i) |
157 { |
158 { |
158 const TDesC& dd = (*paths)[i]; |
159 const TDesC& dd = (*paths)[i]; |
159 RDebug::Print(_L(" Database %d: %S\r\n"), i + 1, &dd); |
160 TheTest.Printf(_L(" Database %d: %S\r\n"), i + 1, &dd); |
160 } |
161 } |
161 delete paths; |
162 delete paths; |
162 paths = NULL; |
163 paths = NULL; |
163 |
164 |
164 //Valid arguments, but no databases having the supplied security policy UID. |
165 //Valid arguments, but no databases having the supplied security policy UID. |