Пример #1
0
/**
Check that view contains 1 field for each contact and that field is null
*/
void CContactViewTest::doEmptyFieldsetSortTestL(const CContactViewBase &aLView)
	{
	TInt length = aLView.CountL();
	TInt manyfields = 0;
	TInt i;
	INTCOMPARE( length , ==,  iContacts, 0, 0 );

	for(i = 0; i < length; ++i)
		{
		const CViewContact &vcontact = aLView.ContactAtL(i);
		manyfields = vcontact.FieldCount();
		INTCOMPARE( manyfields , ==,  1,  i, 0 );
		SINGLECOMPARE(  CheckViewContact( aLView.ContactAtL(i), KNullDesC ),  i ,  0 );
		}
	iObserver->iMainFunc = NULL;
	iObserver->iDoFunc = NULL;
	iObserver->CleanView();
	}
Пример #2
0
/**
check that local view contains 10 contacts, each containing 1 empty field
*/
void CContactViewTest::doAllEmptyTestL(const CContactViewBase &aLView)
	{
	ClosePersistanceL(ETrue);
	TInt length = aLView.CountL();
	TInt manyfields = 0;
	TInt i;
	INTCOMPARE( length , ==,  iContacts, 0, 0 );

	for(i = 0; i < length; ++i)
		{
		manyfields = aLView.ContactAtL(i).FieldCount();
		INTCOMPARE( manyfields , ==,  1,  i, 0 );
		SINGLECOMPARE(  CheckViewContact( aLView.ContactAtL(i), KNullDesC ),  i ,  0 );
		}
	iObserver->iMainFunc = NULL;
	iObserver->iDoFunc = NULL;
	iObserver->CleanView();
	}
Пример #3
0
/**
check that local view contains 10 contacts, each containing 1 empty field
*/
void CContactViewTest::doViewEmptyTestL(const CContactViewBase &aLView)
	{
	TInt length = aLView.CountL();
	TInt manyfields = 0;
	TInt i;
	INTCOMPARE( length , ==,  iContacts, 0, 0 );
	iIterate->Reset();
	for(i = 0; i < length; ++i)
		{
		const CViewContact &vcontact = aLView.ContactAtL(i);
		manyfields = vcontact.FieldCount();
		INTCOMPARE( manyfields , ==,  1,  i, 0 );
		SINGLECOMPARE(  CheckViewContact( vcontact, GetFieldL(1) ),  i,  0 );
		}
	iObserver->iMainFunc = NULL;
	iObserver->iDoFunc = NULL;
	iObserver->CleanView();
	}
Пример #4
0
/**
check that a field is generated for each view contact and that field matches list of missing of fields
remove generated field from contact item and repopulate contact view repeat until view contact field is null
*/
void CContactViewTest::doMissingFieldTestL(const CContactViewBase &aLView)
	{
	ClosePersistanceL(ETrue);
	TBool end = ETrue;
	TInt length = aLView.CountL();
	TInt manyfields = 0;
	TInt i;
	//iterate through ini file, that stores list of expected field in order
	const TPtrC mfield = GetNextFieldL();
	INTCOMPARE( length , ==,  iContacts, 0, 0 );
	iIterate->Reset();

	for(i = 0; i < length; ++i)
		{
		const TInt loc = aLView.FindL(iIterate->NextL());
		const CViewContact &vcontact = aLView.ContactAtL( loc );
		manyfields = vcontact.FieldCount();
		const TPtrC vfield = vcontact.Field(0);
		INTCOMPARE(  manyfields , ==,  1,  i, 0 );
		
		//compare view contact field to field stored in ini file
		STRINGCOMPARE( vfield, ==, mfield, i, 0 );
		//if view contact field is null, end test
		end = end && (vfield == KNullDesC);
		//find view contact field in contact item and set to null, if field not found, end test
		end = end || !FindAndClearFieldL( vcontact.Id(), vfield );
		}


	if( end )
		{
		iObserver->iMainFunc = NULL;
		iObserver->iDoFunc = NULL;
		iObserver->CleanView();
		}
	else
		{
		//if test not complete, reset view and repopulate
		OpenPersistanceL();
		iObserver->CleanView();
		iObserver->SetView( CreateViewL() );
		}
	}
Пример #5
0
/**
check that local view contains 10 contacts, each containing as many fields
as there are uids (114), all field that have a corresponding uid should be
non-empty
*/
void CContactViewTest::doAllFullTestL(const CContactViewBase &aLView)
	{
	ClosePersistanceL(ETrue);
	TInt length = aLView.CountL();
	TInt arrayLength = iExistingUidsArray->Count();
	TInt manyfields = 0;
	TInt i;
	INTCOMPARE( length , ==,  iContacts, 0, 0 );

	for(i = 0; i < length; ++i)
		{
		const CViewContact &vcontact = aLView.ContactAtL(i);
		manyfields = vcontact.FieldCount();
		INTCOMPARE( manyfields , ==,  arrayLength,  i, 0 );
		SINGLECOMPARE(  CheckViewContactL( vcontact ),  i ,  0 );
		}
	iObserver->iMainFunc = NULL;
	iObserver->iDoFunc = NULL;
	iObserver->CleanView();
	}