<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 47: running under a debugger on Windows CPPUNIT_ASSERT can Break</title><link>https://sourceforge.net/p/cppunit/feature-requests/47/</link><description>Recent changes to 47: running under a debugger on Windows CPPUNIT_ASSERT can Break</description><atom:link href="https://sourceforge.net/p/cppunit/feature-requests/47/feed.rss" rel="self"/><language>en</language><lastBuildDate>Mon, 17 Sep 2007 02:15:55 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cppunit/feature-requests/47/feed.rss" rel="self" type="application/rss+xml"/><item><title>running under a debugger on Windows CPPUNIT_ASSERT can Break</title><link>https://sourceforge.net/p/cppunit/feature-requests/47/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When running in a debugger under windows it would be nice if CPPUNIT_ASSERT(false); would stop like a break point as opposed to just reporting it at the end of the run. From what I can see this can be accomplished via adding code similar to that below to Asserter.cpp in the method Asserter::Fail(). This will cause a message to be printed in the IDE that when using visual studio, among others will bring the user straight to the line that contains the failed assertion by double clicking on the line in the debugger.&lt;/p&gt;
&lt;p&gt;void&lt;br /&gt;
Asserter::fail( const Message &amp;amp;message, &lt;br /&gt;
const SourceLine &amp;amp;sourceLine )&lt;br /&gt;
{ &lt;br /&gt;
#ifdef _WIN32 &lt;br /&gt;
if (::IsDebuggerPresent()) &lt;br /&gt;
{ &lt;br /&gt;
std::ostringstream oss; &lt;br /&gt;
oss &amp;lt;&amp;lt; sourceLine.fileName() &amp;lt;&amp;lt; "(" &amp;lt;&amp;lt; sourceLine.lineNumber() &amp;lt;&amp;lt; ") :  " &amp;lt;&amp;lt; message.shortDescription() &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; message.details() &amp;lt;&amp;lt; std::endl; &lt;br /&gt;
::OutputDebugString(oss.str().c_str()); &lt;br /&gt;
::DebugBreak(); &lt;br /&gt;
} &lt;br /&gt;
#endif // _WIN32 &lt;br /&gt;
throw Exception( message, sourceLine );  37    throw Exception( message, sourceLine ); &lt;br /&gt;
} &lt;/p&gt;
&lt;p&gt;just a thought.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les</dc:creator><pubDate>Mon, 17 Sep 2007 02:15:55 -0000</pubDate><guid>https://sourceforge.net345817d42523085904688d73c5d996f7e2077138</guid></item></channel></rss>