persistentstorage/sql/TEST/t_sqlperformance4.cpp
branchRCL_3
changeset 56 839ea9debada
parent 42 28839de615b4
equal deleted inserted replaced
50:8dc8494f1e0e 56:839ea9debada
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 // NTT DOCOMO, INC - Fix for Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic"
       
    13 //
    12 //
    14 // Description:
    13 // Description:
    15 //
    14 //
    16 
    15 
    17 #include <e32test.h>
    16 #include <e32test.h>
   299 		TInt eolPos = sql.Locate(TChar('\n'));
   298 		TInt eolPos = sql.Locate(TChar('\n'));
   300 		if(eolPos < 0)
   299 		if(eolPos < 0)
   301 			{
   300 			{
   302 			break;//No more SQL statements
   301 			break;//No more SQL statements
   303 			}
   302 			}
   304 		TInt stmtLength = eolPos;
   303 		TPtrC8 sqlStmt8(sql.Ptr(), eolPos - 1);//"eolPos - 1" - to cut off the '\r' character
   305 		while (stmtLength > 0 && (sql[stmtLength-1] == '\r'))
       
   306 			{
       
   307 			--stmtLength; //Reduce length to remove carriage return characters from the end of the statement string
       
   308 			}
       
   309 		TPtrC8 sqlStmt8(sql.Ptr(), stmtLength);
       
   310 		TPtrC8 ptr = sql.Mid(eolPos + 1);//"eolPos + 1" - first character after '\n'
   304 		TPtrC8 ptr = sql.Mid(eolPos + 1);//"eolPos + 1" - first character after '\n'
   311 		sql.Set(const_cast <TUint8*> (ptr.Ptr()), ptr.Length(), ptr.Length());
   305 		sql.Set(const_cast <TUint8*> (ptr.Ptr()), ptr.Length(), ptr.Length());
   312 		++recordCount;
   306 		++recordCount;
   313 		
   307 		
   314 		//Convert to 16 bit query string
   308 		//Convert to 16 bit query string