您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ConfigSection函数代码示例

51自学网 2021-06-01 20:13:15
  C++
这篇教程C++ ConfigSection函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ConfigSection函数的典型用法代码示例。如果您正苦于以下问题:C++ ConfigSection函数的具体用法?C++ ConfigSection怎么用?C++ ConfigSection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ConfigSection函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: INFO_PRINTF2

/*** Function Name		:	TestFtw4* Description		: 	ftw for invalid path* Return Value		: 	ftw returns ENOTDIR*/TInt CTestftw::TestFtw4()    {    char parm[PATH_MAX];	int result; 	int ret;		int fd=open("c://validfile.txt", O_WRONLY|O_CREAT);	if(fd==-1)		{		INFO_PRINTF2(_L("file open fails with error No: %d"), errno);		return KErrGeneral;		}		memset(&parm[0], 0, PATH_MAX);       	ReadStringParam(parm);	ret=ftw(parm, &action, 10);   	GetIntFromConfig(ConfigSection(), _L("Expected"), result);   	if(ret==-1 && errno==result)   		{   		close(fd);   		INFO_PRINTF2(_L("ftw returns error no: %d"), errno);		unlink("c://validfile.txt");   		return KErrNone;   		}   	INFO_PRINTF2(_L("ftw fails with error No: %d"), errno);   	close(fd);   	unlink("c://validfile.txt");   	return KErrGeneral;	    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:34,


示例2: doTestStepL

/**doTestStepL()Reads the expected count from the ini file.Obtains the count of the POP accounts created and compares against the expected number.@returnReturns the test step result.*/TVerdict CT_MsgVerifyPopAccountsCount::doTestStepL()	{	INFO_PRINTF1(_L("Test Step: Verify Pop Accounts Count"));	TInt expectedCount = -1;	if(!GetIntFromConfig(ConfigSection(), KExpectedCount, expectedCount) && expectedCount < 0)		{		ERR_PRINTF1(_L("ExpectedCount is not Specified or < 0"));		SetTestStepResult(EFail);		}	else		{		CEmailAccounts *account = CEmailAccounts::NewLC();			RArray<TPopAccount> arrayPopAccounts;		account->GetPopAccountsL(arrayPopAccounts);		TInt count = arrayPopAccounts.Count();				CleanupStack::PopAndDestroy(account);		arrayPopAccounts.Reset();				if (count != expectedCount)			{			ERR_PRINTF3(_L("Number of POP accounts do not match ! expected = %d actual = %d"), 									  expectedCount, count);			SetTestStepResult(EFail);			}		else			{			INFO_PRINTF2(_L("Number of POP accounts matched value = %d !"), expectedCount);				}					}	return TestStepResult();	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:40,


示例3: GetStringFromConfig

/**  * Copy the exported file attachments from ROM to RAM drive  */void CTestCalInterimApiSuiteStepBase::CopyImportFileToWritableDriveL()	{	CFileMan* fileCopier = CFileMan::NewL(iFsSession);	CleanupStack::PushL(fileCopier);	TPtrC	file;	GetStringFromConfig(ConfigSection(), KInitialLocationOfFile, file);	RArray<TPtrC>	fileList;	CleanupClosePushL(fileList);	TokenizeStringL(file, fileList);	// Iterate through the file list and copy them from z drive to c drive	for ( TInt i = 0; i < fileList.Count(); i++ )		{		TFileName initialLocationOfFile = fileList[i];		initialLocationOfFile.Insert(0, KOriginalDrive());		// get current time		TTime now;		now.HomeTime();		// clear any read only attribute if the file is present such we avoid errors at copy time		fileCopier->Attribs(fileList[i], 0, KEntryAttReadOnly, now);		User::LeaveIfError(fileCopier->Copy(initialLocationOfFile, fileList[i], CFileMan::EOverWrite|CFileMan::ERecurse));		// clear any read only attribute such we avoid errors at open time (true on real hardware)		User::LeaveIfError(fileCopier->Attribs(fileList[i], 0, KEntryAttReadOnly, now));		}	CleanupStack::PopAndDestroy(&fileList);	CleanupStack::PopAndDestroy(fileCopier);	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:33,


示例4: drive

TVerdict CAddDriveStep::runTestStepL(TBool /*aOomTest*/)    {    TPtrC str;    TInt drive(0);    if (!GetStringFromConfig(ConfigSection(), _L("drive"), str))        {        ERR_PRINTF1(_L("Missing drive setting"));        SetTestStepResult(EFail);        }    else        {        RFs fs;        fs.Connect();                User::LeaveIfError(fs.CharToDrive(str[0], drive));        //iDriveChar = str[0];        fs.Close();        }    RSisRegistryWritableSession registrySession;                User::LeaveIfError(registrySession.Connect());    CleanupClosePushL(registrySession);    registrySession.AddDriveL(drive);    CleanupStack::PopAndDestroy(&registrySession);        return EPass;    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:28,


示例5: GetIntFromConfig

/** * Deleting the 1000 contact item * with all new fields * @return - void */void CTestContactPerformanceStep::DeletePerformanceL(){    // delete multiple contact item field    CContactItem *readItem = NULL;    //Get the number of contact item from ini file    GetIntFromConfig(ConfigSection(), KNoOfContactItem, iNoOfCI);    for(TInt readContact=0; readContact<iNoOfCI; readContact++)    {        readItem = dBase->ReadContactLC(idArray[readContact]);        CContactItemFieldSet& ContactFieldSet = readItem->CardFields();        for(TInt del=0; del<7; del++)        {            TInt pos = ContactFieldSet.Find(iFieldUid[del], iVcardUid[del]);            if(pos != KErrNotFound)            {                ContactFieldSet.Remove(pos);                SetTestStepResult(EPass);            }            else            {                ERR_PRINTF1(_L("field not deleted"));                SetTestStepResult(EFail);            }        }        CleanupStack::PopAndDestroy(readItem);    }    INFO_PRINTF1(_L("Fields deleted successfully"));}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:35,


示例6: GetIntFromConfig

/** Retrieves numeric id for various time zones*/void CTestTZServer::TimeZoneNumericIdL()	{	iField.Zero();	iField.Append(KNumericIds);	GetIntFromConfig(ConfigSection(),iField,iIntNumericId); //gets expected numeric id		RTz tz;	CleanupClosePushL(tz);	User::LeaveIfError(tz.Connect());		CTzId* tzId = NULL;	TRAPD(err,tzId = tz.GetTimeZoneIdL());			TESTL(err == KErrNone);		CleanupStack::PushL(tzId);	 	TUint tzNumericId = tzId->TimeZoneNumericID();		INFO_PRINTF2(_L("actual : %d"),tzNumericId);		TESTL(tzNumericId == iIntNumericId);		CleanupStack::PopAndDestroy(tzId);	CleanupStack::PopAndDestroy(&tz);	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:29,


示例7: GetIntFromConfig

			EXPORT_C enum TVerdict CPerformOCSPStep::doTestStepPreambleL()				{				TInt result = KErrNone;				TBool found = GetIntFromConfig(ConfigSection(), KExpectedValidationResultKey, result);				User::LeaveIfError(iExpectedResults.Append(result));							if (!found)					{									WARN_PRINTF1(_L("Missing Expected result defaulting to KErrNone"));						}						else					{					TBuf<128> mymsg;										mymsg.Format(_L("Expected result: (%d)"), iExpectedResults[0]);					INFO_PRINTF1(mymsg);					}									if (CActiveScheduler::Current() == NULL)				    {				    INFO_PRINTF1(_L("Installing scheduler"));				    iSched = new(ELeave) CActiveScheduler;				    CActiveScheduler::Install (iSched);				    }					    			    				    				return TestStepResult();						}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:28,


示例8: _LIT

/** * Reads data specified in the ini file and constructs all view validation objects */void CTestContactViewUnderlyingViewUpdateStep::ReadIniAndConstructViewValidationObjectsL()	{	_LIT(KListOfViewsToBeValidated, "ListOfViewsToBeValidated");	TPtrC listOfViewsToBeRemoved;	TESTL(GetStringFromConfig(ConfigSection(), KListOfViewsToBeValidated, listOfViewsToBeRemoved));	RArray<TPtrC>	sections;	CleanupClosePushL(sections);	ViewUtilityReference().TokenizeStringL(listOfViewsToBeRemoved, sections);	for ( TInt i = 0; i < sections.Count(); ++i )		{		TViewValidationData ViewValidationData;		_LIT(KContactViewType, "ViewType");		TPtrC contactViewTypeString;		GetStringFromConfig(sections[i], KContactViewType, contactViewTypeString);		ViewValidationData.SetViewType(contactViewTypeString);		_LIT(KContactViewIndex, "ViewIndex");		TInt contactViewIndex;		GetIntFromConfig(sections[i], KContactViewIndex, contactViewIndex);		ViewValidationData.SetViewIndex(contactViewIndex);		_LIT(KUpdatedViewCount, "UpdatedViewCount");		TInt updatedViewCount = 0;		GetIntFromConfig(sections[i], KUpdatedViewCount, updatedViewCount);		ViewValidationData.SetExpectedViewCount(updatedViewCount);		iViewValidationArray.AppendL(ViewValidationData);		}	CleanupStack::PopAndDestroy(&sections); 	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:37,


示例9: GetIntFromConfig

void CTPKCS7OOMTest::doTestOOML()	{	TInt OOMTest;	GetIntFromConfig(ConfigSection(),_L("OOMTestNo"),OOMTest);	__UHEAP_MARK;				if (OOMTest == 1)		{		CPKCS7ContentInfo* theTest = NULL;		theTest = CPKCS7ContentInfo::NewL(iRawData->Des());		delete theTest;		}	// Digest Info	else if (OOMTest == 2)		{		CPKCS7DigestInfo* theTest0 = NULL;		theTest0 = CPKCS7DigestInfo::NewL(iRawData->Des());		delete theTest0;		}	// Encrypted Data	else if (OOMTest == 3)		{		CPKCS7ContentInfo* theTest1 = NULL;		theTest1 = CPKCS7ContentInfo::NewL(iRawData->Des());					CleanupStack::PushL(theTest1);		CPKCS7EncryptedDataObject* theTest2 = NULL;		theTest2 = CPKCS7EncryptedDataObject::NewL(*theTest1);						CleanupStack::PopAndDestroy(theTest1);		delete theTest2;		}		__UHEAP_MARKEND;}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:35,


示例10: TestStepResult

//	Step 4	CertificateTVerdict CTPKCS7CertificateTest::doTestStepL()	{	if (TestStepResult() != EPass)		{		return TestStepResult();		}	TBool checkCount;	TInt expectedCount;	checkCount = GetIntFromConfig (ConfigSection(),_L("CertificateCount"), expectedCount);		TInt err;		CPKCS7ContentInfo * contentInfo = NULL;	TRAP (err, contentInfo = CPKCS7ContentInfo::NewL(iRawData->Des()));    	if(err == KErrNone)		{		CPKCS7SignedObject * p7 = NULL;		if( contentInfo->ContentType() == 2)			{			TRAP (err, p7 = CPKCS7SignedObject::NewL(*contentInfo));						if (err != KErrNone)				{				SetTestStepResult(EFail);				INFO_PRINTF2(_L("Got %d building PKCS7 object"), err);				}			else				{				CleanupStack::PushL (p7);				const RPointerArray<CPKCS7ExtendedCertificateOrCertificate>& certificates = p7->Certificates();				if (checkCount)					{					if (certificates.Count() != expectedCount)						{						SetTestStepResult(EFail);						INFO_PRINTF3(_L("Expected %d certificates, got %d"), expectedCount, certificates.Count());						}					}				CleanupStack::PopAndDestroy (p7);				}			}		}	else		{		SetTestStepResult(EFail);		}			if (!checkCount && (TestStepResult()==EPass))		{		SetTestStepResult(EInconclusive);		INFO_PRINTF1(_L("No test performed in this step"));		}	return TestStepResult();	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:61,


示例11: INFO_PRINTF1

TVerdict CVerifyServerCertStep::doTestStepL()	{	INFO_PRINTF1(_L("Calling TLS Provider Verify Certificate."));		CX509Certificate* cert = NULL;	TInt err = VerifyServerCertificateL(cert);	delete cert; // don't really need the cert		TInt expectedResult;		if (!GetIntFromConfig(ConfigSection(), KExpectedResult, expectedResult))		{		// failed to get expected result from config file... using KErrNone.		expectedResult = KErrNone;		}		if (err != expectedResult)		{		INFO_PRINTF3(_L("Failed! TLS Provider returned error code %d, expecting %d."),			err, expectedResult);		SetTestStepResult(EFail);		return EFail;		}	else		{		INFO_PRINTF1(_L("Test passed."));		SetTestStepResult(EPass);		}	return TestStepResult();	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:30,


示例12: WriteIntToConfig

/** Function : RetriveSearchSortResultL Description : Retrieves the search/sort result @return : none */void CT_MsgSearchSortByQueryObject::RetriveSearchSortResultL(const TInt aIterationLimit, TMsvSearchSortResultType aResultType)	{	// Get the number of messages satisfying the search/sort request	TInt resultCount = iSharedDataCommon.iSearchSortOperation->GetResultCountL();	WriteIntToConfig(ConfigSection(), KCountOfResult, resultCount); 		// Get the search/sort result according to user preference	TMsvId messageId, serviceId;	TMsvEntry messageEntry;	iSharedDataCommon.iSearchSortResultArray.Reset(); // Flush out the existing search/sort result	if (aIterationLimit > 0 && aResultType == EMsvResultAsTMsvId) // Iteration limit is one and result type is TMsvId		{		for(TInt index = 0; index < resultCount; ++index)			{			iSharedDataCommon.iSearchSortOperation->GetNextResultL(messageId);			 // Get the corresponding index entry and append the same to array of entries.			iSharedDataCommon.iSession->GetEntry(messageId, serviceId, messageEntry);			iSharedDataCommon.iSearchSortResultArray.Append(messageEntry);			}		}	else if(aIterationLimit > 0 && aResultType == EMsvResultAsTMsvEntry) // Iteration limit is one and result type is TMsvEntry		{		for(TInt index = 0; index < resultCount; ++index)			{			iSharedDataCommon.iSearchSortOperation->GetNextResultL(messageEntry);			iSharedDataCommon.iSearchSortResultArray.Append(messageEntry);			}		}	else if (aIterationLimit == 0 && aResultType == EMsvResultAsTMsvId) // No iteration and result type is TMsvId		{		RArray<TMsvId> idArray;		TRAPD(error, iSharedDataCommon.iSearchSortOperation->GetResultsL(idArray));		if(error == KErrNone)			{			// Get the corresponding index entries and create an array of entries.			for(TInt index = 0; index < idArray.Count(); ++index)				{				iSharedDataCommon.iSession->GetEntry(idArray[index], serviceId, messageEntry);				iSharedDataCommon.iSearchSortResultArray.Append(messageEntry);				}			}		else			{			SetTestStepError(error);			}		}	else // No iteration and result type is TMsvEntry		{//		RArray<TMsvEntry> entryArray;		TRAPD(error, iSharedDataCommon.iSearchSortOperation->GetResultsL(iSharedDataCommon.iSearchSortResultArray));		SetTestStepError(error);		}	// Ensure Number of Entries in iSharedDataCommon.iSearchSortResultArray is same as the result count	if(iSharedDataCommon.iSearchSortResultArray.Count() != resultCount)		{		ERR_PRINTF1(_L("MisMatch in Result count and Entries retrieved"));		ERR_PRINTF3(_L("Search-sort result count= %d Entries retrieved= %d"), resultCount, iSharedDataCommon.iSearchSortResultArray.Count());		SetTestStepResult(EFail);		}	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:65,


示例13: rawDataPtr

HBufC8* CTPKCS7StepBase::readFileL (TPtrC tag){    TPtrC fileName;    if (GetStringFromConfig(ConfigSection(), tag, fileName) == EFalse)    {        return NULL;    }    RFile file;    if (file.Open(iFs, fileName, EFileRead) != KErrNone)    {        INFO_PRINTF2(_L("Cannot open file %S for reading"), &fileName);        return NULL;    }    CleanupClosePushL(file);    TInt fileSize = 0;    User::LeaveIfError(file.Size(fileSize));    HBufC8* result = HBufC8::NewL(fileSize);    result->Des().SetLength(fileSize);    TPtr8 rawDataPtr(result->Des());    rawDataPtr.SetLength(fileSize);    file.Read (rawDataPtr);    CleanupStack::PopAndDestroy (&file);    INFO_PRINTF3(_L("Read %d octets from %S"), result->Size(), &fileName);    return result;}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:32,


示例14: INFO_PRINTF1

/**@SYMTestCaseID			PIM-APP-ENGINES-CALINTERIMAPI-CIT-0005-HP@SYMTestType			CIT@SYMTestPriority		Medium@SYMPREQ				1098@SYMFssID				3.2.1 005@SYMTestCaseDesc		delete the opened file@SYMTestActions			deletes the opened file@SYMTestExpectedResults	Aganda file is and deleted*/void CTestCalInterimApiSuiteStepBase::DeleteCalenderFileL()	{	INFO_PRINTF1(_L("Deleting calender file"));	TRAPD(err, iSession->DeleteCalFileL(iCalenderFileName));	if( err == KErrNone )		{		TBool reCreateCalFile = ETrue;	    if (!GetBoolFromConfig(ConfigSection(), KReCreateCalFile, reCreateCalFile))	        {	    	reCreateCalFile = ETrue;	        }	    if (reCreateCalFile)	        {	    	INFO_PRINTF1(_L("Trying to create the file after deletion"));		    TRAPD(err, iSession->CreateCalFileL(iCalenderFileName));		    if( err != KErrNone )			    {			    ERR_PRINTF2(KErrInDeleteCalFileL, err);			    SetTestStepResult(EFail);			    }	        }		}	else		{		ERR_PRINTF2(KErrDeletingCalenderFile, err);		SetTestStepResult(EFail);		}	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:40,


示例15: _LIT

TInt CTestSysunistd::nice_less_than_lowest( )    {	_LIT( KPassed, "Passed" );    _LIT( KFailed, "Failed" );    _LIT( KSetpriority, "In setpriority" );    INFO_PRINTF1( KSetpriority );	int retVal = 0, i;	TInt retrn;	errno = 0;	TInt prio_low_end;	TInt prio_low_start;		_LIT( Kprio_low_start, "Parameter1" );	TBool res = GetIntFromConfig(ConfigSection(), Kprio_low_start, prio_low_start);	if(!res)		{	 	_LIT(Kerr , "Failed to read first parameter from ini file") ;	 	INFO_PRINTF1(Kerr) ;	 	return KErrGeneral ;		}	 _LIT( Kprio_low_end, "Parameter2" );	 res = GetIntFromConfig(ConfigSection(), Kprio_low_end, prio_low_end);	 if(!res)		{	 	_LIT(Kerr , "Failed to read second parameter from ini file") ;	 	INFO_PRINTF1(Kerr) ;	 	return KErrGeneral ;		}	errno = 0;	for (i = prio_low_start; i >= prio_low_end; i--)		{		retVal = nice(i);		if((retVal == -1)&&(errno))			{			INFO_PRINTF1( KFailed );			retrn = KErrGeneral;			}		else			{	    	INFO_PRINTF1( KPassed );		    }		}	retrn = KErrNone;	return retrn ;    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:47,


示例16: _LIT

void CTestRControlChannel::SavePreviousLogFileL()	{	_LIT(KInfoLogFile, "Saving Previous logs If any.... /n");	INFO_PRINTF1(KInfoLogFile);	RFs fileserv;	TInt error = fileserv.Connect();	if(!error)		{		_LIT(KlogFile, "C://logs//log.txt");		_LIT(KPrefixLog, "C://logs//");		_LIT(KSuffix, "_UDEB");		_LIT(KExtn, ".txt");				CFileMan* fMan = NULL;		TRAP_IGNORE(fMan = CFileMan::NewL(fileserv));		if(fMan != NULL)			{			CleanupStack::PushL(fMan);			RBuf newFileName;			const TInt KTwenty = 20;			newFileName.Create(ConfigSection().Length() + KTwenty );			newFileName.Copy(KPrefixLog);			//Script file name			iScriptName.Copy(ConfigSection());			newFileName.Append(iScriptName);			newFileName.Append(KSuffix);			newFileName.Append(KExtn);						TInt error = fMan->Rename(KlogFile, newFileName);			if (error != KErrNone)				{				_LIT(KErrInfo, "Unable to Save Previous logs...May be NO Previous logs exist /n");				ERR_PRINTF1(KErrInfo);				}			else				{				_LIT(KSavingInfo, "Saved Previous logs with File Name: %S /n");				INFO_PRINTF2(KSavingInfo, &newFileName);				}			CleanupStack::PopAndDestroy(fMan);			newFileName.Close();			}		}	fileserv.Close();	_LIT(KInfoLogFile1, "Saving Previous logs End.... /n");	INFO_PRINTF1(KInfoLogFile1);	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:47,


示例17: INFO_PRINTF1

/**  Function : doTestStepL  Description : Reads the Imap account name, folder name ,the entry name from the ini file.				It the then searches for the given entry under the specified folder.				The test passes if the entry is found else it fail.  @return : TVerdict - Test step result*/TVerdict CT_MsgFindEntryByName::doTestStepL()	{	INFO_PRINTF1(_L(" TestStep :  FindEntryByName"));	/* Reads the IMAP account name from the ini file */	TPtrC imapAccountName;	if(!GetStringFromConfig( ConfigSection(), KImapAccountName, imapAccountName))		{		ERR_PRINTF1(_L("Imap Account Name is not specified"));		SetTestStepResult(EFail);		}	else		{		/* Retrieves the IMAP service Id for the given IMAP account */		TMsvId imapServiceId = CT_MsgUtilsCentralRepository::GetImapServiceIdL((TDes&)imapAccountName);		INFO_PRINTF2(_L("Imap service id is %d"),imapServiceId);		/* Reads the name of the remote folder from the ini file */		TPtrC folderName;		if(!GetStringFromConfig( ConfigSection(), KFolderName, folderName))			{			ERR_PRINTF1(_L("Remote Parent Folder name is not specified"));			SetTestStepResult(EFail);			}		else			{			/* Reads the entry name that is to be verified from the ini file */			TPtrC entryName;			if(!GetStringFromConfig( ConfigSection(), KEntryName, entryName))				{				ERR_PRINTF1(_L("Entry name to search is not specified"));				SetTestStepResult(EFail);				}			else				{				TBool caseSensitive = EFalse;				GetBoolFromConfig(ConfigSection(), KCaseSensitive, caseSensitive);				/* Gets the Id of the given entry to be searched */				TMsvId  entryId;				TRAPD(err,entryId = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataIMAP.iSession,imapAccountName,entryName,folderName,caseSensitive));				INFO_PRINTF2(_L(" The entry Id is %d"),entryId);				SetTestStepError(err);				}			}		}			return TestStepResult();	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:54,


示例18: TESTL

TVerdict CTestCompareCntFiles::doTestStepL()/** * @return - TVerdict code * Override of base class pure virtual */	{	// connect to file system	User::LeaveIfError(iFsSession.Connect());	TESTL(TestStepResult() == EPass);	INFO_PRINTF1(_L("CTestCompareCntFiles::doTestStepL() start"));	TESTL(GetStringFromConfig(ConfigSection(), KExportFile, iExportFilePath));		GetStringFromConfig(ConfigSection(), KExpectedExportFile, iExpectedExportFilePath);	GetStringFromConfig(ConfigSection(), KFieldToVerify, iFieldToVerify);	GetStringFromConfig(ConfigSection(), KNoField, iNoField);		// Create Utility class object, to use TokenizeStringL	CTestStep* self = static_cast<CTestStep*>(this);	iExportObj = new(ELeave) CContactsPBAPExportUtilityClass(self);		TokenizeAndCompareL();	TokenizeAndCheckNoFieldL();		// Comparing two files	TBool compareFile = EFalse;	GetBoolFromConfig(ConfigSection(), KCompareFile, compareFile);		if(compareFile)		{		TBool fileCompare = EFalse;		// Call CompareWholeFileL to use the normal comparison of two files, ignoring the REV property		fileCompare = CompareWholeFileL(iExpectedExportFilePath, iExportFilePath);		if(!fileCompare)			{			SetTestStepResult(EFail);			}		}		iFsSession.Close();    	INFO_PRINTF1(_L("CTestCompareCntFiles::doTestStepL() finish"));		return TestStepResult();		}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:47,


示例19: GetIntFromConfig

void CEtelMMLbsTestStepBase::ValidateMCRefLocParams()	{	TInt expectedRefLocLatSign ;	GetIntFromConfig(ConfigSection(), _L("expectedRefLocLatSign"), expectedRefLocLatSign );	TInt expectedRefLocLongSign ;	GetIntFromConfig(ConfigSection(), _L("expectedRefLocLongSign"), expectedRefLocLongSign );	TBool expectedRefLocRequest;	GetBoolFromConfig(ConfigSection(), _L("expectedRefLocRequest"), expectedRefLocRequest);		// Reference Location data populated and status is false	TEST(iMeasurementControl.iMeasurementCommand.iSetup.iUePosGpsAssistanceData.iReferenceLocation.iLatitudeSign == DMMTSY_PHONE_LCS_MC_GPS_REFLOC_LATSIGN1);	TEST(iMeasurementControl.iMeasurementCommand.iSetup.iUePosGpsAssistanceData.iReferenceLocation.iLatitude == expectedRefLocLatSign);	TEST(iMeasurementControl.iMeasurementCommand.iSetup.iUePosGpsAssistanceData.iReferenceLocation.iLongitude == expectedRefLocLongSign) ;	TEST(iMeasurementControl.iMeasurementCommand.iSetup.iUePosGpsAssistanceData.iGpsAddlDataStatus.iReferenceLocationRequest == expectedRefLocRequest);	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:17,


示例20: ConfigSection

void CContactViewTest::PreTestL()	{	iSemaphore.CreateLocal( 0 );	iSemaphore2.CreateLocal( 0 );	const TDesC &KSection = ConfigSection();	iPLView = ( KSection.Find( KPLView ) == 0 ); // section has to start with plview	iRecoverFlag = ( KSection.Find( KRecover ) == 0 );	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:8,


示例21: _LIT

/** * Adds contact fields to the contact, as per the desired contact view filter */void CTestContactViewCRUDOperationsStep::AddFieldsSpecificToFilterL(CContactItem& aContact)	{	_LIT(KDesiredFilterString, "desiredFilter");	TPtrC desiredFilterString;	GetStringFromConfig(ConfigSection(), KDesiredFilterString, desiredFilterString);	CContactDatabase::TContactViewFilter	viewFilter = ViewUtilityReference().GetContactViewFilterL(desiredFilterString);	AddFilterBasedFieldsL(aContact, viewFilter);	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:11,


示例22: GetIntFromConfig

TInt CTestSendsignal::TestSigqueue (  )	{   	int ret, ret1 = KErrGeneral, status, Signum;	pid_t pid, pid1;	union sigval sival;	char **argv=(char**)malloc(3*sizeof(char*));	ret = GetIntFromConfig(ConfigSection(), _L("Signum"), Signum);	if(ret == 0)		{		ERR_PRINTF1(_L("Failed to read the signal number")) ;		goto close;		}	ret = setsigenv();	if( ret == KErrGeneral)		{		ERR_PRINTF1(_L("Failed in setting the default enviroment for signal")) ;		goto close;		}	argv[0]=(char*)malloc(34*sizeof(char));	argv[1]=(char*)malloc(3*sizeof(char));	argv[2]= 0;	strcpy(argv[0], "z://sys//bin//sendsignal.exe");	sprintf(argv[1], "%d", Signum);		ret = posix_spawn(&pid, "z://sys//bin//sendsignal.exe", NULL, NULL, argv, (char**)NULL);	if(ret != 0)		{		ERR_PRINTF2(_L("Error in posix spawn and errno is set to %d"),errno);		goto close;		}	INFO_PRINTF2( _L("the value of pid returned by posix_spawn is %d"),  pid);	User::After(50000); // TODO: Remove once the sending issue is fixed	sival.sival_int = 0;	ret = sigqueue(pid,Signum,sival);	if(ret != 0)		{		ERR_PRINTF2( _L("Error in sending the signal to the spawned process and errno is set %d"),errno);		goto close;		}	pid1 = waitpid(pid, &status, WUNTRACED);	if (pid1 != pid)		{		ERR_PRINTF1(_L("waitpid failed..."));			goto close;		}	if(WEXITSTATUS(status) != 0)		{		ERR_PRINTF2(_L("sigqueue() failed in the child process for signal %d"),Signum);		goto close;				}	INFO_PRINTF2(_L("Successfully able to send a signal %d"),Signum);	ret1 = KErrNone;	close:	free((void*)argv[0]);	free((void*)argv[1]);	free((void*)argv);	return ret1;	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:58,


示例23: INFO_PRINTF1

/**  Function : doTestStepL  Description : Reads the  Imap account name from the ini file.		        Reads the event type from the ini file.		        And requests what msgs have been affected by that		   		event, within the folder that this observer is watching.  @return : TVerdict - Test step result*/TVerdict CT_MsgObserverCkEventNCount::doTestStepL()	{			INFO_PRINTF1(_L(" Test Step : Checking event type and total number of msgs effected form observer"));	TPtrC imapAccountName,event;	TInt expectedNum;	        //retrieve account name from ini	if(!GetStringFromConfig( ConfigSection(), KAccountName, imapAccountName))		{		ERR_PRINTF1(_L("Imap Account Name is not specified"));		SetTestStepResult(EFail);		}		if( TestStepResult() != EFail )		{	     //retrieve event expected from ini 	    if(!GetStringFromConfig( ConfigSection(), KEventName, event))			{			ERR_PRINTF1(_L("Event type not specified"));			SetTestStepResult(EFail);			}		//ask observer how many entries have been affected by that event		TInt actualNum=iSharedDataIMAP.iObserver->CheckEventAndCountL((TDesC&)event);		INFO_PRINTF2(_L(" Total number of msgs effected are: %d"),actualNum);						if(!GetIntFromConfig( ConfigSection(), KNumExpected, expectedNum))			{			ERR_PRINTF1(_L("Expected count not specified!"));			}					if (actualNum!=expectedNum)			{			ERR_PRINTF1(_L("Actual number of msgs effected by event does not equal to number expected! "));			SetTestStepResult(EFail);			}				}			    		return TestStepResult();						}//end function  doTestStepL
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:53,


示例24: ConfigSection

TVerdict CUpnpRequestParserTest::doTestStepL()	{	TPtrC dataChunk;		    if (    	!GetStringFromConfig(ConfigSection(), KDataChunk1, dataChunk)	||    	!GetBoolFromConfig(ConfigSection(), KParseExcessData, iNeedToParseExcessData)	||    	!GetIntFromConfig(ConfigSection(), KExpectedRequests, iExpectedRequests)	||    	!GetIntFromConfig( ConfigSection(), KDataChunkCount, iDataChunkCount )    	)		{		ERR_PRINTF5(_L("===> Problem in reading values from ini.			/						/nExpected fields are: /n%S/n%S/n%S/n%S <==="					  ), &KDataChunk1, &KParseExcessData, &KExpectedRequests, 					  &KDataChunkCount );		SetTestStepResult(EFail);		return TestStepResult();		}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:18,


示例25: GetIntFromConfig

/*** Function Name		: TestFtw2* Description		: ftw with negative 'ndirs'* Return Value		: ftw returns EINVAL*/TInt CTestftw::TestFtw2()    {    int ndirs, result;	int ret;		GetIntFromConfig(ConfigSection(), _L("Param1"), ndirs);	   	ret=ftw(".", &action, ndirs);   	   	GetIntFromConfig(ConfigSection(), _L("Expected"), result);   	   	if(ret==-1 && errno==result)   		{   		return KErrNone;   		}   	INFO_PRINTF2(_L("ftw fails with error No: %d"), errno);   	return KErrGeneral;	    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:23,


示例26: INFO_PRINTF1

/**  Does the main functionality test.  Here, reads values from INI file and calls NormaliseAndCompareUriL  @internalTechnology   @param		None  @return		EPass or EFail indicating the success or failure of the test step*/TVerdict CTestNormaliseUriStep::doTestStepL()	{	__UHEAP_MARK;	INFO_PRINTF1(_L("/n"));	// Get necessary information from INI file	TPtrC uri;	TPtrC expUri;	TInt RetCode;		if(!GetStringFromConfig(ConfigSection(), 	KIniUri, uri) ||	   !GetStringFromConfig(ConfigSection(), KIniExpectedUri, expUri) ||	   !GetIntFromConfig(ConfigSection(), KRetCode, RetCode) )		{		ERR_PRINTF3(_L("Problem in reading values from ini.			/						/nExpected fields are: /n%S/n%S/n"),&KIniUri, &KIniExpectedUri);		SetTestStepResult(EFail);		}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:25,


示例27: INFO_PRINTF1

TVerdict CSampleStep1::doTestStepL()/** * @return - TVerdict code * Override of base class pure virtual * Demonstrates reading configuration parameters fom an ini file section */	{	INFO_PRINTF1(_L("In Test Step"));  	TDriveName scriptDrive(ScriptDriveName());  	INFO_PRINTF2(_L("The Drive where script file is executed from is %S"), &scriptDrive);	TInt theInt;	TPtrC val;	_LIT(tem,"NewData");	val.Set(tem);	TBool theBool;	TBuf<40> buf;	TPtrC theString;	TInt changeInt(83);	TInt changeHex(183);	TBool changeBool(ETrue);	_LIT(sectName,"Section3");	GetHexFromConfig(sectName,_L("TheHex"),changeInt);	GetIntFromConfig(ConfigSection(),_L("TheInt"),theInt);	GetBoolFromConfig(ConfigSection(),_L("TheBool"),theBool);	GetStringFromConfig(ConfigSection(),_L("TheString"),theString);	buf.Copy(theString);	WriteBoolToConfig(sectName,_L("TheBool"),changeBool);	WriteIntToConfig(ConfigSection(),_L("TheInt"),changeInt);	WriteHexToConfig(sectName,_L("TheHex"),changeHex);	// Demonstrate panic	if(buf == _L("PanicMe"))		{		const TInt KSampleServerPanic = 1;		User::Panic(_L("SampleServer"),KSampleServerPanic);		}			SetTestStepResult(EPass);	return TestStepResult();	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:44,



注:本文中的ConfigSection函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ConfigValue函数代码示例
C++ ConfigKey函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。