oaUnitAssertLess()
The function checks if the checked value is greater than the upper limit.
Synopsis
int oaUnitAssertLess(string TC_ID, anytype checkedValue, anytype maxValue, [anytype userTcData]);
Parameter
Parameters | Meaning |
---|---|
TC ID | The test ID. Each test case must contain a test ID. |
checkedValue | The value that is tested. |
maxValue | The upper limit (value). |
userTcData | Optional parameter. Test case specific data can be set for the test case. |
Return Value
The error code
Error
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 less than the upper limit value, the function returns 0. If the condition was not fulfilled meaning that the value is greater than the upper limit value, the function returns 1.
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 the upper limit. The values that are less than the upper limit are OK. The checked value and maxValue must be of same variable type.
Example
The following example checks if the value returned by the function getTestValue() is greater than the upper limit.
#uses "CtrlOaUnit"
main()
{
const int _VALUE1 = 100;
/* This example checks if the function getTestValue() returns a value less than 100.
This is a good case since the value is less than 100 (100-2)*/
oaUnitAssertLess("IS-LESS", getTestValue(), VALUE1);
}
int getTestValue()
{
return 100 - 2;
}
Assignment
Availability
CTRL
See also