|
1 // Copyright (c) 1997-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <e32test.h> |
|
17 #include <f32file.h> |
|
18 #include <s32file.h> |
|
19 #include <s32mem.h> |
|
20 #include <cntdb.h> |
|
21 #include <cntitem.h> |
|
22 #include <cntfldst.h> |
|
23 #include <e32def.h> |
|
24 #include "T_TTVERS.H" |
|
25 #include "T_UTILS.H" |
|
26 #include <coreappstest/testserver.h> |
|
27 |
|
28 CCntTest* CntTest=NULL; |
|
29 LOCAL_D RTest test(_L("T_TTVERS")); |
|
30 LOCAL_D CContactIdArray* TheIds; |
|
31 |
|
32 LOCAL_D CArrayPtr<CContactItem>* TheItems; |
|
33 LOCAL_D CArrayPtr<CContactItem>* TheItems2; |
|
34 LOCAL_D CArrayPtr<CContactItem>* TheItems3; |
|
35 LOCAL_D RFs TheFs; |
|
36 const TPtrC KDatabaseFileName=_L("C:TT_VERS"); |
|
37 |
|
38 // |
|
39 // CVersitTest |
|
40 // |
|
41 |
|
42 CVersitTest::CVersitTest() |
|
43 {} |
|
44 |
|
45 CVersitTest::~CVersitTest() |
|
46 { |
|
47 delete iParser; |
|
48 delete iStore; |
|
49 } |
|
50 |
|
51 void CVersitTest::StreamInL() |
|
52 //Convert the iVersit into stream format, save it as "TTVersitIn" |
|
53 //and internalize it as a CVersitParser |
|
54 { |
|
55 RFs fsSession; |
|
56 User::LeaveIfError(fsSession.Connect()); |
|
57 CFileStore* store = CDirectFileStore::ReplaceLC(fsSession,_L("c:\\TTVersit2"),EFileWrite); |
|
58 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
59 RStoreWriteStream outstream; |
|
60 TStreamId id = outstream.CreateLC(*store); |
|
61 TInt length=iVersit.Length(); |
|
62 for (TInt ii=0; ii<length; ii++) |
|
63 outstream.WriteInt8L(iVersit[ii]); |
|
64 outstream.CommitL(); |
|
65 CleanupStack::PopAndDestroy(); |
|
66 store->SetRootL(id); |
|
67 store->CommitL(); |
|
68 CleanupStack::PopAndDestroy(); |
|
69 store = CDirectFileStore::OpenLC(fsSession,_L("c:\\TTVersit2"),EFileRead); //retrieve stream |
|
70 RStoreReadStream instream; |
|
71 instream.OpenLC(*store,store->Root()); |
|
72 iParser->InternalizeL(instream); |
|
73 CleanupStack::PopAndDestroy(2); //store + stream |
|
74 } |
|
75 |
|
76 void CVersitTest::StreamLC(RReadStream& aStream) |
|
77 { |
|
78 GetSampleVersitL(); |
|
79 RFs fsSession; |
|
80 User::LeaveIfError(fsSession.Connect()); |
|
81 CFileStore* store = CDirectFileStore::ReplaceLC(fsSession,_L("c:\\TTVersitIn"),EFileWrite); |
|
82 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
83 RStoreWriteStream outstream; |
|
84 TStreamId id = outstream.CreateLC(*store); |
|
85 TInt length=iVersit.Length(); |
|
86 for (TInt ii=0; ii<length; ii++) |
|
87 outstream.WriteInt8L(iVersit[ii]); |
|
88 outstream.CommitL(); |
|
89 CleanupStack::PopAndDestroy(); |
|
90 store->SetRootL(id); |
|
91 store->CommitL(); |
|
92 CleanupStack::PopAndDestroy(); // store |
|
93 store = CDirectFileStore::OpenLC(fsSession,_L("c:\\TTVersitIn"),EFileRead); //retrieve stream |
|
94 RStoreReadStream instream; |
|
95 instream.OpenLC(*store,store->Root()); |
|
96 CleanupStack::Pop(); // instream |
|
97 aStream=RReadStream(instream); |
|
98 } |
|
99 |
|
100 void CVersitTest::Stream2LC(RReadStream& aStream) |
|
101 { |
|
102 GetSampleVersit2L(); |
|
103 RFs fsSession; |
|
104 User::LeaveIfError(fsSession.Connect()); |
|
105 CFileStore* store = CDirectFileStore::ReplaceLC(fsSession,_L("c:\\TTVersitIn2"),EFileWrite); |
|
106 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
107 RStoreWriteStream outstream; |
|
108 TStreamId id = outstream.CreateLC(*store); |
|
109 TInt length=iVersit.Length(); |
|
110 for (TInt ii=0; ii<length; ii++) |
|
111 outstream.WriteInt8L(iVersit[ii]); |
|
112 outstream.CommitL(); |
|
113 CleanupStack::PopAndDestroy(); |
|
114 store->SetRootL(id); |
|
115 store->CommitL(); |
|
116 CleanupStack::PopAndDestroy(); // store |
|
117 store = CDirectFileStore::OpenLC(fsSession,_L("c:\\TTVersitIn2"),EFileRead); //retrieve stream |
|
118 RStoreReadStream instream; |
|
119 instream.OpenLC(*store,store->Root()); |
|
120 CleanupStack::Pop(); // instream |
|
121 aStream=RReadStream(instream); |
|
122 } |
|
123 |
|
124 void CVersitTest::Stream3LC(RReadStream& aStream) |
|
125 { |
|
126 GetSampleVersit3L(); |
|
127 RFs fsSession; |
|
128 User::LeaveIfError(fsSession.Connect()); |
|
129 CFileStore* store = CDirectFileStore::ReplaceLC(fsSession,_L("c:\\TTVersitIn3"),EFileWrite); |
|
130 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
131 RStoreWriteStream outstream; |
|
132 TStreamId id = outstream.CreateLC(*store); |
|
133 TInt length=iVersit.Length(); |
|
134 for (TInt ii=0; ii<length; ii++) |
|
135 outstream.WriteInt8L(iVersit[ii]); |
|
136 outstream.CommitL(); |
|
137 CleanupStack::PopAndDestroy(); |
|
138 store->SetRootL(id); |
|
139 store->CommitL(); |
|
140 CleanupStack::PopAndDestroy(); // store |
|
141 store = CDirectFileStore::OpenLC(fsSession,_L("c:\\TTVersitIn3"),EFileRead); //retrieve stream |
|
142 RStoreReadStream instream; |
|
143 instream.OpenLC(*store,store->Root()); |
|
144 CleanupStack::Pop(); // instream |
|
145 aStream=RReadStream(instream); |
|
146 } |
|
147 |
|
148 void CVersitTest::StreamOutL() |
|
149 { |
|
150 } |
|
151 |
|
152 void CVersitTest::SaveFileVersitL() |
|
153 // Save iParser into VersitFile |
|
154 { |
|
155 if (iParser) |
|
156 { |
|
157 RFs fsSession; |
|
158 User::LeaveIfError(fsSession.Connect()); |
|
159 RFile file; |
|
160 if (file.Replace(fsSession,_L("C:\\VersitFile"),EFileWrite)==KErrNone) |
|
161 iParser->ExternalizeL(file); |
|
162 } |
|
163 } |
|
164 |
|
165 // |
|
166 // CVCardTest |
|
167 // |
|
168 |
|
169 void CVCardTest::LoadFileVersitL() |
|
170 // Read VCard.vcf into iVersit |
|
171 { |
|
172 iParser=CParserVCard::NewL(); |
|
173 RFs fsSession; |
|
174 User::LeaveIfError(fsSession.Connect()); |
|
175 RFile file; |
|
176 if (file.Open(fsSession,_L("C:\\VCard.vcf"),EFileRead)==KErrNone) |
|
177 { |
|
178 TInt start=0; |
|
179 iParser->InternalizeL(file,start); |
|
180 } |
|
181 } |
|
182 /* |
|
183 LOCAL_C void DisplayField(TInt aFieldNumber, const CContentType &aContentType, const TDesC &aDes) |
|
184 { |
|
185 TBuf<128> out; |
|
186 out.Format(_L("Field %d mapped to %x {"),aFieldNumber,aContentType.Mapping()); |
|
187 for(TInt loop=0;loop<aContentType.FieldTypeCount();loop++) |
|
188 { |
|
189 if (loop>0) |
|
190 out.Append(TChar(',')); |
|
191 out.AppendFormat(_L("%x"),aContentType.FieldType(loop)); |
|
192 } |
|
193 out.AppendFormat(_L("} is %S store type"),&aDes); |
|
194 test.Printf(out); |
|
195 test.Getch(); |
|
196 } |
|
197 |
|
198 LOCAL_C void DisplayDatabase(CContactDatabase *aDb) |
|
199 { |
|
200 TContactItemId theid; |
|
201 CContactItem* contactItem=NULL; |
|
202 TContactIter iter(*aDb); |
|
203 theid=iter.FirstL(); |
|
204 while(theid!=KNullContactId ) |
|
205 { |
|
206 test.Printf(_L("\n========================ROW ID %d"),theid); |
|
207 contactItem=aDb->ReadContactLC(theid); |
|
208 CContactItemFieldSet& fieldSet=contactItem->CardFields(); |
|
209 TInt fieldcount=fieldSet.Count(); |
|
210 test.Printf(_L(" %d fields"),fieldcount); |
|
211 for (TInt ii=0;ii<fieldcount;ii++) |
|
212 { |
|
213 const CContentType &content=fieldSet[ii].ContentType(); |
|
214 test.Printf(_L("\nLabel [")); |
|
215 test.Printf(fieldSet[ii].Label()); |
|
216 test.Printf(_L("]\n")); |
|
217 switch(fieldSet[ii].StorageType()) |
|
218 { |
|
219 case KStorageTypeText: |
|
220 { |
|
221 DisplayField(ii, content, _L("Text")); |
|
222 test.Printf(_L("\n")); |
|
223 TPtrC fieldText=fieldSet[ii].TextStorage()->Text(); |
|
224 test.Printf(fieldText); |
|
225 test.Printf(_L("\tLength = %d"),fieldText.Length()); |
|
226 } |
|
227 break; |
|
228 case KStorageTypeStore: |
|
229 DisplayField(ii, content, _L("Store")); |
|
230 break; |
|
231 case KStorageTypeDateTime: |
|
232 DisplayField(ii, content, _L("DateTime")); |
|
233 break; |
|
234 case KStorageTypeContactItemId: |
|
235 DisplayField(ii, content, _L("ContactItemId")); |
|
236 break; |
|
237 default: |
|
238 DisplayField(ii, content, _L("unknown")); |
|
239 break; |
|
240 } |
|
241 // test.Getch(); |
|
242 } |
|
243 theid=iter.NextL(); |
|
244 CleanupStack::PopAndDestroy(); // contactItem |
|
245 } |
|
246 test.Printf(_L("\nEnd of the database\n")); |
|
247 } |
|
248 */ |
|
249 |
|
250 LOCAL_C void ExportImportTestL() |
|
251 { |
|
252 CDirectFileStore *store=CDirectFileStore::ReplaceLC(CntTest->Fs(),_L("c:\\ttVersitout"),EFileWrite); |
|
253 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
254 RStoreWriteStream outStream; |
|
255 TStreamId streamId=outStream.CreateLC(*store); |
|
256 // |
|
257 CContactDatabase* db=CntTest->Db(); |
|
258 CContactIdArray *idList=CContactIdArray::NewLC(); |
|
259 CContactCard *card=CContactCard::NewLC(); |
|
260 SetNameL(*card,KUidContactFieldNote,KUidContactFieldVCardMapNOTE,_L("ABCDE"),EFalse); |
|
261 SetNameL(*card,KUidContactFieldEMail,KUidContactFieldVCardMapEMAILINTERNET,_L("One"),EFalse); |
|
262 idList->AddL(db->AddNewContactL(*card)); |
|
263 //zzz hits a Versit bug |
|
264 // SetNameL(*card,KUidContactFieldFax,KUidContactFieldVCardMapFAX,_L("ZYX"),EFalse); |
|
265 SetNameL(*card,KUidContactFieldFax,KUidContactFieldVCardMapTEL,_L("ZYX"),EFalse); |
|
266 SetNameL(*card,KUidContactFieldEMail,KUidContactFieldVCardMapEMAILINTERNET,_L("Two"),EFalse); |
|
267 idList->AddL(db->AddNewContactL(*card)); |
|
268 SetNameL(*card,KUidContactFieldSms,KUidContactFieldVCardMapTEL,_L("QQQQ"),EFalse); |
|
269 SetNameL(*card,KUidContactFieldEMail,KUidContactFieldVCardMapEMAILINTERNET,_L("Three"),EFalse); |
|
270 idList->AddL(db->AddNewContactL(*card)); |
|
271 CleanupStack::PopAndDestroy(); // card |
|
272 // |
|
273 db->ExportSelectedContactsL(TUid::Uid(KUidVCardConvDefaultImpl),*idList,outStream,CContactDatabase::ETTFormat); |
|
274 TInt targetCount=db->CountL(); |
|
275 for(TInt loop3=0;loop3<idList->Count();loop3++) |
|
276 { |
|
277 CContactItem *delFieldContact=db->OpenContactLX((*idList)[loop3]); |
|
278 CleanupStack::PushL(delFieldContact); |
|
279 delFieldContact->CardFields().Remove(0); |
|
280 db->CommitContactL(*delFieldContact); |
|
281 CleanupStack::PopAndDestroy(2); // OpenContact, delFieldContact |
|
282 } |
|
283 CleanupStack::PopAndDestroy(); // idList |
|
284 outStream.CommitL(); |
|
285 store->SetRootL(streamId); |
|
286 store->CommitL(); |
|
287 CleanupStack::PopAndDestroy(); // outStream |
|
288 // |
|
289 RStoreReadStream inStream; |
|
290 inStream.OpenLC(*store,streamId); |
|
291 TBool success=EFalse; |
|
292 CArrayPtr<CContactItem>* importedContacts=db->ImportContactsL(TUid::Uid(KUidVCardConvDefaultImpl),inStream,success,CContactDatabase::ETTFormat); |
|
293 CleanupStack::PushL(importedContacts); |
|
294 test(success); |
|
295 test(importedContacts->Count()==3); |
|
296 test(targetCount==db->CountL()); |
|
297 // |
|
298 const CContactIdArray *sortList=db->SortedItemsL(); |
|
299 for(TInt loop2=0;loop2<sortList->Count();loop2++) |
|
300 { |
|
301 CContactItem *contact=db->ReadContactLC((*sortList)[loop2]); |
|
302 TPtrC fieldTxt=FieldText(*contact,KUidContactFieldGivenName); |
|
303 if (fieldTxt==_L("One")) |
|
304 test(FieldText(*contact,KUidContactFieldNote)==_L("ABCDE")); |
|
305 else if (fieldTxt==_L("Two")) |
|
306 test(FieldText(*contact,KUidContactFieldFax)==_L("ZYX")); |
|
307 else if (fieldTxt==_L("Three")) |
|
308 test(FieldText(*contact,KUidContactFieldPhoneNumber)==_L("QQQQ")); |
|
309 CleanupStack::PopAndDestroy(); // contact |
|
310 } |
|
311 // |
|
312 for(TInt loop=0;loop<importedContacts->Count();loop++) |
|
313 db->DeleteContactL((*importedContacts)[loop]->Id()); |
|
314 importedContacts->ResetAndDestroy(); |
|
315 CleanupStack::PopAndDestroy(2); // importedContacts, inStream |
|
316 // |
|
317 CleanupStack::PopAndDestroy(); // store |
|
318 } |
|
319 |
|
320 /** |
|
321 |
|
322 @SYMTestCaseID PIM-T-TTVERS-0001 |
|
323 |
|
324 */ |
|
325 |
|
326 LOCAL_C void DoTestsL() |
|
327 { |
|
328 // create test database |
|
329 test.Start(_L("@SYMTESTCaseID:PIM-T-TTVERS-0001 Preparing tests")); |
|
330 |
|
331 User::LeaveIfError(TheFs.Connect()); |
|
332 CleanupClosePushL(TheFs); |
|
333 CTestRegister * TempFiles = CTestRegister::NewLC(); |
|
334 TempFiles->RegisterL(KDatabaseFileName, EFileTypeCnt); |
|
335 TempFiles->RegisterL(_L("C:\\ttversitin")); |
|
336 TempFiles->RegisterL(_L("C:\\ttversitin2")); |
|
337 TempFiles->RegisterL(_L("C:\\ttversitin3")); |
|
338 TempFiles->RegisterL(_L("C:\\ttversitout")); |
|
339 TempFiles->RegisterL(_L("C:\\ttversitout.vcf")); |
|
340 TempFiles->RegisterL(_L("C:\\ttversitoutb.vcf")); |
|
341 |
|
342 TheIds=CContactIdArray::NewLC(); |
|
343 TRAPD(err, CContactDatabase::DeleteDatabaseL(KDatabaseFileName)); |
|
344 if ((err != KErrNone) && (err != KErrNotFound)) |
|
345 { |
|
346 User::Leave(err); |
|
347 } |
|
348 |
|
349 CVersitTest* vtest=NULL; |
|
350 |
|
351 if (vtest) |
|
352 CleanupStack::PopAndDestroy(); //vtest; |
|
353 vtest=new(ELeave)CVCardTest; |
|
354 CleanupStack::PushL(vtest); |
|
355 CVersitTest* vtest2=NULL; |
|
356 vtest2=new(ELeave)CVCardTest; |
|
357 CleanupStack::PushL(vtest2); |
|
358 CVersitTest* vtest3=NULL; |
|
359 vtest3=new(ELeave)CVCardTest; |
|
360 CleanupStack::PushL(vtest3); |
|
361 //Import |
|
362 test.Next(_L("Importing vcard")); |
|
363 |
|
364 CContactDatabase* db=CntTest->CreateDatabaseL(); |
|
365 CntTest->Db()->OverrideMachineUniqueId(0); //testcode assumes machineUID is 0 |
|
366 TBool success; |
|
367 TUid vcardmode; |
|
368 vcardmode.iUid=KUidVCardConvDefaultImpl; |
|
369 RReadStream stream; |
|
370 vtest->StreamLC(stream); |
|
371 stream.PushL(); |
|
372 TheItems=db->ImportContactsL(vcardmode,stream,success,CContactDatabase::EIncludeX); |
|
373 test(success); |
|
374 CleanupStack::PopAndDestroy(2); // stream,store |
|
375 test(db->CountL()==1); |
|
376 test(TheItems->Count()==1); |
|
377 test((*TheItems)[0]->UidStringL(0x0)==_L("AAA")); |
|
378 //Export |
|
379 test.Next(_L("Exporting vcard")); |
|
380 |
|
381 CFileStore* store = CDirectFileStore::ReplaceLC(TheFs,_L("c:\\ttVersitout.vcf"),EFileWrite); |
|
382 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
383 RStoreWriteStream outstream; |
|
384 TStreamId id = outstream.CreateLC(*store); |
|
385 TUid uid; |
|
386 uid.iUid=KUidVCardConvDefaultImpl; |
|
387 TInt itemCount=TheItems->Count(); |
|
388 for (TInt ii=0;ii<itemCount;ii++) |
|
389 TheIds->AddL((*TheItems)[ii]->Id()); |
|
390 db->ExportSelectedContactsL(uid,*TheIds,outstream,CContactDatabase::ETTFormat); |
|
391 outstream.CommitL(); |
|
392 store->SetRootL(id); |
|
393 store->CommitL(); |
|
394 CleanupStack::PopAndDestroy(2); // store+ oustream |
|
395 // check there are no X-EPOC |
|
396 CFileStore* store2 = CDirectFileStore::OpenLC(TheFs,_L("c:\\ttVersitout.vcf"),EFileRead); //retrieve stream |
|
397 RStoreReadStream tinstream; |
|
398 tinstream.OpenLC(*store2,id); |
|
399 RReadStream xstream=RReadStream(tinstream); |
|
400 HBufC* xdes=HBufC::NewLC(99); |
|
401 TPtr ptr(xdes->Des()); |
|
402 xstream.ReadL(ptr); |
|
403 test(xdes->Des().Match(_L("*X-*"))==KErrNotFound); |
|
404 CleanupStack::PopAndDestroy(3); // store2+ instream |
|
405 //DisplayDatabase(db); |
|
406 test.Next(_L("Updating vcard 2")); |
|
407 |
|
408 RReadStream stream2; |
|
409 vtest2->Stream2LC(stream2); |
|
410 stream2.PushL(); |
|
411 TheItems2=db->ImportContactsL(vcardmode,stream2,success,CContactDatabase::ETTFormat); |
|
412 test(success); |
|
413 CleanupStack::PopAndDestroy(2); // stream,store |
|
414 test(db->CountL()==1); |
|
415 //Export again |
|
416 //DisplayDatabase(db); |
|
417 test.Next(_L("Exporting vcard")); |
|
418 |
|
419 TheIds->Reset(); |
|
420 TheIds->AddL(1); |
|
421 store = CDirectFileStore::ReplaceLC(TheFs,_L("c:\\ttVersitoutb.vcf"),EFileWrite); |
|
422 store->SetTypeL(KDirectFileStoreLayoutUid); |
|
423 id = outstream.CreateLC(*store); |
|
424 uid.iUid=KUidVCardConvDefaultImpl; |
|
425 itemCount=TheItems->Count(); |
|
426 db->ExportSelectedContactsL(uid,*TheIds,outstream,CContactDatabase::ETTFormat); |
|
427 outstream.CommitL(); |
|
428 store->SetRootL(id); |
|
429 store->CommitL(); |
|
430 CleanupStack::PopAndDestroy(2); // store+ oustream |
|
431 /** |
|
432 @SYMTestCaseID PIM-T-TTVERS-0002 |
|
433 @SYMTestType UT |
|
434 @SYMTestPriority High |
|
435 @SYMDEF INC056117 |
|
436 @SYMTestCaseDesc To verify that the incorrect behaviour described in INC056117 |
|
437 no longer exists. |
|
438 @SYMTestActions A vCard is imported where the N, ADR;WORK, EMAIL;INTERNET, |
|
439 TITLE, ORG, NOTE, URL, ROLE and FN property values all have > 255 characters. |
|
440 @SYMTestExpectedResults The vCard is correctly imported i.e. properties which |
|
441 map to text fields with maximum of 255 characters are truncated and no overflow |
|
442 occurs in the DBMS component (leading to a panic in the test case). Further |
|
443 sanity checks are made to ensure that the contacts database contains the |
|
444 expected number of contacts (2), that the number of CContactItem objects in |
|
445 TheItems3 is as expected (1) and that the UID string for the CContactItem |
|
446 object in TheItems3 is as expected ("BBB"). |
|
447 */ |
|
448 test.Next(_L("@SYMTESTCaseID:PIM-T-TTVERS-0002 Import vCard with property values > 255 characters")); |
|
449 |
|
450 RReadStream stream3; |
|
451 vtest3->Stream3LC(stream3); |
|
452 stream3.PushL(); |
|
453 TheItems3=db->ImportContactsL(vcardmode,stream3,success,CContactDatabase::EIncludeX); |
|
454 test(success); |
|
455 CleanupStack::PopAndDestroy(2); // stream3,store |
|
456 test(db->CountL()==2); |
|
457 test(TheItems3->Count()==1); |
|
458 test((*TheItems3)[0]->UidStringL(0x0)==_L("BBB")); |
|
459 |
|
460 if (TheItems) |
|
461 TheItems->ResetAndDestroy(); |
|
462 delete TheItems; |
|
463 if (TheItems2) |
|
464 TheItems2->ResetAndDestroy(); |
|
465 delete TheItems2; |
|
466 if (TheItems3) |
|
467 TheItems3->ResetAndDestroy(); |
|
468 delete TheItems3; |
|
469 |
|
470 CleanupStack::PopAndDestroy(4); // TheIds, vtest, vtest2, vtest3 |
|
471 // |
|
472 ExportImportTestL(); |
|
473 // |
|
474 CntTest->CloseDatabase(); |
|
475 User::After(1000000); |
|
476 CntTest->DeleteDatabaseL(); |
|
477 CleanupStack::PopAndDestroy(2); // FS, TempFiles |
|
478 } |
|
479 |
|
480 GLDEF_C TInt E32Main() |
|
481 { |
|
482 __UHEAP_MARK; |
|
483 CntTest=new(ELeave) CCntTest; |
|
484 CntTest->ConstructL(test,KDatabaseFileName); |
|
485 TRAPD(err,DoTestsL()); |
|
486 CntTest->EndTestLib(err); |
|
487 |
|
488 __UHEAP_MARKEND; |
|
489 return KErrNone; |
|
490 } |