Sizing Stubs

Component Testing for C

For each STUB, the Component Testing feature allocates memory to:

A stub can be called several times during the execution of a test. By default, when you define a STUB, the Component Testing feature allocates space for 10 calls. If you call the STUB more than this you must specify the number of expected calls in the STUB declaration statement.

In the following example, the script allocates storage space for the first 17 calls to the stub:

DEFINE STUB file 17

 #int open_file(char _in f[100]);

 #int create_file(char _in f[100]);

 #int read_file(int _in fd, char _out l[100]);

 #int write_file(int fd, char _in l[100]);

 #int close_file(int fd);

END DEFINE

 

Note   You can also reduce the size when running tests on a target platform that is short on memory resources.