2
0
mirror of https://github.com/boostorg/test.git synced 2026-02-15 01:22:08 +00:00
Files
test/doc/components/test_tools/reference/BOOST_IS_DEFINED.html
Gennadiy Rozental 470273247c in progress
[SVN r33126]
2006-02-26 20:13:01 +00:00

51 lines
2.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>The Test Tools</TITLE>
<LINK rel="stylesheet" type="text/css" href="../../../style/btl.css" media="screen">
<LINK rel="stylesheet" type="text/css" href="../../../style/btl-print.css" media="print">
<META http-equiv="Content-Language" content="en-us">
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<STYLE type="text/css">
H4
{
margin: 0px;
}
</STYLE>
</HEAD>
<BODY>
<DIV class="body">
<H3><A name="BOOST_IS_DEFINED">BOOST_IS_DEFINED</A>( symbol )</H3>
<P class="first-line-indented">Unlike the rest of the tools in the toolbox this tool does not perform
the logging itself. It's only purpose is to check at runtime whether or not the supplied preprocessor
symbol is defined. Use it in combination with BOOST_CHECK to perform and log validation. Macros of
any arity could be checked. To check the macro definition with non-zero arity specify dummy arguments
for it. See below for example.</P>
<P class="first-line-indented">The only tool's argument is a preprocessor symbol that gets validated.
</P>
<H4>Example: test.cpp</H4>
<PRE class="code">#<SPAN class="reserv-word">define</SPAN> BOOST_TEST_MAIN<BR>#<SPAN class="reserv-word">include</SPAN> &lt;<SPAN class="literal">boost/test/unit_test.hpp</SPAN>&gt;<BR>
BOOST_AUTO_TEST_CASE( test )
{
BOOST_CHECK( BOOST_IS_DEFINED(SYMBOL1) );
BOOST_CHECK( BOOST_IS_DEFINED(SYMBOL2(arg)) );
}</PRE>
<H4>Output:</H4>
<P class="test-output">test.cpp(6): error in &quot;test&quot;: check ::boost::test_tools::tt_detail::is_defined_impl( &quot;SYMBOL1&quot;, &quot;=
SYMBOL1&quot; ) failed<BR>
test.cpp(7): error in &quot;test&quot;: check ::boost::test_tools::tt_detail::is_defined_impl( &quot;SYMBOL2(arg)&quot;, &quot;=
SYMBOL2(arg)&quot; ) failed<BR>
<BR>
*** 2 failures detected in test suite &quot;Master
Test Suite&quot;</P>
<DIV class="see_also">
<H4>See Also</H4>
<P class="see-also-content"><A href="BOOST_CHECK.html" target="descr">BOOST_CHECK</A></P>
</DIV>
</DIV>
</BODY>
</HTML>
<!-- Copyright Gennadiy Rozental 2001-2006.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt) -->