1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
- <title>BOOST_DATA_TEST_CASE_F</title>
- <link rel="stylesheet" href="../../../boostbook.css" type="text/css">
- <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
- <link rel="home" href="../../../index.html" title="Boost.Test">
- <link rel="up" href="../test_org_reference.html" title="Tests declaration and organization">
- <link rel="prev" href="test_org_boost_test_dataset.html" title="BOOST_DATA_TEST_CASE">
- <link rel="next" href="test_org_boost_test_suite.html" title="BOOST_TEST_SUITE">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <table cellpadding="2" width="100%"><tr>
- <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
- <td align="center"><a href="../../../../../../../index.html">Home</a></td>
- <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
- <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
- <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
- <td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="test_org_boost_test_dataset.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../test_org_reference.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="test_org_boost_test_suite.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="boost_test.utf_reference.test_org_reference.test_org_boost_test_dataset_fixture"></a><a class="link" href="test_org_boost_test_dataset_fixture.html" title="BOOST_DATA_TEST_CASE_F"><code class="computeroutput"><span class="identifier">BOOST_DATA_TEST_CASE_F</span></code></a>
- </h4></div></div></div>
- <p>
- Declares and registers a data-driven test case, using a particular dataset
- and a fixture. This is basically the same as <a class="link" href="test_org_boost_test_dataset.html" title="BOOST_DATA_TEST_CASE"><code class="computeroutput"><span class="identifier">BOOST_DATA_TEST_CASE</span></code></a> with fixture
- support added.
- </p>
- <pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">my_fixture</span> <span class="special">{</span>
- <span class="identifier">my_fixture</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">some_string</span><span class="special">(</span><span class="string">"environment X"</span><span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">some_string</span><span class="special">;</span>
- <span class="special">};</span>
- <span class="identifier">BOOST_DATA_TEST_CASE_F</span><span class="special">(</span><span class="identifier">my_fixture</span><span class="special">,</span> <span class="identifier">test_case_name</span><span class="special">,</span> <span class="identifier">dataset</span><span class="special">,</span> <span class="identifier">var1</span><span class="special">,</span> <span class="identifier">var2</span><span class="special">...,</span> <span class="identifier">varN</span><span class="special">)</span>
- <span class="special">{</span>
- <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">var1</span> <span class="special">!=</span> <span class="number">0</span><span class="special">);</span>
- <span class="comment">//...</span>
- <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">varN</span> <span class="special">!=</span> <span class="number">0</span><span class="special">);</span>
- <span class="special">}</span>
- </pre>
- <p>
- The fixture should implement the appropriate <a class="link" href="../../tests_organization/fixtures/models.html" title="Fixture models">interface</a>.
- As any fixture, it is possible to have test assertions in the fixture class.
- </p>
- <p>
- See <a class="link" href="../../tests_organization/fixtures/case.html" title="Test case fixture">here</a>
- for more details on fixtures and <a class="link" href="../../tests_organization/test_cases/test_case_generation/datasets_auto_registration.html" title="Declaring and registering test cases with datasets">here</a>
- for more details on datasets declaration.
- </p>
- </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-2019 Boost.Test
- contributors<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- 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>)
- </p>
- </div></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="test_org_boost_test_dataset.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../test_org_reference.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="test_org_boost_test_suite.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- </body>
- </html>
|