oaUnitAssertTrue()

Function checks if a condition is TRUE.

Synopsis

int oaUnitAssertTrue(string TC_ID, bool condition, [anytype userTcData]);

Parameter

Parameters Meaning
TC ID The test ID. Each test case must contain a test ID.
condition The test condition to be tested.
userTcData Optional parameter. Test case specific data can be set for the test case.

Return Value

The error code. In case of wrong or missing parameters, the function returns -1 or -2. If the condition was fulfilled, the function returns 0. If the condition was not fulfilled, the function returns 1.

Error

The function returns the error code.

Description

The CTRL OA Unit CTRL extension contains a set of functions that can be used for testing purposes. The function checks if a condition is TRUE. The condition must be a boolean variable, otherwise the parameter is invalid.

Example

The following example checks if the function getTestValue() returns TRUE.

#uses "CtrlOaUnit"
main()
{
  /* Following example checks if the function getTestValue() returns TRUE. This is
  a good case since the value is TRUE*/
  oaUnitAssertTrue("IS-TRUE", getTestValue());
}
bool getTestValue()
{
  return TRUE;
}

Assignment

CTRL OA Unit DLL

Availability

CTRL

See also

CTRL OA Unit, Basics