void CTransactionsStep::NestedTransactionTestL()
	{
	TContactItemId cid = iIterate->NextL();
	
	iContactsDatabase->DatabaseBeginLC(EFalse);
	iContactsDatabase->DatabaseBeginLC(ETrue);
	OpenL(cid);
	SetFieldL(1, GetFieldL(KStringFields, KField, 1) );
	CommitL(ETrue);
	iContactsDatabase->DatabaseCommitLP(ETrue);
	OpenL(cid);
	SetFieldL(2, GetFieldL(KStringFields, KField, 2) );
	CommitL(ETrue);	
	EndTransactionL(ETrue);
	
	iIterate->Reset();
	TInt err = KErrNone;
	TInt k = 0;
	TESTPRINT( iContactsDatabase->CountL() == iContacts );
	
	for( k = 0; k < iContacts; ++k)
		{
		TRAP(err, ReadL( iIterate->NextL() ) );
		TESTPRINTI( KErrNone == err, k );
		TESTPRINTI( CheckAllFieldsL(KNullDesC), k );
		CloseL( ETrue );
		}	
	}
// ---------------------------------------------------------------------------
// CAppMngr2InfoIterator::SetAllFieldsL()
// ---------------------------------------------------------------------------
//
EXPORT_C void CAppMngr2InfoIterator::SetAllFieldsL()
    {
    SetFieldL( R_SWCOMMON_DETAIL_NAME, iInfo.Name() );
    SetStatusL();
    SetLocationL();
    SetFieldL( R_SWCOMMON_DETAIL_APPSIZE, iInfo.Details() );
    SetOtherFieldsL();
    }
示例#3
0
void CContactViewTest::SetContactL()
	{
	TInt length = iFields->Count();
	TInt i;
	for( i = 0; i < length; ++i)
		{
		SetFieldL(*iFields, i, (*iFields)[i].Label());
		}
	}
/**
sets aMany fields of a currently read / open item to aText
*/
void CContactsRamTest::SetManyFieldsL(const TDesC& aText, const TInt aMany, CContactItemFieldSet &fields)
	{
	TInt count = fields.Count();
	if( count > aMany )
		{
		count = aMany;
		}
	TInt i = 0;
	for(; i < count; ++i)
		{
		SetFieldL(fields[i],aText);
		}
	}
/**
sets aMany fields of a currently read / open item to aText
*/
void CPerformanceFunctionalityBase::SetManyFieldsL(const TDesC& aText, const TInt aMany)
	{
	TInt count = iFields->Count();
	if( count > aMany )
		{
		count = aMany;
		}
	TInt i = 0;
	for(; i < count; ++i)
		{
		SetFieldL(i,aText);
		}
	}
// ---------------------------------------------------------------------------
// CAppMngr2InfoIterator::SetStatusL()
// ---------------------------------------------------------------------------
//
EXPORT_C void CAppMngr2InfoIterator::SetStatusL()
    {
    HBufC* status = NULL;
    if( iInfoType == EAppMngr2StatusInstalled )
        {
        status = StringLoader::LoadLC( R_SWCOMMON_DETAIL_VALUE_INSTALLED );
        }
    else // iInfoType is EAppMngr2StatusNotInstalled
        {
        status = StringLoader::LoadLC( R_SWCOMMON_DETAIL_VALUE_NOT_INSTALLED );
        }
    SetFieldL( R_SWCOMMON_DETAIL_STATUS, *status );
    CleanupStack::PopAndDestroy( status );
    }
示例#7
0
TVerdict CConcurrentInitializerStep::doTestStepL()
	{
	__UHEAP_MARK;
	_LIT(KStartTest,"CConcurrentInitializerStep::doTestStepL()");
	INFO_PRINTF1(KStartTest);  //Block start

	InitializeL();
	iIterate->Reset();
	TInt j = 0;
	for(; j < iContacts; ++j)
		{
		OpenL(iIterate->NextL());
		TInt fieldId=iFields->Find(KUidContactFieldPhoneNumber);
		SetFieldL(fieldId,GetFieldL(KStringFields, KField, 1));// if this is not set, speeddial cant be set
		CommitL(EFalse);
		}
	iIterate->Reset();
	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
// ---------------------------------------------------------------------------
// CAppMngr2InfoIterator::SetLocationL()
// ---------------------------------------------------------------------------
//
EXPORT_C void CAppMngr2InfoIterator::SetLocationL()
    {
    TChar driveChar;
    RFs::DriveToChar( iInfo.LocationDrive(), driveChar );
    const TInt KSingleLetter = 1;
    TBuf<KSingleLetter> driveLetter;
    driveLetter.Append( driveChar );

    HBufC* memory = NULL;
    if( iInfo.Location() == EAppMngr2LocationMemoryCard )
        {
        memory = StringLoader::LoadLC( R_SWCOMMON_DETAIL_VALUE_MMC, driveLetter );
        }
    else if( iInfo.Location() == EAppMngr2LocationMassStorage )
        {
        memory = StringLoader::LoadLC( R_SWCOMMON_DETAIL_VALUE_MASS_STORAGE, driveLetter );
        }
    else
        {
        memory = StringLoader::LoadLC( R_SWCOMMON_DETAIL_VALUE_DEVICE, driveLetter );
        }
    SetFieldL( R_SWCOMMON_DETAIL_LOCATION, *memory );
    CleanupStack::PopAndDestroy( memory );
    }