oaUnitAssertGreater()

The function checks if the current value is greater than the lower limit.

Synopsis

int oaUnitAssertGreater(string TC_ID, anytype checkedValue, anytype minValue, [anytype userTcData]);

Parameter

Parameters Meaning
TC ID The test ID. Each test case must contain a test ID.
checkedValue The value that is tested.
minValue The lower limit value.
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, meaning that the value is greater than the lower limit value, the function returns 0. If the condition was not fulfilled meaning that the value is less than the lower limit value, 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 the checked value is greater than lover limit. All values that are greater than the lower limit are OK. The checked value and minValue must be of the same variable type.

Example

The example checks if the value returned by the function getTestValue() is greater than the lover limit.

main()
{
  const int _VALUE1 = 100;
  /* The following example checks if the function getTestValue() returns a value greater
  than 100. This is bad case since the returned value is 100-2*/
  oaUnitAssertGreater("IS-GREATHER", getTestValue(), VALUE1);
}
int getTestValue()
{
  return 100 - 2;
}

Assignment

CTRL OA Unit DLL

Availability

CTRL

See also

CTRL OA Unit, Basics