Editing Add BIST tests for octave functions written in C++

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
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 ==

Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)