The RefX test is typically used with hexadecimal tests where data has to be compared against a known reference using a mask. This test compares the 32-bit (DWord) test result (the internal variable, TestResult) with a hexadecimal reference mask, ignoring the bits specified as zero (0) by the mask. Both reference and mask should be specified for this test. If no mask is specified, the mask is set to 0. All bits are “don’t care”.
The reference is the expected value and the mask represents the bits that should be compared. For example, a mask of hex 5 specifies that bits 0 and 2 should be compared. Both values are 32 bits integer (long).
If the result and the reference/mask are identical, the test status is PASS (1). If they are not, the test status is FAIL (2). The test status is stored in the TestStatus internal variable that can be used to determine program flow.
To define a RefX test's properties:
1. Select the
test and click (Properties)
on the ATEasy toolbar. The Test
Properties dialog appears:
2. In the Mask field, enter the hexadecimal reference mask to which TestResult is to be compared.
3. In the Ref field, enter the reference value to which TestResult is to be compared.
4. Make other selections and entries as needed in the dialog box. For descriptions of the common test properties (name, ID, etc.), see Test Properties Window.
5. Click the Windows Close button in the upper-right corner of the dialog box to close it.
After a RefX test is finished, ATEasy prints the results to a log window in hexadecimal format.
Here is an example of RefX test log output in text format:
Here is an example of the same RefX test log output in HTML format:
The following example simulates the way ATEasy calculates TestStatus in Ref-X or Ref-2 tests after the test was executed.
if TestStatus=NONE and VarType(TestResult) <> vtEmpty then
if (TestResult or Test.Ref) and Test.Mask then
TestStatus=FAIL
else
TestStatus=PASS
endif
endif
! The status now is in TestStatus of which ATEasy write the
! status field.
Note that the TestResult internal variable should be assigned by the test during test execution.
Ref Property (ATest), Mask Property (ATest), GetTestRef, GetTestMask, SetTestRef, SetTestMask, TestResult Variable, TestRefResult Variable, TestStatus Variable