Boost C++ Libraries: Ticket #12631: BOOST_TEST_MESSAGE generates incorrect output when used in BOOST_DATA_TEST_CASE https://svn.boost.org/trac10/ticket/12631 <p> When I use BOOST_TEST_MESSAGE in a BOOST_DATA_TEST_CASE, I get the following misleading/incorrect output: </p> <pre class="wiki">Entering test case "test_update" Testing update : Failure occurred in a following context: filename = util/test_image2.jpg; Update Volume with 100 Failure occurred in a following context: filename = util/test_image2.jpg; Test case TestReadImageComment/test_update did not check any assertions </pre><p> The context is the the boost data test case arguments even though there are no test errors. I tried debugging the code, but how to fix this is not obvious to me. </p> <p> Here is the modified test from the BOOST_TEST_MESSAGE documentation: </p> <pre class="wiki">#if 0 BOOST_AUTO_TEST_CASE(test_update) //, *utf::disabled()) #else std::string filenames[] = { "util/test_image2.jpg" }; BOOST_DATA_TEST_CASE(test_update, btd::make(filenames), filename) #endif { std::string field_name = "Volume"; int value = 100; BOOST_TEST_MESSAGE("Testing update :"); BOOST_TEST_MESSAGE("Update " &lt;&lt; field_name &lt;&lt; " with " &lt;&lt; value); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12631 Trac 1.4.3 Raffi Enficiaud Mon, 30 Jan 2017 20:06:07 GMT owner changed https://svn.boost.org/trac10/ticket/12631#comment:1 https://svn.boost.org/trac10/ticket/12631#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> </ul> Ticket Raffi Enficiaud Sun, 19 Mar 2017 19:45:08 GMT <link>https://svn.boost.org/trac10/ticket/12631#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12631#comment:2</guid> <description> <p> Would something like </p> <pre class="wiki">Running 1 test case... Entering test module "message in dataset" /Users/raffi/Personnel/boost_github/libs/test/test/framework-ts/message-in-datatestcase-test.cpp:17: Entering test suite "test_update" /Users/raffi/Personnel/boost_github/libs/test/test/framework-ts/message-in-datatestcase-test.cpp:17: Entering test case "_0" Testing update : Message generated in the following context: sample = util/test_image2.jpg; Update Volume with 100 Message generated in the following context: sample = util/test_image2.jpg; Test case test_update/_0 did not check any assertions /Users/raffi/Personnel/boost_github/libs/test/test/framework-ts/message-in-datatestcase-test.cpp:17: Leaving test case "_0"; testing time: 111us /Users/raffi/Personnel/boost_github/libs/test/test/framework-ts/message-in-datatestcase-test.cpp:17: Leaving test suite "test_update"; testing time: 163us Leaving test module "message in dataset"; testing time: 197us *** No errors detected Program ended with exit code: 0 </pre><p> do instead? Unfortunately it will be hard to discard the second printing. Discarding any printing of context might be not desired in some circumstances as well. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sun, 19 Mar 2017 21:42:50 GMT</pubDate> <title>status, version changed https://svn.boost.org/trac10/ticket/12631#comment:3 https://svn.boost.org/trac10/ticket/12631#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.61.0</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> Ticket anonymous Mon, 20 Mar 2017 12:04:48 GMT <link>https://svn.boost.org/trac10/ticket/12631#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12631#comment:4</guid> <description> <p> Yes, I think that will do just fine. You have eliminated the clause "Failure occurred", which was the reason I wrote the original ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 22 Jun 2017 23:05:28 GMT</pubDate> <title>version, milestone changed https://svn.boost.org/trac10/ticket/12631#comment:5 https://svn.boost.org/trac10/ticket/12631#comment:5 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.65.0</span> → <span class="trac-field-new">Boost 1.61.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> Ticket Raffi Enficiaud Sun, 16 Jul 2017 08:44:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12631#comment:6 https://svn.boost.org/trac10/ticket/12631#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> In master, rev <code>3ddb0e0d29e8ebfe4ba20921a3d366f7b5b837b2 </code> </p> Ticket