<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ASSERT</id>
	<title>ASSERT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ASSERT"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ASSERT&amp;action=history"/>
	<updated>2026-04-13T12:14:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=ASSERT&amp;diff=697&amp;oldid=prev</id>
		<title>ConvertBot: implements a logical check for testing</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ASSERT&amp;diff=697&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:30Z</updated>

		<summary type="html">&lt;p&gt;implements a logical check for testing&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;implements a logical check for testing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;conditional&amp;gt; - Logical test to be performed (EQ,EQS,... see IF tests)&lt;br /&gt;
&lt;br /&gt;
The ASSERT command uses IF style conditions to perform tests.  The &amp;lt;conditional&amp;gt;&lt;br /&gt;
is the same type of &amp;lt;conditional&amp;gt; used in the IF command, i.e:&lt;br /&gt;
  IF &amp;lt;conditional&amp;gt; [AND/OR] [&amp;lt;conditional2&amp;gt;] ... statements.&lt;br /&gt;
&lt;br /&gt;
The ASSERT intrinsic keeps a running count of the number of failures encountered&lt;br /&gt;
by ASSERT since initialization.  The /INIT=table also initializes a table name&lt;br /&gt;
&amp;lt;table&amp;gt; in the results table with the results of each ASSERT command with the&lt;br /&gt;
/TOTAL switch applied to construct an overall status for the test_all macro.&lt;br /&gt;
&lt;br /&gt;
EXAMPLES:&lt;br /&gt;
  1) General usage within a test macro&lt;br /&gt;
    nM&amp;gt; ASSERT/TEXT=&amp;quot;description of test&amp;quot; x eq 3.14&lt;br /&gt;
&lt;br /&gt;
  2) To keep a running  total of all tests&lt;br /&gt;
    nM&amp;gt; ASSERT/INIT=G_STATUS           ! Initialize the failure count and use&lt;br /&gt;
                                       ! the result g_status to hold test data&lt;br /&gt;
    nM&amp;gt; %test_if                       ! Run the if tests&lt;br /&gt;
    nM&amp;gt; ASSERT/TID=&amp;quot;IF&amp;quot;/TOTAL=TEST&lt;br /&gt;
    nM&amp;gt; ASSERT/TID=&amp;quot;ALL&amp;quot;/TOTAL=TESTALL&lt;br /&gt;
&lt;br /&gt;
  3) Run a simple test and keep the result of the test in STATUS&lt;br /&gt;
    nM&amp;gt; ASSERT/STAT=STATUS/DEBUG=NO 1 EQ 1&lt;br /&gt;
    nM&amp;gt; res status&lt;br /&gt;
     4S: STATUS          = PASS&lt;br /&gt;
&lt;br /&gt;
  4) Use the /NOOP switch to exclude a missing test from counting as a failure&lt;br /&gt;
     for the cumulative tests.&lt;br /&gt;
    nM&amp;gt; assert/stat=status/text=&amp;quot;missing test&amp;quot; /noop=MISS&lt;br /&gt;
    INFO: missing test.................................................MISS&lt;br /&gt;
&lt;br /&gt;
  5) Use /GROUP= and /SUMMARY in testing data from a file:&lt;br /&gt;
&lt;br /&gt;
    res t:myfileTests {TEXT=&amp;quot;Testing myfile.prm&amp;quot;}&lt;br /&gt;
    file open f myfile.prm&lt;br /&gt;
      assert/group=myfileTests/test f.SIZE   EQ 1024&lt;br /&gt;
      assert/group=myfileTests/test f.XSTART EQ 0&lt;br /&gt;
      assert/group=myfileTests/test f.XDELTA EQ 0.123&lt;br /&gt;
      &lt;br /&gt;
      do i 0 f.size-1&lt;br /&gt;
        ! more tests&lt;br /&gt;
      enddo&lt;br /&gt;
    enddo&lt;br /&gt;
    assert/group=myfileTests/summary&lt;br /&gt;
&lt;br /&gt;
  See the tests (test*.mm) in $NMROOT/nxm/sys/test for many more examples.&lt;br /&gt;
&lt;br /&gt;
SWITCHES:&lt;br /&gt;
  /CS            - Perform a CASE SENSITIVE test (for EQS, EQSS and SUBS only).&lt;br /&gt;
                   [DEF=IgnoreCase]&lt;br /&gt;
  /DEBUG=NO      - Hide normal output, unless the test fails.&lt;br /&gt;
  /EXCEPT        - Condition should generate an exception.&lt;br /&gt;
  /GROUP=&amp;lt;tbl&amp;gt;   - Indicates a test is part of a group of tests, such as tests&lt;br /&gt;
                   for rows in a file. The table should contain the following&lt;br /&gt;
                   entries:&lt;br /&gt;
                      TEXT=&amp;lt;msg&amp;gt;  - Basic description of the test.&lt;br /&gt;
                   Note that this must be a table in the results table that is&lt;br /&gt;
                   writable as additional information will be written to it&lt;br /&gt;
                   to total up the number of tests that PASS/FAIL. Setting this&lt;br /&gt;
                   automatically sets /DEBUG=NO unless /SUMMARY is given. See&lt;br /&gt;
                   example #5 (above) for sample usage.            (Since 3.3.2)&lt;br /&gt;
  /NOOP=&amp;lt;text&amp;gt;   - Exclude a test from counting as a failure of the cumulative&lt;br /&gt;
                   tests. Default &amp;lt;text&amp;gt; is &amp;quot;N/A&amp;quot;.&lt;br /&gt;
  /SUMMARY       - Used with /GROUP= to assert that all previous tests for that&lt;br /&gt;
                   group have passed. See example #5 (above).      (Since 3.3.2)&lt;br /&gt;
  /TEST=PASS     - Assert that a test case will pass, and set the description&lt;br /&gt;
                   string (i.e. /TEXT=) to match the test case.&lt;br /&gt;
  /TEST=FAIL     - Assert that a test case will fail, and set the description&lt;br /&gt;
                   string (i.e. /TEXT=) to match the test case.&lt;br /&gt;
  /TEXT=&amp;lt;descr&amp;gt;  - String describing the test being performed. [DEFAULT=&amp;quot;TEST&amp;quot;]&lt;br /&gt;
  /TOL=&amp;lt;n&amp;gt;       - The *relative* tolerance for EQT test (see IF)&lt;br /&gt;
  /DELTA=&amp;lt;n&amp;gt;     - The *absolute* tolerance for EQT test (see IF)  (Since 3.3.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  ---- The following switches are special-purpose or used within CONFIDENCE ----&lt;br /&gt;
  /HIDEFAIL=[Y|N]- INTERNAL USE ONLY to test ASSERT itself. [DEFAULT=NO]&lt;br /&gt;
                   If Yes, assert failure will NOT be displayed, but still&lt;br /&gt;
                   counted as a failed test.&lt;br /&gt;
  /INIT=&amp;lt;name&amp;gt;   - Initialize global counters and create global status table&lt;br /&gt;
                   names &amp;lt;name&amp;gt; (CONFIDENCE uses /INIT=&amp;quot;G_STATUS&amp;quot;).&lt;br /&gt;
  /LABEL=&amp;lt;label&amp;gt; - Used with /TOTAL= to indicate an alternate table to write&lt;br /&gt;
                   results to (rather than the global table set in /INIT=).&lt;br /&gt;
  /LTEXT=&amp;lt;n&amp;gt;     - Length of text when padded [DEFAULT=80]&lt;br /&gt;
  /PAD=[Y|N]     - Pad the output? [DEFAULT=YES]&lt;br /&gt;
  /STAT=&amp;lt;label&amp;gt;  - Result name to hold status of test = PASS or FAIL&lt;br /&gt;
                   [DEFAULT=no result]&lt;br /&gt;
  /TID=&amp;lt;tid&amp;gt;     - Table ID, used with /TOTAL to denote overall results entry,&lt;br /&gt;
                   this also overrides the default value for /TEXT= with the&lt;br /&gt;
                   given test id.&lt;br /&gt;
  /TOTAL=RESET   - INTERNAL USE ONLY, do not use! Saves the current test&lt;br /&gt;
                   results into results table specified by /LABEL= and then&lt;br /&gt;
                   reset the test counters.&lt;br /&gt;
  /TOTAL=TEST    - Test current group (i.e. since last /TOTAL=TEST), write&lt;br /&gt;
                   table entry named by the /TID=entry value.&lt;br /&gt;
  /TOTAL=TESTALL - Test the total of all test since /INIT&lt;br /&gt;
&lt;br /&gt;
SEE ALSO:  CONFIDENCE, IF, nxm.sys.lib.Args&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>