oaUnitAssertNotEqualDelta()

The function checks if the checked value is NOT in bad range.

Synopsis

int oaUnitAssertNotEqualDelta(string TC_ID, float checkedValue, float badValue, float delta, [anytype userTcData]);

Parameter

Parameters Meaning
TC ID The test ID. Each test case must contain a test ID.
checkedValue The value that is tested.
badValue The not expected value.
delta The delta that is considered for the bad value range.
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 in the bad range, the function returns 0. If the condition was not fulfilled meaning that the value is outside the bad range, 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 NOT in bad value range. All values that are badValue+- delta, are in bad range. Values in good range are values outside this range (range: badValue+- delta).

The checked value, badValue, and delta must be of the same variable type.

Example

The following example checks if the value returned by the function getTestValue() is in bad range.

#uses "CtrlOaUnit"
main()
{
  const int _VALUE1 = 100;
  /* The following example checks if the function getTestValue() returns a value in
  the range from 95 to 105 (100-5 and 100+5) This is a good case since the returned
  value is 98*/
  oaUnitAssertNotEqualDelta("IS-VALUE-IN-BAD-RANGE", getTestValue(), VALUE1 , 5);
}
int getTestValue()
{
  return 100 - 2;
}

Assignment

CTRL OA Unit DLL

Availability

CTRL

See also

CTRL OA Unit, Basics