kerneltest/f32test/fsstress/t_rmain.cpp
changeset 149 d9f1e5bfe28c
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
135:5e441a173c63 149:d9f1e5bfe28c
    17 
    17 
    18 #if !defined(__F32FILE_H__)
    18 #if !defined(__F32FILE_H__)
    19 #include <f32file.h>
    19 #include <f32file.h>
    20 #endif
    20 #endif
    21 #if !defined(__E32TEST_H__)
    21 #if !defined(__E32TEST_H__)
       
    22 #define	__E32TEST_EXTENSION__
    22 #include <e32test.h>
    23 #include <e32test.h>
    23 #endif
    24 #endif
    24 #if !defined(__E32HAL_H__)
    25 #if !defined(__E32HAL_H__)
    25 #include <e32hal.h>
    26 #include <e32hal.h>
    26 #endif
    27 #endif
    75 	TBuf<4> driveBuf=_L("?:\\");
    76 	TBuf<4> driveBuf=_L("?:\\");
    76 	driveBuf[0]=(TText)(aDrive+'A');
    77 	driveBuf[0]=(TText)(aDrive+'A');
    77 	RFormat format;
    78 	RFormat format;
    78 	TInt count;
    79 	TInt count;
    79 	TInt r=format.Open(TheFs,driveBuf,EHighDensity,count);
    80 	TInt r=format.Open(TheFs,driveBuf,EHighDensity,count);
    80 	test(r==KErrNone);
    81 	test_KErrNone(r);
    81 	while(count)
    82 	while(count)
    82 		{
    83 		{
    83 		TInt r=format.Next(count);
    84 		TInt r=format.Next(count);
    84 		test(r==KErrNone);
    85 		test_KErrNone(r);
    85 		}
    86 		}
    86 	format.Close();
    87 	format.Close();
    87 	}
    88 	}
    88 
    89 
    89 LOCAL_C void PushLotsL()
    90 LOCAL_C void PushLotsL()
   105 	{
   106 	{
   106 
   107 
   107 	gSessionPath=_L("?:\\F32-TST\\");
   108 	gSessionPath=_L("?:\\F32-TST\\");
   108 	TChar driveLetter;
   109 	TChar driveLetter;
   109 	TInt r=TheFs.DriveToChar(aDrive,driveLetter);
   110 	TInt r=TheFs.DriveToChar(aDrive,driveLetter);
   110 	test(r==KErrNone);
   111 	test_KErrNone(r);
   111 	gSessionPath[0]=(TText)driveLetter;
   112 	gSessionPath[0]=(TText)driveLetter;
   112 	r=TheFs.SetSessionPath(gSessionPath);
   113 	r=TheFs.SetSessionPath(gSessionPath);
   113 	test(r==KErrNone);
   114 	test_KErrNone(r);
   114 	r=TheFs.MkDirAll(gSessionPath);
   115 	r=TheFs.MkDirAll(gSessionPath);
   115 	test(r==KErrNone || r==KErrAlreadyExists);
   116 	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
   116 	TheFs.ResourceCountMarkStart();
   117 	TheFs.ResourceCountMarkStart();
   117 	
   118 	
   118 	switch(aDrive)
   119 	switch(aDrive)
   119 		{
   120 		{
   120 #if defined (__MARM__)
   121 #if defined (__MARM__)
   267  	__UHEAP_MARK;
   268  	__UHEAP_MARK;
   268 
   269 
   269 	test.Title();
   270 	test.Title();
   270 	test.Start(_L("Starting tests..."));
   271 	test.Start(_L("Starting tests..."));
   271 	r=TheFs.Connect();
   272 	r=TheFs.Connect();
   272 	test(r==KErrNone);
   273 	test_KErrNone(r);
   273 //	TheFs.SetAllocFailure(gAllocFailOn);
   274 //	TheFs.SetAllocFailure(gAllocFailOn);
   274 
   275 
   275 //	Default drive testing
   276 //	Default drive testing
   276 	DoTests(KDefaultDrive);	
   277 	DoTests(KDefaultDrive);	
   277 
   278 
   278 //	Remote drive testing
   279 //	Remote drive testing
   279 	RThread clientThreadQ;
   280 	RThread clientThreadQ;
   280 	r=clientThreadQ.Create(_L("TestRemoteDrive"), TestRemoteDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   281 	r=clientThreadQ.Create(_L("TestRemoteDrive"), TestRemoteDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   281 	test(r==KErrNone);	
   282 	test_KErrNone(r);	
   282 	TRequestStatus statq;
   283 	TRequestStatus statq;
   283 	clientThreadQ.Logon(statq);
   284 	clientThreadQ.Logon(statq);
   284 	test.Next(_L("Resume clientThreadQ"));	
   285 	test.Next(_L("Resume clientThreadQ"));	
   285 	clientThreadQ.Resume();
   286 	clientThreadQ.Resume();
   286 
   287 
   287 //	MARM CF card drive testing (WINS emulates CF card on X)
   288 //	MARM CF card drive testing (WINS emulates CF card on X)
   288 	RThread clientThreadX;
   289 	RThread clientThreadX;
   289 	r=clientThreadX.Create(_L("TestXDrive"), TestXDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   290 	r=clientThreadX.Create(_L("TestXDrive"), TestXDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   290 	test(r==KErrNone);	
   291 	test_KErrNone(r);	
   291 	TRequestStatus statx;
   292 	TRequestStatus statx;
   292 	clientThreadX.Logon(statx);
   293 	clientThreadX.Logon(statx);
   293 	test.Next(_L("Resume clientThreadX"));	
   294 	test.Next(_L("Resume clientThreadX"));	
   294 	clientThreadX.Resume();
   295 	clientThreadX.Resume();
   295 
   296 
   296 //	MARM RAM drive testing (WINS emulates FAT filesystem on Y)  	
   297 //	MARM RAM drive testing (WINS emulates FAT filesystem on Y)  	
   297 	RThread clientThreadY;
   298 	RThread clientThreadY;
   298 	r=clientThreadY.Create(_L("TestYDrive"), TestYDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   299 	r=clientThreadY.Create(_L("TestYDrive"), TestYDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
   299 	test(r==KErrNone);	
   300 	test_KErrNone(r);	
   300 	TRequestStatus staty;
   301 	TRequestStatus staty;
   301 	clientThreadY.Logon(staty);
   302 	clientThreadY.Logon(staty);
   302 	test.Next(_L("Resume clientThreadY"));	
   303 	test.Next(_L("Resume clientThreadY"));	
   303 	clientThreadY.Resume();
   304 	clientThreadY.Resume();
   304 
   305