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 publish 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 == |