| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>BOOST_TEST_CHECKPOINT</title> |
| <link rel="stylesheet" href="../../../../style/style.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> |
| <link rel="home" href="../../../index.html" title="Boost Test Library"> |
| <link rel="up" href="test-log.html" title="Test log output"> |
| <link rel="prev" href="BOOST_TEST_MESSAGE.html" title="BOOST_TEST_MESSAGE"> |
| <link rel="next" href="BOOST_TEST_PASSPOINT.html" title="BOOST_TEST_PASSPOINT"> |
| <script language="JavaScript1.2" src="../../../../js/boost-test.js"></script> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table width="100%"><tr> |
| <td width="10%"><a href="../../../index.html"><img alt="Home" width="229" height="61" border="0" src="../../../../../../../libs/test/docbook/img/boost.test.logo.png"></a></td> |
| <td valign="middle" align="left"> > <a href="../../../utf.html">The Unit Test Framework</a> > <a href="../../user-guide.html">User's guide</a><a href="../../testing-tools.html"> |
| > |
| </a><a href="../test-output.html">Test Output </a><a href="../runtime-config.html"> |
| > |
| </a><a href="test-log.html">Test log</a><a href="results-report.html"> |
| > |
| </a><b>BOOST_TEST_CHECKPOINT</b> |
| </td> |
| <td><div class="spirit-nav"> |
| <a href="BOOST_TEST_MESSAGE.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a href="BOOST_TEST_PASSPOINT.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a> |
| </div></td> |
| </tr></table> |
| <hr> |
| <div class="section" lang="en"> |
| <div class="titlepage"><div><div><h6 class="title"> |
| <a name="utf.user-guide.test-output.log.BOOST_TEST_CHECKPOINT"></a>BOOST_TEST_CHECKPOINT</h6></div></div></div> |
| <p class="first-line-indented"> |
| The macro BOOST_TEST_CHECKPOINT is intended to be used to inject "named" checkpoint position. The |
| macro signature is as follows: |
| </p> |
| <pre class="inline-synopsis"> |
| <a name="BOOST_TEST_CHECKPOINT"></a>BOOST_TEST_CHECKPOINT(<span class="emphasis"><em>checkoint_message</em></span>)</pre> |
| <p class="first-line-indented"> |
| The message formatted at the checkpoint position is saved and reported by the exception logging functions (if any |
| occurs). Similarly to the <code class="computeroutput"><a class="link" href="BOOST_TEST_MESSAGE.html#BOOST_TEST_MESSAGE">BOOST_TEST_MESSAGE</a></code> the message can be formatted from any standard |
| output stream compliant components. |
| </p> |
| <div class="example"> |
| <a name="utf.user-guide.test-output.log.BOOST_TEST_CHECKPOINT.example22"></a><p class="title"><b>Example 28. BOOST_TEST_CHECKPOINT usage</b></p> |
| <div class="example-contents"> |
| <pre class="programlisting">#define BOOST_TEST_MODULE example |
| #include <boost/test/included/unit_test.hpp> |
| |
| //____________________________________________________________________________// |
| |
| extern void foo( int i ); |
| |
| //____________________________________________________________________________// |
| |
| BOOST_AUTO_TEST_CASE( test_external_interface ) |
| { |
| for( int i = 3; i >=0; i-- ) { |
| BOOST_TEST_CHECKPOINT( "Calling foo with i=" << i ); |
| foo( i ); |
| } |
| } |
| |
| //____________________________________________________________________________// |
| |
| void foo( int i ) |
| { |
| int j = 2/(i-1); |
| } |
| |
| //____________________________________________________________________________//</pre> |
| <table class="simplelist" border="0" summary="Simple list"><tr> |
| <td><code class="literal"><a href="../../../../src/examples/example22.cpp" target="_top">Source code</a></code></td> |
| <td> | </td> |
| <td><code class="literal"><a href="#" target="_top" id="id654179" onclick="toggle_element( 'example22-output', 'id654179', 'Show output', 'Hide output' ); return false;">Show output</a></code></td> |
| </tr></table> |
| <pre class="example-output" id="example22-output">> example |
| Running 1 test case... |
| unknown location(0): fatal error in "test_external_interface": signal: integer divide by zero; address of failing instruction: 0x00048090 |
| test.cpp(13): last checkpoint: Calling foo with i=1 |
| |
| *** 1 failure detected in test suite "example" |
| </pre> |
| </div> |
| </div> |
| <br class="example-break"> |
| </div> |
| <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"></td> |
| <td align="right"><div class="copyright-footer">Copyright © 2001-2007 Gennadiy Rozental</div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="BOOST_TEST_MESSAGE.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="test-log.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_TEST_PASSPOINT.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a> |
| </div> |
| </body> |
| </html> |