Add BIST tests for octave functions written in C++: Difference between revisions

Jump to navigation Jump to search
m
(→‎Instances: update count)
Line 215: Line 215:
*/
*/
</pre>
</pre>
==== Example 4 : Function tested elsewhere ====
The BIST tests are normally located immediately following the DEFUN block.  However this is not always the case.  For functions that occur in pairs like set()/get() or load()/save() the tests may be located near just one of the functions.  Or the tests may be located in a single block somewhere else.  This could be the end of the file, or it could be in a separate test file in the test/ directory.  In this case, the function needs only to be marked with an explanation about where the tests reside.  For example, in bessel.cc there is a large test block at the end of the file and the code includes a note that begins with '%!#'
<pre>
/*
%!# Function besselj is tested along with other bessels at the end of this file
*/
</pre>
Alternatively, it may make sense to move the tests to reside next to the function.  For example, cputime() does not have tests in data.cc, but it does in test/system.tst.


== Detailed Instructions ==
== Detailed Instructions ==
1,072

edits

Navigation menu