Beispiel #1
0
/**
@SYMTestCaseID          SYSLIB-DBMS-CT-0637
@SYMTestCaseDesc        Streaming conversions test
@SYMTestPriority        Medium
@SYMTestActions         Test the database definition and enquiry functions 
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
LOCAL_C void Test()
	{
	test.Start(_L(" @SYMTestCaseID:SYSLIB-DBMS-CT-0637 Build without transactions "));
	CreateDatabaseL();
	TUint time1,size1;
	BuildTable(KRecords,EFalse,time1,size1);
	CloseDatabaseL();
	test.Next(_L("Build with transactions"));
	CreateDatabaseL();
	TUint time2,size2;
	BuildTable(KRecords,ETrue,time2,size2);
	test.Printf(_L("Transaction performance: time %4.2f, size %4.2f\n"),TReal(time1)/TReal(time2),TReal(size1)/TReal(size2));
	test.Next(_L("Build Int index"));
	Execute(_L("create unique index int on table (int)"));
	test.Next(_L("Break index"));
	BreakIndex();
	test.Next(_L("Build Text index"));
	Execute(_L("create unique index text on table (text)"));
	test.Next(_L("Recover"));
	test (TheDatabase.IsDamaged());
	CloseDatabaseL();
	OpenDatabase();
	test (TheDatabase.IsDamaged());
	Recover();
	test.Next(_L("Drop table"));
	Execute(_L("drop table table"));
	CloseDatabaseL();
	}
Beispiel #2
0
/**
 * Test Step postamble function, part of cleanup activity for the test step
 */
TVerdict CTestContactViewDatabaseUtilitiesStep::doTestStepPostambleL()
	{
	iPimTestServer.Close();
	CloseDatabaseL();
	UnInstallActiveSchedularL();
	return TestStepResult();
	}
Beispiel #3
0
/**
@SYMTestCaseID          SYSLIB-DBMS-CT-0579
@SYMTestCaseDesc        Tests the database definition and enquiry functions
@SYMTestPriority        Medium
@SYMTestActions        	Executes the index and bookmark tests
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
LOCAL_C void BigTestL()
	{
	test.Start(_L(" @SYMTestCaseID:SYSLIB-DBMS-CT-0579 Table "));
	CreateDatabaseL();
	BuildTable(KRecords);
	test(TheTable.Open(TheDatabase,KTableName)==KErrNone);
	TheTable.EndL();
	IterateL(TheTable.EPrevious);
	TheTable.BeginningL();
	IterateL(TheTable.ENext);
	TheTable.EndL();
	IterateL(TheTable.EPrevious);
	TheTable.Close();
	test.Next(_L("Int32 Index"));
	CDbKey *key=CDbKey::NewLC();
	key->AddL(KColumnInt);
	key->MakeUnique();
	TestIndex(KIndexInt,*key);
	test.Next(_L("Text[200] Index"));
	key->Clear();
	key->AddL(KColumnText);
	key->MakeUnique();
	TestIndex(KIndexText,*key);
	test.Next(_L("Bookmarks"));
	TestBookmark();
	test.Next(_L("Int32 Index"));
#ifndef __TOOLS2__
	TheTimer.Start(_L("drop"));
#endif
	test(TheDatabase.DropIndex(KIndexInt,KTableName)==KErrNone);
#ifndef __TOOLS2__
	TheTimer.Stop();
#endif
	key->Clear();
	key->AddL(KColumnInt);
	key->MakeUnique();
	TestIndex(KIndexInt,*key);
	CleanupStack::PopAndDestroy();
	test.Next(_L("Break & Recover"));
	BreakIndex();
	Recover();
	test.Next(_L("Drop Indexes"));
	DropIndexes();
	test.Next(_L("Delete all records"));
	DeleteTable();
	CloseDatabaseL();
	test.End();
	}
/**
* Adds contact cards and groups in the database
*/
void CTestContactViewCRUDOperationsStep::CreateContactItemsL()
	{
	_LIT(KAddContacts, "add");
	TBool addContacts = EFalse;
	GetBoolFromConfig(ConfigSection(), KAddContacts, addContacts);

	if(!addContacts)
		{
		return;
		}

	// Add contacts and groups in the main thread and validate the view count and view notifications
	// in the contact views thread
	TPtrC currentOperation(KAddContactOperations);
	SetCurrentOperation(currentOperation);
	AddContactEntriesL();
	CloseDatabaseL();
	OpenDataBaseL();
	ResumeContactViewsThreadL();
	}
/**
* Deletes contact items in the database
*/
void CTestContactViewCRUDOperationsStep::RemoveContactItemsL()
	{
	_LIT(KDeleteContacts, "delete");
	TBool deleteContacts = EFalse;
	GetBoolFromConfig(ConfigSection(), KDeleteContacts, deleteContacts);

	if(!deleteContacts)
		{
		return;
		}

	// Delete Contacts in the main thread and validate the view count and view notifications
	// in the contact views thread
	TPtrC currentOperation(KRemoveContactsOperations);
	SetCurrentOperation(currentOperation);
	DeleteContactCardsL();
	CloseDatabaseL();
	OpenDataBaseL();
	ResumeContactViewsThreadL();
	}
Beispiel #6
0
/**
@SYMTestCaseID          SYSLIB-DBMS-CT-1317
@SYMTestCaseDesc        Deleting a table from the database 
@SYMTestPriority        Medium
@SYMTestActions        	Delete the rows from the rowset.Check for empty rows in the rowset.
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
LOCAL_C void DeleteTable()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-DBMS-CT-1317 "));
	const TInt KTenthRecords=KRecords/10;

	test (TheTable.Open(TheDatabase,KTableName)==KErrNone);
	TheDatabase.Begin();
	TInt ii;
	for (ii=0;ii<15;++ii)
		{
		TheTable.NextL();
		TheTable.DeleteL();
		}
	TheTable.NextL();
	TDbBookmark mark=TheTable.Bookmark();
	TheTable.Close();
	TheDatabase.Commit();
	CloseDatabaseL();
	OpenDatabaseL();
#ifndef __TOOLS2__
	TheTimer.Start(_L("delete table"));
#endif
	test (TheTable.Open(TheDatabase,KTableName)==KErrNone);
	TheDatabase.Begin();
	TheTable.GotoL(mark);
	TheTable.DeleteL();
	for (ii=0;ii<KTenthRecords*2-16;++ii)
		{
		TheTable.NextL();
		TheTable.DeleteL();
		}
	TheTable.EndL();
	for (ii=0;ii<KTenthRecords*2;++ii)
		{
		TheTable.PreviousL();
		TheTable.DeleteL();
		}
	TheTable.BeginningL();
	for (ii=0;ii<KTenthRecords*3;++ii)
		TheTable.NextL();
	for (ii=0;ii<KTenthRecords*2;++ii)
		{
		TheTable.NextL();
		TheTable.DeleteL();
		}
	for (ii=0;ii<KTenthRecords*2;++ii)
		{
		TheTable.PreviousL();
		TheTable.DeleteL();
		}
	for (ii=0;ii<KTenthRecords;++ii)
		{
		TheTable.NextL();
		TheTable.DeleteL();
		}
	for (ii=0;ii<KTenthRecords;++ii)
		{
		TheTable.PreviousL();
		TheTable.DeleteL();
		}
	test (TheTable.CountL()==0);
	test (!TheTable.NextL());
	test (!TheTable.PreviousL());
	test (TheDatabase.Commit()==KErrNone);
	TheTable.Close();
#ifndef __TOOLS2__
	TheTimer.Stop();
#endif
	}