lxaRunModelSmokeTest

<< | Back to Salience 6 C API Index | >>

Summary

Runs smoke tests to ensure that the installed Salience version is compatible with the models in the data directory. Please use the output of this function to create detailed reports for support engagements.
A smoke test is successful if the number of "success" messages is at least 1 (showing that smoke testing was invoked) and the number of "failure" messages is 0 (showing that no errors arose during smoke testing).
The acConfigurationID parameter specifies the configuration for the results, which are returned in a ModelSmokeTestList structure. Configurations are defined using the method lxaAddSalienceConfiguration.

Syntax

int lxaRunModelSmokeTest(SalienceSession* pSession,
                         ModelSmokeTestList *pSuccesses,
                         ModelSmokeTestList* pFailures, 
                         const char *acConfigurationID);

Parameters

pSession Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession
pSuccesses Pointer to a ModelSmokeTestList structure that will get filled in by the call
pFailures Pointer to a ModelSmokeTestList structure that will get filled in by the call
acConfigurationID Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

ModelSmokeTestList oSuccesses;
ModelSmokeTestList oFailures;
int ret = lxaRunModelSmokeTest(pSession,&oSuccesses, &oFailures, acConfigId);
if (ret != 0) {
	cout << "function failed with Salience error " << ret <<  endl;
} else if (oSuccesses.nEntries == 0) {
	cout << "smoke testing was not successfully invoked." << endl;
} else if (oFailures.nEntries == 0) {
	cout << "No errors found." << endl;
} else {
	for (int i = 0; oFailures.nEntries; i++) {
		cout << "acModelPath: " << oFailures.pEntries->acModelPath << endl;
		cout << "acMessage: " << oFailures.pEntries->acMessage << endl;
		cout << "acExplanation: " << oFailures.pEntries->acExplanation << endl;
		cout << "acDocumentId: " << oFailures.pEntries->acDocumentId << endl;
		cout << "acExpectedLabel: " << oFailures.pEntries->acExpectedLabel << endl;
		cout << "acActualLabel: " << oFailures.pEntries->acActualLabel << endl;
		cout << "acExpectedSpanOffset: " << oFailures.pEntries->acExpectedSpanOffset << endl;
		cout << "acActualSpanOffset: " << oFailures.pEntries->acActualSpanOffset << endl;
		cout << "acExpectedSpanLength: " << oFailures.pEntries->acExpectedSpanLength << endl;
		cout << "acActualSpanLength: " << oFailures.pEntries->acActualSpanLength << endl;
	}
}

<< | Back to Salience 6 C API Index | >>