equal
deleted
inserted
replaced
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". |
69 } |
69 } |
70 |
70 |
71 // Delete secure shared database. |
71 // Delete secure shared database. |
72 TInt TDBSCUtils::DeleteDatabase(RDbs& aDbs, TUid aPolicyUid, const TDesC& aDbName) |
72 TInt TDBSCUtils::DeleteDatabase(RDbs& aDbs, TUid aPolicyUid, const TDesC& aDbName) |
73 { |
73 { |
74 RDebug::Print(_L("Deleting %X \"%S\" database.\n"), aPolicyUid.iUid, &aDbName); |
74 TheDbscUtils.iTest.Printf(_L("Deleting %X \"%S\" database.\n"), aPolicyUid.iUid, &aDbName); |
75 TInt err = aDbs.DeleteDatabase(aDbName, aPolicyUid); |
75 TInt err = aDbs.DeleteDatabase(aDbName, aPolicyUid); |
76 if(err != KErrNone && err != KErrNotFound) |
76 if(err != KErrNone && err != KErrNotFound) |
77 { |
77 { |
78 RDebug::Print(_L("Error %d deleting \"%S\" database.\n"), err, &aDbName); |
78 TheDbscUtils.iTest.Printf(_L("Error %d deleting \"%S\" database.\n"), err, &aDbName); |
79 } |
79 } |
80 return err; |
80 return err; |
81 } |
81 } |
82 |
82 |
83 //Check if a secure shared database with "aDatabaseName" name exists. |
83 //Check if a secure shared database with "aDatabaseName" name exists. |
132 //It will do a test cleanup before the termination, if iFunc data member is not null. |
132 //It will do a test cleanup before the termination, if iFunc data member is not null. |
133 void TDBSCUtils::Check(TInt aValue, TInt aLine) |
133 void TDBSCUtils::Check(TInt aValue, TInt aLine) |
134 { |
134 { |
135 if(!aValue) |
135 if(!aValue) |
136 { |
136 { |
|
137 TheDbscUtils.iTest.Printf(_L("*** Expression evaluated to false\r\n")); |
137 if(TheDbscUtils.iFunc) |
138 if(TheDbscUtils.iFunc) |
138 { |
139 { |
139 TheDbscUtils.iFunc(); |
140 TheDbscUtils.iFunc(); |
140 } |
141 } |
141 TheDbscUtils.iTest(EFalse, aLine); |
142 TheDbscUtils.iTest(EFalse, aLine); |
146 //It will do a test cleanup before the termination, if iFunc data member is not null. |
147 //It will do a test cleanup before the termination, if iFunc data member is not null. |
147 void TDBSCUtils::Check(TInt aValue, TInt aExpected, TInt aLine) |
148 void TDBSCUtils::Check(TInt aValue, TInt aExpected, TInt aLine) |
148 { |
149 { |
149 if(aValue != aExpected) |
150 if(aValue != aExpected) |
150 { |
151 { |
151 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
152 TheDbscUtils.iTest.Printf(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
152 if(TheDbscUtils.iFunc) |
153 if(TheDbscUtils.iFunc) |
153 { |
154 { |
154 TheDbscUtils.iFunc(); |
155 TheDbscUtils.iFunc(); |
155 } |
156 } |
156 TheDbscUtils.iTest(EFalse, aLine); |
157 TheDbscUtils.iTest(EFalse, aLine); |