sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include <e32test.h>
|
sl@0
|
17 |
#include <bautils.h>
|
sl@0
|
18 |
#include <sqldb.h>
|
sl@0
|
19 |
#include <stdlib.h>
|
sl@0
|
20 |
#include "sqlite3.h"
|
sl@0
|
21 |
#include "SqliteSymbian.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
25 |
|
sl@0
|
26 |
RTest TheTest(_L("t_sqlcompact3 test"));
|
sl@0
|
27 |
RSqlDatabase TheDb;
|
sl@0
|
28 |
RSqlStatement TheStmt;
|
sl@0
|
29 |
|
sl@0
|
30 |
_LIT(KTestDir, "c:\\test\\");
|
sl@0
|
31 |
_LIT(KTestDbName1, "c:\\test\\t_sqlcompact3_1.db");
|
sl@0
|
32 |
_LIT(KTestPrivDbName, "c:\\private\\21212124\\t_sqlcompact3_2.db");
|
sl@0
|
33 |
_LIT(KTestPrivDbNameZ,"z:\\private\\21212124\\t_sqldb1.db");//Created outside the test app
|
sl@0
|
34 |
_LIT(KTestPrivDbNameC,"c:\\private\\21212124\\t_sqldb1.db");
|
sl@0
|
35 |
_LIT(KTestSecureDbName, "c:[21212124]t_sqlcompact3_3.db");
|
sl@0
|
36 |
_LIT8(KTestFullSecureDbNameZ, "c:\\private\\10281e17\\[21212124]t_sqlcompact3_3.db\x0");
|
sl@0
|
37 |
|
sl@0
|
38 |
const TInt KAutoVacuum = 1;
|
sl@0
|
39 |
const TInt KIncrementalVacuum = 2;
|
sl@0
|
40 |
const TInt KSqlDefaultVacuum = KIncrementalVacuum;
|
sl@0
|
41 |
|
sl@0
|
42 |
//In order to be able to compile the test, the following variables are defined (used inside the OS porting layer, when _SQLPROFILER macro is defined)
|
sl@0
|
43 |
#ifdef _SQLPROFILER
|
sl@0
|
44 |
TInt TheSqlSrvProfilerFileRead = 0;
|
sl@0
|
45 |
TInt TheSqlSrvProfilerFileWrite = 0;
|
sl@0
|
46 |
TInt TheSqlSrvProfilerFileSync = 0;
|
sl@0
|
47 |
TInt TheSqlSrvProfilerFileSetSize = 0;
|
sl@0
|
48 |
#endif
|
sl@0
|
49 |
|
sl@0
|
50 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
51 |
|
sl@0
|
52 |
void DestroyTestEnv()
|
sl@0
|
53 |
{
|
sl@0
|
54 |
TheStmt.Close();
|
sl@0
|
55 |
TheDb.Close();
|
sl@0
|
56 |
(void)RSqlDatabase::Delete(KTestPrivDbNameC);
|
sl@0
|
57 |
(void)RSqlDatabase::Delete(KTestSecureDbName);
|
sl@0
|
58 |
(void)RSqlDatabase::Delete(KTestPrivDbName);
|
sl@0
|
59 |
(void)RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
60 |
sqlite3SymbianLibFinalize();
|
sl@0
|
61 |
CloseSTDLIB();
|
sl@0
|
62 |
}
|
sl@0
|
63 |
|
sl@0
|
64 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
65 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
66 |
//Test macros and functions
|
sl@0
|
67 |
void Check(TInt aValue, TInt aLine)
|
sl@0
|
68 |
{
|
sl@0
|
69 |
if(!aValue)
|
sl@0
|
70 |
{
|
sl@0
|
71 |
DestroyTestEnv();
|
sl@0
|
72 |
TheTest(EFalse, aLine);
|
sl@0
|
73 |
}
|
sl@0
|
74 |
}
|
sl@0
|
75 |
void Check(TInt aValue, TInt aExpected, TInt aLine)
|
sl@0
|
76 |
{
|
sl@0
|
77 |
if(aValue != aExpected)
|
sl@0
|
78 |
{
|
sl@0
|
79 |
DestroyTestEnv();
|
sl@0
|
80 |
RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
|
sl@0
|
81 |
TheTest(EFalse, aLine);
|
sl@0
|
82 |
}
|
sl@0
|
83 |
}
|
sl@0
|
84 |
#define TEST(arg) ::Check((arg), __LINE__)
|
sl@0
|
85 |
#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)
|
sl@0
|
86 |
|
sl@0
|
87 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
88 |
|
sl@0
|
89 |
void CreateTestEnv()
|
sl@0
|
90 |
{
|
sl@0
|
91 |
RFs fs;
|
sl@0
|
92 |
TInt err = fs.Connect();
|
sl@0
|
93 |
TEST2(err, KErrNone);
|
sl@0
|
94 |
|
sl@0
|
95 |
err = fs.MkDir(KTestDir);
|
sl@0
|
96 |
TEST(err == KErrNone || err == KErrAlreadyExists);
|
sl@0
|
97 |
|
sl@0
|
98 |
err = fs.CreatePrivatePath(EDriveC);
|
sl@0
|
99 |
TEST(err == KErrNone || err == KErrAlreadyExists);
|
sl@0
|
100 |
|
sl@0
|
101 |
fs.Close();
|
sl@0
|
102 |
|
sl@0
|
103 |
sqlite3SymbianLibInit();
|
sl@0
|
104 |
}
|
sl@0
|
105 |
|
sl@0
|
106 |
///////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
107 |
|
sl@0
|
108 |
/**
|
sl@0
|
109 |
@SYMTestCaseID SYSLIB-SQL-UT-4056
|
sl@0
|
110 |
@SYMTestCaseDesc Manual compaction - configuration test.
|
sl@0
|
111 |
The test creates a database with a manual compaction mode.
|
sl@0
|
112 |
The test reopens the database and verifies that the compaction mode is persistent and is still manual.
|
sl@0
|
113 |
Then the test reopens the database using different compaction mode in the configuration string and
|
sl@0
|
114 |
verifies that the original (manual) compaction mode cannot be changed when the database is opened.
|
sl@0
|
115 |
@SYMTestPriority Medium
|
sl@0
|
116 |
@SYMTestActions Manual compaction - configuration test.
|
sl@0
|
117 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
118 |
@SYMREQ REQ10274
|
sl@0
|
119 |
REQ10402
|
sl@0
|
120 |
*/
|
sl@0
|
121 |
void CompactConfigTest1L()
|
sl@0
|
122 |
{
|
sl@0
|
123 |
//Create a test database with "manual" compaction mode
|
sl@0
|
124 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=manual");
|
sl@0
|
125 |
TInt err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
126 |
TEST2(err, KErrNone);
|
sl@0
|
127 |
//Check the vacuum mode. The SQLite vacuum mode should be "incremental"
|
sl@0
|
128 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
129 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
130 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
131 |
TheDb.Close();
|
sl@0
|
132 |
//Close and open the database again. The SQLite vacuum mode should be "incremental".
|
sl@0
|
133 |
err = TheDb.Open(KTestDbName1);
|
sl@0
|
134 |
TEST2(err, KErrNone);
|
sl@0
|
135 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
136 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
137 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
138 |
TheDb.Close();
|
sl@0
|
139 |
//Close and open the database again with a config string with "auto" compaction mode.
|
sl@0
|
140 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
141 |
_LIT8(KConfigStr2, "compaction=auto");
|
sl@0
|
142 |
err = TheDb.Open(KTestDbName1, &KConfigStr2);
|
sl@0
|
143 |
TEST2(err, KErrNone);
|
sl@0
|
144 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
145 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
146 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
147 |
TheDb.Close();
|
sl@0
|
148 |
//Delete database
|
sl@0
|
149 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
150 |
TEST2(err, KErrNone);
|
sl@0
|
151 |
}
|
sl@0
|
152 |
|
sl@0
|
153 |
/**
|
sl@0
|
154 |
@SYMTestCaseID SYSLIB-SQL-UT-4057
|
sl@0
|
155 |
@SYMTestCaseDesc Auto compaction - configuration test.
|
sl@0
|
156 |
The test creates a database with an auto compaction mode.
|
sl@0
|
157 |
The test reopens the database and verifies that the compaction mode is persistent and is still auto.
|
sl@0
|
158 |
Then the test reopens the database using different compaction mode in the configuration string and
|
sl@0
|
159 |
verifies that the original (auto) compaction mode cannot be changed when the database is opened.
|
sl@0
|
160 |
@SYMTestPriority Medium
|
sl@0
|
161 |
@SYMTestActions Auto compaction - configuration test.
|
sl@0
|
162 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
163 |
@SYMREQ REQ10274
|
sl@0
|
164 |
REQ10400
|
sl@0
|
165 |
*/
|
sl@0
|
166 |
void CompactConfigTest2L()
|
sl@0
|
167 |
{
|
sl@0
|
168 |
//Create a test database with "auto" compaction mode
|
sl@0
|
169 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=auto");
|
sl@0
|
170 |
TInt err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
171 |
TEST2(err, KErrNone);
|
sl@0
|
172 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
173 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
174 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
175 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
176 |
TheDb.Close();
|
sl@0
|
177 |
//Create a test database with "synchronous" compaction mode
|
sl@0
|
178 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
179 |
TEST2(err, KErrNone);
|
sl@0
|
180 |
_LIT8(KConfigStr3, "encoding=utf-8;compaction=synchronous");
|
sl@0
|
181 |
err = TheDb.Create(KTestDbName1, &KConfigStr3);
|
sl@0
|
182 |
TEST2(err, KErrNone);
|
sl@0
|
183 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
184 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
185 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
186 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
187 |
TheDb.Close();
|
sl@0
|
188 |
//Close and open the database again. The SQLite vacuum mode should be "auto".
|
sl@0
|
189 |
err = TheDb.Open(KTestDbName1);
|
sl@0
|
190 |
TEST2(err, KErrNone);
|
sl@0
|
191 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
192 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
193 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
194 |
TheDb.Close();
|
sl@0
|
195 |
//Close and open the database again with a config string with "background" compaction mode.
|
sl@0
|
196 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
197 |
_LIT8(KConfigStr2, "compaction=background");
|
sl@0
|
198 |
err = TheDb.Open(KTestDbName1, &KConfigStr2);
|
sl@0
|
199 |
TEST2(err, KErrNone);
|
sl@0
|
200 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
201 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
202 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
203 |
TheDb.Close();
|
sl@0
|
204 |
//Delete database
|
sl@0
|
205 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
206 |
TEST2(err, KErrNone);
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
/**
|
sl@0
|
210 |
@SYMTestCaseID SYSLIB-SQL-UT-4058
|
sl@0
|
211 |
@SYMTestCaseDesc Background compaction - configuration test.
|
sl@0
|
212 |
The test creates a database with a background compaction mode.
|
sl@0
|
213 |
The test reopens the database and verifies that the compaction mode is persistent and is still background.
|
sl@0
|
214 |
Then the test reopens the database using different compaction mode in the configuration string and
|
sl@0
|
215 |
verifies that the original (background) compaction mode cannot be changed when the database is opened.
|
sl@0
|
216 |
@SYMTestPriority Medium
|
sl@0
|
217 |
@SYMTestActions Background compaction - configuration test.
|
sl@0
|
218 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
219 |
@SYMREQ REQ10274
|
sl@0
|
220 |
*/
|
sl@0
|
221 |
void CompactConfigTest3L()
|
sl@0
|
222 |
{
|
sl@0
|
223 |
//Create a test database with "background" compaction mode
|
sl@0
|
224 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=background");
|
sl@0
|
225 |
TInt err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
226 |
TEST2(err, KErrNone);
|
sl@0
|
227 |
//Check the vacuum mode. The SQLite vacuum mode should be "incremental"
|
sl@0
|
228 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
229 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
230 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
231 |
TheDb.Close();
|
sl@0
|
232 |
//Close and open the database again. The SQLite vacuum mode should be "incremental".
|
sl@0
|
233 |
err = TheDb.Open(KTestDbName1);
|
sl@0
|
234 |
TEST2(err, KErrNone);
|
sl@0
|
235 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
236 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
237 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
238 |
TheDb.Close();
|
sl@0
|
239 |
//Close and open the database again with a config string with "manual" compaction mode.
|
sl@0
|
240 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
241 |
_LIT8(KConfigStr2, "compaction=manual");
|
sl@0
|
242 |
err = TheDb.Open(KTestDbName1, &KConfigStr2);
|
sl@0
|
243 |
TEST2(err, KErrNone);
|
sl@0
|
244 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
245 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
246 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
247 |
TheDb.Close();
|
sl@0
|
248 |
//Delete database
|
sl@0
|
249 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
250 |
TEST2(err, KErrNone);
|
sl@0
|
251 |
}
|
sl@0
|
252 |
|
sl@0
|
253 |
/**
|
sl@0
|
254 |
@SYMTestCaseID SYSLIB-SQL-UT-4059
|
sl@0
|
255 |
@SYMTestCaseDesc Background compaction - no configuration string test.
|
sl@0
|
256 |
The test creates a database without using a configuration string.
|
sl@0
|
257 |
The database should be created with default compaction mode - background.
|
sl@0
|
258 |
The test reopens the database and verifies that the compaction mode is persistent and is still background.
|
sl@0
|
259 |
Then the test reopens the database using different compaction mode in the configuration string and
|
sl@0
|
260 |
verifies that the original (background) compaction mode cannot be changed when the database is opened.
|
sl@0
|
261 |
@SYMTestPriority Medium
|
sl@0
|
262 |
@SYMTestActions Background compaction - no configuration string test.
|
sl@0
|
263 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
264 |
@SYMREQ REQ10273
|
sl@0
|
265 |
REQ10274
|
sl@0
|
266 |
*/
|
sl@0
|
267 |
void CompactConfigTest4L()
|
sl@0
|
268 |
{
|
sl@0
|
269 |
//Create a test database without configuration string
|
sl@0
|
270 |
TInt err = TheDb.Create(KTestDbName1);
|
sl@0
|
271 |
TEST2(err, KErrNone);
|
sl@0
|
272 |
//Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum
|
sl@0
|
273 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
274 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
275 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
276 |
TheDb.Close();
|
sl@0
|
277 |
//Delete database
|
sl@0
|
278 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
279 |
TEST2(err, KErrNone);
|
sl@0
|
280 |
//Create a test database with invalid configuration string
|
sl@0
|
281 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=backgrund");
|
sl@0
|
282 |
err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
283 |
TEST2(err, KErrNone);
|
sl@0
|
284 |
//Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum
|
sl@0
|
285 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
286 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
287 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
288 |
TheDb.Close();
|
sl@0
|
289 |
//Delete database
|
sl@0
|
290 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
291 |
TEST2(err, KErrNone);
|
sl@0
|
292 |
//Create a test database with invalid configuration string
|
sl@0
|
293 |
_LIT8(KConfigStr2, "compactin=background");
|
sl@0
|
294 |
err = TheDb.Create(KTestDbName1, &KConfigStr2);
|
sl@0
|
295 |
TEST2(err, KErrNone);
|
sl@0
|
296 |
//Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum
|
sl@0
|
297 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
298 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
299 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
300 |
TheDb.Close();
|
sl@0
|
301 |
//Delete database
|
sl@0
|
302 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
303 |
TEST2(err, KErrNone);
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
/**
|
sl@0
|
307 |
@SYMTestCaseID SYSLIB-SQL-UT-4060
|
sl@0
|
308 |
@SYMTestCaseDesc Private database and compaction configuration test.
|
sl@0
|
309 |
The test verifies that a private database can be created using auto, background or
|
sl@0
|
310 |
manual compaction mode and that the compaction mode does not chage after reopening
|
sl@0
|
311 |
the database.
|
sl@0
|
312 |
The test also verifies that if the database is legacy, read-only, then the compaction
|
sl@0
|
313 |
mode is auto.
|
sl@0
|
314 |
The test also verifies that if the database is legacy, r/w, then the compaction
|
sl@0
|
315 |
mode will be changed from auto to background.
|
sl@0
|
316 |
@SYMTestPriority Medium
|
sl@0
|
317 |
@SYMTestActions Private database and compaction configuration test.
|
sl@0
|
318 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
319 |
@SYMREQ REQ10273
|
sl@0
|
320 |
REQ10274
|
sl@0
|
321 |
REQ10400
|
sl@0
|
322 |
REQ10402
|
sl@0
|
323 |
*/
|
sl@0
|
324 |
void CompactConfigTest5L()
|
sl@0
|
325 |
{
|
sl@0
|
326 |
//Create a private test database with "auto" compaction mode
|
sl@0
|
327 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=auto");
|
sl@0
|
328 |
TInt err = TheDb.Create(KTestPrivDbName, &KConfigStr1);
|
sl@0
|
329 |
TEST2(err, KErrNone);
|
sl@0
|
330 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
331 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
332 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
333 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
334 |
TheDb.Close();
|
sl@0
|
335 |
//Close and open the database again. The SQLite vacuum mode should be "auto".
|
sl@0
|
336 |
err = TheDb.Open(KTestPrivDbName);
|
sl@0
|
337 |
TEST2(err, KErrNone);
|
sl@0
|
338 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
339 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
340 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
341 |
TheDb.Close();
|
sl@0
|
342 |
//Close and open the database again with a config string with "background" compaction mode.
|
sl@0
|
343 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
344 |
_LIT8(KConfigStr2, "compaction=background");
|
sl@0
|
345 |
err = TheDb.Open(KTestPrivDbName, &KConfigStr2);
|
sl@0
|
346 |
TEST2(err, KErrNone);
|
sl@0
|
347 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
348 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
349 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
350 |
TheDb.Close();
|
sl@0
|
351 |
//Delete database
|
sl@0
|
352 |
err = RSqlDatabase::Delete(KTestPrivDbName);
|
sl@0
|
353 |
TEST2(err, KErrNone);
|
sl@0
|
354 |
//Create a private test database - no config string
|
sl@0
|
355 |
err = TheDb.Create(KTestPrivDbName);
|
sl@0
|
356 |
TEST2(err, KErrNone);
|
sl@0
|
357 |
//Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum
|
sl@0
|
358 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
359 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
360 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
361 |
TheDb.Close();
|
sl@0
|
362 |
//Close and open the database again. The SQLite vacuum mode should be KSqlDefaultVacuum.
|
sl@0
|
363 |
err = TheDb.Open(KTestPrivDbName);
|
sl@0
|
364 |
TEST2(err, KErrNone);
|
sl@0
|
365 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
366 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
367 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
368 |
TheDb.Close();
|
sl@0
|
369 |
//Close and open the database again with a config string with "auto" compaction mode.
|
sl@0
|
370 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
371 |
err = TheDb.Open(KTestPrivDbName, &KConfigStr1);
|
sl@0
|
372 |
TEST2(err, KErrNone);
|
sl@0
|
373 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
374 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
375 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
376 |
TheDb.Close();
|
sl@0
|
377 |
//Delete database
|
sl@0
|
378 |
err = RSqlDatabase::Delete(KTestPrivDbName);
|
sl@0
|
379 |
TEST2(err, KErrNone);
|
sl@0
|
380 |
//Open an existing private database that is read-only (on drive Z:)
|
sl@0
|
381 |
err = TheDb.Open(KTestPrivDbNameZ, &KConfigStr1);
|
sl@0
|
382 |
TEST2(err, KErrNone);
|
sl@0
|
383 |
//Check the vacuum mode. The SQLite compact mode should be "auto" (this is an old database (pre-"background compact" era))
|
sl@0
|
384 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
385 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
386 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
387 |
TheDb.Close();
|
sl@0
|
388 |
//Open the same database after copying it to drive C: (r/w private database). The compaction mode should change from auto to background.
|
sl@0
|
389 |
RFs fs;
|
sl@0
|
390 |
err = fs.Connect();
|
sl@0
|
391 |
TEST2(err, KErrNone);
|
sl@0
|
392 |
CFileMan* fm = CFileMan::NewL(fs);
|
sl@0
|
393 |
TEST(fm != NULL);
|
sl@0
|
394 |
err = fm->Copy(KTestPrivDbNameZ, KTestPrivDbNameC);
|
sl@0
|
395 |
TEST2(err, KErrNone);
|
sl@0
|
396 |
//"Copy" operation executed without errors. Now it is a time to turn off the read-only
|
sl@0
|
397 |
//flag of the target file (which may be on if the source file is on a read-only drive)
|
sl@0
|
398 |
err = fs.SetAtt(KTestPrivDbNameC, 0, KEntryAttReadOnly);
|
sl@0
|
399 |
TEST2(err, KErrNone);
|
sl@0
|
400 |
delete fm;
|
sl@0
|
401 |
fs.Close();
|
sl@0
|
402 |
err = TheDb.Open(KTestPrivDbNameC);
|
sl@0
|
403 |
TEST2(err, KErrNone);
|
sl@0
|
404 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
405 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
406 |
TEST2(compact, KSqlDefaultVacuum);
|
sl@0
|
407 |
TheDb.Close();
|
sl@0
|
408 |
(void)RSqlDatabase::Delete(KTestPrivDbNameC);
|
sl@0
|
409 |
}
|
sl@0
|
410 |
|
sl@0
|
411 |
RSqlSecurityPolicy CreateTestSecurityPolicy()
|
sl@0
|
412 |
{
|
sl@0
|
413 |
const TSecurityPolicy KDefaultPolicy(TSecurityPolicy::EAlwaysPass);
|
sl@0
|
414 |
RSqlSecurityPolicy securityPolicy;
|
sl@0
|
415 |
TInt err = securityPolicy.Create(KDefaultPolicy);
|
sl@0
|
416 |
TEST2(err, KErrNone);
|
sl@0
|
417 |
return securityPolicy;
|
sl@0
|
418 |
}
|
sl@0
|
419 |
|
sl@0
|
420 |
void TestCompactMode(TInt aExpectedCompactMode)
|
sl@0
|
421 |
{
|
sl@0
|
422 |
sqlite3 *dbHandle = NULL;
|
sl@0
|
423 |
TInt rc = sqlite3_open((const char*)KTestFullSecureDbNameZ().Ptr(), &dbHandle);
|
sl@0
|
424 |
TEST2(rc, SQLITE_OK);
|
sl@0
|
425 |
|
sl@0
|
426 |
sqlite3_stmt* stmtHandle = NULL;
|
sl@0
|
427 |
const char* stmtTailZ = NULL;
|
sl@0
|
428 |
rc = sqlite3_prepare_v2(dbHandle, "PRAGMA auto_vacuum", -1, &stmtHandle, &stmtTailZ);
|
sl@0
|
429 |
TEST2(rc, SQLITE_OK);
|
sl@0
|
430 |
|
sl@0
|
431 |
rc = sqlite3_step(stmtHandle);
|
sl@0
|
432 |
TEST2(rc, SQLITE_ROW);
|
sl@0
|
433 |
TInt compact = sqlite3_column_int(stmtHandle, 0);
|
sl@0
|
434 |
|
sl@0
|
435 |
sqlite3_finalize(stmtHandle);
|
sl@0
|
436 |
sqlite3_close(dbHandle);
|
sl@0
|
437 |
|
sl@0
|
438 |
TEST2(compact, aExpectedCompactMode);
|
sl@0
|
439 |
}
|
sl@0
|
440 |
|
sl@0
|
441 |
/**
|
sl@0
|
442 |
@SYMTestCaseID SYSLIB-SQL-UT-4061
|
sl@0
|
443 |
@SYMTestCaseDesc Secure shared database and compaction configuration test.
|
sl@0
|
444 |
The test verifies that a secure shared database can be created using auto, background or
|
sl@0
|
445 |
manual compaction mode and that the compaction mode does not chage after reopening
|
sl@0
|
446 |
the database.
|
sl@0
|
447 |
@SYMTestPriority Medium
|
sl@0
|
448 |
@SYMTestActions Secure shared database and compaction configuration test.
|
sl@0
|
449 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
450 |
@SYMREQ REQ10273
|
sl@0
|
451 |
REQ10274
|
sl@0
|
452 |
REQ10400
|
sl@0
|
453 |
REQ10402
|
sl@0
|
454 |
*/
|
sl@0
|
455 |
void CompactConfigTest6L()
|
sl@0
|
456 |
{
|
sl@0
|
457 |
//Create a secure test database with "auto" compaction mode.
|
sl@0
|
458 |
RSqlSecurityPolicy securityPolicy = CreateTestSecurityPolicy();
|
sl@0
|
459 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction=auto");
|
sl@0
|
460 |
TInt err = TheDb.Create(KTestSecureDbName, securityPolicy, &KConfigStr1);
|
sl@0
|
461 |
TEST2(err, KErrNone);
|
sl@0
|
462 |
securityPolicy.Close();
|
sl@0
|
463 |
TheDb.Close();
|
sl@0
|
464 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
465 |
TestCompactMode(KAutoVacuum);
|
sl@0
|
466 |
//Close and open the database again. The SQLite vacuum mode should be "auto".
|
sl@0
|
467 |
err = TheDb.Open(KTestSecureDbName);
|
sl@0
|
468 |
TEST2(err, KErrNone);
|
sl@0
|
469 |
TheDb.Close();
|
sl@0
|
470 |
TestCompactMode(KAutoVacuum);
|
sl@0
|
471 |
//Close and open the database again with a config string with "background" compaction mode.
|
sl@0
|
472 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
473 |
_LIT8(KConfigStr2, "compaction=background");
|
sl@0
|
474 |
err = TheDb.Open(KTestSecureDbName, &KConfigStr2);
|
sl@0
|
475 |
TEST2(err, KErrNone);
|
sl@0
|
476 |
TheDb.Close();
|
sl@0
|
477 |
TestCompactMode(KAutoVacuum);
|
sl@0
|
478 |
//Delete database
|
sl@0
|
479 |
err = RSqlDatabase::Delete(KTestSecureDbName);
|
sl@0
|
480 |
TEST2(err, KErrNone);
|
sl@0
|
481 |
//Create a private test database - no config string
|
sl@0
|
482 |
securityPolicy = CreateTestSecurityPolicy();
|
sl@0
|
483 |
err = TheDb.Create(KTestSecureDbName, securityPolicy);
|
sl@0
|
484 |
TEST2(err, KErrNone);
|
sl@0
|
485 |
securityPolicy.Close();
|
sl@0
|
486 |
TheDb.Close();
|
sl@0
|
487 |
//Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum.
|
sl@0
|
488 |
TestCompactMode(KSqlDefaultVacuum);
|
sl@0
|
489 |
//Close and open the database again. The SQLite vacuum mode should be KSqlDefaultVacuum.
|
sl@0
|
490 |
err = TheDb.Open(KTestSecureDbName);
|
sl@0
|
491 |
TEST2(err, KErrNone);
|
sl@0
|
492 |
TheDb.Close();
|
sl@0
|
493 |
TestCompactMode(KSqlDefaultVacuum);
|
sl@0
|
494 |
//Close and open the database again with a config string with "auto" compaction mode.
|
sl@0
|
495 |
//The SQLite vacuum mode should stay unchanged.
|
sl@0
|
496 |
err = TheDb.Open(KTestSecureDbName, &KConfigStr1);
|
sl@0
|
497 |
TEST2(err, KErrNone);
|
sl@0
|
498 |
TheDb.Close();
|
sl@0
|
499 |
TestCompactMode(KSqlDefaultVacuum);
|
sl@0
|
500 |
//Delete database
|
sl@0
|
501 |
err = RSqlDatabase::Delete(KTestSecureDbName);
|
sl@0
|
502 |
TEST2(err, KErrNone);
|
sl@0
|
503 |
}
|
sl@0
|
504 |
|
sl@0
|
505 |
/**
|
sl@0
|
506 |
@SYMTestCaseID SYSLIB-SQL-UT-4062
|
sl@0
|
507 |
@SYMTestCaseDesc Compaction configuration test - multiple connections.
|
sl@0
|
508 |
The test creates a database with auto or background compaction mode.
|
sl@0
|
509 |
Then the test opens more connections to the same database.
|
sl@0
|
510 |
The test verifies that the compaction mode of the connections opened later is
|
sl@0
|
511 |
the same as the compaction mode of the database that was openen first.
|
sl@0
|
512 |
The test also verifies that the compactino mode cannot be changed even if the second
|
sl@0
|
513 |
connection is opened with a configuration string with a specified different compaction mode.
|
sl@0
|
514 |
@SYMTestPriority Medium
|
sl@0
|
515 |
@SYMTestActions Compaction configuration test - multiple connections.
|
sl@0
|
516 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
517 |
@SYMREQ REQ10273
|
sl@0
|
518 |
REQ10274
|
sl@0
|
519 |
REQ10400
|
sl@0
|
520 |
*/
|
sl@0
|
521 |
void CompactConfigTest7L()
|
sl@0
|
522 |
{
|
sl@0
|
523 |
//Create a test database with "auto" compaction mode.
|
sl@0
|
524 |
_LIT8(KConfigStr1, "encoding=utf-8;compaction = auto");
|
sl@0
|
525 |
TInt err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
526 |
TEST2(err, KErrNone);
|
sl@0
|
527 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
528 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
529 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
530 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
531 |
//Open a second connection to the same database - no config string
|
sl@0
|
532 |
RSqlDatabase db2;
|
sl@0
|
533 |
err = db2.Open(KTestDbName1);
|
sl@0
|
534 |
TEST2(err, KErrNone);
|
sl@0
|
535 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
536 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
537 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
538 |
TSqlScalarFullSelectQuery scalarQuery2(db2);
|
sl@0
|
539 |
compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
540 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
541 |
//Open a third connection to the same database - "background" compaction mode config string
|
sl@0
|
542 |
_LIT8(KConfigStr2, " encoding = utf-8 ; ; ; compaction = background ");
|
sl@0
|
543 |
RSqlDatabase db3;
|
sl@0
|
544 |
err = db3.Open(KTestDbName1, &KConfigStr2);
|
sl@0
|
545 |
TEST2(err, KErrNone);
|
sl@0
|
546 |
//Check the vacuum mode. The SQLite vacuum mode should be "auto"
|
sl@0
|
547 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
548 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
549 |
compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
550 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
551 |
TSqlScalarFullSelectQuery scalarQuery3(db3);
|
sl@0
|
552 |
compact = scalarQuery3.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
553 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
554 |
//Close & Delete database
|
sl@0
|
555 |
db3.Close();
|
sl@0
|
556 |
db2.Close();
|
sl@0
|
557 |
TheDb.Close();
|
sl@0
|
558 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
559 |
TEST2(err, KErrNone);
|
sl@0
|
560 |
//
|
sl@0
|
561 |
//
|
sl@0
|
562 |
//Create a test database with "background" compaction mode
|
sl@0
|
563 |
_LIT8(KConfigStr3, "compaction = background ;;;;");
|
sl@0
|
564 |
err = TheDb.Create(KTestDbName1, &KConfigStr3);
|
sl@0
|
565 |
TEST2(err, KErrNone);
|
sl@0
|
566 |
//Check the vacuum mode. The SQLite vacuum mode should be "incremental"
|
sl@0
|
567 |
scalarQuery.SetDatabase(TheDb);
|
sl@0
|
568 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
569 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
570 |
//Open a second connection to the same database - no config string
|
sl@0
|
571 |
err = db2.Open(KTestDbName1);
|
sl@0
|
572 |
TEST2(err, KErrNone);
|
sl@0
|
573 |
//Check the vacuum mode. The SQLite vacuum mode should be "incremental"
|
sl@0
|
574 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
575 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
576 |
scalarQuery2.SetDatabase(db2);
|
sl@0
|
577 |
compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
578 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
579 |
//Open a third connection to the same database - "auto" compaction mode config string
|
sl@0
|
580 |
_LIT8(KConfigStr4, " encoding = utf-16 ; compaction = auto ; ; ; ");
|
sl@0
|
581 |
err = db3.Open(KTestDbName1, &KConfigStr4);
|
sl@0
|
582 |
TEST2(err, KErrNone);
|
sl@0
|
583 |
//Check the vacuum mode. The SQLite vacuum mode should be "incremental"
|
sl@0
|
584 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
585 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
586 |
compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
587 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
588 |
scalarQuery3.SetDatabase(db3);
|
sl@0
|
589 |
compact = scalarQuery3.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
590 |
TEST2(compact, KIncrementalVacuum);
|
sl@0
|
591 |
//Close & Delete database
|
sl@0
|
592 |
db3.Close();
|
sl@0
|
593 |
db2.Close();
|
sl@0
|
594 |
TheDb.Close();
|
sl@0
|
595 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
596 |
TEST2(err, KErrNone);
|
sl@0
|
597 |
}
|
sl@0
|
598 |
|
sl@0
|
599 |
/**
|
sl@0
|
600 |
@SYMTestCaseID SYSLIB-SQL-UT-4063
|
sl@0
|
601 |
@SYMTestCaseDesc Compaction configuration test - attached database.
|
sl@0
|
602 |
The test creates a database with an auto compaction mode.
|
sl@0
|
603 |
Then the test attaches the same database.
|
sl@0
|
604 |
The test verifies that the compaction mode of the main and the attached database is the same - auto.
|
sl@0
|
605 |
@SYMTestPriority Medium
|
sl@0
|
606 |
@SYMTestActions Compaction configuration test - attached database.
|
sl@0
|
607 |
@SYMTestExpectedResults Test must not fail
|
sl@0
|
608 |
@SYMREQ REQ10273
|
sl@0
|
609 |
REQ10274
|
sl@0
|
610 |
REQ10400
|
sl@0
|
611 |
*/
|
sl@0
|
612 |
void CompactConfigTest8L()
|
sl@0
|
613 |
{
|
sl@0
|
614 |
//Create a test database with "auto" compaction mode
|
sl@0
|
615 |
_LIT8(KConfigStr1, "; ;; ; compaction = auto; ");
|
sl@0
|
616 |
TInt err = TheDb.Create(KTestDbName1, &KConfigStr1);
|
sl@0
|
617 |
TEST2(err, KErrNone);
|
sl@0
|
618 |
//Attach a database
|
sl@0
|
619 |
err = TheDb.Attach(KTestDbName1, _L("db2"));
|
sl@0
|
620 |
TEST2(err, KErrNone);
|
sl@0
|
621 |
//Check compact for both main and attached database
|
sl@0
|
622 |
TSqlScalarFullSelectQuery scalarQuery(TheDb);
|
sl@0
|
623 |
TInt compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
624 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
625 |
compact = scalarQuery.SelectIntL(_L("PRAGMA db2.auto_vacuum"));
|
sl@0
|
626 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
627 |
//Detach
|
sl@0
|
628 |
err = TheDb.Detach(_L("db2"));
|
sl@0
|
629 |
TEST2(err, KErrNone);
|
sl@0
|
630 |
//Check compact again
|
sl@0
|
631 |
compact = scalarQuery.SelectIntL(_L("PRAGMA auto_vacuum"));
|
sl@0
|
632 |
TEST2(compact, KAutoVacuum);
|
sl@0
|
633 |
//
|
sl@0
|
634 |
TheDb.Close();
|
sl@0
|
635 |
err = RSqlDatabase::Delete(KTestDbName1);
|
sl@0
|
636 |
TEST2(err, KErrNone);
|
sl@0
|
637 |
}
|
sl@0
|
638 |
|
sl@0
|
639 |
void DoTestsL()
|
sl@0
|
640 |
{
|
sl@0
|
641 |
TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4056 Compaction configuration tests 1 - manual compact"));
|
sl@0
|
642 |
CompactConfigTest1L();
|
sl@0
|
643 |
|
sl@0
|
644 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4057 Compaction configuration tests 2 - auto compact"));
|
sl@0
|
645 |
CompactConfigTest2L();
|
sl@0
|
646 |
|
sl@0
|
647 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4058 Compaction configuration tests 3 - background compact"));
|
sl@0
|
648 |
CompactConfigTest3L();
|
sl@0
|
649 |
|
sl@0
|
650 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4059 Compaction configuration tests 4 - invalid compact"));
|
sl@0
|
651 |
CompactConfigTest4L();
|
sl@0
|
652 |
|
sl@0
|
653 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4060 Compaction configuration tests 5 - private databases"));
|
sl@0
|
654 |
CompactConfigTest5L();
|
sl@0
|
655 |
|
sl@0
|
656 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4061 Compaction configuration tests 6 - secure databases"));
|
sl@0
|
657 |
CompactConfigTest6L();
|
sl@0
|
658 |
|
sl@0
|
659 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4062 Compaction configuration tests 7 - multiple connections"));
|
sl@0
|
660 |
CompactConfigTest7L();
|
sl@0
|
661 |
|
sl@0
|
662 |
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4063 Compaction configuration tests 8 - attached databases"));
|
sl@0
|
663 |
CompactConfigTest8L();
|
sl@0
|
664 |
}
|
sl@0
|
665 |
|
sl@0
|
666 |
TInt E32Main()
|
sl@0
|
667 |
{
|
sl@0
|
668 |
TheTest.Title();
|
sl@0
|
669 |
|
sl@0
|
670 |
CTrapCleanup* tc = CTrapCleanup::New();
|
sl@0
|
671 |
|
sl@0
|
672 |
__UHEAP_MARK;
|
sl@0
|
673 |
|
sl@0
|
674 |
DestroyTestEnv();
|
sl@0
|
675 |
CreateTestEnv();
|
sl@0
|
676 |
TRAPD(err, DoTestsL());
|
sl@0
|
677 |
DestroyTestEnv();
|
sl@0
|
678 |
TEST2(err, KErrNone);
|
sl@0
|
679 |
|
sl@0
|
680 |
__UHEAP_MARKEND;
|
sl@0
|
681 |
|
sl@0
|
682 |
TheTest.End();
|
sl@0
|
683 |
TheTest.Close();
|
sl@0
|
684 |
|
sl@0
|
685 |
delete tc;
|
sl@0
|
686 |
|
sl@0
|
687 |
User::Heap().Check();
|
sl@0
|
688 |
return KErrNone;
|
sl@0
|
689 |
}
|