os/ossrv/lowlevellibsandfws/apputils/tsrc/T_BaflDefect.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2005-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 <f32file.h>
sl@0
    17
#include <e32test.h>
sl@0
    18
#include <bautils.h>
sl@0
    19
#include <hal.h>
sl@0
    20
#include <e32std.h>
sl@0
    21
#include <e32math.h>
sl@0
    22
sl@0
    23
#include "backup_std.h"
sl@0
    24
sl@0
    25
LOCAL_D CTrapCleanup*		TheTrapCleanup=NULL;
sl@0
    26
LOCAL_D CActiveScheduler*	TheActiveScheduler=NULL;
sl@0
    27
sl@0
    28
LOCAL_D RTest				TheTest (_L("T_BaflDefect"));
sl@0
    29
LOCAL_D RFs					TheFs;
sl@0
    30
sl@0
    31
_LIT(KServerLauncherProcess, "T_BackupServerLauncher");
sl@0
    32
_LIT(KServerName, "!BackupServer");
sl@0
    33
_LIT(KBURServerName,"baksrvs");
sl@0
    34
sl@0
    35
class RIpcServerCloseTest : public RSessionBase
sl@0
    36
{
sl@0
    37
public: // Constructors and destructor
sl@0
    38
sl@0
    39
	/**
sl@0
    40
	* Constructor for performing 1st stage construction
sl@0
    41
	*/
sl@0
    42
	RIpcServerCloseTest();
sl@0
    43
sl@0
    44
	/**
sl@0
    45
	* Destructor.
sl@0
    46
	*/
sl@0
    47
	~RIpcServerCloseTest();
sl@0
    48
sl@0
    49
	/**
sl@0
    50
	* Performs test steps
sl@0
    51
	*/
sl@0
    52
	void RunTestL(const TDesC& aTargetSrvName, TInt aNumber, TInt aArgCount);
sl@0
    53
};
sl@0
    54
sl@0
    55
RIpcServerCloseTest::RIpcServerCloseTest()
sl@0
    56
	{
sl@0
    57
	// No implementation required
sl@0
    58
	}
sl@0
    59
sl@0
    60
RIpcServerCloseTest::~RIpcServerCloseTest()
sl@0
    61
	{
sl@0
    62
	Close();	
sl@0
    63
	}
sl@0
    64
sl@0
    65
void RIpcServerCloseTest::RunTestL(const TDesC& aTargetSrvName, TInt aNumber, TInt aArgCount)
sl@0
    66
	{
sl@0
    67
	TVersion version(0,0,0);
sl@0
    68
	TInt err = KErrNotFound;
sl@0
    69
	TInt numberOfAttempts = 3;
sl@0
    70
	
sl@0
    71
	while(err!=KErrNone && numberOfAttempts>0)
sl@0
    72
		{
sl@0
    73
		err = CreateSession(aTargetSrvName, version, 200);
sl@0
    74
sl@0
    75
		if(err!=KErrNone)
sl@0
    76
			{
sl@0
    77
			// wait then try again if err!=0
sl@0
    78
			TheTest.Printf(_L("CreateSession returned: %d"), err);
sl@0
    79
			User::After(1000000);
sl@0
    80
			numberOfAttempts--;
sl@0
    81
			}
sl@0
    82
		}
sl@0
    83
	
sl@0
    84
	TheTest(err == KErrNone);
sl@0
    85
	
sl@0
    86
	HBufC8* buf = HBufC8::NewLC(255);
sl@0
    87
	TPtr8 ptr = buf->Des();
sl@0
    88
	ptr.Fill(Math::Random(),255);
sl@0
    89
		
sl@0
    90
	TIpcArgs args;
sl@0
    91
		
sl@0
    92
	for(TInt i = 0; i < aArgCount ;i++)
sl@0
    93
		{
sl@0
    94
		args.Set(i,&ptr);
sl@0
    95
		}
sl@0
    96
	
sl@0
    97
	TheTest.Printf(_L("Sending request to: %d with %d args"), aNumber, aArgCount);
sl@0
    98
	
sl@0
    99
	TRequestStatus status;
sl@0
   100
	
sl@0
   101
	SendReceive(aNumber, args, status);
sl@0
   102
	
sl@0
   103
	User::WaitForRequest(status);
sl@0
   104
	
sl@0
   105
	TheTest.Printf(_L("Status value from sending request: %d with %d args"), status.Int(), aArgCount);
sl@0
   106
	
sl@0
   107
	TheTest(status.Int() == KErrNotSupported);
sl@0
   108
sl@0
   109
	CleanupStack::PopAndDestroy(buf);
sl@0
   110
	}
sl@0
   111
sl@0
   112
//This function is used in the test code to kill backupSrv or the backuplauncher process.
sl@0
   113
// It creates a separate process to do this as killing a process requires
sl@0
   114
// PwrMgmt capability which we don't want to grant to all test exes.
sl@0
   115
TInt KillProcess(const TDesC& aProcessName)
sl@0
   116
	{
sl@0
   117
	_LIT(KProcessKiller, "t_processkiller");
sl@0
   118
	TRequestStatus stat;
sl@0
   119
	RProcess p;
sl@0
   120
	TInt result = p.Create(KProcessKiller, aProcessName);
sl@0
   121
	
sl@0
   122
	if(result == KErrNone)
sl@0
   123
		{
sl@0
   124
		// Asynchronous logon: completes when process terminates with process exit code
sl@0
   125
		p.Logon(stat);
sl@0
   126
		p.Resume();
sl@0
   127
sl@0
   128
		User::WaitForRequest(stat);
sl@0
   129
		result = p.ExitReason();
sl@0
   130
		p.Close();			
sl@0
   131
		}
sl@0
   132
sl@0
   133
	return result;
sl@0
   134
	}
sl@0
   135
sl@0
   136
TInt LaunchServer(RProcess& aServer)
sl@0
   137
	{	
sl@0
   138
	TheTest.Printf(_L("Launching BackupServer...\n"));
sl@0
   139
	
sl@0
   140
	TInt err = aServer.Create(KServerLauncherProcess, _L(""));
sl@0
   141
	TheTest(err == KErrNone);
sl@0
   142
	     
sl@0
   143
	//Start server and wait until it is running
sl@0
   144
	TRequestStatus serverStat;
sl@0
   145
	aServer.SetJustInTime(false);   
sl@0
   146
	aServer.Resume(); 
sl@0
   147
		   
sl@0
   148
	aServer.Rendezvous(serverStat);
sl@0
   149
	User::WaitForRequest(serverStat);
sl@0
   150
		
sl@0
   151
	err = serverStat.Int();
sl@0
   152
		 
sl@0
   153
	return err;
sl@0
   154
	}
sl@0
   155
sl@0
   156
/**
sl@0
   157
@SYMTestCaseID          SYSLIB-BAFL-UT-4052
sl@0
   158
@SYMTestCaseDesc        Tests BackupServer crashes under IPC fuzzing and freezes phone 
sl@0
   159
@SYMTestPriority        High
sl@0
   160
@SYMTestActions         Calls BackupServer with EBakOpCodeCloseServer with 0-4 args. Verifies that server returns KErrNotSupported.
sl@0
   161
@SYMTestExpectedResults Server should not process the  CloseServer message and should return KErrNotSupported
sl@0
   162
*/
sl@0
   163
LOCAL_C void Defect_INC120743L()
sl@0
   164
    {
sl@0
   165
	TheTest.Next (_L ("Defect_INC120743L"));
sl@0
   166
    
sl@0
   167
	__UHEAP_MARK;
sl@0
   168
	
sl@0
   169
    RProcess server;
sl@0
   170
    TInt messageToTest = EBakOpCodeCloseServer;
sl@0
   171
sl@0
   172
    //Clean up any chance of launcher or baksrvs still running
sl@0
   173
    TInt err = KillProcess(KServerLauncherProcess);
sl@0
   174
    if((err != KErrNotFound)&&(err != KErrDied))
sl@0
   175
    	{
sl@0
   176
    	User::LeaveIfError(err);	
sl@0
   177
    	}
sl@0
   178
sl@0
   179
    err = KillProcess(KBURServerName);
sl@0
   180
    if((err != KErrNotFound)&&(err != KErrDied))
sl@0
   181
    	{
sl@0
   182
    	User::LeaveIfError(err);	
sl@0
   183
    	}
sl@0
   184
    
sl@0
   185
    TInt startedFlag = LaunchServer(server);
sl@0
   186
    
sl@0
   187
    TheTest.Printf(_L("LaunchServer has returned: %d"), startedFlag);
sl@0
   188
    
sl@0
   189
    TheTest(startedFlag == 0 || startedFlag == KErrAlreadyExists);
sl@0
   190
    
sl@0
   191
 	CTrapCleanup* cleanup=CTrapCleanup::New();
sl@0
   192
   	err=KErrNoMemory;
sl@0
   193
sl@0
   194
   	if (cleanup)
sl@0
   195
   		{
sl@0
   196
		//Carry out each test with number of arguments 1 - 4
sl@0
   197
		for(TInt argCount = 0; argCount <= 4; argCount++)
sl@0
   198
			{
sl@0
   199
			RIpcServerCloseTest closeTest;
sl@0
   200
		
sl@0
   201
			TRAP(err,closeTest.RunTestL(KServerName, messageToTest, argCount));
sl@0
   202
		
sl@0
   203
			closeTest.Close();
sl@0
   204
			}
sl@0
   205
sl@0
   206
   		delete cleanup;
sl@0
   207
   		}
sl@0
   208
        
sl@0
   209
	__UHEAP_MARKEND;
sl@0
   210
    }
sl@0
   211
sl@0
   212
/**
sl@0
   213
@SYMTestCaseID          SYSLIB-BAFL-CT-1390
sl@0
   214
@SYMTestCaseDesc        Tests BaflUtils::PersistScreenCalibration
sl@0
   215
@SYMTestPriority        Medium
sl@0
   216
@SYMTestActions         Deletes screen calibration file, calls PersistScreenCalibration()
sl@0
   217
and checks that file now exists
sl@0
   218
@SYMTestExpectedResults Test must not fail
sl@0
   219
@SYMREQ                 REQ0000
sl@0
   220
*/
sl@0
   221
void Defect_DEF068052L()
sl@0
   222
	{
sl@0
   223
	TheTest.Next (_L (" @SYMTestCaseID:SYSLIB-BAFL-CT-1390 Defect_DEF068052L "));
sl@0
   224
sl@0
   225
    __UHEAP_MARK;
sl@0
   226
sl@0
   227
	User::LeaveIfError (TheFs.Connect ());
sl@0
   228
	::CleanupClosePushL (TheFs);
sl@0
   229
sl@0
   230
	const TInt KDriveLength = 2;
sl@0
   231
	const TInt KScreenPathLength = 26;
sl@0
   232
	const TInt KScreenPathLengthTemp = 30;
sl@0
   233
sl@0
   234
	_LIT (KDriveColon, ":");
sl@0
   235
	_LIT (KScreen, "\\System\\Data\\Screen.DAT");
sl@0
   236
	_LIT (KScreenTemp, "\\System\\Data\\ScreenTemp.DAT");
sl@0
   237
sl@0
   238
	// Find the system drive
sl@0
   239
	TDriveNumber systemDrive = TheFs.GetSystemDrive();
sl@0
   240
sl@0
   241
	// Set up a full file path name incorporating the system drive
sl@0
   242
	// (for example if system drive is EDriveC pathname will be:
sl@0
   243
	// C:\System\Data\Screen.DAT)
sl@0
   244
	TBuf<KDriveLength+KScreenPathLength> screenFilePath;
sl@0
   245
	screenFilePath.Append(systemDrive + 'A');
sl@0
   246
	screenFilePath.Append(KDriveColon);
sl@0
   247
	screenFilePath.Append(KScreen);
sl@0
   248
sl@0
   249
	// Set up a full file path name to make a copy of the screen.dat
sl@0
   250
	// file.
sl@0
   251
	TBuf<KDriveLength+KScreenPathLengthTemp> screenFilePathTemp;
sl@0
   252
	screenFilePathTemp.Append(systemDrive + 'A');
sl@0
   253
	screenFilePathTemp.Append(KDriveColon);
sl@0
   254
	screenFilePathTemp.Append(KScreenTemp);
sl@0
   255
sl@0
   256
	// Make a copy of the screen.dat file (if it exists)
sl@0
   257
	BaflUtils::CopyFile(TheFs, screenFilePath, screenFilePathTemp);
sl@0
   258
sl@0
   259
	// Delete the Screen.DAT file (if it exists)
sl@0
   260
	BaflUtils::DeleteFile(TheFs, screenFilePath);
sl@0
   261
sl@0
   262
	// Saving Screen settings - call API to write the screen
sl@0
   263
	// calibration to file
sl@0
   264
	TDigitizerCalibration calib;
sl@0
   265
	BaflUtils::PersistScreenCalibration(calib);
sl@0
   266
sl@0
   267
	// Check if screen.dat file now exists
sl@0
   268
	TBool exists = BaflUtils::FileExists(TheFs, screenFilePath);
sl@0
   269
	TheTest(exists);
sl@0
   270
sl@0
   271
	TheTest.Printf(_L("Screen settings were saved in %S\n"), &screenFilePath);
sl@0
   272
sl@0
   273
	// Cleaning up, restore files to original state
sl@0
   274
	User::LeaveIfError(BaflUtils::DeleteFile(TheFs, screenFilePath));
sl@0
   275
	BaflUtils::CopyFile(TheFs, screenFilePathTemp, screenFilePath);
sl@0
   276
	BaflUtils::DeleteFile(TheFs, screenFilePathTemp);
sl@0
   277
	CleanupStack::PopAndDestroy (&::TheFs);
sl@0
   278
sl@0
   279
	__UHEAP_MARKEND;
sl@0
   280
	}
sl@0
   281
sl@0
   282
/**
sl@0
   283
@SYMTestCaseID          SYSLIB-BAFL-CT-0487
sl@0
   284
@SYMTestCaseDesc        Tests for defect number INC045169L
sl@0
   285
@SYMTestPriority        High
sl@0
   286
@SYMTestActions         Tests for creation of files
sl@0
   287
@SYMTestExpectedResults Tests must not fail
sl@0
   288
@SYMREQ                 REQ0000
sl@0
   289
*/
sl@0
   290
void Defect_INC045169L()
sl@0
   291
	{
sl@0
   292
	TheTest.Next (_L (" @SYMTestCaseID:SYSLIB-BAFL-CT-0487 Defect_INC045169L "));
sl@0
   293
sl@0
   294
	__UHEAP_MARK;
sl@0
   295
sl@0
   296
  	// find out the number of open handles
sl@0
   297
	TInt startProcessHandleCount;
sl@0
   298
	TInt startThreadHandleCount;
sl@0
   299
	RThread ().HandleCount (startProcessHandleCount, startThreadHandleCount);
sl@0
   300
sl@0
   301
	//
sl@0
   302
	// The Test Setup
sl@0
   303
sl@0
   304
	User::LeaveIfError (TheFs.Connect ());
sl@0
   305
	::CleanupClosePushL (TheFs);
sl@0
   306
sl@0
   307
	//
sl@0
   308
	// The Test Begins...
sl@0
   309
sl@0
   310
sl@0
   311
	// Our test diectory and files...
sl@0
   312
	_LIT (KDirectory, "C:\\System\\Data\\");
sl@0
   313
sl@0
   314
	// ++++++++++++++
sl@0
   315
sl@0
   316
	// When creating test file names be careful to use different
sl@0
   317
	// combinations of charaters as you may get ambiguity!
sl@0
   318
	// i.e. '.aaa' will find files '.a' or 'a' if on disk.
sl@0
   319
	// similarly, 'abc158' will find files 'abc' or 'abc.'.
sl@0
   320
	// Also, file name ending in a period will have them
sl@0
   321
	// stripped off by the Fs, so 'abcd.' will give you 'abcd'
sl@0
   322
	// Finally, don't have like names like 'abc.rsc' and 'abc.r'
sl@0
   323
sl@0
   324
	// Failure cases
sl@0
   325
	_LIT (KFilename1, "c:"); // not supported
sl@0
   326
	_LIT (KFilename2, "x"); // not supported
sl@0
   327
	_LIT (KFilename3, "C:\\System\\Data\\a"); // not supported
sl@0
   328
	_LIT (KFilename4, "C:\\System\\Data\\ab"); // not supported
sl@0
   329
	_LIT (KFilename5, "C:\\System\\Data\\i.j"); // no 'i.01' available
sl@0
   330
	_LIT (KFilename6, "C:\\System\\Data\\abc.r12345678901234567890"); // suffix too large
sl@0
   331
	_LIT (KFilename7, "C:\\System\\Data\\"); // not supported
sl@0
   332
sl@0
   333
	// Successful cases
sl@0
   334
	_LIT (KFilename10, "C:\\System\\Data\\cde");
sl@0
   335
	_LIT (KFilename11, "C:\\System\\Data\\abc158");
sl@0
   336
	_LIT (KFilename12, "C:\\System\\Data\\C01abc001");
sl@0
   337
	_LIT (KFilename13, "C:\\System\\Data\\0123456789.012");
sl@0
   338
	_LIT (KFilename14, "C:\\System\\Data\\0123");
sl@0
   339
	_LIT (KFilename15, "C:\\System\\Data\\0123456789012");
sl@0
   340
	_LIT (KFilename16, "C:\\System\\Data\\C.01a1");
sl@0
   341
	_LIT (KFilename17, "C:\\System\\Data\\C.a0a1");
sl@0
   342
	_LIT (KFilename18, "C:\\System\\Data\\.b");
sl@0
   343
	_LIT (KFilename19, "C:\\System\\Data\\.ccc");
sl@0
   344
	_LIT (KFilename20, "C:\\System\\Data\\rfg.3a");
sl@0
   345
	_LIT (KFilename21, "C:\\System\\Data\\abc.r158");
sl@0
   346
	_LIT (KFilename22, "C:\\System\\Data\\abc.rsc");
sl@0
   347
	_LIT (KFilename23, "C:\\System\\Data\\efg.r");
sl@0
   348
	_LIT (KFilename24, "C:\\System\\Data\\klmn.");
sl@0
   349
	_LIT (KFilename25, "C:\\System\\Data\\jhgdfgd.123456789abc");
sl@0
   350
	_LIT (KFilename26, "\\abc.r158");
sl@0
   351
	_LIT (KFilename27, "abc.r158");
sl@0
   352
	_LIT (KFilename28, "c:abc.r158");
sl@0
   353
sl@0
   354
	// ++++++++++++++
sl@0
   355
sl@0
   356
	// ELangAmerican
sl@0
   357
	_LIT (KLocale, "ELOCL.10");
sl@0
   358
	_LIT (KNearestLang, "C:\\System\\Data\\abc.r10");
sl@0
   359
sl@0
   360
	// Tidy the files if there...
sl@0
   361
	// KFilename1 can't be created
sl@0
   362
	BaflUtils::DeleteFile (TheFs, KFilename2);
sl@0
   363
	BaflUtils::DeleteFile (TheFs, KFilename3);
sl@0
   364
	BaflUtils::DeleteFile (TheFs, KFilename4);
sl@0
   365
	BaflUtils::DeleteFile (TheFs, KFilename5);
sl@0
   366
	BaflUtils::DeleteFile (TheFs, KFilename6);
sl@0
   367
sl@0
   368
 	// Do not delete KFileName7, there may be other
sl@0
   369
 	// files in this directory unrelated to this test
sl@0
   370
 	// which are required by other tests.
sl@0
   371
 	// See defect DEF108808
sl@0
   372
 	// BaflUtils::DeleteFile (TheFs, KFilename7);
sl@0
   373
sl@0
   374
	BaflUtils::DeleteFile (TheFs, KFilename10);
sl@0
   375
	BaflUtils::DeleteFile (TheFs, KFilename11);
sl@0
   376
	BaflUtils::DeleteFile (TheFs, KFilename12);
sl@0
   377
	BaflUtils::DeleteFile (TheFs, KFilename13);
sl@0
   378
	BaflUtils::DeleteFile (TheFs, KFilename14);
sl@0
   379
	BaflUtils::DeleteFile (TheFs, KFilename15);
sl@0
   380
	BaflUtils::DeleteFile (TheFs, KFilename16);
sl@0
   381
	BaflUtils::DeleteFile (TheFs, KFilename17);
sl@0
   382
	BaflUtils::DeleteFile (TheFs, KFilename18);
sl@0
   383
	BaflUtils::DeleteFile (TheFs, KFilename19);
sl@0
   384
	BaflUtils::DeleteFile (TheFs, KFilename20);
sl@0
   385
	BaflUtils::DeleteFile (TheFs, KFilename21);
sl@0
   386
	BaflUtils::DeleteFile (TheFs, KFilename22);
sl@0
   387
	BaflUtils::DeleteFile (TheFs, KFilename23);
sl@0
   388
#ifdef __EPOC32__
sl@0
   389
	BaflUtils::DeleteFile (TheFs, KFilename24);
sl@0
   390
#else
sl@0
   391
	// Windows strips off trailing periods
sl@0
   392
	BaflUtils::DeleteFile (TheFs, _L("C:\\System\\Data\\klmn"));
sl@0
   393
#endif
sl@0
   394
	BaflUtils::DeleteFile (TheFs, KFilename25);
sl@0
   395
	BaflUtils::DeleteFile (TheFs, KFilename26);
sl@0
   396
	BaflUtils::DeleteFile (TheFs, KFilename27);
sl@0
   397
	BaflUtils::DeleteFile (TheFs, KFilename28);
sl@0
   398
	BaflUtils::DeleteFile (TheFs, KNearestLang);
sl@0
   399
sl@0
   400
	// Confirm the prerequisites for this test...
sl@0
   401
	if (!BaflUtils::PathExists (TheFs, KDirectory))
sl@0
   402
		{
sl@0
   403
		BaflUtils::EnsurePathExistsL(TheFs, KDirectory);
sl@0
   404
		}
sl@0
   405
sl@0
   406
	// KFilename1 can't be created
sl@0
   407
	TheTest (BaflUtils::FileExists (TheFs, KFilename2) == EFalse);
sl@0
   408
	TheTest (BaflUtils::FileExists (TheFs, KFilename3) == EFalse);
sl@0
   409
	TheTest (BaflUtils::FileExists (TheFs, KFilename4) == EFalse);
sl@0
   410
	TheTest (BaflUtils::FileExists (TheFs, KFilename5) == EFalse);
sl@0
   411
	TheTest (BaflUtils::FileExists (TheFs, KFilename6) == EFalse);
sl@0
   412
	// KFilename7 can't be created, not a file
sl@0
   413
sl@0
   414
	TheTest (BaflUtils::FileExists (TheFs, KFilename10) == EFalse);
sl@0
   415
	TheTest (BaflUtils::FileExists (TheFs, KFilename11) == EFalse);
sl@0
   416
	TheTest (BaflUtils::FileExists (TheFs, KFilename12) == EFalse);
sl@0
   417
	TheTest (BaflUtils::FileExists (TheFs, KFilename13) == EFalse);
sl@0
   418
	TheTest (BaflUtils::FileExists (TheFs, KFilename14) == EFalse);
sl@0
   419
	TheTest (BaflUtils::FileExists (TheFs, KFilename15) == EFalse);
sl@0
   420
	TheTest (BaflUtils::FileExists (TheFs, KFilename16) == EFalse);
sl@0
   421
	TheTest (BaflUtils::FileExists (TheFs, KFilename17) == EFalse);
sl@0
   422
	TheTest (BaflUtils::FileExists (TheFs, KFilename18) == EFalse);
sl@0
   423
	TheTest (BaflUtils::FileExists (TheFs, KFilename19) == EFalse);
sl@0
   424
	TheTest (BaflUtils::FileExists (TheFs, KFilename20) == EFalse);
sl@0
   425
	TheTest (BaflUtils::FileExists (TheFs, KFilename21) == EFalse);
sl@0
   426
	TheTest (BaflUtils::FileExists (TheFs, KFilename22) == EFalse);
sl@0
   427
	TheTest (BaflUtils::FileExists (TheFs, KFilename23) == EFalse);
sl@0
   428
	TheTest (BaflUtils::FileExists (TheFs, KFilename24) == EFalse);
sl@0
   429
	TheTest (BaflUtils::FileExists (TheFs, KFilename25) == EFalse);
sl@0
   430
	TheTest (BaflUtils::FileExists (TheFs, KFilename26) == EFalse);
sl@0
   431
	TheTest (BaflUtils::FileExists (TheFs, KFilename27) == EFalse);
sl@0
   432
	TheTest (BaflUtils::FileExists (TheFs, KFilename28) == EFalse);
sl@0
   433
	TheTest (BaflUtils::FileExists (TheFs, KNearestLang) == EFalse);
sl@0
   434
sl@0
   435
	// Create the files...
sl@0
   436
	RFile rFile;
sl@0
   437
	// KFilename1 can't be created
sl@0
   438
	rFile.Create (TheFs, KFilename2, EFileRead);
sl@0
   439
	rFile.Close ();
sl@0
   440
	rFile.Create (TheFs, KFilename3, EFileRead);
sl@0
   441
	rFile.Close ();
sl@0
   442
	rFile.Create (TheFs, KFilename4, EFileRead);
sl@0
   443
	rFile.Close ();
sl@0
   444
	rFile.Create (TheFs, KFilename5, EFileRead);
sl@0
   445
	rFile.Close ();
sl@0
   446
	rFile.Create (TheFs, KFilename6, EFileRead);
sl@0
   447
	rFile.Close ();
sl@0
   448
	rFile.Create (TheFs, KFilename7, EFileRead);
sl@0
   449
	rFile.Close ();
sl@0
   450
sl@0
   451
	rFile.Create (TheFs, KFilename10, EFileRead);
sl@0
   452
	rFile.Close ();
sl@0
   453
	rFile.Create (TheFs, KFilename11, EFileRead);
sl@0
   454
	rFile.Close ();
sl@0
   455
	rFile.Create (TheFs, KFilename12, EFileRead);
sl@0
   456
	rFile.Close ();
sl@0
   457
	rFile.Create (TheFs, KFilename13, EFileRead);
sl@0
   458
	rFile.Close ();
sl@0
   459
	rFile.Create (TheFs, KFilename14, EFileRead);
sl@0
   460
	rFile.Close ();
sl@0
   461
	rFile.Create (TheFs, KFilename15, EFileRead);
sl@0
   462
	rFile.Close ();
sl@0
   463
	rFile.Create (TheFs, KFilename16, EFileRead);
sl@0
   464
	rFile.Close ();
sl@0
   465
	rFile.Create (TheFs, KFilename17, EFileRead);
sl@0
   466
	rFile.Close ();
sl@0
   467
	rFile.Create (TheFs, KFilename18, EFileRead);
sl@0
   468
	rFile.Close ();
sl@0
   469
	rFile.Create (TheFs, KFilename19, EFileRead);
sl@0
   470
	rFile.Close ();
sl@0
   471
	rFile.Create (TheFs, KFilename20, EFileRead);
sl@0
   472
	rFile.Close ();
sl@0
   473
	rFile.Create (TheFs, KFilename21, EFileRead);
sl@0
   474
	rFile.Close ();
sl@0
   475
	rFile.Create (TheFs, KFilename22, EFileRead);
sl@0
   476
	rFile.Close ();
sl@0
   477
	rFile.Create (TheFs, KFilename23, EFileRead);
sl@0
   478
	rFile.Close ();
sl@0
   479
	rFile.Create (TheFs, KFilename24, EFileRead);
sl@0
   480
	rFile.Close ();
sl@0
   481
	rFile.Create (TheFs, KFilename25, EFileRead);
sl@0
   482
	rFile.Close ();
sl@0
   483
	rFile.Create (TheFs, KFilename26, EFileRead);
sl@0
   484
	rFile.Close ();
sl@0
   485
	rFile.Create (TheFs, KFilename27, EFileRead);
sl@0
   486
	rFile.Close ();
sl@0
   487
	rFile.Create (TheFs, KFilename28, EFileRead);
sl@0
   488
	rFile.Close ();
sl@0
   489
	rFile.Create (TheFs, KNearestLang, EFileRead);
sl@0
   490
	rFile.Close ();
sl@0
   491
sl@0
   492
	TBuf <256> filename (KFilename1);
sl@0
   493
sl@0
   494
	// Test the defect...
sl@0
   495
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   496
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename1, &filename);
sl@0
   497
	TheTest(filename == KFilename1);
sl@0
   498
sl@0
   499
	filename.Copy (KFilename2);
sl@0
   500
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   501
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename2, &filename);
sl@0
   502
	TheTest(filename == _L("x"));
sl@0
   503
sl@0
   504
	filename.Copy (KFilename3);
sl@0
   505
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   506
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename3, &filename);
sl@0
   507
	TheTest(filename == KFilename3);
sl@0
   508
sl@0
   509
	filename.Copy (KFilename4);
sl@0
   510
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   511
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename4, &filename);
sl@0
   512
	TheTest(filename == KFilename4);
sl@0
   513
sl@0
   514
	filename.Copy (KFilename5);
sl@0
   515
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   516
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename5, &filename);
sl@0
   517
	TheTest(filename == KFilename5);
sl@0
   518
sl@0
   519
	filename.Copy (KFilename6);
sl@0
   520
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   521
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename6, &filename);
sl@0
   522
	TheTest(filename == KFilename6);
sl@0
   523
sl@0
   524
	filename.Copy (KFilename7);
sl@0
   525
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   526
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename7, &filename);
sl@0
   527
	TheTest(filename == KFilename7);
sl@0
   528
sl@0
   529
sl@0
   530
sl@0
   531
	filename.Copy (KFilename10);
sl@0
   532
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   533
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename10, &filename);
sl@0
   534
	TheTest(filename == KFilename10);
sl@0
   535
sl@0
   536
	filename.Copy (KFilename11);
sl@0
   537
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   538
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename11, &filename);
sl@0
   539
	TheTest(filename == KFilename11);
sl@0
   540
sl@0
   541
	filename.Copy (KFilename12);
sl@0
   542
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   543
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename12, &filename);
sl@0
   544
	TheTest(filename == KFilename12);
sl@0
   545
sl@0
   546
	filename.Copy (KFilename13);
sl@0
   547
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   548
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename13, &filename);
sl@0
   549
	TheTest(filename == KFilename13);
sl@0
   550
sl@0
   551
	filename.Copy (KFilename14);
sl@0
   552
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   553
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename14, &filename);
sl@0
   554
	TheTest(filename == KFilename14);
sl@0
   555
sl@0
   556
	filename.Copy (KFilename15);
sl@0
   557
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   558
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename15, &filename);
sl@0
   559
	TheTest(filename == KFilename15);
sl@0
   560
sl@0
   561
	filename.Copy (KFilename16);
sl@0
   562
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   563
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename16, &filename);
sl@0
   564
	TheTest(filename == KFilename16);
sl@0
   565
sl@0
   566
	filename.Copy (KFilename17);
sl@0
   567
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   568
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename17, &filename);
sl@0
   569
	TheTest(filename == KFilename17);
sl@0
   570
sl@0
   571
	filename.Copy (KFilename18);
sl@0
   572
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   573
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename18, &filename);
sl@0
   574
	TheTest(filename == KFilename18);
sl@0
   575
sl@0
   576
	filename.Copy (KFilename19);
sl@0
   577
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   578
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename19, &filename);
sl@0
   579
	TheTest(filename == KFilename19);
sl@0
   580
sl@0
   581
	filename.Copy (KFilename20);
sl@0
   582
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   583
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename20, &filename);
sl@0
   584
	TheTest(filename == KFilename20);
sl@0
   585
sl@0
   586
	filename.Copy (KFilename21);
sl@0
   587
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   588
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename21, &filename);
sl@0
   589
	TheTest(filename == KFilename21);
sl@0
   590
sl@0
   591
	filename.Copy (KFilename22);
sl@0
   592
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   593
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename22, &filename);
sl@0
   594
	TheTest(filename == KFilename22);
sl@0
   595
sl@0
   596
	filename.Copy (KFilename23);
sl@0
   597
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   598
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename23, &filename);
sl@0
   599
	TheTest(filename == KFilename23);
sl@0
   600
sl@0
   601
	filename.Copy (KFilename24);
sl@0
   602
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   603
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename24, &filename);
sl@0
   604
	TheTest(filename == KFilename24);
sl@0
   605
sl@0
   606
	filename.Copy (KFilename25);
sl@0
   607
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   608
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename25, &filename);
sl@0
   609
	TheTest(filename == KFilename25);
sl@0
   610
sl@0
   611
	filename.Copy (KFilename26);
sl@0
   612
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   613
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename26, &filename);
sl@0
   614
	TheTest(filename == KFilename26);
sl@0
   615
sl@0
   616
	filename.Copy (KFilename27);
sl@0
   617
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   618
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename27, &filename);
sl@0
   619
	TheTest(filename == KFilename27);
sl@0
   620
sl@0
   621
	filename.Copy (KFilename28);
sl@0
   622
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   623
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename28, &filename);
sl@0
   624
	TheTest(filename == KFilename28);
sl@0
   625
sl@0
   626
sl@0
   627
	// Store the original locale settings so they can be restored at the
sl@0
   628
	// end of the test.
sl@0
   629
sl@0
   630
	TExtendedLocale originalLocale;
sl@0
   631
	originalLocale.LoadSystemSettings();
sl@0
   632
sl@0
   633
	// Change locale
sl@0
   634
	TExtendedLocale newLocale;
sl@0
   635
	TBuf<50> libraryName;
sl@0
   636
sl@0
   637
	libraryName.Format(KLocale);
sl@0
   638
sl@0
   639
	TInt err = newLocale.LoadLocale(libraryName);
sl@0
   640
	User::LeaveIfError (err);
sl@0
   641
sl@0
   642
	newLocale.SaveSystemSettings();
sl@0
   643
	User::After (5000000);
sl@0
   644
sl@0
   645
	filename.Copy (KFilename1);
sl@0
   646
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   647
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename1, &filename);
sl@0
   648
	TheTest(filename == KFilename1);
sl@0
   649
sl@0
   650
	filename.Copy (KFilename2);
sl@0
   651
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   652
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename2, &filename);
sl@0
   653
	TheTest(filename == _L("x"));
sl@0
   654
sl@0
   655
	filename.Copy (KFilename3);
sl@0
   656
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   657
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename3, &filename);
sl@0
   658
	TheTest(filename == KFilename3);
sl@0
   659
sl@0
   660
	filename.Copy (KFilename4);
sl@0
   661
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   662
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename4, &filename);
sl@0
   663
	TheTest(filename == KFilename4);
sl@0
   664
sl@0
   665
	filename.Copy (KFilename5);
sl@0
   666
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   667
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename5, &filename);
sl@0
   668
	TheTest(filename == KFilename5);
sl@0
   669
sl@0
   670
	filename.Copy (KFilename6);
sl@0
   671
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   672
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename6, &filename);
sl@0
   673
	TheTest(filename == KFilename6);
sl@0
   674
sl@0
   675
	filename.Copy (KFilename7);
sl@0
   676
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   677
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename7, &filename);
sl@0
   678
	TheTest(filename == KFilename7);
sl@0
   679
sl@0
   680
sl@0
   681
sl@0
   682
	filename.Copy (KFilename10);
sl@0
   683
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   684
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename10, &filename);
sl@0
   685
	TheTest(filename == KFilename10);
sl@0
   686
sl@0
   687
	filename.Copy (KFilename11);
sl@0
   688
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   689
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename11, &filename);
sl@0
   690
	TheTest(filename == KFilename11);
sl@0
   691
sl@0
   692
	filename.Copy (KFilename12);
sl@0
   693
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   694
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename12, &filename);
sl@0
   695
	TheTest(filename == KFilename12);
sl@0
   696
sl@0
   697
	filename.Copy (KFilename13);
sl@0
   698
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   699
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename13, &filename);
sl@0
   700
	TheTest(filename == KFilename13);
sl@0
   701
sl@0
   702
	filename.Copy (KFilename14);
sl@0
   703
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   704
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename14, &filename);
sl@0
   705
	TheTest(filename == KFilename14);
sl@0
   706
sl@0
   707
	filename.Copy (KFilename15);
sl@0
   708
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   709
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename15, &filename);
sl@0
   710
	TheTest(filename == KFilename15);
sl@0
   711
sl@0
   712
	filename.Copy (KFilename16);
sl@0
   713
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   714
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename16, &filename);
sl@0
   715
	TheTest(filename == KFilename16);
sl@0
   716
sl@0
   717
	filename.Copy (KFilename17);
sl@0
   718
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   719
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename17, &filename);
sl@0
   720
	TheTest(filename == KFilename17);
sl@0
   721
sl@0
   722
	filename.Copy (KFilename18);
sl@0
   723
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   724
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename18, &filename);
sl@0
   725
	TheTest(filename == KFilename18);
sl@0
   726
sl@0
   727
	filename.Copy (KFilename19);
sl@0
   728
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   729
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename19, &filename);
sl@0
   730
	TheTest(filename == KFilename19);
sl@0
   731
sl@0
   732
	filename.Copy (KFilename20);
sl@0
   733
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   734
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename20, &filename);
sl@0
   735
	TheTest(filename == KFilename20);
sl@0
   736
sl@0
   737
	filename.Copy (KFilename21);
sl@0
   738
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   739
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename21, &filename);
sl@0
   740
	TheTest(filename == KNearestLang);
sl@0
   741
sl@0
   742
	filename.Copy (KFilename22);
sl@0
   743
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   744
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename22, &filename);
sl@0
   745
	TheTest(filename == KNearestLang);
sl@0
   746
sl@0
   747
	filename.Copy (KFilename23);
sl@0
   748
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   749
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename23, &filename);
sl@0
   750
	TheTest(filename == KFilename23);
sl@0
   751
sl@0
   752
	filename.Copy (KFilename24);
sl@0
   753
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   754
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename24, &filename);
sl@0
   755
	TheTest(filename == KFilename24);
sl@0
   756
sl@0
   757
	filename.Copy (KFilename25);
sl@0
   758
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   759
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename25, &filename);
sl@0
   760
	TheTest(filename == KFilename25);
sl@0
   761
sl@0
   762
	filename.Copy (KFilename26);
sl@0
   763
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   764
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename26, &filename);
sl@0
   765
	TheTest(filename == KFilename26);
sl@0
   766
sl@0
   767
	filename.Copy (KFilename27);
sl@0
   768
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   769
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename27, &filename);
sl@0
   770
	TheTest(filename == KFilename27);
sl@0
   771
sl@0
   772
	filename.Copy (KFilename28);
sl@0
   773
	BaflUtils::NearestLanguageFile (TheFs, filename);
sl@0
   774
	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KFilename28, &filename);
sl@0
   775
	TheTest(filename == KFilename28);
sl@0
   776
sl@0
   777
	// Tidy the files...
sl@0
   778
	// KFilename1 can't be created
sl@0
   779
	BaflUtils::DeleteFile (TheFs, KFilename2);
sl@0
   780
	BaflUtils::DeleteFile (TheFs, KFilename3);
sl@0
   781
	BaflUtils::DeleteFile (TheFs, KFilename4);
sl@0
   782
	BaflUtils::DeleteFile (TheFs, KFilename5);
sl@0
   783
	BaflUtils::DeleteFile (TheFs, KFilename6);
sl@0
   784
sl@0
   785
	// Do not delete KFileName7, there may be other
sl@0
   786
 	// files in this directory unrelated to this test
sl@0
   787
 	// which are required by other tests.
sl@0
   788
 	// See defect DEF108808
sl@0
   789
 	// BaflUtils::DeleteFile (TheFs, KFilename7);
sl@0
   790
sl@0
   791
	BaflUtils::DeleteFile (TheFs, KFilename10);
sl@0
   792
	BaflUtils::DeleteFile (TheFs, KFilename11);
sl@0
   793
	BaflUtils::DeleteFile (TheFs, KFilename12);
sl@0
   794
	BaflUtils::DeleteFile (TheFs, KFilename13);
sl@0
   795
	BaflUtils::DeleteFile (TheFs, KFilename14);
sl@0
   796
	BaflUtils::DeleteFile (TheFs, KFilename15);
sl@0
   797
	BaflUtils::DeleteFile (TheFs, KFilename16);
sl@0
   798
	BaflUtils::DeleteFile (TheFs, KFilename17);
sl@0
   799
	BaflUtils::DeleteFile (TheFs, KFilename18);
sl@0
   800
	BaflUtils::DeleteFile (TheFs, KFilename19);
sl@0
   801
	BaflUtils::DeleteFile (TheFs, KFilename20);
sl@0
   802
	BaflUtils::DeleteFile (TheFs, KFilename21);
sl@0
   803
	BaflUtils::DeleteFile (TheFs, KFilename22);
sl@0
   804
	BaflUtils::DeleteFile (TheFs, KFilename23);
sl@0
   805
#ifdef __EPOC32__
sl@0
   806
	BaflUtils::DeleteFile (TheFs, KFilename24);
sl@0
   807
#else
sl@0
   808
	// Windows strips off trailing periods
sl@0
   809
	BaflUtils::DeleteFile (TheFs, _L("C:\\System\\Data\\klmn"));
sl@0
   810
#endif
sl@0
   811
	BaflUtils::DeleteFile (TheFs, KFilename25);
sl@0
   812
	BaflUtils::DeleteFile (TheFs, KFilename26);
sl@0
   813
	BaflUtils::DeleteFile (TheFs, KFilename27);
sl@0
   814
	BaflUtils::DeleteFile (TheFs, KFilename28);
sl@0
   815
	BaflUtils::DeleteFile (TheFs, KNearestLang);
sl@0
   816
sl@0
   817
	// Restore the original locale settings.
sl@0
   818
  	originalLocale.SaveSystemSettings();
sl@0
   819
sl@0
   820
	CleanupStack::PopAndDestroy (&::TheFs);
sl@0
   821
sl@0
   822
	// The Test Ends...
sl@0
   823
	//
sl@0
   824
sl@0
   825
	// check that no handles have leaked
sl@0
   826
	TInt endProcessHandleCount;
sl@0
   827
	TInt endThreadHandleCount;
sl@0
   828
	RThread ().HandleCount (endProcessHandleCount, endThreadHandleCount);
sl@0
   829
sl@0
   830
	TheTest (startThreadHandleCount == endThreadHandleCount);
sl@0
   831
sl@0
   832
	__UHEAP_MARKEND;
sl@0
   833
	}
sl@0
   834
sl@0
   835
//===============================================================================
sl@0
   836
sl@0
   837
/**
sl@0
   838
Initialise the cleanup stack and active scheduler
sl@0
   839
*/
sl@0
   840
LOCAL_C void SetupL ()
sl@0
   841
    {
sl@0
   842
	TheTrapCleanup = CTrapCleanup::New ();
sl@0
   843
	User::LeaveIfNull (TheTrapCleanup);
sl@0
   844
sl@0
   845
	// Construct and install the active scheduler
sl@0
   846
	TheActiveScheduler = new (ELeave) CActiveScheduler;
sl@0
   847
	CActiveScheduler::Install (TheActiveScheduler);
sl@0
   848
	}
sl@0
   849
sl@0
   850
/**
sl@0
   851
Cleanup
sl@0
   852
*/
sl@0
   853
LOCAL_C void CleanupL ()
sl@0
   854
    {
sl@0
   855
	delete TheActiveScheduler;
sl@0
   856
	delete TheTrapCleanup;
sl@0
   857
	}
sl@0
   858
sl@0
   859
sl@0
   860
/**
sl@0
   861
Invoke the tests
sl@0
   862
*/
sl@0
   863
LOCAL_C void DoTestsL ()
sl@0
   864
    {
sl@0
   865
	Defect_INC045169L ();
sl@0
   866
	Defect_DEF068052L ();
sl@0
   867
	
sl@0
   868
	Defect_INC120743L ();
sl@0
   869
	}
sl@0
   870
sl@0
   871
GLDEF_C TInt E32Main ()
sl@0
   872
	{
sl@0
   873
	__UHEAP_MARK;
sl@0
   874
sl@0
   875
	TheTest.Printf (_L ("\n"));
sl@0
   876
	TheTest.Title ();
sl@0
   877
	TheTest.Start (_L("Defect Tests "));
sl@0
   878
sl@0
   879
	TRAPD (err, SetupL ());
sl@0
   880
	TheTest (err == KErrNone);
sl@0
   881
sl@0
   882
	TRAP (err, DoTestsL ());
sl@0
   883
	TheTest (err == KErrNone);
sl@0
   884
sl@0
   885
	CleanupL ();
sl@0
   886
sl@0
   887
	TheTest.End ();
sl@0
   888
	TheTest.Close ();
sl@0
   889
sl@0
   890
	__UHEAP_MARKEND;
sl@0
   891
	return (KErrNone);
sl@0
   892
	}