authorisation/userpromptservice/database/test/tupsdb/source/tupsdbstep.cpp
changeset 62 b23410e29e22
parent 8 35751d3474b7
equal deleted inserted replaced
60:11c66574c2a2 62:b23410e29e22
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   447 			
   447 			
   448 			//Connect to the database
   448 			//Connect to the database
   449 			upsDb = CDecisionDbW::NewL(iDbLocation,iFs);
   449 			upsDb = CDecisionDbW::NewL(iDbLocation,iFs);
   450 			CleanupStack::PushL(upsDb);
   450 			CleanupStack::PushL(upsDb);
   451 			
   451 			
   452 			RPointerArray<CDecisionRecord> recordList = GetDecisionsL(*upsDb,*filter,iCancel);
   452 			RPointerArray<CDecisionRecord> recordList;
       
   453 			CleanupResetAndDestroyPushL(recordList);
       
   454 			GetDecisionsL(*upsDb, *filter, iCancel, recordList);
   453 			
   455 			
   454 			TInt recNum;
   456 			TInt recNum;
   455 			recNum = recordList.Count();
   457 			recNum = recordList.Count();
   456 			if(recNum)
   458 			if(recNum)
   457 				{
   459 				{				
   458 				CleanupClosePushL(recordList);
       
   459 				OpenDecisionFileL(EFileWrite);
   460 				OpenDecisionFileL(EFileWrite);
   460 			
   461 			
   461 				for(TInt i=0; i<recNum; ++i)
   462 				for(TInt i=0; i<recNum; ++i)
   462 					{
   463 					{
   463 					WriteDecisionL(*recordList[i]);
   464 					WriteDecisionL(*recordList[i]);
   464 					}
   465 					}
   465 				CloseDecisionFile();
   466 				CloseDecisionFile();				
   466 				CleanupStack::Pop(&recordList);
   467 				}
   467 				}
   468 			CleanupStack::PopAndDestroy(&recordList);			
   468 			recordList.Close();
       
   469 				
   469 				
   470 			TInt expectedRecords;
   470 			TInt expectedRecords;
   471 			if(EFalse == GetIntFromConfig(ConfigSection(),KExpectedRecords,expectedRecords))
   471 			if(EFalse == GetIntFromConfig(ConfigSection(),KExpectedRecords,expectedRecords))
   472 				{
   472 				{
   473 				expectedRecords=-1;
   473 				expectedRecords=-1;