persistentstorage/sql/TEST/t_sqlload.cpp
changeset 29 cce6680bbf1c
parent 28 7a522c0700d3
child 51 7d4490026038
--- a/persistentstorage/sql/TEST/t_sqlload.cpp	Fri May 14 13:32:10 2010 +0100
+++ b/persistentstorage/sql/TEST/t_sqlload.cpp	Thu Jul 01 17:02:22 2010 +0100
@@ -60,6 +60,9 @@
 //Binary data length
 const TInt KBinDataLen = 2003;
 
+//StatementMaxNumberTest() time limit in seconds.
+const TInt KTestTimeLimit = 60;//seconds
+
 ///////////////////////////////////////////////////////////////////////////////////////
 
 void DeleteTestFiles()
@@ -124,8 +127,8 @@
 ///////////////////////////////////////////////////////////////////////////////////////
 
 //StatementMaxNumberTest() timeouts in WDP builds.
-//This function is used to check whether the time limit is reaqched or not.
-TBool IsTimeLimitReached()
+//This function is used return the seconds passed from the start of the test case.
+TTimeIntervalSeconds ExecutionTimeSeconds()
 	{
 	struct TStartTime
 		{
@@ -137,7 +140,6 @@
 		};
 	
 	static TStartTime startTime; 
-	const TInt KTestTimeLimit = 150;//seconds
 	
 	TTime currTime;
 	currTime.HomeTime();
@@ -145,7 +147,7 @@
 	TTimeIntervalSeconds s;
 	TInt err = currTime.SecondsFrom(startTime.iTime, s);
 	TEST2(err, KErrNone);
-	return s.Int() > KTestTimeLimit;
+	return s;
 	}
 
 void CreateTestDir()
@@ -614,8 +616,9 @@
 		if((idx % 100) == 0)
 			{
 			GetHomeTimeAsString(time);
-			TheTest.Printf(_L("=== %S: Create % 5d statements\r\n"), &time, idx + 1);
-			if(IsTimeLimitReached())
+			TTimeIntervalSeconds s = ExecutionTimeSeconds();
+			TheTest.Printf(_L("=== %S: Create % 5d statements. %d seconds.\r\n"), &time, idx + 1, s.Int());
+			if(s.Int() > KTestTimeLimit)
 				{
 				TheTest.Printf(_L("=== %S: The time limit reached.\r\n"), &time);
 				++idx;//The idx-th statement is valid, the statement count is idx + 1.
@@ -649,12 +652,13 @@
 		TEST2(err, KSqlAtRow);
 		err = stmt[idx].Next();
 		TEST2(err, KSqlAtEnd);
+		GetHomeTimeAsString(time);
+		TTimeIntervalSeconds s = ExecutionTimeSeconds();
 		if((j % 100) == 0)
 			{
-			GetHomeTimeAsString(time);
-			TheTest.Printf(_L("=== %S: % 5d statements processed\r\n"), &time, j + 1);
+			TheTest.Printf(_L("=== %S: % 5d statements processed. %d seconds.\r\n"), &time, j + 1, s.Int());
 			}
-		if(IsTimeLimitReached())
+		if(s.Int() > KTestTimeLimit)
 			{
 			TheTest.Printf(_L("=== %S: The time limit reached.\r\n"), &time);
 			break;