kerneltest/f32test/server/t_locate.cpp
changeset 109 b3a1d9898418
parent 90 947f0dc9f7a8
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
    99 	TheFs.SetErrorCondition(-47,5);
    99 	TheFs.SetErrorCondition(-47,5);
   100 	TDriveInfo drive;
   100 	TDriveInfo drive;
   101 	for (TInt i=0;i<5;i++)
   101 	for (TInt i=0;i<5;i++)
   102 		{
   102 		{
   103 		TInt r=TheFs.Drive(drive);
   103 		TInt r=TheFs.Drive(drive);
   104 		test(r==KErrNone);
   104 		test_KErrNone(r);
   105 		}
   105 		}
   106 	TInt r=TheFs.MkDirAll(_L("alskdjfl"));
   106 	TInt r=TheFs.MkDirAll(_L("alskdjfl"));
   107 	test(r==-47);
   107 	test_Value(r, r == -47);
   108 	r=TheFs.MkDirAll(_L("alskdjfl"));
   108 	r=TheFs.MkDirAll(_L("alskdjfl"));
   109 	test(r==-47);
   109 	test_Value(r, r == -47);
   110 	TheFs.SetErrorCondition(KErrNone);
   110 	TheFs.SetErrorCondition(KErrNone);
   111 	r=TheFs.Drive(drive);
   111 	r=TheFs.Drive(drive);
   112 	test(r==KErrNone);
   112 	test_KErrNone(r);
   113 #endif
   113 #endif
   114 //
   114 //
   115 	test.Next(_L("Create LOCTEST files"));
   115 	test.Next(_L("Create LOCTEST files"));
   116 	Mf(_L("\\F32-TST\\LOCTEST\\FILE1.AAA"));
   116 	Mf(_L("\\F32-TST\\LOCTEST\\FILE1.AAA"));
   117 	Mf(_L("\\F32-TST\\LOCTEST\\FILE2.BBB"));
   117 	Mf(_L("\\F32-TST\\LOCTEST\\FILE2.BBB"));
   150     TInt err;
   150     TInt err;
   151     TDriveList driveList;
   151     TDriveList driveList;
   152     TDriveInfo info;
   152     TDriveInfo info;
   153 
   153 
   154 	 err = TheFs.DriveList(driveList);
   154 	 err = TheFs.DriveList(driveList);
   155     test( err == KErrNone );
   155     test_KErrNone(err);
   156     
   156     
   157     for (TInt i = 0; i < KMaxDrives; i++) 
   157     for (TInt i = 0; i < KMaxDrives; i++) 
   158         {
   158         {
   159         
   159         
   160         if (driveList[i]) 
   160         if (driveList[i]) 
   161             {
   161             {
   162             err = TheFs.Drive(info, i);
   162             err = TheFs.Drive(info, i);
   163             test( err == KErrNone ); 
   163             test_KErrNone(err); 
   164                         
   164                         
   165             if(( info.iDriveAtt  & KDriveAttRemovable ) && !( info.iDriveAtt  & KDriveAttLogicallyRemovable ))  
   165             if(( info.iDriveAtt  & KDriveAttRemovable ) && !( info.iDriveAtt  & KDriveAttLogicallyRemovable ))  
   166             	{
   166             	{
   167 								
   167 								
   168 				if ( ( info.iType != EMediaNotPresent) && (info.iType != EMediaUnknown) && (info.iType != EMediaCdRom) )
   168 				if ( ( info.iType != EMediaNotPresent) && (info.iType != EMediaUnknown) && (info.iType != EMediaCdRom) )
   196     TInt err;
   196     TInt err;
   197     TDriveList driveList;
   197     TDriveList driveList;
   198     TDriveInfo info;
   198     TDriveInfo info;
   199 
   199 
   200 	 err = TheFs.DriveList(driveList);
   200 	 err = TheFs.DriveList(driveList);
   201     test( err == KErrNone );
   201     test_KErrNone(err);
   202     
   202     
   203     for (TInt i = 0; i < KMaxDrives; i++) 
   203     for (TInt i = 0; i < KMaxDrives; i++) 
   204         {
   204         {
   205         
   205         
   206         if (driveList[i]) 
   206         if (driveList[i]) 
   207             {
   207             {
   208             err = TheFs.Drive(info, i);
   208             err = TheFs.Drive(info, i);
   209             test( err == KErrNone ); 
   209             test_KErrNone(err); 
   210                         
   210                         
   211             if( info.iDriveAtt  & KDriveAttInternal  ) 
   211             if( info.iDriveAtt  & KDriveAttInternal  ) 
   212             	{			
   212             	{			
   213 				
   213 				
   214 				TheFs.DriveToChar(i,internalDriveLetter) ;
   214 				TheFs.DriveToChar(i,internalDriveLetter) ;
   246 	
   246 	
   247 		TFileName gPathRem;
   247 		TFileName gPathRem;
   248 		gPathRem.Append (removableDriveLetter);
   248 		gPathRem.Append (removableDriveLetter);
   249 		gPathRem.Append (_L(":\\F32-TST\\") );
   249 		gPathRem.Append (_L(":\\F32-TST\\") );
   250 		TInt r=fMan->RmDir(gPathRem);
   250 		TInt r=fMan->RmDir(gPathRem);
   251 		test(r==KErrNone);
   251 		test_KErrNone(r);
   252 	
   252 	
   253 		delete fMan;
   253 		delete fMan;
   254 		}
   254 		}
   255 	}
   255 	}
   256 
   256 
   267 	
   267 	
   268 		TFileName gPathInt;
   268 		TFileName gPathInt;
   269 		gPathInt.Append (internalDriveLetter);
   269 		gPathInt.Append (internalDriveLetter);
   270 		gPathInt.Append (_L(":\\F32-TST\\") );
   270 		gPathInt.Append (_L(":\\F32-TST\\") );
   271 		TInt r=fMan->RmDir(gPathInt);
   271 		TInt r=fMan->RmDir(gPathInt);
   272 		test(r==KErrNone);
   272 		test_KErrNone(r);
   273 	
   273 	
   274 		delete fMan;
   274 		delete fMan;
   275 		}
   275 		}
   276 	}
   276 	}
   277 
   277 
   283 	
   283 	
   284 	
   284 	
   285 	TInt r=TheFs.AddFileSystem(_L("CFAFSDLY"));
   285 	TInt r=TheFs.AddFileSystem(_L("CFAFSDLY"));
   286 	test.Printf(_L("Add remote file system\n"));
   286 	test.Printf(_L("Add remote file system\n"));
   287 	test.Printf(_L("AddFileSystem returned %d\n"),r);
   287 	test.Printf(_L("AddFileSystem returned %d\n"),r);
   288 	test (r==KErrNone || r==KErrAlreadyExists);
   288 	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
   289 
   289 
   290 
   290 
   291 	r=TheFs.MountFileSystem(_L("DELAYFS"),EDriveQ);
   291 	r=TheFs.MountFileSystem(_L("DELAYFS"),EDriveQ);
   292 
   292 
   293 	
   293 	
   294 	test.Printf(_L("Mount remote file system\n"));
   294 	test.Printf(_L("Mount remote file system\n"));
   295 	test.Printf(_L("MountFileSystem returned %d\n"),r);
   295 	test.Printf(_L("MountFileSystem returned %d\n"),r);
   296 	test(r==KErrNone || r==KErrCorrupt || r==KErrNotReady || r==KErrAlreadyExists);
   296 	test_Value(r, r == KErrNone || r==KErrCorrupt || r==KErrNotReady || r==KErrAlreadyExists);
   297 
   297 
   298 	
   298 	
   299 	Mf(_L("Q:\\F32-TST\\LOCTEST\\BIN\\FINDFILE.AAA"));
   299 	Mf(_L("Q:\\F32-TST\\LOCTEST\\BIN\\FINDFILE.AAA"));
   300 
   300 
   301 	}
   301 	}
   309  	
   309  	
   310  	TInt r=TheFs.DismountFileSystem(_L("DELAYFS"),EDriveQ);
   310  	TInt r=TheFs.DismountFileSystem(_L("DELAYFS"),EDriveQ);
   311  	 
   311  	 
   312  	test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r);
   312  	test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r);
   313  	
   313  	
   314  	test(r==KErrNone );
   314  	test_KErrNone(r);
   315 	}
   315 	}
   316 
   316 
   317 
   317 
   318 	
   318 	
   319 
   319 
   324 	{
   324 	{
   325 	test.Next(_L("Test FindByPath"));
   325 	test.Next(_L("Test FindByPath"));
   326 	
   326 	
   327 	TAutoClose<RFs> fs;
   327 	TAutoClose<RFs> fs;
   328 	TInt r=fs.iObj.Connect();
   328 	TInt r=fs.iObj.Connect();
   329 	test(r==KErrNone);
   329 	test_KErrNone(r);
   330 	TFindFile finder(fs.iObj);
   330 	TFindFile finder(fs.iObj);
   331 	TPtrC path=gPath1;
   331 	TPtrC path=gPath1;
   332 	r=finder.FindByPath(_L("file1.aaa"),&path);
   332 	r=finder.FindByPath(_L("file1.aaa"),&path);
   333 	test(r==KErrNone);
   333 	test_KErrNone(r);
   334 	TParse fileParse;
   334 	TParse fileParse;
   335 	fileParse.Set(finder.File(),NULL,NULL);
   335 	fileParse.Set(finder.File(),NULL,NULL);
   336 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
   336 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
   337 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   337 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   338 	r=finder.Find();
   338 	r=finder.Find();
   339 	test(r==KErrNotFound);
   339 	test_Value(r, r == KErrNotFound);
   340 
   340 
   341 
   341 
   342 	path.Set(gPath2);
   342 	path.Set(gPath2);
   343 	r=finder.FindByPath(_L("file1.aaa"),&path);
   343 	r=finder.FindByPath(_L("file1.aaa"),&path);
   344 	test(r==KErrNone);
   344 	test_KErrNone(r);
   345 	fileParse.Set(finder.File(),NULL,NULL);
   345 	fileParse.Set(finder.File(),NULL,NULL);
   346 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
   346 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
   347 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   347 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   348 	r=finder.Find();
   348 	r=finder.Find();
   349 	test(r==KErrNone);
   349 	test_KErrNone(r);
   350 	fileParse.Set(finder.File(),NULL,NULL);
   350 	fileParse.Set(finder.File(),NULL,NULL);
   351 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\"));
   351 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\"));
   352 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   352 	test(fileParse.NameAndExt()==_L("file1.aaa"));
   353 	r=finder.Find();
   353 	r=finder.Find();
   354 	test(r==KErrNotFound);
   354 	test_Value(r, r == KErrNotFound);
   355 //
   355 //
   356 	test.Next(_L("Test FindByDir"));
   356 	test.Next(_L("Test FindByDir"));
   357 	TPtrC dir=_L("\\F32-TST\\LOCTEST\\BIN2\\");
   357 	TPtrC dir=_L("\\F32-TST\\LOCTEST\\BIN2\\");
   358 	r=finder.FindByDir(_L("file2.bbb"),dir);
   358 	r=finder.FindByDir(_L("file2.bbb"),dir);
   359 	test(r==KErrNone);
   359 	test_KErrNone(r);
   360 	TFileName defaultPath;
   360 	TFileName defaultPath;
   361 	r=TheFs.SessionPath(defaultPath);
   361 	r=TheFs.SessionPath(defaultPath);
   362 	defaultPath.SetLength(2);
   362 	defaultPath.SetLength(2);
   363 	test(r==KErrNone);
   363 	test_KErrNone(r);
   364 	fileParse.Set(finder.File(),NULL,NULL);
   364 	fileParse.Set(finder.File(),NULL,NULL);
   365 	test(fileParse.Drive()==defaultPath);
   365 	test(fileParse.Drive()==defaultPath);
   366 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   366 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   367 	test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound); // MatchF only sees wildcards in its argument
   367 	test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound); // MatchF only sees wildcards in its argument
   368 	r=finder.Find();
   368 	r=finder.Find();
   375 			test(fileParse.Drive()==_L("C:"));
   375 			test(fileParse.Drive()==_L("C:"));
   376 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   376 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   377 		test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound);
   377 		test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound);
   378 		r=finder.Find();
   378 		r=finder.Find();
   379 		}
   379 		}
   380 	test(r==KErrNotFound);
   380 	test_Value(r, r == KErrNotFound);
   381 	}
   381 	}
   382 
   382 
   383 LOCAL_C void Test2()
   383 LOCAL_C void Test2()
   384 //
   384 //
   385 // Test extremes
   385 // Test extremes
   387 	{
   387 	{
   388 
   388 
   389 	test.Next(_L("Test extremes"));
   389 	test.Next(_L("Test extremes"));
   390 	TAutoClose<RFs> fs;
   390 	TAutoClose<RFs> fs;
   391 	TInt r=fs.iObj.Connect();
   391 	TInt r=fs.iObj.Connect();
   392 	test(r==KErrNone);
   392 	test_KErrNone(r);
   393 	TBuf<4> temp=_L("");
   393 	TBuf<4> temp=_L("");
   394 	TFindFile finder(fs.iObj);
   394 	TFindFile finder(fs.iObj);
   395 	r=finder.FindByPath(_L("file1.aaa"),&temp);
   395 	r=finder.FindByPath(_L("file1.aaa"),&temp);
   396 	test(r==KErrNotFound);
   396 	test_Value(r, r == KErrNotFound);
   397 	r=finder.Find();
   397 	r=finder.Find();
   398 	test(r==KErrNotFound);
   398 	test_Value(r, r == KErrNotFound);
   399 //
   399 //
   400 	TPtrC path=_L("blarg.7");
   400 	TPtrC path=_L("blarg.7");
   401 	r=finder.FindByPath(_L(""),&path);	
   401 	r=finder.FindByPath(_L(""),&path);	
   402 	test(r==KErrArgument);
   402 	test_Value(r, r == KErrArgument);
   403 	r=finder.FindByPath(_L("*"),&path);
   403 	r=finder.FindByPath(_L("*"),&path);
   404 	test(r==KErrNotFound);
   404 	test_Value(r, r == KErrNotFound);
   405 	r=finder.FindByPath(_L("xmvid"),&path);
   405 	r=finder.FindByPath(_L("xmvid"),&path);
   406 	test(r==KErrNotFound);
   406 	test_Value(r, r == KErrNotFound);
   407 	r=finder.Find();
   407 	r=finder.Find();
   408 	test(r==KErrNotFound);
   408 	test_Value(r, r == KErrNotFound);
   409 //
   409 //
   410 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
   410 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
   411 	r=finder.FindByPath(_L(""),&path);
   411 	r=finder.FindByPath(_L(""),&path);
   412 	test(r==KErrArgument);
   412 	test_Value(r, r == KErrArgument);
   413 	r=finder.FindByPath(_L("xyz.abc"),&path);
   413 	r=finder.FindByPath(_L("xyz.abc"),&path);
   414 	test(r==KErrNotFound);
   414 	test_Value(r, r == KErrNotFound);
   415 	r=finder.Find();
   415 	r=finder.Find();
   416 	test(r==KErrNotFound);
   416 	test_Value(r, r == KErrNotFound);
   417 	
   417 	
   418 	test.Next(_L("Test FindByDir with empty file spec"));
   418 	test.Next(_L("Test FindByDir with empty file spec"));
   419 	TPtrC dir2=_L("\\F32-TST\\LOCTEST\\");
   419 	TPtrC dir2=_L("\\F32-TST\\LOCTEST\\");
   420 	r=finder.FindByDir(_L(""),dir2);
   420 	r=finder.FindByDir(_L(""),dir2);
   421 	test(r==KErrArgument);		
   421 	test_Value(r, r == KErrArgument);		
   422 	
   422 	
   423 	}
   423 	}
   424 
   424 
   425 LOCAL_C void Test3()
   425 LOCAL_C void Test3()
   426 //
   426 //
   434 	TInt r=TheFs.SessionPath(defaultPath);
   434 	TInt r=TheFs.SessionPath(defaultPath);
   435 	defaultPath.SetLength(2);
   435 	defaultPath.SetLength(2);
   436 //
   436 //
   437 	TAutoClose<RFs> fs;
   437 	TAutoClose<RFs> fs;
   438 	r=fs.iObj.Connect();
   438 	r=fs.iObj.Connect();
   439 	test(r==KErrNone);
   439 	test_KErrNone(r);
   440 	TFindFile finder(fs.iObj);
   440 	TFindFile finder(fs.iObj);
   441 	r=finder.FindByPath(_L("file1.aaa"),&path);
   441 	r=finder.FindByPath(_L("file1.aaa"),&path);
   442 	test(r==KErrNotFound);
   442 	test_Value(r, r == KErrNotFound);
   443 	r=finder.Find();
   443 	r=finder.Find();
   444 	test(r==KErrNotFound);
   444 	test_Value(r, r == KErrNotFound);
   445 //
   445 //
   446 	path.Set(_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   446 	path.Set(_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   447 	r=finder.FindByPath(_L("file2.bbb"),&path);
   447 	r=finder.FindByPath(_L("file2.bbb"),&path);
   448 	test(r==KErrNone);
   448 	test_KErrNone(r);
   449 	TParse fileParse;
   449 	TParse fileParse;
   450 	fileParse.Set(finder.File(),NULL,NULL);
   450 	fileParse.Set(finder.File(),NULL,NULL);
   451 	test(fileParse.Drive()==defaultPath);
   451 	test(fileParse.Drive()==defaultPath);
   452 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   452 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   453 	test(fileParse.NameAndExt()==_L("file2.bbb"));
   453 	test(fileParse.NameAndExt()==_L("file2.bbb"));
   454 	r=finder.Find();
   454 	r=finder.Find();
   455 	test(r==KErrNotFound || r==KErrNone);
   455 	test_Value(r, r == KErrNotFound || r==KErrNone);
   456 	if (r==KErrNone)
   456 	if (r==KErrNone)
   457 		{
   457 		{
   458 		fileParse.Set(finder.File(),NULL,NULL);
   458 		fileParse.Set(finder.File(),NULL,NULL);
   459 		test(fileParse.Drive()!=defaultPath);
   459 		test(fileParse.Drive()!=defaultPath);
   460 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   460 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   461 		test(fileParse.NameAndExt()==_L("file2.bbb"));
   461 		test(fileParse.NameAndExt()==_L("file2.bbb"));
   462 		r=finder.Find();
   462 		r=finder.Find();
   463 		test(r==KErrNotFound);
   463 		test_Value(r, r == KErrNotFound);
   464 		}
   464 		}
   465 //
   465 //
   466 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
   466 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
   467 	r=finder.FindByPath(_L("xyz.abc"),&path);
   467 	r=finder.FindByPath(_L("xyz.abc"),&path);
   468 	test(r==KErrNotFound);
   468 	test_Value(r, r == KErrNotFound);
   469 	r=finder.Find();
   469 	r=finder.Find();
   470 	test(r==KErrNotFound);
   470 	test_Value(r, r == KErrNotFound);
   471 //
   471 //
   472 	r=finder.FindByPath(_L("file2.bbb"),&path);
   472 	r=finder.FindByPath(_L("file2.bbb"),&path);
   473 	test(r==KErrNone);
   473 	test_KErrNone(r);
   474 	fileParse.Set(finder.File(),NULL,NULL);
   474 	fileParse.Set(finder.File(),NULL,NULL);
   475 	test(fileParse.Drive()==defaultPath);
   475 	test(fileParse.Drive()==defaultPath);
   476 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   476 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   477 	test(fileParse.NameAndExt()==_L("file2.bbb"));
   477 	test(fileParse.NameAndExt()==_L("file2.bbb"));
   478 	r=finder.Find();
   478 	r=finder.Find();
   479 	test(r==KErrNotFound || r==KErrNone);
   479 	test_Value(r, r == KErrNotFound || r==KErrNone);
   480 	if (r==KErrNone)
   480 	if (r==KErrNone)
   481 		{
   481 		{
   482 		fileParse.Set(finder.File(),NULL,NULL);
   482 		fileParse.Set(finder.File(),NULL,NULL);
   483 		test(fileParse.Drive()!=defaultPath);
   483 		test(fileParse.Drive()!=defaultPath);
   484 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   484 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
   485 		test(fileParse.NameAndExt()==_L("file2.bbb"));
   485 		test(fileParse.NameAndExt()==_L("file2.bbb"));
   486 		r=finder.Find();
   486 		r=finder.Find();
   487 		test(r==KErrNotFound);
   487 		test_Value(r, r == KErrNotFound);
   488 		}
   488 		}
   489 	}
   489 	}
   490 
   490 
   491 LOCAL_C void Test4()
   491 LOCAL_C void Test4()
   492 //
   492 //
   500 	TInt count;
   500 	TInt count;
   501 	TEntry entry;
   501 	TEntry entry;
   502 	TFileName path;
   502 	TFileName path;
   503 
   503 
   504 	TInt r=finder.FindWildByPath(_L("*.aaa"),&gPath3,dir);
   504 	TInt r=finder.FindWildByPath(_L("*.aaa"),&gPath3,dir);
   505 	test(r==KErrNone);
   505 	test_KErrNone(r);
   506 	count=dir->Count();
   506 	count=dir->Count();
   507 	test(count==3);
   507 	test(count==3);
   508 	entry=(*dir)[0];
   508 	entry=(*dir)[0];
   509 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   509 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   510 	entry=(*dir)[1];
   510 	entry=(*dir)[1];
   516 	path=fileParse.FullName();
   516 	path=fileParse.FullName();
   517 	test(path==_L("*.aaa"));
   517 	test(path==_L("*.aaa"));
   518 	delete dir;
   518 	delete dir;
   519 
   519 
   520 	r=finder.FindWild(dir);
   520 	r=finder.FindWild(dir);
   521 	test(r==KErrNone);
   521 	test_KErrNone(r);
   522 	count=dir->Count();
   522 	count=dir->Count();
   523 	test(count==2);
   523 	test(count==2);
   524 	entry=(*dir)[0];
   524 	entry=(*dir)[0];
   525 	test(entry.iName.MatchF(_L("FILE1.AAA"))!=KErrNotFound);
   525 	test(entry.iName.MatchF(_L("FILE1.AAA"))!=KErrNotFound);
   526 	entry=(*dir)[1];
   526 	entry=(*dir)[1];
   529 	path=fileParse.FullName();
   529 	path=fileParse.FullName();
   530 	test(path==_L("C:\\F32-TST\\LOCTEST\\BIN1\\*.aaa"));
   530 	test(path==_L("C:\\F32-TST\\LOCTEST\\BIN1\\*.aaa"));
   531 	delete dir;
   531 	delete dir;
   532 
   532 
   533 	r=finder.FindWild(dir);
   533 	r=finder.FindWild(dir);
   534 	test(r==KErrNotFound);
   534 	test_Value(r, r == KErrNotFound);
   535 	r=finder.FindWild(dir);
   535 	r=finder.FindWild(dir);
   536 	test(r==KErrNotFound);
   536 	test_Value(r, r == KErrNotFound);
   537 
   537 
   538 	r=finder.FindWildByPath(_L("*FILE.AAA*"), &gPath1, dir);
   538 	r=finder.FindWildByPath(_L("*FILE.AAA*"), &gPath1, dir);
   539 	test(r==KErrNone);
   539 	test_KErrNone(r);
   540 	test(dir->Count()==1);
   540 	test(dir->Count()==1);
   541 	entry=(*dir)[0];
   541 	entry=(*dir)[0];
   542 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   542 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   543 	delete dir;
   543 	delete dir;
   544 	
   544 	
   545 	r=finder.FindWildByPath(_L("*FILE.AAA"), &gPath1, dir);
   545 	r=finder.FindWildByPath(_L("*FILE.AAA"), &gPath1, dir);
   546 	test(r==KErrNone);
   546 	test_KErrNone(r);
   547 	test(dir->Count()==1);
   547 	test(dir->Count()==1);
   548 	entry=(*dir)[0];
   548 	entry=(*dir)[0];
   549 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   549 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   550 	delete dir;
   550 	delete dir;
   551 	
   551 	
   552 	r=finder.FindWildByPath(_L("FILE.AAA*"), &gPath1, dir);
   552 	r=finder.FindWildByPath(_L("FILE.AAA*"), &gPath1, dir);
   553 	test(r==KErrNone);
   553 	test_KErrNone(r);
   554 	test(dir->Count()==1);
   554 	test(dir->Count()==1);
   555 	entry=(*dir)[0];
   555 	entry=(*dir)[0];
   556 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   556 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
   557 	delete dir;
   557 	delete dir;
   558 
   558 
   559     
   559     
   560 	r=finder.FindWildByPath(_L("CONFUSED.DOG"), &gPath1, dir);
   560 	r=finder.FindWildByPath(_L("CONFUSED.DOG"), &gPath1, dir);
   561 	test(r==KErrNone);
   561 	test_KErrNone(r);
   562 	test(dir->Count()==1);
   562 	test(dir->Count()==1);
   563 	entry=(*dir)[0];
   563 	entry=(*dir)[0];
   564 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   564 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   565 	delete dir;
   565 	delete dir;
   566 
   566 
   567 	r=finder.FindWildByPath(_L("*CONFUSED.DOG"), &gPath1, dir);
   567 	r=finder.FindWildByPath(_L("*CONFUSED.DOG"), &gPath1, dir);
   568 	test(r==KErrNone);
   568 	test_KErrNone(r);
   569 	test(dir->Count()==1);
   569 	test(dir->Count()==1);
   570 	entry=(*dir)[0];
   570 	entry=(*dir)[0];
   571 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   571 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   572 	delete dir;
   572 	delete dir;
   573 	r=finder.FindWildByPath(_L("CONFUSED.DOG*"), &gPath1, dir);
   573 	r=finder.FindWildByPath(_L("CONFUSED.DOG*"), &gPath1, dir);
   574 	test(r==KErrNone);
   574 	test_KErrNone(r);
   575 	test(dir->Count()==1);
   575 	test(dir->Count()==1);
   576 	entry=(*dir)[0];
   576 	entry=(*dir)[0];
   577 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   577 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   578 	delete dir;
   578 	delete dir;
   579 	r=finder.FindWildByPath(_L("*CONFUSED.DOG*"), &gPath1, dir);
   579 	r=finder.FindWildByPath(_L("*CONFUSED.DOG*"), &gPath1, dir);
   580 	test(r==KErrNone);
   580 	test_KErrNone(r);
   581 	test(dir->Count()==1);
   581 	test(dir->Count()==1);
   582 	entry=(*dir)[0];
   582 	entry=(*dir)[0];
   583 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   583 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
   584 	delete dir;
   584 	delete dir;
   585 	}
   585 	}
   596 	TInt count;
   596 	TInt count;
   597 	TEntry entry;
   597 	TEntry entry;
   598 	TFileName path;
   598 	TFileName path;
   599 
   599 
   600 	TInt r=finder.FindWildByDir(_L("FILE*"),_L("\\F32-TST\\LOCTEST\\BIN3\\"),dir);
   600 	TInt r=finder.FindWildByDir(_L("FILE*"),_L("\\F32-TST\\LOCTEST\\BIN3\\"),dir);
   601 	test(r==KErrNone);
   601 	test_KErrNone(r);
   602 	count=dir->Count();
   602 	count=dir->Count();
   603 	test(count==1);
   603 	test(count==1);
   604 	entry=(*dir)[0];
   604 	entry=(*dir)[0];
   605 	test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound);
   605 	test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound);
   606 	TParse fileParse;
   606 	TParse fileParse;
   612 	delete dir;
   612 	delete dir;
   613 
   613 
   614 	r=finder.FindWild(dir);
   614 	r=finder.FindWild(dir);
   615 	if (r==KErrNotFound)
   615 	if (r==KErrNotFound)
   616 		return;
   616 		return;
   617 	test(r==KErrNone);
   617 	test_KErrNone(r);
   618 	entry=(*dir)[0];
   618 	entry=(*dir)[0];
   619 	test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound);
   619 	test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound);
   620 	fileParse.Set(finder.File(),NULL,NULL);
   620 	fileParse.Set(finder.File(),NULL,NULL);
   621 	path=fileParse.FullName();
   621 	path=fileParse.FullName();
   622 	test(path.CompareF(tpath)==0);
   622 	test(path.CompareF(tpath)==0);
   623 	delete dir;
   623 	delete dir;
   624 
   624 
   625 	r=finder.FindWild(dir);
   625 	r=finder.FindWild(dir);
   626 	test(r==KErrNotFound);
   626 	test_Value(r, r == KErrNotFound);
   627 	r=finder.FindWild(dir);
   627 	r=finder.FindWild(dir);
   628 	test(r==KErrNotFound);
   628 	test_Value(r, r == KErrNotFound);
   629 	}
   629 	}
   630 
   630 
   631 LOCAL_C void Test6()
   631 LOCAL_C void Test6()
   632 //
   632 //
   633 // Test file not found
   633 // Test file not found
   635 	{
   635 	{
   636 
   636 
   637 	test.Next(_L("Test file not found"));
   637 	test.Next(_L("Test file not found"));
   638 	TFindFile ff(TheFs);
   638 	TFindFile ff(TheFs);
   639 	TInt r=ff.FindByDir(_L("NOEXIST.EXE"),_L("\\System\\Programs\\"));
   639 	TInt r=ff.FindByDir(_L("NOEXIST.EXE"),_L("\\System\\Programs\\"));
   640 	test(r==KErrNotFound);
   640 	test_Value(r, r == KErrNotFound);
   641 	}
   641 	}
   642 
   642 
   643 
   643 
   644 
   644 
   645 
   645 
   674 
   674 
   675 	{
   675 	{
   676 	
   676 	
   677 	TAutoClose<RFs> fs;
   677 	TAutoClose<RFs> fs;
   678 	TInt r=fs.iObj.Connect();
   678 	TInt r=fs.iObj.Connect();
   679 	test(r==KErrNone);
   679 	test_KErrNone(r);
   680 	TFindFile finder(fs.iObj);
   680 	TFindFile finder(fs.iObj);
   681 	TPtrC path=gPath4;
   681 	TPtrC path=gPath4;
   682 	r=finder.FindByPath(_L("findfile.aaa"),&path); 	
   682 	r=finder.FindByPath(_L("findfile.aaa"),&path); 	
   683 	
   683 	
   684 	TParse fileParse;
   684 	TParse fileParse;
   685 	
   685 	
   686 	test.Next(_L("Test FindByPath without specifying any mask"));
   686 	test.Next(_L("Test FindByPath without specifying any mask"));
   687 	
   687 	
   688 	if (removableFlag == 1)
   688 	if (removableFlag == 1)
   689 		{
   689 		{
   690 			test(r==KErrNone); 
   690 			test_KErrNone(r); 
   691 			fileParse.Set(finder.File(),NULL,NULL);
   691 			fileParse.Set(finder.File(),NULL,NULL);
   692 			test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   692 			test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   693 			test(fileParse.NameAndExt()==_L("findfile.aaa")); //The filename.aaa in the removable Drive
   693 			test(fileParse.NameAndExt()==_L("findfile.aaa")); //The filename.aaa in the removable Drive
   694 			r=finder.Find();
   694 			r=finder.Find();
   695 			test(r==KErrNotFound);     //remote drives are excluded by default
   695 			test_Value(r, r == KErrNotFound);     //remote drives are excluded by default
   696 		
   696 		
   697 		}
   697 		}
   698 	else
   698 	else
   699 		test(r==KErrNotFound);
   699 		test_Value(r, r == KErrNotFound);
   700 
   700 
   701 	
   701 	
   702 
   702 
   703 	test.Next(_L("Search for the specified file in all Drives, including remotes ones \n"));
   703 	test.Next(_L("Search for the specified file in all Drives, including remotes ones \n"));
   704 
   704 
   705 
   705 
   706 	r=finder.SetFindMask(	KDriveAttAll) ;
   706 	r=finder.SetFindMask(	KDriveAttAll) ;
   707 	test(r==KErrNone);
   707 	test_KErrNone(r);
   708 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   708 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   709 	test(r==KErrNone);
   709 	test_KErrNone(r);
   710 	fileParse.Set(finder.File(),NULL,NULL);
   710 	fileParse.Set(finder.File(),NULL,NULL);
   711 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
   711 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
   712 	test(fileParse.NameAndExt()==_L("findfile.aaa"));      //either the remote or removable one.
   712 	test(fileParse.NameAndExt()==_L("findfile.aaa"));      //either the remote or removable one.
   713 	r=finder.Find();
   713 	r=finder.Find();
   714 	
   714 	
   715 	
   715 	
   716 	if (removableFlag == 1)
   716 	if (removableFlag == 1)
   717 		{	
   717 		{	
   718 		test(r==KErrNone);
   718 		test_KErrNone(r);
   719 	
   719 	
   720 		fileParse.Set(finder.File(),NULL,NULL);
   720 		fileParse.Set(finder.File(),NULL,NULL);
   721 
   721 
   722 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   722 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   723 		test(fileParse.NameAndExt()==_L("findfile.aaa"));         //either the remote or removable one.
   723 		test(fileParse.NameAndExt()==_L("findfile.aaa"));         //either the remote or removable one.
   724 
   724 
   725 		r=finder.Find();
   725 		r=finder.Find();
   726 		test(r==KErrNotFound);
   726 		test_Value(r, r == KErrNotFound);
   727 		}
   727 		}
   728 	else 
   728 	else 
   729 		{
   729 		{
   730 		test(r==KErrNotFound);	
   730 		test_Value(r, r == KErrNotFound);	
   731 			
   731 			
   732 		}
   732 		}
   733 		
   733 		
   734 		
   734 		
   735 	test.Next(_L("Search exclusively in remote drives \n"));
   735 	test.Next(_L("Search exclusively in remote drives \n"));
   736 
   736 
   737 	r=finder.SetFindMask(	KDriveAttExclusive| KDriveAttRemote); 
   737 	r=finder.SetFindMask(	KDriveAttExclusive| KDriveAttRemote); 
   738 	test(r==KErrNone);
   738 	test_KErrNone(r);
   739 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   739 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   740 	test(r==KErrNone);
   740 	test_KErrNone(r);
   741 	fileParse.Set(finder.File(),NULL,NULL);
   741 	fileParse.Set(finder.File(),NULL,NULL);
   742 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   742 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
   743 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
   743 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
   744 	r=finder.Find();
   744 	r=finder.Find();
   745 	test(r==KErrNotFound);
   745 	test_Value(r, r == KErrNotFound);
   746 
   746 
   747 	
   747 	
   748 	test.Next(_L("Search excluding removables and remote \n"));
   748 	test.Next(_L("Search excluding removables and remote \n"));
   749 
   749 
   750 	r=finder.SetFindMask(	KDriveAttExclude | KDriveAttRemovable |KDriveAttRemote ); 
   750 	r=finder.SetFindMask(	KDriveAttExclude | KDriveAttRemovable |KDriveAttRemote ); 
   751 	test(r==KErrNone);
   751 	test_KErrNone(r);
   752 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
   752 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
   753 	test(r==KErrNotFound);   //filename.aaa exists in the remote drive and if present to the removable one
   753 	test_Value(r, r == KErrNotFound);   //filename.aaa exists in the remote drive and if present to the removable one
   754 
   754 
   755 
   755 
   756 	test.Next(_L("Search in Internal Drives \n"));
   756 	test.Next(_L("Search in Internal Drives \n"));
   757 
   757 
   758 	r=finder.SetFindMask(KDriveAttInternal ) ;
   758 	r=finder.SetFindMask(KDriveAttInternal ) ;
   759 	test(r==KErrNone);
   759 	test_KErrNone(r);
   760 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
   760 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
   761 	test(r==KErrNotFound);   //filename.aaa exists only in the Removable drive and the remote one.
   761 	test_Value(r, r == KErrNotFound);   //filename.aaa exists only in the Removable drive and the remote one.
   762 
   762 
   763 
   763 
   764 	}
   764 	}
   765 
   765 
   766 	
   766 	
   787 	test.Next(_L("Test SetFindMask with all mask combinations \n"));	
   787 	test.Next(_L("Test SetFindMask with all mask combinations \n"));	
   788 	
   788 	
   789 	
   789 	
   790 	TAutoClose<RFs> fs;
   790 	TAutoClose<RFs> fs;
   791 	TInt r=fs.iObj.Connect();
   791 	TInt r=fs.iObj.Connect();
   792 	test(r==KErrNone);
   792 	test_KErrNone(r);
   793 	TFindFile finder(fs.iObj);
   793 	TFindFile finder(fs.iObj);
   794 	TPtrC path=gPath4;	
   794 	TPtrC path=gPath4;	
   795 	TParse fileParse;
   795 	TParse fileParse;
   796 		
   796 		
   797 
   797 
   798 	r=finder.SetFindMask(KDriveAttAll) ;
   798 	r=finder.SetFindMask(KDriveAttAll) ;
   799 	test(r==KErrNone);
   799 	test_KErrNone(r);
   800 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   800 	r=finder.FindByPath(_L("findfile.aaa"),&path);
   801 	test(r==KErrNone);
   801 	test_KErrNone(r);
   802 	fileParse.Set(finder.File(),NULL,NULL);
   802 	fileParse.Set(finder.File(),NULL,NULL);
   803 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
   803 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
   804 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
   804 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
   805 
   805 
   806 
   806 
   836 		//	test.Printf(_L("Expected Result : %d     \n"), testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts);
   836 		//	test.Printf(_L("Expected Result : %d     \n"), testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts);
   837 		//	test.Printf(_L("  Actual Result : 0x%08x \n"), err);
   837 		//	test.Printf(_L("  Actual Result : 0x%08x \n"), err);
   838 		
   838 		
   839 		//	test.Printf(_L("\nTest mask : %d \n"),testCombinations[matchIdx].iMatchMask | testAtt );
   839 		//	test.Printf(_L("\nTest mask : %d \n"),testCombinations[matchIdx].iMatchMask | testAtt );
   840 			
   840 			
   841 			test( r == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) );
   841 			test_Value(r, r == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) );
   842 			
   842 			
   843 			
   843 			
   844 			if (r== KErrNone)
   844 			if (r== KErrNone)
   845 				{
   845 				{
   846 				r  = finder.FindByPath(_L("findfile.aaa"),&path);
   846 				r  = finder.FindByPath(_L("findfile.aaa"),&path);
   847 				test (r== KErrNone || r ==KErrNotFound);
   847 				test_Value(r, r == KErrNone || r ==KErrNotFound);
   848 				}
   848 				}
   849 			
   849 			
   850 			}
   850 			}
   851 		}
   851 		}
   852 
   852 
   879 
   879 
   880 	{		
   880 	{		
   881 
   881 
   882 	TAutoClose<RFs> fs;
   882 	TAutoClose<RFs> fs;
   883 	TInt r=fs.iObj.Connect();
   883 	TInt r=fs.iObj.Connect();
   884 	test(r==KErrNone);
   884 	test_KErrNone(r);
   885 	
   885 	
   886 	TFindFile finder(fs.iObj);
   886 	TFindFile finder(fs.iObj);
   887 	
   887 	
   888 	CDir* dir;
   888 	CDir* dir;
   889 	CDir* dir3;
   889 	CDir* dir3;
   897 		{
   897 		{
   898 		
   898 		
   899 		test.Next(_L("FindByDir with wild filenames when a find mask is specified"));
   899 		test.Next(_L("FindByDir with wild filenames when a find mask is specified"));
   900 		
   900 		
   901 		TInt r=finder.SetFindMask(KDriveAttRemovable);
   901 		TInt r=finder.SetFindMask(KDriveAttRemovable);
   902 		test(r==KErrNone);
   902 		test_KErrNone(r);
   903 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
   903 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
   904 		test(r==KErrNone);
   904 		test_KErrNone(r);
   905 		count=dir->Count();
   905 		count=dir->Count();
   906 		test(count==1);
   906 		test(count==1);
   907 		entry=(*dir)[0];
   907 		entry=(*dir)[0];
   908 		test(entry.iName.MatchF(_L("FINDFILE.AAA"))!=KErrNotFound); 
   908 		test(entry.iName.MatchF(_L("FINDFILE.AAA"))!=KErrNotFound); 
   909 		delete dir;	
   909 		delete dir;	
   910 
   910 
   911 		r=finder.FindWild(dir);
   911 		r=finder.FindWild(dir);
   912 		test(r==KErrNotFound);	
   912 		test_Value(r, r == KErrNotFound);	
   913 		
   913 		
   914 		
   914 		
   915 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttRemovable);
   915 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttRemovable);
   916 		test(r==KErrNone);
   916 		test_KErrNone(r);
   917 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
   917 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
   918 		test(r==KErrNotFound);
   918 		test_Value(r, r == KErrNotFound);
   919 		
   919 		
   920 		
   920 		
   921 		test.Next(_L("Test FindByDir when a find mask is specified"));
   921 		test.Next(_L("Test FindByDir when a find mask is specified"));
   922 		
   922 		
   923 		
   923 		
   924 		TPtrC dir2=_L("\\F32-TST\\LOCTEST\\BIN\\");
   924 		TPtrC dir2=_L("\\F32-TST\\LOCTEST\\BIN\\");
   925 		
   925 		
   926 		r=finder.SetFindMask(KDriveAttExclude | KDriveAttRemote );
   926 		r=finder.SetFindMask(KDriveAttExclude | KDriveAttRemote );
   927 		test(r==KErrNone);
   927 		test_KErrNone(r);
   928 		r=finder.FindByDir(_L("findfile.aaa"),dir2);
   928 		r=finder.FindByDir(_L("findfile.aaa"),dir2);
   929 		test(r==KErrNone);
   929 		test_KErrNone(r);
   930 	
   930 	
   931 		r=finder.Find();
   931 		r=finder.Find();
   932 		test(r==KErrNotFound);	
   932 		test_Value(r, r == KErrNotFound);	
   933 		
   933 		
   934 
   934 
   935 		}
   935 		}
   936 	
   936 	
   937 
   937 
   963 		gPath5.Append (internalDriveLetter);
   963 		gPath5.Append (internalDriveLetter);
   964 		gPath5.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\INT\\") );
   964 		gPath5.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\INT\\") );
   965 
   965 
   966 		
   966 		
   967 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);
   967 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);
   968  		test(r==KErrNone);
   968  		test_KErrNone(r);
   969 		test(dir3->Count()==2);
   969 		test(dir3->Count()==2);
   970 		
   970 		
   971 		entry=(*dir3)[0];		
   971 		entry=(*dir3)[0];		
   972 		test(  (entry.iName.MatchF(_L("FINDINTERNALFILE_B.AAA"))!=KErrNotFound)  || (entry.iName.MatchF(_L("FINDINTERNALFILE.AAA"))!=KErrNotFound)  );
   972 		test(  (entry.iName.MatchF(_L("FINDINTERNALFILE_B.AAA"))!=KErrNotFound)  || (entry.iName.MatchF(_L("FINDINTERNALFILE.AAA"))!=KErrNotFound)  );
   973 		
   973 		
   979 		delete dir3;
   979 		delete dir3;
   980 		
   980 		
   981 		
   981 		
   982 		
   982 		
   983 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttInternal);
   983 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttInternal);
   984 		test(r==KErrNone);
   984 		test_KErrNone(r);
   985 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);	
   985 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);	
   986  		test(r==KErrNone);
   986  		test_KErrNone(r);
   987 		test(dir3->Count()==2);
   987 		test(dir3->Count()==2);
   988 		
   988 		
   989 		delete dir3;
   989 		delete dir3;
   990 		
   990 		
   991 		
   991 		
   992 		r=finder.FindWild(dir3);
   992 		r=finder.FindWild(dir3);
   993 		test(r==KErrNotFound);
   993 		test_Value(r, r == KErrNotFound);
   994 				
   994 				
   995 				
   995 				
   996 		}
   996 		}
   997 
   997 
   998 
   998 
  1024     //------------------------------------
  1024     //------------------------------------
  1025     test.Printf(_L("Test FindWildByPath failures\n"));	
  1025     test.Printf(_L("Test FindWildByPath failures\n"));	
  1026     
  1026     
  1027     __UHEAP_MARK;
  1027     __UHEAP_MARK;
  1028     nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
  1028     nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
  1029     test(nRes == KErrNone);
  1029     test_KErrNone(nRes);
  1030     test(pDir && pDir->Count() > 1);
  1030     test(pDir && pDir->Count() > 1);
  1031     delete pDir;
  1031     delete pDir;
  1032 
  1032 
  1033  
  1033  
  1034     for(cnt = 0; ;cnt++)
  1034     for(cnt = 0; ;cnt++)
  1035         {
  1035         {
  1036         nRes =TheFs.SetErrorCondition(KMyError, cnt);
  1036         nRes =TheFs.SetErrorCondition(KMyError, cnt);
  1037         test(nRes == KErrNone);
  1037         test_KErrNone(nRes);
  1038 
  1038 
  1039         pDir = (CDir*)0xaabbccdd;
  1039         pDir = (CDir*)0xaabbccdd;
  1040         nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
  1040         nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
  1041         
  1041         
  1042         //-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL 
  1042         //-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL 
  1068    //------------------------------------
  1068    //------------------------------------
  1069    test.Printf(_L("Test FindWildByDir failures\n"));	
  1069    test.Printf(_L("Test FindWildByDir failures\n"));	
  1070     
  1070     
  1071    __UHEAP_MARK;
  1071    __UHEAP_MARK;
  1072    nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
  1072    nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
  1073    test(nRes == KErrNone);
  1073    test_KErrNone(nRes);
  1074    test(pDir && pDir->Count() > 1);
  1074    test(pDir && pDir->Count() > 1);
  1075    delete pDir;
  1075    delete pDir;
  1076    
  1076    
  1077    for(cnt = 0; ;cnt++)
  1077    for(cnt = 0; ;cnt++)
  1078         {
  1078         {
  1079         nRes =TheFs.SetErrorCondition(KMyError, cnt);
  1079         nRes =TheFs.SetErrorCondition(KMyError, cnt);
  1080         test(nRes == KErrNone);
  1080         test_KErrNone(nRes);
  1081 
  1081 
  1082         pDir = (CDir*)0xaabbccdd;
  1082         pDir = (CDir*)0xaabbccdd;
  1083         nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
  1083         nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
  1084         
  1084         
  1085         //-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL  
  1085         //-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL