Excluding a parameter from a stub

Component Testing for Ada

You can specify in the stub definition that a particular parameter is not to be tested or given a value. This is done using a modifier of type no instead of in, out or in out.

Note   You must be careful when using _no on an output parameter, as no value will be assigned. It will then be difficult to predict the behavior of the function under test on returning from the stub.

Example

In this example, the f parameters to read_file and write_file are never tested.

DEFINE STUB file

#procedure read_file(f: _no file_t; l:out string; res:out BOOLEAN);

#procedure write_file(f: _no file_t, l : string);

END DEFINE

 

Related Topics

Advanced StubsNative Code in StubsSimulating Generic UnitsSimulating Functions with _inout Mode ArraysSimulating Functions that Use a Variable Number of ParametersSeparate Body Stub