assertion_boost_error.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>BOOST_ERROR</title>
  5. <link rel="stylesheet" href="../../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../../../index.html" title="Boost.Test">
  8. <link rel="up" href="../testing_tool_ref.html" title="Reference API for writing tests">
  9. <link rel="prev" href="test_org_boost_test_case_expected_failure.html" title="BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES">
  10. <link rel="next" href="assertion_boost_fail.html" title="BOOST_FAIL">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="test_org_boost_test_case_expected_failure.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../testing_tool_ref.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="assertion_boost_fail.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h4 class="title">
  27. <a name="boost_test.utf_reference.testing_tool_ref.assertion_boost_error"></a><a class="link" href="assertion_boost_error.html" title="BOOST_ERROR"><code class="computeroutput"><span class="identifier">BOOST_ERROR</span></code></a>
  28. </h4></div></div></div>
  29. <pre class="programlisting"><span class="identifier">BOOST_ERROR</span><span class="special">(</span><span class="identifier">message</span><span class="special">);</span>
  30. </pre>
  31. <p>
  32. <a class="link" href="assertion_boost_error.html" title="BOOST_ERROR"><code class="computeroutput"><span class="identifier">BOOST_ERROR</span></code></a> tool behave the same
  33. way as <code class="computeroutput"><a class="link" href="assertion_boost_test_universal_macro.html" title="BOOST_TEST"><code class="computeroutput"><span class="identifier">BOOST_TEST</span></code></a><span class="special">(</span><span class="keyword">false</span><span class="special">,</span> <span class="identifier">message</span><span class="special">)</span></code>.
  34. This tool is used for an unconditional error counter increasing and message
  35. logging.
  36. </p>
  37. <p>
  38. The tool's only parameter is an error message to log.
  39. </p>
  40. <h6>
  41. <a name="boost_test.utf_reference.testing_tool_ref.assertion_boost_error.h0"></a>
  42. <span class="phrase"><a name="boost_test.utf_reference.testing_tool_ref.assertion_boost_error.example_descr"></a></span><a class="link" href="assertion_boost_error.html#boost_test.utf_reference.testing_tool_ref.assertion_boost_error.example_descr">Example:
  43. BOOST_ERROR usage</a>
  44. </h6>
  45. <div class="informaltable"><table class="table">
  46. <colgroup><col></colgroup>
  47. <thead><tr><th>
  48. <p>
  49. Code
  50. </p>
  51. </th></tr></thead>
  52. <tbody><tr><td>
  53. <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_TEST_MODULE</span> <span class="identifier">example</span>
  54. <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">included</span><span class="special">/</span><span class="identifier">unit_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
  55. <span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test</span> <span class="special">)</span>
  56. <span class="special">{</span>
  57. <span class="identifier">BOOST_ERROR</span><span class="special">(</span> <span class="string">"Nothing to test"</span> <span class="special">);</span>
  58. <span class="special">}</span>
  59. </pre>
  60. </td></tr></tbody>
  61. </table></div>
  62. <div class="informaltable"><table class="table">
  63. <colgroup><col></colgroup>
  64. <thead><tr><th>
  65. <p>
  66. Output
  67. </p>
  68. </th></tr></thead>
  69. <tbody><tr><td>
  70. <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">&gt;</span> <span class="identifier">example</span>
  71. <span class="identifier">Running</span> <span class="number">1</span> <span class="identifier">test</span> <span class="keyword">case</span><span class="special">...</span>
  72. <span class="identifier">test</span><span class="special">.</span><span class="identifier">cpp</span><span class="special">(</span><span class="number">8</span><span class="special">):</span> <span class="identifier">error</span> <span class="identifier">in</span> <span class="string">"test"</span><span class="special">:</span> <span class="identifier">Nothing</span> <span class="identifier">to</span> <span class="identifier">test</span>
  73. <span class="special">***</span> <span class="number">1</span> <span class="identifier">failures</span> <span class="identifier">is</span> <span class="identifier">detected</span> <span class="identifier">in</span> <span class="identifier">test</span> <span class="identifier">suite</span> <span class="string">"example"</span>
  74. </pre>
  75. </td></tr></tbody>
  76. </table></div>
  77. <p>
  78. See also:
  79. </p>
  80. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
  81. <a class="link" href="assertion_boost_test_universal_macro.html" title="BOOST_TEST"><code class="computeroutput"><span class="identifier">BOOST_TEST</span></code></a>
  82. </li></ul></div>
  83. </div>
  84. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  85. <td align="left"></td>
  86. <td align="right"><div class="copyright-footer">Copyright &#169; 2001-2019 Boost.Test
  87. contributors<p>
  88. Distributed under the Boost Software License, Version 1.0. (See accompanying
  89. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  90. </p>
  91. </div></td>
  92. </tr></table>
  93. <hr>
  94. <div class="spirit-nav">
  95. <a accesskey="p" href="test_org_boost_test_case_expected_failure.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../testing_tool_ref.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="assertion_boost_fail.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
  96. </div>
  97. </body>
  98. </html>