sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: RTest TheTest(_L("t_sqldb64 test")); sl@0: RFs TheFs; sl@0: RSqlDatabase TheDb; sl@0: RSqlStatement TheStmt; sl@0: sl@0: _LIT(KTestDbName1, "\\test\\t_sqldb64_1.db"); sl@0: sl@0: const TInt64 K1Mb = 1024LL * 1024LL; sl@0: const TInt64 K1Gb = 1024LL * K1Mb; sl@0: const TInt64 K4Gb = 4LL * K1Gb; sl@0: sl@0: TInt64 TheLastInsertedRowid = -1LL; sl@0: sl@0: struct TTestDriveInfo sl@0: { sl@0: TInt iSizeMb; sl@0: TBool iWritable; sl@0: }; sl@0: sl@0: TTestDriveInfo TheDriveInfo[KMaxDrives]; sl@0: TInt TheBiggestDriveNo = -1; sl@0: TFileName TheDbName; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: void DeleteTestFiles() sl@0: { sl@0: TheStmt.Close(); sl@0: TheDb.Close(); sl@0: (void)RSqlDatabase::Delete(TheDbName); sl@0: } sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: //Test macros and functions sl@0: void Check(TInt aValue, TInt aLine) sl@0: { sl@0: if(!aValue) sl@0: { sl@0: DeleteTestFiles(); sl@0: TheTest(EFalse, aLine); sl@0: } sl@0: } sl@0: void Check(TInt aValue, TInt aExpected, TInt aLine) sl@0: { sl@0: if(aValue != aExpected) sl@0: { sl@0: DeleteTestFiles(); sl@0: RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); sl@0: TheTest(EFalse, aLine); sl@0: } sl@0: } sl@0: #define TEST(arg) ::Check((arg), __LINE__) sl@0: #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: void CreateTestEnv() sl@0: { sl@0: TInt err = TheFs.Connect(); sl@0: TEST2(err, KErrNone); sl@0: } sl@0: sl@0: void SqlTimerPrint(const TDesC& aText, TUint32 aStartTicks, TUint32 aEndTicks) sl@0: { sl@0: static TInt freq = 0; sl@0: if(freq == 0) sl@0: { sl@0: TEST2(HAL::Get(HAL::EFastCounterFrequency, freq), KErrNone); sl@0: } sl@0: TInt64 diffTicks = (TInt64)aEndTicks - (TInt64)aStartTicks; sl@0: if(diffTicks < 0) sl@0: { sl@0: diffTicks = KMaxTUint32 + diffTicks + 1; sl@0: } sl@0: const TInt KMicroSecIn1Sec = 1000000; sl@0: TInt32 us = (diffTicks * KMicroSecIn1Sec) / freq; sl@0: TheTest.Printf(_L("#### %S. Execution time: %d us\r\n"), &aText, us); sl@0: } sl@0: sl@0: TUint32 SqlTimerTicks() sl@0: { sl@0: return User::FastCounter(); sl@0: } sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-SQL-CT-4129 sl@0: @SYMTestCaseDesc Creation of a database bigger than 4Gb (KMaxTUint). sl@0: The test creates a test database with a table and inserts records into the table sl@0: until the database size gets bigger than 4Gb (KMaxTUint). The purpose of the test is to verify sl@0: that it is possible to create and manipulate 64-bit databases. sl@0: @SYMTestActions Creation of a database bigger than 4Gb (KMaxTUint). sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMTestPriority Medium sl@0: @SYMREQ REQ12104 sl@0: REQ12105 sl@0: */ sl@0: void CreateBigDbTest(const TDesC& aDbName, TInt64 aDbSize) sl@0: { sl@0: __ASSERT_ALWAYS(aDbSize > 0LL, User::Invariant()); sl@0: (void)RSqlDatabase::Delete(aDbName); sl@0: _LIT8(KConfig, "encoding=\"UTF-8\""); sl@0: TInt err = TheDb.Create(aDbName, &KConfig); sl@0: TEST2(err, KErrNone); sl@0: // sl@0: err = TheDb.Exec(_L8("CREATE TABLE A(Id INTEGER PRIMARY KEY AUTOINCREMENT, Data BLOB)")); sl@0: TEST2(err, 1); sl@0: TInt64 fsize = 0; sl@0: TheTest.Printf(_L("==File size:")); sl@0: while(fsize < aDbSize) sl@0: { sl@0: const TInt KRecCnt = 1000; sl@0: //Insert KRecCnt records in a transaction sl@0: err = TheDb.Exec(_L8("BEGIN")); sl@0: if(err < 0) sl@0: { sl@0: TheTest.Printf(_L("==='BEGIN' has failed with err %d\r\n"), err); sl@0: } sl@0: TEST(err >= 0); sl@0: err = TheStmt.Prepare(TheDb, _L8("INSERT INTO A(Data) VALUES(zeroblob(32768))"));//32Kb big blob sl@0: TEST2(err, KErrNone); sl@0: for(TInt i=0;i= 0); sl@0: TheLastInsertedRowid = TheDb.LastInsertedRowId(); sl@0: TEST(TheLastInsertedRowid > 0LL); sl@0: //Check and print the file size sl@0: TheDb.Close(); sl@0: RFile64 file; sl@0: err = file.Open(TheFs, aDbName, EFileRead | EFileWrite); sl@0: TEST2(err, KErrNone); sl@0: err = file.Size(fsize); sl@0: TEST2(err, KErrNone); sl@0: file.Close(); sl@0: TheTest.Printf(_L(" %ldMb"), fsize / K1Mb); sl@0: err = TheDb.Open(aDbName); sl@0: TEST2(err, KErrNone); sl@0: } sl@0: TheTest.Printf(_L("\r\n")); sl@0: // sl@0: TheDb.Close(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-SQL-CT-4130 sl@0: @SYMTestCaseDesc SQL operations on a 64-bit database. sl@0: The test uses the database created in test case PDS-SQL-UT-4129. sl@0: Simple INSERT, UPDATE, DELETE and SELECT statements are executed on the database. sl@0: The data in the test SQL statements is such that the manipulated records are beyond the 4Gb sl@0: file offset. Some other of the test SQL statements will perform sequential scan of the whole sl@0: database from offset 0 to the end of the database file. sl@0: The purpose of the test is to verify that there are no problem if the database offset is 64-bit. sl@0: @SYMTestActions SQL operations on a 64-bit database. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMTestPriority Medium sl@0: @SYMREQ REQ12104 sl@0: REQ12105 sl@0: */ sl@0: void SimpleDbOperationsTestL(const TDesC& aDbName) sl@0: { sl@0: __ASSERT_ALWAYS(TheLastInsertedRowid > 0LL, User::Invariant()); sl@0: TInt err = TheDb.Open(aDbName); sl@0: TEST2(err, KErrNone); sl@0: //SELECT-1 sl@0: TUint32 start = SqlTimerTicks(); sl@0: err = TheStmt.Prepare(TheDb, _L8("SELECT Id FROM A WHERE ROWID = :Prm")); sl@0: TEST2(err, KErrNone); sl@0: err = TheStmt.BindInt64(0, TheLastInsertedRowid - 1LL); sl@0: TEST2(err, KErrNone); sl@0: err = TheStmt.Next(); sl@0: TEST2(err, KSqlAtRow); sl@0: TInt64 id = TheStmt.ColumnInt64(0); sl@0: TheTest.Printf(_L("==Id=%ld\r\n"), id); sl@0: TheStmt.Close(); sl@0: TUint32 end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("SELECT-1"), start, end); sl@0: //INSERT sl@0: start = SqlTimerTicks(); sl@0: err = TheDb.Exec(_L("INSERT INTO A(Data) VALUES('123456')")); sl@0: TEST2(err, 1); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("INSERT"), start, end); sl@0: //UPDATE sl@0: start = SqlTimerTicks(); sl@0: TBuf<100> sql; sl@0: sql.Format(_L("UPDATE A SET Data='56789' WHERE Id=%ld"), id); sl@0: err = TheDb.Exec(sql); sl@0: TEST2(err, 1); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("UPDATE"), start, end); sl@0: //SELECT-2 sl@0: start = SqlTimerTicks(); sl@0: TSqlScalarFullSelectQuery scalarQuery(TheDb); sl@0: sql.Format(_L("SELECT Data FROM A WHERE ID = %ld"), id); sl@0: TBuf<32> buf; sl@0: err = scalarQuery.SelectTextL(sql, buf); sl@0: TEST2(err, KErrNone); sl@0: err = buf.Compare(_L("56789")); sl@0: TEST2(err, 0); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("SELECT-2"), start, end); sl@0: //SELECT-3 sl@0: start = SqlTimerTicks(); sl@0: sql.Format(_L("SELECT COUNT(*) FROM A")); sl@0: TInt recCnt = scalarQuery.SelectIntL(sql); sl@0: TheTest.Printf(_L("==Records count: %d\r\n"), recCnt); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("SELECT-3"), start, end); sl@0: TEST(recCnt > 0); sl@0: //SELECT-4 sl@0: start = SqlTimerTicks(); sl@0: sql.Format(_L("SELECT MAX(ROWID) FROM A")); sl@0: TInt rowid = scalarQuery.SelectIntL(sql); sl@0: TheTest.Printf(_L("==MAX(ROWID): %d\r\n"), rowid); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("SELECT-4"), start, end); sl@0: TEST(rowid > 0); sl@0: //DELETE sl@0: start = SqlTimerTicks(); sl@0: sql.Format(_L("DELETE FROM A WHERE ID = %ld"), id); sl@0: err = TheDb.Exec(sql); sl@0: TEST2(err, 1); sl@0: end = SqlTimerTicks(); sl@0: SqlTimerPrint(_L("DELETE"), start, end); sl@0: // sl@0: TheDb.Close(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-SQL-CT-4145 sl@0: @SYMTestCaseDesc RSqlDatabase::Size() on a 64-bit database. sl@0: The test uses the database created in test case PDS-SQL-UT-4129, opens the database sl@0: and calls the Size() methods. The first Size() call should fail with KErrTooBig error, sl@0: because the database size is over 2Gb and cannot fit in the 32-bit integer result of the call. sl@0: The second call of the overloaded Size() method should correctly report the database size. sl@0: @SYMTestActions RSqlDatabase::Size() on a 64-bit database. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMTestPriority Medium sl@0: @SYMREQ REQ12105 sl@0: */ sl@0: void SizeTest(const TDesC& aDbName) sl@0: { sl@0: __ASSERT_ALWAYS(TheLastInsertedRowid > 0LL, User::Invariant()); sl@0: TInt err = TheDb.Open(aDbName); sl@0: TEST2(err, KErrNone); sl@0: //Size-1 sl@0: TInt size = TheDb.Size(); sl@0: TEST2(size, KErrTooBig); sl@0: //Size-2 sl@0: RSqlDatabase::TSize size2; sl@0: err = TheDb.Size(size2); sl@0: TEST2(err, KErrNone); sl@0: TEST(size2.iSize > K4Gb); sl@0: // sl@0: TheDb.Close(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-SQL-CT-4146 sl@0: @SYMTestCaseDesc Background compaction on a 64-bit database. sl@0: The test uses the database created in test case PDS-SQL-UT-4129 and opens the database. sl@0: Iteration 1: sl@0: The test executes a DELETE sql statement that deletes couple of records. The freed disk space sl@0: is big enough to kick-off the background compaction. The test waits couple of seconds and then sl@0: checks the database size and free space to verify that the background compaction really compacted sl@0: the database. sl@0: Iteration 2: sl@0: Iteration 2 is the same as iteration 1, but the freed database space is such that the following sl@0: background compaction will shrink the database size to be less than 4Gb. sl@0: After iteration 2 the test performs an INSERT transaction and increases the database size to be sl@0: bigger than 4Gb. sl@0: @SYMTestActions Background compaction on a 64-bit database. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMTestPriority Medium sl@0: @SYMREQ REQ12105 sl@0: */ sl@0: void BackgroundCompactionTest(const TDesC& aDbName) sl@0: { sl@0: __ASSERT_ALWAYS(TheLastInsertedRowid > 0LL, User::Invariant()); sl@0: TInt err = TheDb.Open(aDbName); sl@0: TEST2(err, KErrNone); sl@0: const TInt64 KDelRecCnt[2] = {10LL, 2400LL}; sl@0: for(TInt i=0;i<2;++i) sl@0: { sl@0: TheTest.Printf(_L("=========== Iteration %d ===========\r\n"), i + 1); sl@0: //Size-1 sl@0: RSqlDatabase::TSize size; sl@0: err = TheDb.Size(size); sl@0: TEST2(err, KErrNone); sl@0: TEST(size.iSize > K4Gb); sl@0: TheTest.Printf(_L(" ==Before DELETE, database size=%ldKb\r\n"), size.iSize / 1024LL); sl@0: //Delete records sl@0: TBuf<100> sql; sl@0: sql.Format(_L("DELETE FROM A WHERE ROWID > %ld AND ROWID < %ld"), TheLastInsertedRowid - KDelRecCnt[i], TheLastInsertedRowid); sl@0: err = TheDb.Exec(sql); sl@0: TEST(err > 0); sl@0: //Size-2 sl@0: err = TheDb.Size(size); sl@0: TEST2(err, KErrNone); sl@0: TEST(size.iSize > K4Gb); sl@0: TEST(size.iFree > (50 * 1024)); sl@0: TheTest.Printf(_L(" ==After DELETE, database size=%ldKb, free space=%ldKb\r\n"), size.iSize / 1024LL, size.iFree / 1024LL); sl@0: //Wait some time (to allow the background compaction to run) sl@0: const TInt KOneSecond = 1000000; sl@0: const TInt KMaxWaitTime = 300 * KOneSecond;//300 sec == 5 min sl@0: TInt waitTime = 0; sl@0: while(waitTime < KMaxWaitTime) sl@0: { sl@0: const TInt KWaitStep = 5 * KOneSecond; sl@0: User::After(KWaitStep); sl@0: //Check the size sl@0: err = TheDb.Size(size); sl@0: TEST2(err, KErrNone); sl@0: if(size.iFree == 0) sl@0: { sl@0: break; sl@0: } sl@0: waitTime += KWaitStep; sl@0: TheTest.Printf(_L(" ==After %3d sec, database size=%ldKb, free space=%ldKb\r\n"), waitTime / KOneSecond, size.iSize / 1024LL, size.iFree / 1024LL); sl@0: } sl@0: if(i == 0) sl@0: { sl@0: TEST(size.iSize > K4Gb); sl@0: } sl@0: else sl@0: { sl@0: TEST(size.iSize < K4Gb); sl@0: } sl@0: TEST2(size.iFree, 0); sl@0: //Records count sl@0: sql.Format(_L("SELECT COUNT(*) FROM A")); sl@0: TSqlScalarFullSelectQuery q(TheDb); sl@0: TInt recCnt = -1; sl@0: TRAP(err, recCnt = q.SelectIntL(sql)); sl@0: TEST2(err, KErrNone); sl@0: TheTest.Printf(_L(" ==Records count: %d\r\n"), recCnt); sl@0: TEST(recCnt > 0); sl@0: } sl@0: TheTest.Printf(_L("==Increase the database size above 4Gb\r\n")); sl@0: //Insert KRecCnt records in a transaction sl@0: const TInt KRecCnt = 2500; sl@0: err = TheDb.Exec(_L8("BEGIN")); sl@0: TEST(err >= 0); sl@0: err = TheStmt.Prepare(TheDb, _L8("INSERT INTO A(Data) VALUES(zeroblob(32768))"));//32Kb big blob sl@0: TEST2(err, KErrNone); sl@0: for(TInt i=0;i= 0); sl@0: //Size sl@0: RSqlDatabase::TSize size2; sl@0: err = TheDb.Size(size2); sl@0: TEST2(err, KErrNone); sl@0: TEST(size2.iSize > K4Gb); sl@0: TheTest.Printf(_L(" ==Database size=%ldKb\r\n"), size2.iSize / 1024LL); sl@0: // sl@0: TheDb.Close(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-SQL-CT-4131 sl@0: @SYMTestCaseDesc Deleting database bigger than 4Gb (KMaxTUint). sl@0: The test deletes the database created in test case PDS-SQL-UT-4129. sl@0: @SYMTestActions Deleting database bigger than 4Gb (KMaxTUint). sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMTestPriority Medium sl@0: @SYMREQ REQ12104 sl@0: REQ12105 sl@0: */ sl@0: void DeleteBigDbTest() sl@0: { sl@0: TInt err = RSqlDatabase::Delete(TheDbName); sl@0: TEST2(err, KErrNone); sl@0: } sl@0: sl@0: void CollectDriveInfo() sl@0: { sl@0: TheTest.Printf(_L("==================\r\n")); sl@0: _LIT(KType1, "Not present"); sl@0: _LIT(KType2, "Unknown"); sl@0: _LIT(KType3, "Floppy"); sl@0: _LIT(KType4, "Hard disk"); sl@0: _LIT(KType5, "CD ROM"); sl@0: _LIT(KType6, "RAM disk"); sl@0: _LIT(KType7, "Flash"); sl@0: _LIT(KType8, "ROM drive"); sl@0: _LIT(KType9, "Remote drive"); sl@0: _LIT(KType10,"NAND flash"); sl@0: _LIT(KType11,"Rotating media"); sl@0: sl@0: Mem::FillZ(TheDriveInfo, sizeof(TheDriveInfo)); sl@0: TheBiggestDriveNo = 0; sl@0: sl@0: for(TInt drive=EDriveA;drive<=EDriveZ;++drive) sl@0: { sl@0: TDriveInfo driveInfo; sl@0: TInt err = TheFs.Drive(driveInfo, drive); sl@0: if(err == KErrNone) sl@0: { sl@0: TVolumeInfo vinfo; sl@0: err = TheFs.Volume(vinfo, drive); sl@0: if(err == KErrNone) sl@0: { sl@0: TVolumeIOParamInfo vparam; sl@0: err = TheFs.VolumeIOParam(drive, vparam); sl@0: TEST2(err, KErrNone); sl@0: TBuf8<128> vinfoex8; sl@0: err = TheFs.QueryVolumeInfoExt(drive, EFileSystemSubType, vinfoex8); sl@0: TEST2(err, KErrNone); sl@0: TPtrC vinfoex((const TUint16*)(vinfoex8.Ptr() + 8), vinfoex8[0]); sl@0: TPtrC KMediaTypeNames[] = {KType1(), KType2(), KType3(), KType4(), KType5(), KType6(), KType7(), KType8(), KType9(), KType10(), KType11()}; sl@0: TInt sizeMb = vinfo.iSize / K1Mb; sl@0: TheTest.Printf(_L("Drive: %C:, Type: %16.16S, File System: %8.8S, Size: %d Mb.\r\n"), 'A' + drive, &KMediaTypeNames[driveInfo.iType], &vinfoex, sizeMb); sl@0: TheTest.Printf(_L(" Block size=%d, Cluster size=%d, Read buffer size=%d.\r\n"), vparam.iBlockSize, vparam.iClusterSize, vparam.iRecReadBufSize); sl@0: TheDriveInfo[drive].iSizeMb = sizeMb; sl@0: if(driveInfo.iType == EMediaRam || driveInfo.iType == EMediaHardDisk || driveInfo.iType == EMediaFlash || driveInfo.iType == EMediaNANDFlash) sl@0: { sl@0: TheDriveInfo[drive].iWritable = ETrue; sl@0: if(sizeMb > TheDriveInfo[TheBiggestDriveNo].iSizeMb) sl@0: { sl@0: TheBiggestDriveNo = drive; sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: TheTest.Printf(_L("Drive %C. RFs::Volume() has failed with err=%d.\r\n"), 'A' + drive, err); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: TheTest.Printf(_L("Drive %C. RFs::Drive() has failed with err=%d.\r\n"), 'A' + drive, err); sl@0: } sl@0: } sl@0: sl@0: TheTest.Printf(_L("The biggest R/W drive is: %C, Size: %d Mb\r\n"), 'A' + TheBiggestDriveNo, TheDriveInfo[TheBiggestDriveNo].iSizeMb); sl@0: TDriveUnit drvUnit(TheBiggestDriveNo); sl@0: TDriveName drvName = drvUnit.Name(); sl@0: TParse parse; sl@0: parse.Set(KTestDbName1, &drvName, NULL); sl@0: TheDbName.Copy(parse.FullName()); sl@0: sl@0: TRAPD(err, BaflUtils::EnsurePathExistsL(TheFs, TheDbName)); sl@0: TEST(err == KErrNone || err == KErrAlreadyExists); sl@0: sl@0: TheTest.Printf(_L("==================\r\n")); sl@0: } sl@0: sl@0: void DoTestsL() sl@0: { sl@0: TheTest.Start(_L("Collect drive information")); sl@0: CollectDriveInfo(); sl@0: sl@0: TInt64 maxDrvSize = TheDriveInfo[TheBiggestDriveNo].iSizeMb * K1Mb; sl@0: if(maxDrvSize <= K4Gb) sl@0: { sl@0: TheTest.Printf(_L("There is no drive bigger than 4Gb. The tests won't be executed.\r\n")); sl@0: return; sl@0: } sl@0: sl@0: TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4129 Create database, bigger than 4Gb")); sl@0: CreateBigDbTest(TheDbName, K4Gb + 64 * K1Mb); sl@0: sl@0: TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-CT-4130 64-bit database - simple operations test")); sl@0: SimpleDbOperationsTestL(TheDbName); sl@0: sl@0: TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-CT-4145 64-bit database - Size() test")); sl@0: SizeTest(TheDbName); sl@0: sl@0: TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-CT-4146 64-bit database - background compaction test")); sl@0: BackgroundCompactionTest(TheDbName); sl@0: sl@0: TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-CT-4131 Delete 64-bit database test")); sl@0: DeleteBigDbTest(); sl@0: } sl@0: sl@0: TInt E32Main() sl@0: { sl@0: TheTest.Title(); sl@0: sl@0: CTrapCleanup* tc = CTrapCleanup::New(); sl@0: TheTest(tc != NULL); sl@0: sl@0: __UHEAP_MARK; sl@0: sl@0: CreateTestEnv(); sl@0: DeleteTestFiles(); sl@0: TRAPD(err, DoTestsL()); sl@0: DeleteTestFiles(); sl@0: TheFs.Close(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: __UHEAP_MARKEND; sl@0: sl@0: TheTest.End(); sl@0: TheTest.Close(); sl@0: sl@0: delete tc; sl@0: sl@0: User::Heap().Check(); sl@0: return KErrNone; sl@0: }