Fixing and Rerunning the Failed Test

You need to fix the test so that it is checking for the correct distance.
  1. Switch back to the COBOL perspective by clicking GUID-0A9C39E1-72CC-4252-BE5E-E9C931DE7A27-low.png.

    Your workspace is displayed using the COBOL perspective.

  2. With DistanceTest.cbl displayed in the editor, replace the value 4787 with 7703, so that the IF statement now reads:
               if function numval(distance-km) not equal 7703
                   string "Incorrect distance in kilometers returned - " 
                           distance-km delimited by size
                           x"0" delimited by size
                           into errormessage
                   end-string
                   call MFU-ASSERT-FAIL-Z using errormessage
               end-if
  3. Press Ctrl+S to save the changes.
  4. In the Micro Focus Unit Testing view, click GUID-689439CA-A240-4D62-8B50-658E12A2E7CC-low.png (Run Failed).

    The failed test is rerun, and now passes.

  5. Select the Code Coverage tab, and expand AirportDemo > aircode again. Notice how the statistics have changed since we enhanced the test.

    GUID-0D8BB48D-EC43-47DE-ABB0-CBDFE6F7C3BA-low.png

This concludes the tutorial.