• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>BOOST_&lt;level&gt;_NE</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="assertion_boost_level_message.html" title="BOOST_&lt;level&gt;_MESSAGE">
10<link rel="next" href="assertion_boost_level_predicate.html" title="BOOST_&lt;level&gt;_PREDICATE">
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="assertion_boost_level_message.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_level_predicate.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_level_ne"></a><a class="link" href="assertion_boost_level_ne.html" title="BOOST_&lt;level&gt;_NE"><code class="computeroutput"><span class="identifier">BOOST_</span><span class="special">&lt;</span><span class="identifier">level</span><span class="special">&gt;</span><span class="identifier">_NE</span></code></a>
28</h4></div></div></div>
29<pre class="programlisting"><span class="identifier">BOOST_WARN_NE</span><span class="special">(</span><span class="identifier">left</span><span class="special">,</span> <span class="identifier">right</span><span class="special">);</span>
30<span class="identifier">BOOST_CHECK_NE</span><span class="special">(</span><span class="identifier">left</span><span class="special">,</span> <span class="identifier">right</span><span class="special">);</span>
31<span class="identifier">BOOST_REQUIRE_NE</span><span class="special">(</span><span class="identifier">left</span><span class="special">,</span> <span class="identifier">right</span><span class="special">);</span>
32</pre>
33<p>
34          Check performed by these tools is the same as the one performed by <code class="computeroutput"><a class="link" href="assertion_boost_level.html" title="BOOST_&lt;level&gt;"><code class="computeroutput"><span class="identifier">BOOST_</span><span class="special">&lt;</span><span class="identifier">level</span><span class="special">&gt;</span></code></a><span class="special">(</span> <span class="identifier">left</span> <span class="special">!=</span> <span class="identifier">right</span> <span class="special">)</span></code>. The difference is that the matched values
35          are reported as well.
36        </p>
37<h6>
38<a name="boost_test.utf_reference.testing_tool_ref.assertion_boost_level_ne.h0"></a>
39          <span class="phrase"><a name="boost_test.utf_reference.testing_tool_ref.assertion_boost_level_ne.example_descr"></a></span><a class="link" href="assertion_boost_level_ne.html#boost_test.utf_reference.testing_tool_ref.assertion_boost_level_ne.example_descr">Example:
40          BOOST_&lt;level&gt;_NE usage</a>
41        </h6>
42<div class="informaltable"><table class="table">
43<colgroup><col></colgroup>
44<thead><tr><th>
45                  <p>
46                    Code
47                  </p>
48                </th></tr></thead>
49<tbody><tr><td>
50<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>
51<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>
52
53<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test</span> <span class="special">)</span>
54<span class="special">{</span>
55  <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span>
56  <span class="keyword">int</span> <span class="identifier">j</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span>
57  <span class="identifier">BOOST_CHECK_NE</span><span class="special">(</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">j</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">10</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">check</span> <span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">j</span> <span class="identifier">failed</span> <span class="special">[</span><span class="number">3</span> <span class="special">==</span> <span class="number">3</span><span class="special">]</span>
73
74<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>
75</pre>
76                </td></tr></tbody>
77</table></div>
78<p>
79          See also:
80        </p>
81<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
82              <a class="link" href="assertion_boost_level_eq.html" title="BOOST_&lt;level&gt;_EQUAL"><code class="computeroutput"><span class="identifier">BOOST_</span><span class="special">&lt;</span><span class="identifier">level</span><span class="special">&gt;</span><span class="identifier">_EQUAL</span></code></a>
83            </li></ul></div>
84</div>
85<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
86<td align="left"></td>
87<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test 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="assertion_boost_level_message.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_level_predicate.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
96</div>
97</body>
98</html>
99