kerneltest/f32test/server/t_fsched.cpp
changeset 200 73ea206103e6
parent 109 b3a1d9898418
child 247 d8d70de2bd36
equal deleted inserted replaced
152:657f875b013e 200:73ea206103e6
    27 #include <e32svr.h>
    27 #include <e32svr.h>
    28 #include <f32dbg.h>
    28 #include <f32dbg.h>
    29 #include "t_server.h"
    29 #include "t_server.h"
    30 #include <e32twin.h>
    30 #include <e32twin.h>
    31 #include <e32cmn.h>
    31 #include <e32cmn.h>
       
    32 #include "f32_test_utils.h"
       
    33 
       
    34 using namespace F32_Test_Utils;
    32 
    35 
    33 //----------------------------------------------------------------------------------------------
    36 //----------------------------------------------------------------------------------------------
    34 //! @SYMTestCaseID      PBASE-T_FSCHED-0191
    37 //! @SYMTestCaseID      PBASE-T_FSCHED-0191
    35 //! @SYMTestType        CIT
    38 //! @SYMTestType        CIT
    36 //! @SYMPREQ            PREQ914
    39 //! @SYMPREQ            PREQ914
   928 	
   931 	
   929 	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
   932 	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
   930 	test.Printf(_L("\nSync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
   933 	test.Printf(_L("\nSync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
   931 	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
   934 	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
   932 	#if !defined(__WINS__)
   935 	#if !defined(__WINS__)
   933 	// If this condition fails, means that writing the sync file while fairscheduling a small sync read takes too long
   936 		// If this condition fails, it means that writing the sync file while fairscheduling a small sync read takes too long
   934 		test.Printf(_L("time: %f\n"), time);
   937 		test.Printf(_L("time: %f\n"), time);
   935 //		test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) );  
   938 		// test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) );  
   936 		test(time > 0);
   939 		test(time > 0);
   937 	#endif 
   940 	#endif 
   938 	
   941 	
   939 	// Async test 
   942 	// Async test 
   940 	TRequestStatus status[KWaitRequestsTableSize];
   943 	TRequestStatus status[KWaitRequestsTableSize];
   957 	
   960 	
   958 	test.Printf(_L("\nAsync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
   961 	test.Printf(_L("\nAsync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
   959 	time = I64LOW(timeTaken.Int64() / KuStomS); 
   962 	time = I64LOW(timeTaken.Int64() / KuStomS); 
   960 
   963 
   961 	#if !defined(__WINS__)
   964 	#if !defined(__WINS__)
   962 	// If this condition fails, means that writing the async file while fairscheduling a small async read takes too long
   965 	if (!Is_HVFS(TheFs, gDrive))
       
   966 		{
       
   967 		// If this condition fails, it means that writing the async file while fairscheduling a small async read takes too long
   963 		test.Printf(_L("time: %f\n"), time);
   968 		test.Printf(_L("time: %f\n"), time);
   964 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
   969 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
   965 //		test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) );
   970 		// test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) );
   966 		test(time > 0);
   971 		test(time > 0);
       
   972 		}
   967 	#endif
   973 	#endif
   968 }
   974 }
   969 
   975 
   970 /** Writes a small file while writing a big one
   976 /** Writes a small file while writing a big one
   971 
   977 
   996 	
  1002 	
   997 	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
  1003 	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
   998 	test.Printf(_L("\nSync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
  1004 	test.Printf(_L("\nSync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
   999 	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
  1005 	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
  1000 	#if !defined(__WINS__)
  1006 	#if !defined(__WINS__)
  1001 	// If this condition fails, means that writing the sync file while fairscheduling a small sync write takes too long
  1007 		// If this condition fails, it means that writing the sync file while fairscheduling a small sync write takes too long
  1002 		test.Printf(_L("time: %f\n"), time);
  1008 		test.Printf(_L("time: %f\n"), time);
  1003 // 		test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) ); 
  1009 		// test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) ); 
  1004 		test(time > 0);
  1010 		test(time > 0);
  1005 	#endif 
  1011 	#endif 
  1006 
  1012 
  1007 	// Async test 
  1013 	// Async test 
  1008 	TRequestStatus status[KWaitRequestsTableSize];
  1014 	TRequestStatus status[KWaitRequestsTableSize];
  1016 	WaitForAll(status, gBigFileSize, KBigBlockSize);
  1022 	WaitForAll(status, gBigFileSize, KBigBlockSize);
  1017 	time2.HomeTime();
  1023 	time2.HomeTime();
  1018 	
  1024 	
  1019 	timeTaken = time2.MicroSecondsFrom(time1);
  1025 	timeTaken = time2.MicroSecondsFrom(time1);
  1020 	test.Printf(_L("\nAsync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
  1026 	test.Printf(_L("\nAsync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
  1021 	time=I64LOW(timeTaken.Int64() / KuStomS); 
  1027 	time=I64LOW(timeTaken.Int64() / KuStomS);
  1022 	#if !defined(__WINS__)
  1028 	#if !defined(__WINS__)
  1023 	// If this condition fails, means that writing the async file while fairscheduling a small async write takes too long
  1029 	if (!Is_HVFS(TheFs, gDrive))
       
  1030 		{
       
  1031 		// If this condition fails, it means that writing the async file while fairscheduling a small async write takes too long
  1024 		test.Printf(_L("time: %f\n"), time);
  1032 		test.Printf(_L("time: %f\n"), time);
  1025 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
  1033 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
  1026 //		test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) ); 
  1034 		// test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) );
  1027 		test(time > 0);
  1035 		test(time > 0);
       
  1036 		}
  1028 	#endif
  1037 	#endif
  1029 	bigFile.Close();
  1038 	bigFile.Close();
  1030 	smallFile.Close();	
  1039 	smallFile.Close();	
  1031 }
  1040 }
  1032 
  1041 
  1334 
  1343 
  1335   	test.Next(_L("Ensure write order is preserved\n"));
  1344   	test.Next(_L("Ensure write order is preserved\n"));
  1336 	TestWriteOrder();
  1345 	TestWriteOrder();
  1337 	
  1346 	
  1338 	// Format the drive to make sure no blocks are left to be erased in LFFS
  1347 	// Format the drive to make sure no blocks are left to be erased in LFFS
  1339 	#if !defined(__WINS__)
  1348 	if (!Is_Win32(TheFs, gDrive))
  1340 		Format(gDrive);	
  1349 		Format(gDrive);	
  1341 	#endif
  1350 	
  1342 	r = TheFs.MkDirAll(gSessionPath);
  1351 	r = TheFs.MkDirAll(gSessionPath);
  1343 	
  1352 	
  1344 	TimeTakenToWriteBigFile(1);  
  1353 	TimeTakenToWriteBigFile(1);  
  1345 	TimeTakenToWriteBigFileAsync(1);
  1354 	TimeTakenToWriteBigFileAsync(1);
  1346 
  1355 
  1503 	else if (r == KErrCorrupt)
  1512 	else if (r == KErrCorrupt)
  1504 		{
  1513 		{
  1505 		test.Printf(_L("%c: Media corruption; previous test may have aborted; else, check hardware\n"), (TUint)gDrive + 'A');
  1514 		test.Printf(_L("%c: Media corruption; previous test may have aborted; else, check hardware\n"), (TUint)gDrive + 'A');
  1506 		}
  1515 		}
  1507 	TESTERROR(r);
  1516 	TESTERROR(r);
  1508 #if !defined(__WINS__)
  1517 	
  1509 	if ((volInfo.iDrive.iMediaAtt & KMediaAttFormattable))
  1518 	if (!Is_Win32(TheFs, gDrive) && (volInfo.iDrive.iMediaAtt & KMediaAttFormattable))
  1510 		Format(gDrive);
  1519 		Format(gDrive);
  1511 #endif
       
  1512 
  1520 
  1513 	if(CheckForDiskSize())
  1521 	if(CheckForDiskSize())
  1514 		{
  1522 		{
  1515 		DoTests();
  1523 		DoTests();
  1516 		}
  1524 		}