Creating complex stubs

Component Testing for Ada

If necessary, you can make stub operation more complex by inserting native Ada code into the body of the simulated function. You can do this easily by adding the lines of native code after the prototype.

Example

The following stub definition makes extensive use of native Ada code.

DEFINE STUB file

 #function open_file(f:string) return file_t is

 #begin

 # raise file_error;

 #end;

END DEFINE

 

Related Topics

Advanced StubsExcluding a Parameter from a StubSimulating Generic UnitsSimulating Functions with _inout Mode ArraysSimulating Functions that Use a Variable Number of ParametersSeparate Body Stub