diff -r 31a8f755b7fe -r 211563e4b919 persistentstorage/sql/TEST/t_sqloom2.cpp --- a/persistentstorage/sql/TEST/t_sqloom2.cpp Thu Apr 01 00:19:42 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqloom2.cpp Wed Apr 14 17:46:32 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -45,7 +45,7 @@ //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement) void PrepareStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) { - _LIT8(KSqlString, "SELECT * FROM BBB"); + _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); TInt err = aStmt.Prepare(aDb, KSqlString); User::LeaveIfError(err); } @@ -53,14 +53,14 @@ //"RSqlStatement::PrepareL()" OOM test (8-bit SELECT SQL statement) void PrepareStmt8_2L(RSqlDatabase& aDb, RSqlStatement& aStmt) { - _LIT8(KSqlString, "SELECT * FROM BBB"); + _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); aStmt.PrepareL(aDb, KSqlString); } //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement), syntax error void PrepareBadStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) { - _LIT8(KSqlString, "SELECT123 * FROM BBB"); + _LIT8(KSqlString, "SELECT123 * FROM BBB WHERE Fld1=? AND Fld4<>?"); TInt err = aStmt.Prepare(aDb, KSqlString); User::LeaveIfError(err); } @@ -68,16 +68,18 @@ //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement, move next) void PrepareMoveStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) { - _LIT8(KSqlString, "SELECT * FROM BBB"); + _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); TInt err = aStmt.Prepare(aDb, KSqlString); - if(err == KErrNone) - { - err = aStmt.Next(); - if(err == KSqlAtRow) - { - err = KErrNone; - } - } + User::LeaveIfError(err); + err = aStmt.BindInt(0, 1); + User::LeaveIfError(err); + err = aStmt.BindText(1, _L("data244weewfn43wr83224iu23ewkjfbrektug4i433b3k45b")); + User::LeaveIfError(err); + err = aStmt.Next(); + if(err == KSqlAtRow) + { + err = KErrNone; + } User::LeaveIfError(err); } @@ -261,7 +263,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -726,7 +728,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -961,7 +963,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KBlobOomTestAllocLimitServer : KBlobOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -1151,7 +1153,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles();