KCMS Test Suite User's Guide

Checking Status Codes

When you have run the scripts, inpect the log file(s).

In Chapter 2, "Running KCMS Test Scripts," Example 2-3 shows the log file output for the script shown in Example 2-2 in that same chapter. Status codes return the value 0 if a command completes successfully. Some scripts, however, expect an error to be returned. You can use the XStatus keyword to test for error conditions you expect to occur.

The IC_evalerr.scr test script, for example, creates test conditons in which the EVAL: command generates errors. The EVAL: command includes the optional keyword XStatus for reporting expected errors. Code example 5-1 is an excerpt from the IC_evalerr.scr script. The example shows two EVAL: commands that will generate errors because of incorrect or missing information. In each case, XStatus is set to the value 4024 ("KCS_PROF_NO_DATA_SUPPORT_4_REQUEST")

See Appendix A, Status Codes ," for a list of all the status strings and their values. You also can find status codes and strings in the header file kcsstats.h. For additional information on the meaning of status codes, see Chapter 6, "Warnings and Error Messages," in the SDK manual KCMS Application Developer's Guide.


Example 6-1 Using XStatus to Report Expected Errors

LOG:Attempt to evaluate
with a profile that does not have the correct transform;

EVAL:Reference=forward; 	SourcePixLayout=RGBInterLeaved;

	DestPixLayout=RGBInterLeaved; 	ImageIn=macbeth_1550.tif; 	ImageOut=None;

	Operation=Reverse; 	XStatus=4024; LOG:Attempt to evaluate an image with a

content not available in the profile; EVAL:Reference=simulate;

	SourcePixLayout=RGBInterLeaved; 	DestPixLayout=RGBInterLeaved;

	ImageIn=macbeth_1550.tif; 	ImageOut=None; 	Operation=Image;

	Operation=Reverse; 	XStatus=4024;