Current Page: NeXtMidas Training Primitives Test Macros Test Strategy
- - | Typical (non-interactive) test strategy: Run a few test cases. Use pre-defined files or a waveform as input file. Check the output. When possible compare to a known output file. Use the `nxm.<opt>.test.filename.prm` syntax for files in the test area. When comparing output values consider using `EQT` (equals with tolerance) for cases where minor rounding errors are not a problem. Where it makes sense (usually for record-based output) compare a few random rows against expected values. Use `FILE` command to open the file and then use `getDataTable(offset)` to read an individual row. Run more test cases for special options or switches. Whenever a bug is discovered in an existing primitive add a test for that bug. Be sure to check out `IF`: The NeXtMidas `IF` contains many tests that are useful when writing test macros. Some of these include:
    EQT | Numeric equality with a tolerance.
    FEXISTS | Tests to see if a file exists.
    REXISTS | Tests to see if a result exists.
    FEQ | Tests file equality.
For more details see the explain file for `IF`.
Don't Make This Mistake:
The byte ordering of a Data File (Blue File) is dependent on the host system. If you do a binary comparison (`FEQ/B`) between files created on different systems, the test may fail, even though the data in the file is correct. In general you should avoid the use `FEQ/B` when working with a Data File (Blue File).