<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Johannes Passing&#039;s Blog &#187; cfix</title>
	<atom:link href="http://jpassing.wordpress.com/category/cfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://jpassing.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 07 Nov 2009 10:36:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='jpassing.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/3d1ed6bbc67f13240599979d8ded1ff4?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Johannes Passing&#039;s Blog &#187; cfix</title>
		<link>http://jpassing.wordpress.com</link>
	</image>
			<item>
		<title>cfix 1.5.1 released</title>
		<link>http://jpassing.wordpress.com/2009/11/07/cfix-1-5-1-released/</link>
		<comments>http://jpassing.wordpress.com/2009/11/07/cfix-1-5-1-released/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 10:36:28 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[qa]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[unittesting]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=543</guid>
		<description><![CDATA[A new version of cfix, the unit testing framework for C and C++ on Windows, is now available on Sourceforge. Despite fixing several minor issues, the new version resolves the following two issues that were reported by users:

Definiting multiple WinUnit fixtures with setup/teardown routines in a single .cpp file leads to a compilation error
A thread [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=543&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A new version of <a href='http://www.cfix-testing.org/'>cfix, the unit testing framework for C and C++ on Windows</a>, is now available on Sourceforge. Despite fixing several minor issues, the new version resolves the following two issues that were reported by users:</p>
<ul>
<li>Definiting multiple WinUnit fixtures with setup/teardown routines in a single .cpp file leads to a compilation error</li>
<li>A thread handle is leaked during execution of a test (#2889511)</li>
</ul>
<p>Updated binaries and source code are <a href='http://sourceforge.net/projects/cfix/files/'>available for download on Sourceforge</a>.</p>
<p><i>Btw, in case you use cfix for kernel mode testing and are using WDK 7600, please have a look at my previous post: <a href='http://jpassing.wordpress.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/'>LTCG issues with the WIN7/amd64 environment of WDK 7600</a></i></p>
Posted in cfix, Testing, Tools Tagged: bugfix, cfix, qa, release, unittesting <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/543/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=543&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/11/07/cfix-1-5-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>LTCG issues with the WIN7/amd64 environment of WDK 7600</title>
		<link>http://jpassing.wordpress.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/</link>
		<comments>http://jpassing.wordpress.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:26:49 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[WDK]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[ddk]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[ltcg]]></category>
		<category><![CDATA[win7]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=533</guid>
		<description><![CDATA[Now that Windows 7 is out, we all sooner or later have to upgrade to WDK 7600. I am still reluctant to move away from WDK 6000/6001 because of the dropped W2K support, but this is a different issue.
However, as one cfix user who has obviously already adopted WDK 7600 kindly pointed out to me, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=533&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Now that Windows 7 is out, we all sooner or later have to upgrade to WDK 7600. I am still reluctant to move away from WDK 6000/6001 because of the dropped W2K support, but this is a different issue.</p>
<p>However, as one cfix user who has obviously already adopted WDK 7600 kindly pointed out to me, linking a kernel mode unit test against cfix using WDK 7600 and the WIN7/amd64 environment fails reproducibly with the following error message:</p>
<blockquote><p>
error fatal error C1047: The object or library file &#8216;&#8230;\lib\amd64\cfixkdrv.lib&#8217; was created with an older compiler than other objects; rebuild old objects and libraries
</p></blockquote>
<p>In contrast, building the same driver for WIN7/x86 works fine.</p>
<p>As <a href='http://msdn.microsoft.com/en-us/library/ms173554(VS.80).aspx'>the documentation for C1047</a> indicates, this error is usually related to inconsistent usage of Link Time Code Generation (LTCG): As soon as you use LTCG, all objects and libraries must be compiled with /GL &#8212; this normally is not a big deal, but as <a href='http://msdn.microsoft.com/en-us/library/ms794571.aspx'>this WDK page</a> rightfully explains, it means that libraries built this way are not suitable for redistribution because of their dependency on a specific compiler/linker version. But of couse, it also means that a library <i>not</i> built using /GL cannot be used easily when you build your program using LTCG.</p>
<p>Before Windows 7, all WDK build environment configurations I am aware of did not use LTCG. Neither did cfix, so everything worked fine even if your compiler/linker versions did not match the ones used for building cfix.</p>
<p>With WDK 7600, this situation changes: While WLH and other downlevel build environments still do not seem to use LTCG, the WIN7 environment, at least for amd64, enables LTCG by default.</p>
<p>What this means is that as soon as you link against a library which is not part of the WDK and therefore likely to be built using a different compiler version, you&#8217;ll get C1047. It is thus no surprise that attempting to link against cfixkdrv.lib, which is the library all kernel mode unit tests have to link against and which itself has been built using WDK 6000, leads to the error quoted above.</p>
<p>However, once you have figured this out, the workaround for this issue is trivial: Disable LTCG for your test driver by adding the following line to your SOURCES file:</p>
<blockquote><p><code><br />
USER_C_FLAGS=/GL-<br />
</code></p></blockquote>
<p>Link time code generation is a very powerful optimization technique and I encourage everybody to make use of it if possible. However, for the compatibility reasons outlined above, I consider it a rather stupid idea to have the WDK enable LTCG by default. Rather, I had much preferred to see an opt-in switch for LTCG.</p>
<p>Anyway, for the next version, I will consider shipping both, a 7600-compatible LTCG-enabled and a non-LTCG-enabled version of cfixkdrv.lib. Until then, the workaround described above will do the trick.</p>
Posted in cfix, WDK Tagged: ddk, library, ltcg, WDK, win7 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/533/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=533&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Assert Beta 2 Released</title>
		<link>http://jpassing.wordpress.com/2009/09/05/visual-assert-beta-2-released/</link>
		<comments>http://jpassing.wordpress.com/2009/09/05/visual-assert-beta-2-released/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 10:24:57 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Visual Assert]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[qa]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test-driven]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=467</guid>
		<description><![CDATA[The Beta 2 release of Visual Assert (formerly named cfix studio) is now available for download. The release marks a major step in the development of Visual Assert for that it not only comprises a number of bugfixes but also introduces major new features. The two most important certainly are support for EXE targets and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=467&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Beta 2 release of <a href='http://www.visualassert.com/'>Visual Assert</a> (formerly named <i>cfix studio</i>) is now <a href='http://www.visualassert.com/unit-testing-framework/download.html'>available for download</a>. The release marks a major step in the development of Visual Assert for that it not only comprises a number of bugfixes but also introduces major new features. The two most important certainly are support for EXE targets and Wizard assistance.</p>
<h3>Support for EXE Targets</h3>
<p>As <a href='/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/'>announced in a previous post</a> and also discussed in the <a href='/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/'>post about the cfix 1.5 release</a>, Visual Assert now fully supports unit tets emedded in EXE modules. </p>
<p>Previous releases required all unit tests to be compiled and linked into DLLs. In fact, the usage of DLLs has many advantages and therefore remains the recommended practice. However, for certain projects, such a requirement can turn out to be a true obstacle: Whenever the code to be tested is not exported from a DLL or part of a static library (LIB), accessing this code from within such a test DLL could become quite a challenge.</p>
<p>The fact that Visual Assert Beta 2 now fully supports EXE modules means the following: You can now place your unit tests wherever you think they fit best. Whether they are part of a DLL or an EXE, whether you create separate &#8220;unit test&#8221; projects or intermingle your test code with other code &#8212; it is now all up to you. Wherever you placed your tests, Visual Assert will find them and will provide a consistent user experience. </p>
<p>And the best part of the support for EXE modules is that it is totally non-intrusive: You do not have to change your main/WinMain function, much less any other code or build settings. And when run &#8220;outside&#8221; Visual Assert, i.e. launched directly or in the Visual Studio Debugger, the application will behave as normal.</p>
<p>Needless to say, the cfix 1.5 command line test runners, cfix32.exe and cfix64.exe <a href='/?p=492'>also have been updated</a> to properly deal with EXE modules.</p>
<h3>The Wizard</h3>
<p>Although neither the WinUnit API nor the cfix C and C++ API require much boilerplate code to be written, there still is some amount of code that more or less all unit tests share. Thanks to the new Wizard, you can now have Visual Assert generate this code for you. This <i>really</i> helps creating new fixtures more quickly!</p>
<h3>Download, Try it, Share Your Opinion</h3>
<p>Of course, using the new Beta version is free. So whether you are a full time tester or a unit testing sceptic, download the new release and try it by yourself. And of course, your feedback, both positive and negative, is always welcome and <a href='https://cfix.fogbugz.com/default.asp?pg=pgPublicEdit&amp;ixArea=16'>can be posted here</a>.</p>
<p><b><a href='http://www.visualassert.com/unit-testing-framework/download.html'>Download Visual Assert Beta 2</a></b></p>
Posted in cfix, Testing, Visual Assert, Visual Studio Tagged: addin, cfix, qa, tdd, test-driven, unit testing, Visual Assert, Visual Studio <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=467&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/09/05/visual-assert-beta-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.5 released; adds support for EXE-embedded tests and kernel mode multi-threading</title>
		<link>http://jpassing.wordpress.com/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/</link>
		<comments>http://jpassing.wordpress.com/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 10:11:30 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[qa]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[test-driven]]></category>
		<category><![CDATA[unit test]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[unit testing framework]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=492</guid>
		<description><![CDATA[A new version of the cfix unit testing framework is now ready for download.
Unlike the previous release, which was mainly a maintenance release, cfix 1.5 adds major new features: kernel mode multithreading and EXE-based unit tests.
EXE based unit tests
As I discussed in a previous post in the context of Visual Assert/cfix studio, cfix&#8217; restriction to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=492&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A new version of the <a href='http://www.cfix-testing.org/'>cfix unit testing framework</a> is now ready for download.</p>
<p>Unlike the previous release, which was mainly a maintenance release, cfix 1.5 adds major new features: kernel mode multithreading and EXE-based unit tests.</p>
<h3>EXE based unit tests</h3>
<p>As I <a href='/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/'>discussed in a previous post in the context of Visual Assert/cfix studio</a>, cfix&#8217; restriction to DLL based unit tests has turned out to be quite a limitation for certain kinds of projects. </p>
<p>In cfix 1.5, this restriction has been removed: cfix now supports both, unit tests compiled and linked into DLL modules and unit tests embedded into EXE modules. </p>
<p>Now, when I say <i>embeded into an EXE module</i>, I do not mean that you may merely leave out the /LD compiler switch  &#8212; it means that you may compile and link unit tests <i>into the actual</i> application EXE module <i>without</i> impacting this application&#8217;s behavior or having to change the application&#8217;s main() routine: When you run the application direcly or through the debugger, it will behave as normal (e.g. launch GUI). Once you launch it via <code>cfix32 -exe <i>app.exe</i></code> (or <code>cfix64 -exe <i>app.exe</i></code>, respectively), however, the application&#8217;s main() routine will not execute and instead, your embedded unit tests will run.</p>
<p>This may seem awkward at first &#8212; but it offers a tremendous advantage: <i>All</i> of the application&#8217;s code now immediately becomes testable (i.e. accessible by unit test code) without having to do complex reorganization of your build process or source tree layout (although it is still a very good idea to enhance the build process s.t. the unit tests are stripped in the RTM builds and to make cfix.dll <a href='http://msdn.microsoft.com/en-us/library/yx9zd12s(VS.80).aspx'>a delayload DLL</a>). For many projects, relying on this feature will therefore make adopting cfix and maybe even unit testing in general <i>much</i> easier.</p>
<p>In almost all regards, EXE-embedded unit tests behave the same as their DLL counterparts. They are, however, slightly less handy when it comes to debugging (unless you use <a href='http://www.visualassert.com/'>Visual Assert</a>, which will shield you from this). For this reason, and their greater flexibility in general, it should be noted though that DLL-based unit tests will remain the preferred choice.</p>
<h3>Kernel mode multithreading</h3>
<p>Since its first release, cfix has featured support for multi-threaded test cases. Multi-threaded test cases are tests which spawn child threads and &#8212; and this is the important point &#8212; both, the &#8220;main&#8221; thread and the child threads may trigger assertions (i.e. use CFIX_ASSERT and friends). Regardless of the thread an assertion occurs on, it will be recognized by the framework and will lead to the test case being marked as having failed. In case this sounds trivial to you, be informed that not even JUnit properly supports this :)</p>
<p>And while this feature has been supported for user mode tests ever since, the infrastructure for kernel mode unit tests, which was added in version 1.1, has lacked support for this feature: There was no kernel mode counterpart of <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/CfixCreateThread.html'>CfixCreateThread</a> and thus, only single-threaded kernel mode tests were supported.</p>
<p>cfix 1.5 now finally introduces <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/CfixCreateSystemThread.html'>CfixCreateSystemThread</a>: CfixCreateSystemThread is basically a wrapper for PsCreateSystemThread with the added functionality of registering the child thread with cfix. Thus, all threads spawned using CfixCreateSystemThread (rather than using PsCreateSystemThread directly) are allowed to make use of assertions.</p>
<p><i>Kudos to Matt Oh for beta-testing this feature.</i></p>
<h3>Minor enhacements</h3>
<p>Another enhancement related to multi threaded tests is <i>Auto-joining of child threads</i>: After a test routine completes, the framework will now automatically check whether any child threads were created. If this is the case and any of these threads are still running, they will be waited on &#8212; not before all threads have terminated will the test run resume. This feature both makes writing multi-threaded tests more convenient (you do not have to wait by yourself) and safer (No more runaway child threads).</p>
<p>Finally, another feature worth noting is that by specifying the <code>-td</code> command line switch, cfix can be directed to <i>not</i> capture a stack backtrace when an assertion fails. Although stack backtraces are usually very helpful, the symbol loading can make their creation quite expensive. Using this switch can therefore speed up the usage of cfix.</p>
<h3>Download/Upgrade Now</h3>
<p>You see, there are many good reasons to upgrade your cfix installation or &#8212; in case you are not using cfix yet &#8212; to give cfix a try. </p>
<p>Better yet, check out the <a href='http://www.visualassert.com'>Visual Assert</a> AddIn for Visual C++ &#8212; it is based on the new cfix 1.5 release and seamlessly integrates with Visual Studio.</p>
<p><b><a href='https://sourceforge.net/projects/cfix/files/cfix/cfix%201.5.0/cfix_1.5.0.3535.msi/download'>Download cfix 1.5.0 Installer</a></b><br />
<b><a href='https://sourceforge.net/projects/cfix/files/cfix/cfix%201.5.0/cfix-src-1.5.0.3535.zip/download'>Download cfix 1.5.0 source code</a></b></p>
Posted in cfix, Testing, Win32 Tagged: cfix, download, qa, release, test-driven, unit test, unit testing, unit testing framework <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=492&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix studio renamed to Visual Assert</title>
		<link>http://jpassing.wordpress.com/2009/09/02/cfix-studio-renamed-to-visual-assert/</link>
		<comments>http://jpassing.wordpress.com/2009/09/02/cfix-studio-renamed-to-visual-assert/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:56:18 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Visual Assert]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[addin]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=457</guid>
		<description><![CDATA[Back when I began thinking about creating a Visual Studio Add-In for cfix, I needed a code name for the project. After tentatively using the name cfix+ for a while, I quickly settled on cfix studio &#8212; given that the project revolved around cfix and Visual Studio, this name pretty much suggested itself.
Soon after going [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=457&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Back when I began thinking about creating a Visual Studio Add-In for cfix, I needed a code name for the project. After tentatively using the name <i>cfix+</i> for a while, I quickly settled on <i>cfix studio</i> &#8212; given that the project revolved around cfix and Visual Studio, this name pretty much suggested itself.</p>
<p>Soon after going into Beta, however, I had to realize that this name was not without its problems. Most importantly, it makes it hard for users to properly differentiate between <i>cfix</i> and <i>cfix studio</i>. This obviously led to situations where people were not quite sure whether <i>cfix studio</i> is a supplement to, replacement of, or just new version of <i>cfix</i>.</p>
<p>I would not care too much about this ambiguity if the two projects were not very different in terms of licensing: While using the Add-In will require a license to be purchased once it leaves the beta status, the underlying cfix framework is, and will always remain open source and be licensed under the quite permissive LGPL. </p>
<p>As all APIs and libraries unit tests link against are part of the cfix framework, and the cfix framework itself is self-contained, this means that despite the Add-In being closed source, you still get the benefits of open source: Most importantly, there is no lock-in &#8212; you can stop using the Add-In and switch back to the command line tools at any time and be all-open source again. You are even free to create a fork of cfix at any time &#8212; there really is nothing other than convenience that binds you to using the Add-In.</p>
<p>Given that a growing number of people indeed tends to object to using closed source APIs and fears such vendor lock-in, I consider it important to stress this open source nature of the cfix framework underlying the Add-In. </p>
<p>However, at this point it should also become clear that a name that blurs the distinction between the two projects is counterproductive.</p>
<p>Based on this insight, I opted for dropping the <i>cfix studio</i> name and replacing it by something different: <i>Visual Assert</i>. This name should emphasise that the Add-In may be based on, but really is separate from the cfix framework.</p>
<p><img src="http://jpassing.files.wordpress.com/2009/09/logo-visualassert.gif?w=250&#038;h=46" alt="Visual Assert" title="Visual Assert" width="250" height="46" class="size-full wp-image-460" align="center" /></p>
<p>The new name will be used beginning with the upcoming Beta 2 release.</p>
Posted in cfix, Testing, Visual Assert, Visual Studio Tagged: addin, Visual Assert, Visual Studio <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=457&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/09/02/cfix-studio-renamed-to-visual-assert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2009/09/logo-visualassert.gif" medium="image">
			<media:title type="html">Visual Assert</media:title>
		</media:content>
	</item>
		<item>
		<title>Vote for cfix</title>
		<link>http://jpassing.wordpress.com/2009/08/23/vote-for-cfix/</link>
		<comments>http://jpassing.wordpress.com/2009/08/23/vote-for-cfix/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 08:52:49 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[award]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=422</guid>
		<description><![CDATA[The Automated Testing Institute has elected cfix to be one of the finalists for the Autmation Honors award. The winners of the award will be highlighted in a Special December Edition of the Automated Software Testing Magazine. 
If you are a cfix user, be sure to vote for cfix here.
And by the way, I think [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=422&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <i>Automated Testing Institute</i> has elected <a href='http://www.cfix-testing.org/'>cfix</a> to be <a href='http://www.automatedtestinginstitute.com/home/index.php?option=com_content&amp;task=view&amp;id=1248'>one of the finalists</a> for the <i>Autmation Honors</i> award. The winners of the award will be highlighted in a Special December Edition of the Automated Software Testing Magazine. </p>
<p>If you are a cfix user, be sure to <a href='http://www.automatedtestinginstitute.com/home/index.php?option=com_mad4joomla&amp;jid=2&amp;Itemid=137'>vote for cfix here</a>.</p>
<p>And by the way, I think <a href='http://grinder.sourceforge.net/'>The Grinder</a>, which is a really neat web performance testing framework, also deserves being voted for&#8230;</p>
Posted in cfix, Misc Tagged: award, cfix, unit testing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/422/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=422&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/08/23/vote-for-cfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix studio Beta 2 to add support for EXE-based unit tests</title>
		<link>http://jpassing.wordpress.com/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/</link>
		<comments>http://jpassing.wordpress.com/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 11:16:13 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Assert]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[cfix studio]]></category>
		<category><![CDATA[mfc]]></category>
		<category><![CDATA[qa]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=398</guid>
		<description><![CDATA[N.B. cfix studio was the code name of what has become Visual Assert
The biggest shortcoming of the current cfix studio version certainly is that it requires all tests be implemented in a DLL. Conceptually, keeping test cases separated from the remaining code certainly is a good idea &#8212; and implementing tests in a DLL is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=398&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style='color:red;font-style:italic;padding:20px;'>N.B. cfix studio was the code name of what has become <a href='http://www.visualassert.com/'><b>Visual Assert</b></a></span></p>
<p>The biggest shortcoming of the current cfix studio version certainly is that it requires all tests be implemented in a DLL. Conceptually, keeping test cases separated from the remaining code certainly is a good idea &#8212; and implementing tests in a DLL is a way to accomplish this. However, there are many projects in which such separation is either not feasible or just too much effort.</p>
<p>The good news is that with Beta 2, this will finally change: EXEs become first class-citizens in cfix studio and it will not matter any more whether your tests are part of a DLL or EXE project &#8212; you can just put them where you think is appropriate.</p>
<p>Take a classic MFC/GUI application project as an example: It is pretty common for these kinds of projects that most, if not all, application logic is part of a single Visual Studio project that compiles into a single EXE. There may be some additional DLLs or LIBs, but by and large, the EXE itself is where most of the interesting things happen.</p>
<p>The upcoming Beta 2 release now allows you to implement all your unit tests as part of the same EXE project. This means that your tests have access to all classes, functions and resources that are part of the project &#8212; all of which you would not easily have access to if you implemented the tests in a separate DLL. </p>
<p>Of course, embedding unit tests into an executable raises two questions:</p>
<ol>
<li>
	How to strip the tests from the final release?
</li>
<li>
	How on earth will you be able to run these tests without having main() create windows, load files, play sounds, etc each time?
</li>
</ol>
<p>Thankfully, C/C++ has a preprocessor and Visual C++ has the &#8220;exclude from build&#8221; feature which allows you to exclude certain files whenever the project is built using a specific configuration. Using any of these two features, the first question is easily answered.</p>
<p>The second problem is more tricky &#8212; but thankfully, it has already been solved for you: When cfix studio runs unit tests, it is well aware of that running main() might have, let&#8217;s say <i>interesting</i> effects &#8212; so what it does is simple: It just makes sure that main() is never run! Not only does this ensure that the tests run <i>silently</i>, i.e. without windows popping up etc, it also has the benefit that all unit tests &#8220;see&#8221; the application in a pristine state: Rather than having to worry about which state main() has brought the application into, you can initialize and clean up any state you need in your Setup and Teardown functions<sup>1</sup>. </p>
<p>To make a long story short: You can write unit tests in EXE projects in exactly the same manner as you would in a DLL project. No special considerations needed, no project settings that need to be changed, no additional boilerplate code to write. And when you run the EXE outside cfix studio, i.e. hit F5 in Visual Studio or launch the EXE directly, you will not even notice that the EXE houses some unit tests &#8212; everything works as normal.</p>
<p>Sounds good? Then wait a few more days and see it in action!</p>
<p><b>Remarks</b><br />
1: <i>Needless to say, all global variables are initialized, constructors are run, etc. All CRT initialization happens as normal; only main()/WinMain() is not run. And yes, it also works for apps that link statically to MFC and therefore do not have a &#8220;regular&#8221; WinMain()</i>. </p>
Posted in cfix, Testing, Tools, Visual Assert, Visual Studio, Win32 Tagged: addin, cfix, cfix studio, mfc, qa, Testing, Tools, unit test, Visual Studio <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/398/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=398&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing cfix studio, the Visual Studio AddIn for C/C++ Unit Testing</title>
		<link>http://jpassing.wordpress.com/2009/06/23/introducing-cfix-studio-the-visual-studio-addin-for-cc-unit-testing/</link>
		<comments>http://jpassing.wordpress.com/2009/06/23/introducing-cfix-studio-the-visual-studio-addin-for-cc-unit-testing/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:32:01 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Assert]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[cfix]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=290</guid>
		<description><![CDATA[N.B. cfix studio was the code name of what has become Visual Assert
There is little doubt that native code, and C and C++ in particular, is here to stay. And still, it is pretty obvious that when it comes to tools and IDEs, it is the managed world that has gotten most attention from tool [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=290&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style='color:red;font-style:italic;padding:20px;'>N.B. cfix studio was the code name of what has become <a href='http://www.visualassert.com/'><b>Visual Assert</b></a></span></p>
<p>There is little doubt that native code, and C and C++ in particular, is here to stay. And still, it is pretty obvious that when it comes to tools and IDEs, it is the managed world that has gotten most attention from tool vendors over the past years. </p>
<p>While there are lots and lots of useful tools for native development, many of them probably even better than their managed counterparts, there are some areas where the managed language fraction is far ahead: One of these areas certainly is IDE support for unit testing.</p>
<p>JUnit for Eclipse, TestDriven.Net for Visual Studio and MS Test make test-driven development <i>so much</i> more convenient and efficient that it is almost ridiculous that using command line tools is still state of the art for C/C++ development.</p>
<p>That said, there is great news: With <a href='http://www.cfix-studio.com'>cfix studio</a>, there finally is a solution filling in this gap! cfix studio, <a href='http://jpassing.wordpress.com/2009/06/23/cfix-1-4-released/'>based on the cfix unit testing framework</a>, is a Visual Studio-AddIn that allows you to easily write, manage, run, and debug your unit tests from within Visual Studio. No fiddling with command line tools, complex configuration, or boilerplate code required! </p>
<p>Among <a href='http://www.cfix-studio.com/unit-testing-framework/key-features.html'>lots of other features</a>, cfix studio also has first-class support for multi-architecture development – you can easily switch back and forth between 32-bit and 64-bit and can even mix tests of different architectures in a single test run. Needless to say, cfix studio, like cfix, is also fully compatible to WinUnit. </p>
<p>If that has caught your interest, you are invited to check out the first beta version of cfix studio:</p>
<div style='padding-left:50px;padding-top:20px;padding-bottom:20px;'>
<p><b><a href='http://cfix-studio.com/unit-testing-framework/download.html'>Download cfix studio Beta 1</a></b><br />
Version 1.0.0.3458
</div>
<p>It is free, quick to install and comes with a set of example projects. Give it a try &#8212; and please <a href='https://cfix.fogbugz.com/default.asp?pg=pgPublicEdit&amp;ixArea=16'>let me know about all your crticism, suggestions and other feedback</a>!</p>
<p>Here are some screenshots of cfix studio in action:</p>
<p><a href="http://cfix-studio.com/unit-testing-framework/images/stories/explorer-contextmenu.png"><img src="http://jpassing.files.wordpress.com/2009/06/explorer-contextmenu-thumb.png?w=250&#038;h=197" alt="Test Explorer" width="250" height="197" class="alignnone size-full wp-image-300" /></a><br />
<i>The Test Explorer allows you to start a single or set of tests, the Run Window shows the results</i></p>
<p><a href='http://cfix-studio.com/unit-testing-framework/images/stories/run-running.png'><img src="http://jpassing.files.wordpress.com/2009/06/run-running-thumb.png?w=250&#038;h=181" alt="Run Window" title="Run Window: Viewing test progress" width="250" height="181" class="alignnone size-full wp-image-299" /></a><br />
<i>Run Window: Viewing test progress</i></p>
<p><a href="http://cfix-studio.com/unit-testing-framework/images/stories/run-failed-assertion.png"><img src="http://jpassing.files.wordpress.com/2009/06/run-failed-assertion-thumb.png?w=250&#038;h=159" alt="Failed Assertion" title="Failed Assertion" width="250" height="159" class="alignnone size-full wp-image-303" /></a><br />
<i>Run Window: Viewing test results and details of a failed assertion</i></p>
<p><a href="http://cfix-studio.com/unit-testing-framework/images/stories/debug-failed-assertion.png"><img src="http://jpassing.files.wordpress.com/2009/06/debug-failed-assertion-thumb.png?w=250&#038;h=197" alt="Debgging a failed assertion" title="Debgging a failed assertion" width="250" height="197" class="alignnone size-full wp-image-294" /></a><br />
<i>When running in the debugger, a failed assertion will hit a breakpoint and the Run Window will show additional details</i></p>
Posted in cfix, Debugging, Testing, Tools, Visual Assert, Visual Studio  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=290&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/06/23/introducing-cfix-studio-the-visual-studio-addin-for-cc-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2009/06/explorer-contextmenu-thumb.png" medium="image">
			<media:title type="html">Test Explorer</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2009/06/run-running-thumb.png" medium="image">
			<media:title type="html">Run Window: Viewing test progress</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2009/06/run-failed-assertion-thumb.png" medium="image">
			<media:title type="html">Failed Assertion</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2009/06/debug-failed-assertion-thumb.png" medium="image">
			<media:title type="html">Debgging a failed assertion</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.4 released</title>
		<link>http://jpassing.wordpress.com/2009/06/23/cfix-1-4-released/</link>
		<comments>http://jpassing.wordpress.com/2009/06/23/cfix-1-4-released/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:27:38 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=311</guid>
		<description><![CDATA[Today, a new version of cfix, the open source unit testing framework for user and kernel mode C and C++, has been released. cfix 1.4, in addition to the existing feature of allowing test runs to be restricted to specific fixtures, now also allows single testcases to be run in isolation, which can be a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=311&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today, a new version of cfix, the open source unit testing framework for user and kernel mode C and C++, has been released. cfix 1.4, in addition to the existing feature of allowing test runs to be restricted to specific fixtures, now also allows single testcases to be run in isolation, which can be a great aid in debugging. Besides several minor fixes, the cfix API has been slightly enhanced and cfix now degrades more gracefully in case of dbghelp-issues.</p>
<p>Updated cfix binaries and source code are now <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'>available for download</a></p>
Posted in cfix, Debugging, Testing, Tools, Win32  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/311/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=311&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/06/23/cfix-1-4-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.3.0 Released, Introducing WinUnit Compatibility</title>
		<link>http://jpassing.wordpress.com/2009/03/03/cfix-130-released-introducing-winunit-compatibility/</link>
		<comments>http://jpassing.wordpress.com/2009/03/03/cfix-130-released-introducing-winunit-compatibility/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 19:52:45 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[winunit]]></category>
		<category><![CDATA[xunit]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=213</guid>
		<description><![CDATA[cfix 1.3, the latest version of the unit testing framework for C/C++ on Windows, has just been released. As announced in the last blog post, the major new feature of this release is WinUnit compatibility, i.e. the ability to recompile existing WinUnit test suites into cfix test suites without having to change a single line [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=213&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>cfix 1.3, the latest version of the unit testing framework for C/C++ on Windows, has just been released. As announced in the <a href='http://jpassing.wordpress.com/2009/02/26/embracing-winunit/'>last blog post</a>, the major new feature of this release is WinUnit compatibility, i.e. the ability to recompile existing WinUnit test suites into cfix test suites without having to change a single line of code.</p>
<p>To demonstrate that this compatibility indeed works, consider the following simple example:</p>
<blockquote><pre>
#include "WinUnit.h"

<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TEST.html'>BEGIN_TEST</a>(DummyTest)
{
  <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_STRING_EQUAL.html'>WIN_ASSERT_STRING_EQUAL</a>( "foo", "bar" "Descriptive message");
}
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TEST.html'>END_TEST</a>
</pre>
</blockquote>
<p>Compile it:</p>
<blockquote><pre>
cl /I %CFIX_HOME%\include /LD /EHa /Zi winunittest.cpp /link /LIBPATH:%CFIX_HOME%\lib\i386
</pre>
</blockquote>
<p>Or, in case %INCLUDE% and %LIB% already happen to be set properly:</p>
<blockquote><pre>
cl /LD /EHa winunittest.cpp
</pre>
</blockquote>
<p>Note that the only difference to compiling the test for WinUnit ist that a different include path is used &#8212; rather than the original winunit.h, cfix&#8217; own winunit.h is used, which in turn implements the WinUnit API on top of the existing API.</p>
<p>The resulting DLL is a valid cfix DLL and its tests can be run in the usual manner. As the example contains a failing test, cfix will print the stack trace and error description to the console:</p>
<blockquote><pre>
D:\sample&gt;<b>cfix32 -ts -z winunittest.dll</b>
cfix version 1.3.0.3340 (fre)
(C) 2008-2009 - Johannes Passing - http://www.cfix-testing.org/
[Failure]      winunittest.DummyTest.DummyTest
      winunittest.cpp(5): DummyTest

      <b>Expression: Descriptive message: [foo] == [bar] (Expression: "foo" == "bar")</b>
      Last Error: 0 (The operation completed successfully. )

      cfix!CfixpCaptureStackTrace +0x40
      cfix!CfixPeReportFailedAssertion +0xd2
      winunittest!cfixcc::Assertion::Fail&lt;std::...
      winunittest!cfixcc::Assertion::Relate&lt;std...
      winunittest!cfixcc::Assertion::Relate ...
      winunittest!cfixcc::Assertion::RelateStri...
      winunittest!DummyTest +0x9c
      cfix!CfixsRunTestRoutine +0x33
      cfix!CfixsRunTestCaseMethod +0x27
      cfix!CfixsRunTestCase +0x25
      ...
</pre>
</blockquote>
<p>Of course, cfix also supports WinUnit fixtures, as the following example, taken from the original <a href='http://msdn.microsoft.com/en-us/magazine/cc136757.aspx'>WinUnit article on MSDN</a> demonstrates:</p>
<blockquote><pre>
#include "WinUnit.h"
#include &lt;windows.h&gt;

// Fixture must be declared.
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/FIXTURE.html'>FIXTURE</a>(DeleteFileFixture);

namespace
{
  TCHAR s_tempFileName[MAX_PATH] = _T("");
  bool IsFileValid(TCHAR* fileName);
}

// Both SETUP and TEARDOWN must be present.
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/SETUP.html'>SETUP</a>(DeleteFileFixture)
{
  // This is the maximum size of the directory passed to GetTempFileName.
  const unsigned int maxTempPath = MAX_PATH - 14;
  TCHAR tempPath[maxTempPath + 1] = _T("");
  DWORD charsWritten = GetTempPath(maxTempPath + 1, tempPath);
  // (charsWritten does not include null character)
  <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_TRUE.html'>WIN_ASSERT_TRUE</a>(charsWritten  0,
    _T("GetTempPath failed."));

  // Create a temporary file
  UINT tempFileNumber = GetTempFileName(tempPath, _T("WUT"),
    0, // This means the file will get created and closed.
    s_tempFileName);

  // Make sure that the file actually exists
  WIN_ASSERT_WINAPI_SUCCESS(IsFileValid(s_tempFileName),
    _T("File %s is invalid or does not exist."), s_tempFileName);
}

// TEARDOWN does the inverse of SETUP, as well as undoing
// any side effects the tests could have caused.
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/TEARDOWN.html'>TEARDOWN</a>(DeleteFileFixture)
{
  // Delete the temp file if it still exists.
  if (IsFileValid(s_tempFileName))
  {
    // Ensure file is not read-only
    DWORD fileAttributes = GetFileAttributes(s_tempFileName);
    if (fileAttributes &amp; FILE_ATTRIBUTE_READONLY)
    {
      WIN_ASSERT_WINAPI_SUCCESS(
        SetFileAttributes(s_tempFileName,
          fileAttributes ^ FILE_ATTRIBUTE_READONLY),
          _T("Unable to undo read-only attribute of file %s."),
          s_tempFileName);
    }

    // Since I'm testing DeleteFile, I use the alternative CRT file
    // deletion function in my cleanup.
    <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_ZERO.html'>WIN_ASSERT_ZERO</a>(_tremove(s_tempFileName),
      _T("Unable to delete file %s."), s_tempFileName);
  }

  // Clear the temp file name.
  ZeroMemory(s_tempFileName,
    ARRAYSIZE(s_tempFileName) * sizeof(s_tempFileName[0]));
}

<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TESTF.html'>BEGIN_TESTF</a>(DeleteFileShouldDeleteFileIfNotReadOnly, DeleteFileFixture)
{
  WIN_ASSERT_WINAPI_SUCCESS(DeleteFile(s_tempFileName));
  <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_FALSE.html'>WIN_ASSERT_FALSE</a>(IsFileValid(s_tempFileName),
    _T("DeleteFile did not delete %s correctly."),
    s_tempFileName);
}
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TESTF.html'>END_TESTF</a>

<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TESTF.html'>BEGIN_TESTF</a>(DeleteFileShouldFailIfFileIsReadOnly, DeleteFileFixture)
{
  // Set file to read-only
  DWORD fileAttributes = GetFileAttributes(s_tempFileName);
  WIN_ASSERT_WINAPI_SUCCESS(
    SetFileAttributes(s_tempFileName,
    fileAttributes | FILE_ATTRIBUTE_READONLY));

  // Verify that DeleteFile fails with ERROR_ACCESS_DENIED
  // (according to spec)
  <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_FALSE.html'>WIN_ASSERT_FALSE</a>(DeleteFile(s_tempFileName));
  <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/WIN_ASSERT_EQUAL.html'>WIN_ASSERT_EQUAL</a>(ERROR_ACCESS_DENIED, GetLastError());
}
<a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/BEGIN_TESTF.html'>END_TESTF</a>

namespace
{
  bool IsFileValid(TCHAR* fileName)
  {
    return (GetFileAttributes(fileName) != INVALID_FILE_ATTRIBUTES);
  }
}
</pre>
</blockquote>
<p>Compiling and running this test yields the expected output:</p>
<blockquote><pre>
d:\sample&gt;<b>cl /I %CFIX_HOME%\include /LD /EHa /Zi fixture.cpp /link /LIBPATH:%CFIX_HOME%\lib\i386</b>
d:\sample&gt;<b>cfix32 -ts -z fixture.dll</b>
cfix version 1.3.0.3340 (fre)
(C) 2008-2009 - Johannes Passing - http://www.cfix-testing.org/
[Success]      fixture.DeleteFileFixture.DeleteFileShouldDeleteFileIfNotReadOnly
[Success]      fixture.DeleteFileFixture.DeleteFileShouldFailIfFileIsReadOnly

       1 Fixtures
       2 Test cases
           2 succeeded
           0 failed
           0 inconclusive
</pre>
</blockquote>
<h3>Limitations</h3>
<p>All compatibility has its limitations &#8212; although cfix supports all major WinUnit constructs and assertions, there are a small number of known limitations, which are listed in the documentation. And although I am confident that most WinUnit code should compile and run just fine, it is, of course, possible, that further limitations pop up. In such cases, I would welcome an appropriate bug report and will try to fix cfix accordingly.</p>
<h3>Documentation</h3>
<p>In order to have cfix be a fully adequate replacement for cfix, the <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/API.html'>cfix documentation</a> has additionally been augmented to include a documentation of the entire WinUnit API.</p>
<h3>Technical background</h3>
<p>Technically, implementing the compatibility layer went rather smoothly. On the one hand, WinUnit and cfix have similar architectures, which makes many things easier. On the other hand, WinUnit has a clean, single public header file (contrast that to CppUnit!), which also simplified things. And as WinUnit is limited to C++, I was able to use C++ templates (in combination with some preprocessor macros) to implement the entire WinUnit compatibility layer without having to change a single line of cfix itself. Rather, the WinUnit macros/classes are all mapped onto the existing <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/CcAPI.html'>cfix C++ API</a>, which already includes most of what was neccessary to implement the WinUnit functionality. </p>
<h3>Conclusion</h3>
<p>In case have been using WinUnit the past and have a set of existing WinUnit-based test suites, give cfix a try &#8212; Not only should it be a full-featured replacement for WinUnit, you can also expect to see, and benefit from new features in upcoming releases!</p>
<p>Last but not least, the release contains a number of minor bugfixes. So upgrading is recommended even if you do not intend to use the new WinUnit compatibility feature.</p>
<p>cfix can be downloaded <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'>here</a>.</p>
Posted in cfix, Testing, Tools Tagged: c, cfix, release, unit testing, winunit, xunit <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=213&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2009/03/03/cfix-130-released-introducing-winunit-compatibility/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.2 Installer Fixed for AMD64</title>
		<link>http://jpassing.wordpress.com/2008/11/18/cfix-12-installer-fixed-for-amd64/</link>
		<comments>http://jpassing.wordpress.com/2008/11/18/cfix-12-installer-fixed-for-amd64/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 11:30:09 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[amd64]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=175</guid>
		<description><![CDATA[The cfix 1.2 package as released last week contained a rather stupid bug that the new build, 1.2.0.3244, now fixes: the amd64 binaries cfix64.exe and cfixkr64.sys were wrongly installed as cfix32.exe and cfixkr32.sys, respectively. Not only did this stand in contrast to what the documenation stated, it also resulted in cfix being unable to load [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=175&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The cfix 1.2 package as released last week contained a rather stupid bug that the new build, 1.2.0.3244, now fixes: the amd64 binaries cfix64.exe and cfixkr64.sys were wrongly installed as cfix32.exe and cfixkr32.sys, respectively. Not only did this stand in contrast to what the documenation stated, it also resulted in cfix being unable to load the cfixkr driver on AMD64 platforms.</p>
<p>The new MSI package is now <a href='https://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204&amp;release_id=639356'>available for download on Sourceforge</a>.</p>
Posted in cfix, Debugging, Kernel, Testing, Win32 Tagged: amd64, cfix, release <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=175&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/11/18/cfix-12-installer-fixed-for-amd64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.2 introduces improved C++ support</title>
		<link>http://jpassing.wordpress.com/2008/11/10/cfix-12-introduces-improved-c-support/</link>
		<comments>http://jpassing.wordpress.com/2008/11/10/cfix-12-introduces-improved-c-support/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 10:30:20 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[lgpl]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[oss]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=163</guid>
		<description><![CDATA[cfix 1.2, which has been released today, introduces a number of new features, the most prominent being improved support for C++ and additional execution options.
New C++ API
To date, cfix has primarily focussed on C as the programming language to write unit tests in. Although C++ has always been supported, cfix has not made use of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=163&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>cfix 1.2, which has been released today, introduces a number of new features, the most prominent being improved support for C++ and additional execution options.</p>
<h3>New C++ API</h3>
<p>To date, cfix has primarily focussed on C as the programming language to write unit tests in. Although C++ has always been supported, cfix has not made use of the additional capabilities C++ provides. With version 1.2, cfix makes C++ a first class citizen and introduces an additional API that leverages the benefits of C++ and allows writing test cases in a more convenient manner.</p>
<p>Being implemented on top of the existing C API, the C++ API is not a replacement, but rather an addition to the existing API set.</p>
<p>As the following example suggests, fixtures can now be written as classes, with test cases being implemented as methods:</p>
<blockquote><pre>
#include &lt;cfixcc.h&gt;

class ExampleTest : public <a href="http://cfix.sourceforge.net/doc/TestFixture.html" title="TestFixture">cfixcc::TestFixture</a>
{
public:
  void TestOne()
  {}

  void TestTwo()
  {}
};

<a href="http://cfix.sourceforge.net/doc/CFIXCC_BEGIN_CLASS.html" title="CFIXCC_BEGIN_CLASS">CFIXCC_BEGIN_CLASS</a>( ExampleTest )
  <a href="http://cfix.sourceforge.net/doc/CFIXCC_METHOD.html" title="CFIXCC_METHOD">CFIXCC_METHOD</a>( TestOne )
  <a href="http://cfix.sourceforge.net/doc/CFIXCC_METHOD.html" title="CFIXCC_METHOD">CFIXCC_METHOD</a>( TestTwo )
<a href="http://cfix.sourceforge.net/doc/CFIXCC_END_CLASS.html" title="CFIXCC_END_CLASS">CFIXCC_END_CLASS</a>()
</pre>
</blockquote>
<p>To learn more about the definition of fixtures, have a look at the <a href='http://cfix.sourceforge.net/doc/TestFixture.html'>respective TestFixture chapter in the cfix documentation</a>.</p>
<p>Regarding the implementation of test cases, cfix adds a new set of <i>type-safe</i>, template-driven assertions that, for instance, allow convenient <a href="http://cfix.sourceforge.net/doc/CFIXCC_ASSERT_EQUALS.html">equality checks</a>:</p>
<blockquote><pre>
void TestOne()
{
  const wchar_t* testString = L"test";

  //
  // Use typesafe assertions...
  //
  <a href="http://cfix.sourceforge.net/doc/CFIXCC_ASSERT_EQUALS.html" title="CFIXCC_ASSERT_EQUALS">CFIXCC_ASSERT_EQUALS</a>( 1, 1 );
  <a href="http://cfix.sourceforge.net/doc/CFIXCC_ASSERT_EQUALS.html" title="CFIXCC_ASSERT_EQUALS">CFIXCC_ASSERT_EQUALS</a>( L"test", testString );
  <a href="http://cfix.sourceforge.net/doc/CFIXCC_ASSERT_EQUALS.html" title="CFIXCC_ASSERT_EQUALS">CFIXCC_ASSERT_EQUALS</a>( wcslen( testString ), ( size_t ) 4 );

  //
  // ...log messages...
  //
  <a href="http://cfix.sourceforge.net/doc/CFIX_LOG.html" title="http://cfix.sourceforge.net/doc/CFIX_LOG">CFIX_LOG</a>( L"Test string is %s", testString );

  //
  // ...or use the existing "C" assertions.
  //
  <a href="http://cfix.sourceforge.net/doc/CFIX_ASSERT.html" title="CFIX_ASSERT">CFIX_ASSERT</a>( wcslen( testString ) == 4 );
  <a href="http://cfix.sourceforge.net/doc/CFIX_ASSERT_MESSAGE.html" title="CFIX_ASSERT_MESSAGE">CFIX_ASSERT_MESSAGE</a>( testString[ 0 ] == 't',
    L"Test string should start with a 't'" );
}
</pre>
</blockquote>
<p>Again, have a look at the updated <a href='http://cfix.sourceforge.net/doc/API.html'>API reference</a> for an overview of the new API additions.</p>
<h3>Customizing Test Runs</h3>
<p>Another important new feature is the addition of the new switches -fsf (<i>Shortcut Fixture</i>), -fsr (<i>Shortcut Run</i>), and -fss (<i>Shortcut Run On Failing Setup</i>). Using these switches allows you to specify how a test run should resume when a test case fails.</p>
<p>When a test case fails, the default behavior of cfix is to report the failure, and resume at the next test case. By specifying -fsf, however, the remaining test cases of the same fixture will be skipped and execution resumes at the next fixture. With -fsr, cfix can be requirested to abort the entire run as soon as a single test case fails. </p>
<h3>What else is new in 1.2?</h3>
<ul>
<li><a class="link" href="http://cfix.sourceforge.net/doc/CFIX_ASSERT_MESSAGE.html" title="CFIX_ASSERT_MESSAGE">CFIX_ASSERT_MESSAGE</a></li>
<li>ANSI support for <a class="link" href="http://cfix.sourceforge.net/doc/CFIX_LOG.html" title="CFIX_LOG">CFIX_LOG</a>, <a class="link" href="http://cfix.sourceforge.net/doc/CFIX_INCONCLUSIVE.html" title="CFIX_INCONCLUSIVE">CFIX_INCONCLUSIVE</a>,<br />
					and <a class="link" href="http://cfix.sourceforge.net/doc/CFIX_ASSERT_MESSAGE.html" title="CFIX_ASSERT_MESSAGE">CFIX_ASSERT_MESSAGE</a> (and the entire C++ API)</li>
<li><a class="link" href="http://cfix.sourceforge.net/doc/CfixPeGetValue.html" title="CfixPeGetValue">CfixPeGetValue</a> and <a class="link" href="http://cfix.sourceforge.net/doc/CfixPeSetValue.html" title="CfixPeSetValue">CfixPeSetValue</a></li>
<li>Kernel mode: Drivers do not need to link against aux_klib.lib any more</li>
<li><a class="link" href="http://cfix.sourceforge.net/doc/CFIX_FIXTURE_BEFORE.html" title="CFIX_FIXTURE_BEFORE">Before</a> and <a class="link" href="http://cfix.sourceforge.net/doc/CFIX_FIXTURE_AFTER.html" title="CFIX_FIXTURE_AFTER">After</a> routines</li>
<li>Support for cl 13.00 and Visual Studio 2003 (in addition to 2005 and 2008)</li>
</ul>
<h3>Download</h3>
<p>As always, cfix 1.2 is source and binary compatible to previous versions. The new MSI package and source code can now be <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'>downloaded on Sourceforge</a>.</p>
<p>cfix is open source and licensed under the <a href='http://www.gnu.org/licenses/lgpl.html'>GNU Lesser General Public License</a>.</p>
Posted in cfix, Debugging, Kernel, Testing, Win32 Tagged: cfix, Kernel, lgpl, oss, release, tdd, unit testing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=163&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/11/10/cfix-12-introduces-improved-c-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.1.1 released</title>
		<link>http://jpassing.wordpress.com/2008/08/26/cfix-111-released/</link>
		<comments>http://jpassing.wordpress.com/2008/08/26/cfix-111-released/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 11:14:19 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=116</guid>
		<description><![CDATA[As discussed last week, cfix 1.1.0 has suffered from a potential deadlocking issue when run in the VisualStudio 2008 debugger. cfix 1.1.1 mitigates this problem and should now work equally well with Visual Studio 2005 and 2008.
When run in a debugger, cfix now will not try to capture a stack trace for a failed assertion [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=116&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href='http://jpassing.wordpress.com/?p=104'>As discussed last week</a>, cfix 1.1.0 has suffered from a potential deadlocking issue when run in the VisualStudio 2008 debugger. cfix 1.1.1 mitigates this problem and should now work equally well with Visual Studio 2005 and 2008.</p>
<p>When run in a debugger, cfix now will not try to capture a stack trace for a failed assertion any more. These stack traces usually have been redundant to what the debugger provides, yet the logic to implement this has been the reason for the interference with the VS 2008 debugger. When run outside the debugger, cfix will capture and display a stack trace as before. </p>
<p>As always, binaries and source code can be obtained on <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204&amp;release_id=613450'>Sourceforge</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/116/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/116/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=116&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/08/26/cfix-111-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging a Debugger Deadlock</title>
		<link>http://jpassing.wordpress.com/2008/08/23/debugging-a-debugger-deadlock/</link>
		<comments>http://jpassing.wordpress.com/2008/08/23/debugging-a-debugger-deadlock/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 08:10:28 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[VisualStudio]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[deadlock]]></category>
		<category><![CDATA[symbol server]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=97</guid>
		<description><![CDATA[While I still use VisualStudio 2005 Team System for most of my development, I want to make sure that cfix works properly with VisualStudio 2008 as well. 
To test that, I recently started a Windows 2003 Server VM, installed VCExpress 2008 and cfix and attempted to run an example project in the VC debugger. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=97&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While I still use VisualStudio 2005 Team System for most of my development, I want to make sure that cfix works properly with VisualStudio 2008 as well. </p>
<p>To test that, I recently started a Windows 2003 Server VM, installed VCExpress 2008 and cfix and attempted to run an example project in the VC debugger. As long as no assertions fired, everything seemed fine. I then altered the example&#8217;s source code so that one of the assertion would fail, ran it in the debugger &#8212; and waited. Nothing happened.</p>
<p>When an assertion fires, cfix 1.1 attempts to capture the stack trace to make debugging easier. For this to work, the respective debugging symbols must be loaded, and &#8212; if not yet available &#8212; be downloaded from the symbol server. It is thus not uncommon that it takes a couple of seconds before the failure message appears and the debugger breaks in when an assertion fails. But after about a minute, still nothing happened &#8212; a deadlock seems to have occured.</p>
<p>To make the situation worse, I then noticed that while cfix was hanging, Internet Explorer would not properly start any more. After creating its main window, it would hang as well.</p>
<p>So I rebooted the machine and hooked up a kernel debugger. Luckily, the scenario was easy to reproduce and I could take a closer look&#8230;</p>
<h3>Debugging the deadlock</h3>
<p>First, let&#8217;s find the cfix32 process:</p>
<blockquote><pre>
kd&gt; !process 0 0 <b>cfix32.exe</b>
PROCESS <b>8254e490</b>  SessionId: 0  Cid: 06b0    Peb: 7ffde000  ParentCid: 0658
    DirBase: 06e90000  ObjectTable: e170ee58  HandleCount:  69.
    Image: cfix32.exe
</pre>
</blockquote>
<p>Now that we have the VA, we can switch to the process and load its user mode symbols:</p>
<blockquote><pre>
kd&gt; .process /r /p <b>8254e490  </b>
Implicit process is now 8254e490
.cache forcedecodeuser done
Loading User Symbols
...............................
</pre>
</blockquote>
<p>Looking at this process&#8217; threads, it is easy to see that one stack looks suspicious:</p>
<blockquote><pre>
kd&gt; !process 8254e490
PROCESS 8254e490  SessionId: 0  Cid: 06b0
	Peb: 7ffde000  ParentCid: 0658
    DirBase: 06e90000  ObjectTable: e170ee58  HandleCount:  69.
    Image: cfix32.exe
    VadRoot 82455628 Vads 76 Clone 0 Private 491.
    Modified 8. Locked 0.
    DeviceMap e148f3c0

    [...]

THREAD <b>826276f8 </b> Cid 06b0.06b4  Teb: 7ffdd000 Win32Thread:
  <b>e1734a38 WAIT: (Unknown) KernelMode Non-Alertable
	f4422b44  SynchronizationEvent</b>
Not impersonating
DeviceMap                 e148f3c0
Owning Process            8254e490       Image:         cfix32.exe
Wait Start TickCount      13474          Ticks: 9138 (0:00:01:31.511)
Context Switch Count      219                 LargeStack
UserTime                  00:00:00.010
KernelTime                00:00:00.010
Win32 Start Address cfix32!wmainCRTStartup (0x010048cf)
Start Address kernel32!BaseProcessStartThunk (0x77e617f8)
Stack Init f4423000 Current f4422aa0 Base f4423000 Limit f441f000 Call 0
Priority 10 BasePriority 8 PriorityDecrement 0

ChildEBP RetAddr
f4422ab8 808202b6 nt!KiSwapContext+0x25
f4422ad0 8081fb6e nt!KiSwapThread+0x83
<b>f4422b14 809bae63 nt!KeWaitForSingleObject+0x2e0 </b>
f4422bf4 809bc06d nt!DbgkpQueueMessage+0x178
f4422c18 8096ba9a nt!DbgkpSendApiMessage+0x45
f4422cc8 80909942 nt!DbgkMapViewOfSection+0xcf
f4422d34 8082350b nt!NtMapViewOfSection+0x269
f4422d34 7c8285ec nt!KiFastCallEntry+0xf8
00069b94 7c82728b ntdll!KiFastSystemCallRet
00069b98 7c831e05 ntdll!NtMapViewOfSection+0xc
00069bdc 7c831fd6 ntdll!LdrpMapViewOfDllSection+0x64
00069ccc 7c833027 ntdll!LdrpMapDll+0x390
[...]
</pre>
</blockquote>
<p>The thread is blocked &#8212; it is waiting on en event. Events do not have an owner so we have to do a little more to find out, what it is waiting for. Unfortunately, !thread crops the trace, so let us first get the full one:</p>
<blockquote><pre>
kd&gt; .thread <b>826276f8  </b>
kd&gt; kn100
 # ChildEBP RetAddr
00 f4422ab8 808202b6 nt!KiSwapContext+0x25
01 f4422ad0 8081fb6e nt!KiSwapThread+0x83
02 f4422b14 809bae63 nt!KeWaitForSingleObject+0x2e0
03 f4422bf4 809bc06d nt!DbgkpQueueMessage+0x178
04 f4422c18 8096ba9a nt!DbgkpSendApiMessage+0x45
05 f4422cc8 80909942 nt!DbgkMapViewOfSection+0xcf
06 f4422d34 8082350b nt!NtMapViewOfSection+0x269
07 f4422d34 7c8285ec nt!KiFastCallEntry+0xf8
08 00069b94 7c82728b ntdll!KiFastSystemCallRet
09 00069b98 7c831e05 ntdll!NtMapViewOfSection+0xc
0a 00069bdc 7c831fd6 ntdll!LdrpMapViewOfDllSection+0x64
0b 00069ccc 7c833027 ntdll!LdrpMapDll+0x390
0c 00069f30 7c8330f5 ntdll!LdrpLoadImportModule+0x17c
0d 00069f70 7c8330a4 ntdll!LdrpHandleOneNewFormatImportDescriptor+0x4d
0e 00069f8c 7c833248 ntdll!LdrpHandleNewFormatImportDescriptors+0x1d
0f 0006a014 7c833049 ntdll!LdrpWalkImportDescriptor+0x195
10 0006a264 7c8330f5 ntdll!LdrpLoadImportModule+0x1cb
11 0006a2a4 7c8330a4 ntdll!LdrpHandleOneNewFormatImportDescriptor+0x4d
12 0006a2c0 7c833248 ntdll!LdrpHandleNewFormatImportDescriptors+0x1d
13 0006a348 7c83427d ntdll!LdrpWalkImportDescriptor+0x195
14 0006a5e0 7c834065 ntdll!LdrpLoadDll+0x241
15 0006a85c 77e41bf3 ntdll!LdrLoadDll+0x198
16 0006a8c4 77e41dbd kernel32!LoadLibraryExW+0x1b2
17 0006a8d8 77e41df3 kernel32!LoadLibraryExA+0x1f
18 0006a8f8 46a7870c kernel32!LoadLibraryA+0xb5
19 0006a954 46a93b3e WININET!__delayLoadHelper2+0xfc
1a 0006a994 46a93950 WININET!_tailMerge_RASAPI32_dll+0xd
1b 0006a9a8 46a93a4e WININET!DoConnectoidsExist+0x2b
1c 0006a9d4 46a93abc WININET!GetRasConnections+0x34
1d 0006a9f0 46a8c559 WININET!IsDialUpConnection+0xa9
1e 0006aa0c 46a97a44 WININET!FixProxySettingsForCurrentConnection+0x31
1f 0006b5e4 46aa3774 WININET!InternetQueryOptionA+0xa47
20 0006b748 01d12dc6 WININET!InternetQueryOptionW+0x1fa
21 0006b98c 01d12583 symsrv!StoreWinInet::dumpproxyinfo+0x46
22 0006be04 01d1290a symsrv!StoreWinInet::connect+0x273
23 0006c040 01d05ae7 symsrv!StoreWinInet::find+0x3a
24 0006c134 01d06c47 symsrv!cascade+0x87
25 0006c684 01d06a57 symsrv!SymbolServerByIndexW+0x127
26 0006c8b4 0302e30e symsrv!SymbolServerW+0x77
27 0006ccf4 03018eed dbghelp!symsrvGetFile+0x12e
28 0006d9dc 03019f57 dbghelp!diaLocatePdb+0x33d
29 0006dc58 03041ade dbghelp!diaGetPdb+0x207
2a 0006de7c 0303ff15 dbghelp!GetDebugData+0x2be
2b 0006e324 03040516 dbghelp!modload+0x305
2c 0006e7a4 0304068e dbghelp!LoadModule+0x3f6
2d 0006e9e8 03044eaf dbghelp!GetModule+0x4e
2e 0006ea30 03044bda dbghelp!NTGetProcessModules+0x16f
2f 0006eae8 03032e80 dbghelp!GetProcessModules+0x4a
30 0006ed70 60f03f7a dbghelp!SymInitializeW+0x320
31 0006f17c 60f032b0 cfix!CfixpCaptureStackTrace+0x117
32 0006f598 100419b5 cfix!CfixPeReportFailedAssertion+0xc5
WARNING: Stack unwind information not available.
Following frames may be wrong.
33 0006f7c0 10040f40 VsSample!__CfixFixturePeSimpleAdderTest+0x5ab1
34 0006f8b4 10040db6 VsSample!__CfixFixturePeSimpleAdderTest+0x503c
35 0006fa68 10040a8a VsSample!__CfixFixturePeSimpleAdderTest+0x4eb2
36 0006fb48 60f02b64 VsSample!__CfixFixturePeSimpleAdderTest+0x4b86
37 0006fb84 60f02be6 cfix!CfixsRunTestRoutine+0x33
38 0006fb94 60f038e9 cfix!CfixsRunTestCaseMethod+0x27
39 0006fbac 60f03a06 cfix!CfixsRunTestCase+0x25
3a 0006fbcc 60f03ce5 cfix!CfixsRunTsexecActionMethod+0xfb
3b 0006fbf0 0100e135 cfix!CfixsRunSequenceAction+0x122
3c 0006fc2c 0100d5c2 cfix32!CfixrunpRunFixtures+0x90
3d 0006fc40 0100d85c cfix32!CfixrunsMainWorker+0x3f
3e 0006fe7c 010046b8 cfix32!CfixrunMain+0x1b9
3f 0006fee0 0100485e cfix32!wmain+0x80
40 0006ffc0 77e6f23b cfix32!_wmainCRTStartup+0x12b
41 0006fff0 00000000 kernel32!BaseProcessStart+0x23
</pre>
</blockquote>
<p>Whoa, what a trace! cfix!CfixpCaptureStackTrace tries to assemble a stack trace, for which it has to initialize dbghelp.dll first. dbghelp!SymInitializeW seeks help of symsrv.dll, which in turn tries to connect to the Microsoft symbol server. Before it can so, it obviously attempts to get its proxy settings straight, which in turn leads to some DLL (rasapi.dll, in case you wonder) being loaded. The loader then calls into the debugging subsystem (nt!Dbgk*). It may be assumed that the loader is notifying the debugger about the DLL having been loaded.</p>
<p>Turining our attention to Internet Explorer, we look at iexplore.exe&#8217;s threads:</p>
<blockquote><pre>
kd&gt; !process 0 0 iexplore.exe
PROCESS <b>824ec3b0</b>  SessionId: 0  Cid: 07f0    Peb: 7ffdb000  ParentCid: 054c
    DirBase: 0307c000  ObjectTable: e15186b8  HandleCount: 225.
    Image: iexplore.exe

kd&gt; .process /r /p <b>824ec3b0  </b>
Implicit process is now 824ec3b0
.cache forcedecodeuser done
Loading User Symbols
...............................................
</pre>
</blockquote>
<p>Now, iexplore has <i>lots</i> of threads, but skimming over them, one looked interesting:</p>
<blockquote><pre>
kd&gt; !process 824ec3b0
PROCESS 824ec3b0  SessionId: 0  Cid: 07f0
	Peb: 7ffdb000  ParentCid: 054c
    DirBase: 0307c000  ObjectTable: e15186b8  HandleCount: 225.
    Image: iexplore.exe
    VadRoot 824991c8 Vads 168 Clone 0 Private 643.
    Modified 44. Locked 0.
    DeviceMap e148f3c0

    [...]

THREAD 82431980  Cid 07f0.00b8  Teb: 7ffd5000 Win32Thread: 00000000
  WAIT: (Unknown) UserMode Non-Alertable
	<b>82631eb0  Mutant - owning thread 826276f8</b>
Not impersonating
DeviceMap                 e148f3c0
Owning Process            824ec3b0       Image:         iexplore.exe
Wait Start TickCount      21924          Ticks: 688 (0:00:00:06.889)
Context Switch Count      1
UserTime                  00:00:00.000
KernelTime                00:00:00.000
Win32 Start Address ntdll!RtlpWorkerThread (0x7c839efb)
Start Address kernel32!BaseThreadStartThunk (0x77e617ec)
Stack Init f40a3000 Current f40a2c78 Base f40a3000 Limit f40a0000 Call 0
Priority 8 BasePriority 8 PriorityDecrement 0

ChildEBP RetAddr
f40a2c90 808202b6 nt!KiSwapContext+0x25
f40a2ca8 8081fb6e nt!KiSwapThread+0x83
f40a2cec 8090e64e nt!KeWaitForSingleObject+0x2e0
f40a2d50 8082350b nt!NtWaitForSingleObject+0x9a
f40a2d50 7c8285ec nt!KiFastCallEntry+0xf8
01e5fdd0 7c827d0b ntdll!KiFastSystemCallRet
01e5fdd4 77e61d1e ntdll!NtWaitForSingleObject+0xc
01e5fe44 77e61c8d kernel32!WaitForSingleObjectEx+0xac
01e5fe58 46a8c54d kernel32!WaitForSingleObject+0x12
<b>01e5fe74 46a7eeca WININET!FixProxySettingsForCurrentConnection+0x25 </b>
01e5fe8c 46a7ee3f WININET!CFsm_HttpSendRequest::RunSM+0x61
01e5fea4 46a7efa3 WININET!CFsm::Run+0x39
01e5fed4 77da5938 WININET!CFsm::RunWorkItem+0x79
01e5feec 7c83a827 SHLWAPI!ExecuteWorkItem+0x1d
01e5ff44 7c83aa0b ntdll!RtlpWorkerCallout+0x71
01e5ff64 7c83aa82 ntdll!RtlpExecuteWorkerRequest+0x4f
01e5ff78 7c839f60 ntdll!RtlpApcCallout+0x11
01e5ffb8 77e64829 ntdll!RtlpWorkerThread+0x61
01e5ffec 00000000 kernel32!BaseThreadStart+0x34
</pre>
</blockquote>
<p>Now we are getting somewhere. We have seen FixProxySettingsForCurrentConnection in cfix&#8217;s trace already &#8212; but in this case, it is waiting on something. Let&#8217;s see&#8230;</p>
<blockquote><pre>

kd&gt; !object <b>82631eb0  </b>
Object: 82631eb0  Type: (827a5550) Mutant
    ObjectHeader: 82631e98 (old version)
    HandleCount: 3  PointerCount: 6
    Directory Object: e1496420  Name: WininetProxyRegistryMutex
</pre>
</blockquote>
<p>And 826276f8, that&#8217;s the cfix32 thread we have already assessed. Obviously, iexplore waits for cfix to release the WininetProxyRegistryMutex, and cfix waits on someone else.</p>
<p>Turning over to VC, we can find a stack that also contains a call to FixProxySettingsForCurrentConnection on its stack. Again, blocking on WininetProxyRegistryMutex.</p>
<blockquote><pre>
kd&gt; k100
ChildEBP RetAddr
f4492c90 808202b6 nt!KiSwapContext+0x25
f4492ca8 8081fb6e nt!KiSwapThread+0x83
f4492cec 8090e64e nt!KeWaitForSingleObject+0x2e0
f4492d50 8082350b nt!NtWaitForSingleObject+0x9a
f4492d50 7c8285ec nt!KiFastCallEntry+0xf8
065b95c8 7c827d0b ntdll!KiFastSystemCallRet
065b95cc 77e61d1e ntdll!NtWaitForSingleObject+0xc
065b963c 77e61c8d kernel32!WaitForSingleObjectEx+0xac
065b9650 46a8c54d kernel32!WaitForSingleObject+0x12
<b>065b966c 46a7eeca WININET!FixProxySettingsForCurrentConnection+0x25</b>
065b9684 46a7ee3f WININET!CFsm_HttpSendRequest::RunSM+0x61
065b969c 46a7fefa WININET!CFsm::Run+0x39
065b96b4 46ab0a67 WININET!DoFsm+0x25
065b96dc 46aa1092 WININET!HttpWrapSendRequest+0x148
065b9714 06b231da WININET!HttpSendRequestW+0x5e
065b973c 06b22ea8 SYMSRV!StoreWinInet::request+0x2a
065b9770 06b226cc SYMSRV!StoreWinInet::fileinfo+0x18
065b9780 06b22741 SYMSRV!StoreWinInet::get+0x7c
065b9fc4 06b229a3 SYMSRV!StoreWinInet::open+0x41
065ba204 06b15ae7 SYMSRV!StoreWinInet::find+0xd3
065ba2f8 06b16c47 SYMSRV!cascade+0x87
065ba848 06b16a57 SYMSRV!SymbolServerByIndexW+0x127
065baa78 51412896 SYMSRV!SymbolServerW+0x77
065bb8cc 51413383 mspdb80!LOCATOR::SYMSRV::SymbolServer+0x190
065bbf10 514136f8 mspdb80!LOCATOR::FLocatePdbSymsrv+0x75
065bbf38 514139ce mspdb80!LOCATOR::FLocatePdbPathHelper+0x179
065bc96c 51413cbe mspdb80!LOCATOR::FLocatePdbPath+0x105
065bccb4 51414371 mspdb80!LOCATOR::FLocatePdb+0x1ad
065bd9a8 458cc1e8 mspdb80!PDBCommon::OpenValidate5+0xab
065bd9ec 45959d4c msenc90!enc::EncImageEdit::
                  `scalar deleting destructor'+0x4d
065bda34 45958e62 NatDbgDE!OLPDBOpen+0x93
065be6c0 45958f0a NatDbgDE!OLStart+0x107
065be6fc 45958fae NatDbgDE!LoadOmfForReal+0x23
065be714 45959019 NatDbgDE!LoadSymbols+0x43
065be72c 459590d9 NatDbgDE!OLLoadOmf+0x55
065be75c 45959154 NatDbgDE!SHLoadDll+0xd5
065be7ac 45959247 NatDbgDE!CSymbolHandlerX::SHLoadDll+0x5a
065be844 4595937c NatDbgDE!CModule::Load+0x1a1
065be8ac 4594d002 NatDbgDE!CNativeProcess::NotifyModLoad+0xc8
065be9ec 4594cf6d NatDbgDE!EngineCallback+0xb3
065bea18 45958d3f NatDbgDE!EMCallBackDB+0x4c
065bf050 4594d0dc NatDbgDE!LoadFixups+0x218
065bf0ac 4594d289 NatDbgDE!DebugPacket+0x213
065bfdb4 4594cf39 NatDbgDE!EMFunc+0x40f
065bfddc 4594d73d NatDbgDE!TLCallBack+0x1e
065bfdf4 4594d711 NatDbgDE!TLClientLib::Local_TLFunc+0xc8
065bfe3c 4594d85c NatDbgDE!DMSendPacket+0x121
065bfee8 45959b1d NatDbgDE!NotifyEM+0x3ae
<b>065bff0c 4594d663 NatDbgDE!ProcessLoadDLLEvent+0x47</b>
065bff44 4594d686 NatDbgDE!ProcessDebugEvent+0x30d
065bffb8 77e64829 NatDbgDE!DmPollLoop+0x3c
065bffec 00000000 kernel32!BaseThreadStart+0x34
</pre>
</blockquote>
<p>But &#8212; looking closely, it becomes obvious that this thread must be the one handling debug events, and in fact, the call to ProcessLoadDLLEvent is a strong indication for that this thread is currently handling a DLL load event. And now we have closed the loop &#8212; this thread must be handling the DLL load event for rasapi.dll, the DLL which cfix was about to load. And to do this, VC attempts to acquire the WininetProxyRegistryMutex, which is owned by the original cfix thread. Deadlock.</p>
<p>What is interesting about this situation is that neither party &#8212; cfix, iexplore or VCExpress, and also none of the modules clearly is the culprit and behaving wrong. It is more like a combination of special circumstances that bring up the deadlock as discussed.</p>
<p>It is also notable that I am <i>not</i> using any particular proxy settings on this machine and automatic proxy configuration has been turned off.</p>
<p>So far, I have not experienced the same problem with VS 2003 and VS 2005 &#8212; I thus assume that only VS 2008 is affected by this.</p>
<p>Although I am pretty sure that cfix is not really at fault here, I have to adapt it to avoid this deadlock in the future. Until an updated version is available, you can use <a href='http://jpassing.wordpress.com/?p=104'>this workaround</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/97/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/97/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=97&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/08/23/debugging-a-debugger-deadlock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.1 may experience hangs when used in the VisualStudio 2008 debugger</title>
		<link>http://jpassing.wordpress.com/2008/08/23/cfix-11-may-experience-hangs-when-used-in-the-visualstudio-2008-debugger/</link>
		<comments>http://jpassing.wordpress.com/2008/08/23/cfix-11-may-experience-hangs-when-used-in-the-visualstudio-2008-debugger/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 07:55:23 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[debugger]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=104</guid>
		<description><![CDATA[When used in conjunction with the VisualStudio 2008 debugger, cfix may hang indefinitely as soon as an assertion fails. The reason for this behavior is a Symbol Server-caused deadlock between the debugger and cfix. I am going to discuss the details of this deadlock in a separate post.
Until a new version of cfix is available, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=104&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When used in conjunction with the VisualStudio 2008 debugger, <a href='http://cfix.sf.net/'>cfix</a> may hang indefinitely as soon as an assertion fails. The reason for this behavior is a Symbol Server-caused deadlock between the debugger and cfix. I am going to discuss the details of this deadlock in a separate post.</p>
<p>Until a new version of cfix is available, you can work around this problem as follows: Go to the cfix installation directory and rename or delete symsrv.dll. This will stop cfix from contacting the symbol server. While cfix now will not be able to capture proper stack traces any more, this will prevent the mentioned deadlock situation to arise.</p>
<p>The problem only applies to cfix 1.1 and VS 2008. The problem does not occur when debugging with VS 2003, VS 2005, or cdb/ntsd/WinDBG.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/104/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/104/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=104&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/08/23/cfix-11-may-experience-hangs-when-used-in-the-visualstudio-2008-debugger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.1 goes LGPL</title>
		<link>http://jpassing.wordpress.com/2008/07/15/cfix-11-goes-lgpl/</link>
		<comments>http://jpassing.wordpress.com/2008/07/15/cfix-11-goes-lgpl/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 16:37:31 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[lgpl]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=69</guid>
		<description><![CDATA[cfix 1.0 had been licensed under the GNU General Public License. One of the characteristics of the GPL is that it disallows proprietary binaries to be linked against GPL-licensed binaries. 
In the context of cfix, linking is quite a concern &#8212; after all, every test-DLL has to be linked against cfix.dll. As cfix.dll is GPL-licensed, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=69&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href='http://cfix.sf.net'>cfix</a> 1.0 had been licensed under the <i><a href='http://www.gnu.org/licenses/gpl.html'>GNU General Public License</a></i>. One of the characteristics of the GPL is that it disallows proprietary binaries to be linked against GPL-licensed binaries. </p>
<p>In the context of cfix, linking is quite a concern &#8212; after all, every test-DLL has to be linked against cfix.dll. As cfix.dll is GPL-licensed, this means that it would be illegal to redistribute the test-DLL, along with the cfix test runner, commercially. Granted, it is rather uncommon to redistribute testing code with your proprietary software &#8212; however, as it turned out, this case exists.</p>
<p><a href="http://www.gnu.org/licenses/lgpl.html"><img src="http://jpassing.files.wordpress.com/2008/07/lgplv3-147x51.png?w=147&#038;h=51" alt="" width="147" height="51" align='center' border='0' /></a></p>
<p>For this reason, cfix 1.1 switches over to the slightly more liberal <i><a href='http://www.gnu.org/licenses/lgpl.html'>GNU Lesser General Public License</a></i>. The LGPL explicitly allows proprietary binaries to link against LGPL-licensed binaries. As such, redistributing your cfix test-DLLs will not be an issue any more.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/69/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/69/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=69&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/07/15/cfix-11-goes-lgpl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2008/07/lgplv3-147x51.png?w=147" medium="image" />
	</item>
		<item>
		<title>cfix 1.1 introduces NT kernel mode unit tests</title>
		<link>http://jpassing.wordpress.com/2008/07/14/cfix-11-introduces-nt-kernel-mode-unit-tests/</link>
		<comments>http://jpassing.wordpress.com/2008/07/14/cfix-11-introduces-nt-kernel-mode-unit-tests/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 14:48:14 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[NT]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=73</guid>
		<description><![CDATA[cfix 1.1 introduces a number of new features. The most important among these is the additional ability to write kernel mode unit tests, i.e. unit tests that are run in kernel mode. Needless to say, cfix 1.1 still supports user mode unit tests.
All contemporary unit testing frameworks focus on unit testing in user mode. Certainly, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=73&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>cfix 1.1 introduces a number of new features. The most important among these is the additional ability to write kernel mode unit tests, i.e. unit tests that are run in kernel mode. Needless to say, cfix 1.1 still supports user mode unit tests.</p>
<p>All contemporary unit testing frameworks focus on unit testing in user mode. Certainly, the vast majority of testing code can be assumed to be targeting user mode, so this does not come at a surprise. Tools for driver testing, of which there are quite a few, focus on integration testing &#8212; they usually test whether the driver works in its entirety.</p>
<p>While these tools are very useful indeed, they do not support true <i>unit</i> testing &#8212; i.e. offering the ability to test individual routines or subsystems of a driver. To perform such tests, it would be neccessary to write a separate test driver or revert to other techniques <a href='http://www.osronline.com/article.cfm?id=326'>such as this one</a>.</p>
<p>cfix 1.1 fills in this gap and offers the ability to write kernel mode tests. That way, individual parts of what may eventually become a driver can thoroughly be tested in isolation, without neccessitating much boilerplate code.</p>
<h3>Example</h3>
<p>Writing a kernel mode unit test is as easy as writing a user mode unit test &#8212; <b>the API is the same for user and kernel mode tests</b>. Even the tools, cfix32 and cfix64 are the same for both modi. The only true difference is that kernel mode tests require slightly different build settings.</p>
<p>The following listing shows an example for a kernel mode unit test &#8212; but the same code could just as well be compiled into a user mode unit test.</p>
<blockquote><pre>
#include &lt;cfix.h&gt;

static void FixtureSetup()
{
  CFIX_ASSERT( 0 != 1 );
}

static void FixtureTeardown()
{
  CFIX_LOG( L"Tearing down..." );
}

/*++
  Test routine -- do the actual testing.
--*/
static void Test1()
{
  ULONG a = 1;
  ULONG b = 1;
  CFIX_ASSERT_EQUALS_ULONG( a, b );
  CFIX_ASSERT( a + b == 2 );

  // You are free to use all WDM APIs here!

  CFIX_LOG( L"a=%d, b=%d", a, b );
}

/*++
  Define a test fixture.
--*/
CFIX_BEGIN_FIXTURE( MyFixture )
  CFIX_FIXTURE_ENTRY( Test1 )

  CFIX_FIXTURE_SETUP( FixtureSetup )
  CFIX_FIXTURE_TEARDOWN( FixtureTeardown )
CFIX_END_FIXTURE()
</pre>
</blockquote>
<p>Once built, the test can be run from the command line:</p>
<blockquote><pre>
C:\cfix\bin\i386&gt;cfix32 -nologo -kern ktest.sys
Module: ktest (ktest.sys)
  Fixture: MyFixture
    Test1
</pre>
</blockquote>
<p>For a more detailed discussion and more example code, please refer to <a href='http://cfix.sourceforge.net/doc/TutorialKernelWdkAuthoringATestSuite.html'>the <b>tutorial</b></a>.</p>
<h3>Architecture</h3>
<p>For user mode code, the cfix architecture roughly looks like this:<br />
<img src="http://jpassing.files.wordpress.com/2008/07/cfix-arch-user.png" alt="" class="aligncenter size-medium wp-image-75" /><br />
The tests are compiled into a DLL. Using the testrunner application cfix32 or cfix64, one or more fixtures defined in the DLL can be run and the results are reported to the console or to a log file.</p>
<p>For kernel mode code, the acrhitecture looks a little different. The tests are compiled into a driver rather than into a DLL. The driver is verly lightweight and, besides the tests, contains only very little cfix-provided code (basically, just a DriverEntry implementation).<br />
<img src="http://jpassing.files.wordpress.com/2008/07/cfix-arch-kernel2.png" alt="" class="aligncenter size-medium wp-image-76" /><br />
When cfix32 or cfix64 is requested to run a kernel mode tests, it will load the <i>Reflector</i>, a driver that contains the kernel mode fraction of the testing framework. Relaying control operation and output through the reflector, the kernel mode unit tests can be run.</p>
<p>All these additional steps are  performed without additional user intervention &#8212; the drivers are installed, loaded and stopped automatically. From a user perspective, running a kernel mode tests feels just like running a user mode test.</p>
<h3>More&#8230;</h3>
<p>cfix 1.1 introduces additional new features. I will discuss some of them over the next weeks. In any case, whether you have not used cfix yet or are a cfix 1.0 user, you should go straight to the <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'><b>download</b> page now</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=73&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/07/14/cfix-11-introduces-nt-kernel-mode-unit-tests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>

		<media:content url="http://jpassing.files.wordpress.com/2008/07/cfix-arch-user.png" medium="image" />

		<media:content url="http://jpassing.files.wordpress.com/2008/07/cfix-arch-kernel2.png" medium="image" />
	</item>
		<item>
		<title>cfix 1.0.1 adds support for Windows 2000</title>
		<link>http://jpassing.wordpress.com/2008/06/03/cfix-101-adds-support-for-windows-2000/</link>
		<comments>http://jpassing.wordpress.com/2008/06/03/cfix-101-adds-support-for-windows-2000/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 18:50:06 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unittest]]></category>
		<category><![CDATA[W2K]]></category>
		<category><![CDATA[Win2000]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=67</guid>
		<description><![CDATA[
Despite the fact that mainstream support for Windows 2000 has ended in 2005 and the system is well on its way to retirement, Windows 2000 is still in wide use today. As such, it remains being an important target platform for many software packages.


The fact that cfix has not provided support for Windows 2000 was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=67&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
Despite the fact that mainstream support for Windows 2000 has ended in 2005 and the system is well on its way to retirement, Windows 2000 is still in wide use today. As such, it remains being an important target platform for many software packages.
</p>
<p>
The fact that cfix has not provided support for Windows 2000 was thus unfortunate &#8212; after all, if Windows 2000 is among the target platforms of your software, you should be able to run your tests on this platform.
</p>
<p>
cfix 1.0.1 remedies this shortcoming and adds Windows 2000 i386 SP4 as an supported platform.
</p>
<p>
The updated packages are <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'>available for download on Sourceforge</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/67/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/67/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=67&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/06/03/cfix-101-adds-support-for-windows-2000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>cfix 1.0.0 released</title>
		<link>http://jpassing.wordpress.com/2008/04/03/cfix-100-released/</link>
		<comments>http://jpassing.wordpress.com/2008/04/03/cfix-100-released/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 08:00:52 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[cfix]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=52</guid>
		<description><![CDATA[About one month after having released the first release candidate, cfix has now reached version 1.0.0 final.
The differences between RC1 and the final version are minor. A small number of bugs have emerged during the past weeks, most of which related to output and statistics tracking. Those bugs have been fixed in 1.0.0 final. Despite [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=52&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>About one month after <a href='http://jpassing.wordpress.com/2008/02/26/introducing-cfix-a-unit-testing-framework-for-cc-on-win32/'>having released the first release candidate</a>, cfix has now reached version 1.0.0 final.</p>
<p>The differences between RC1 and the final version are minor. A small number of bugs have emerged during the past weeks, most of which related to output and statistics tracking. Those bugs have been fixed in 1.0.0 final. Despite these fixes, there are no functional differences between the two releases.</p>
<p>The new release can be found on the <a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204'>Sourceforge Download page</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=52&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/04/03/cfix-100-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing cfix, a unit testing framework for C/C++ on Win32</title>
		<link>http://jpassing.wordpress.com/2008/02/26/introducing-cfix-a-unit-testing-framework-for-cc-on-win32/</link>
		<comments>http://jpassing.wordpress.com/2008/02/26/introducing-cfix-a-unit-testing-framework-for-cc-on-win32/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 20:05:00 +0000</pubDate>
		<dc:creator>jpassing</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[cfix]]></category>
		<category><![CDATA[unittesting]]></category>
		<category><![CDATA[xunit]]></category>

		<guid isPermaLink="false">http://jpassing.wordpress.com/?p=46</guid>
		<description><![CDATA[
I am happy to announce that the unit testing framework cfix I have developed over the past weeks and months is now available on Sourceforge as a first release candidate. It is licensed under the GPL, both binaries and source code are available.

Background

cfix is a framework for authoring and running xUnit-like testcases written in C [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=46&subd=jpassing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
I am happy to announce that the unit testing framework <i>cfix</i> I have developed over the past weeks and months is <a href='http://cfix.sourceforge.net/'>now available on Sourceforge</a> as a first release candidate. It is licensed under the GPL, both binaries and source code are available.
</p>
<h3>Background</h3>
<p>
cfix is a framework for authoring and running xUnit-like testcases written in C or C++. The aim of the tool is to provide a development experience very similar to frameworks such as JUnit or NUnit. Due to the nature of C and C++, current unit testing frameworks for C and C++ hardly reach the ease of use of JUnit or NUnit. In particular, it is noticable that significantly more code has to be written to implement a test suite.
</p>
<p>
Languages like Java and the various .Net languages, as well as scripting languages, all provide reflection facilities. Unit testing frameworks for these languages can therefore rely on reflective features in order to minimize the amount of code required to define a test suite. Provided a library, the framework can find and identify test cases and is able to selectively run them.
</p>
<p>
Lacking similar reflective facilities, the route most unit testing frameworks for C and C++ have chosen is to oblige the developer to explicitly define test cases and fixtures. Taking CUnit as an example, the developer has to make explictit function calls to define a test suite, add test cases to the suite and to finally run this suite. CppUnit simplifies this a bit, but still requires the developer to implement quite some amount of initialization code. Another important drawback of this approach is the fact that no real separation between test code and test runner is done. Often, even the choice whether to use a graphical or a console frontend for running test is tied to this initialization code.
</p>
<p>
The aim of cfix is to overcome these limitations and to provide an easy to use, yet powerful unit testing framework for C and C++. Rather than having to write tedious initialization code, the developer merely has to define a fixture using the macros shown in the example below.
</p>
<p>
Like JUnit and NUnit (but unlike all frameworks for C/C++, with WinUnit being the notable exception), cfix implements a separation in between test code and the test runner. Unit tests are compiled into a DLL rather than an EXE file. This DLL thus only contains the code to be tested. The entire logic and user interface required to actually run unit tests is contained in the cfix-provided testrunner, cfix32.exe/cfix64.exe.
</p>
<p>Moreover, cfix has been designed to make debugging of unit tests as easy as possible &#8212; the frameworks notices when a debugger is present and allows you to break in as soon as some assertion fails.
</p>
<h3>Example</h3>
<p>So let&#8217;s have a look at a minimalistic cfix unit test:</p>
<blockquote><pre>
#include 

void Test1()
{
  int a = 1;
  int b = 1;
  CFIX_ASSERT( a + b == 2 );
}

CFIX_BEGIN_FIXTURE( MyMinimalisticFixture )
  CFIX_FIXTURE_ENTRY( Test1 )
CFIX_END_FIXTURE()
</pre>
</blockquote>
<p>After compiling and linking the code into a DLL using
<pre>cl /Zi /LD cfix-sample.c</pre>
<p> the unit test can be run with the testrunner <i>cfix32</i> (or <i>cfix64</i>):</p>
<blockquote><pre>
[Success]      cfix-sample.dll.MyMinimalisticFixture.Test1
</pre>
</blockquote>
<p>
Needless to say, cfix is not limited to such simple tests &#8212; have a look at the <a href='http://cfix.sourceforge.net/doc/ch02.html'>Tutorial</a> to learn more about the features, installation and usage of cfix.
</p>
<p>
Enough background information &#8212; go ahead and&#8230;</p>
<div style='font-size:14pt;margin-left:50px;'><a href='http://sourceforge.net/project/showfiles.php?group_id=218233&amp;package_id=263204&amp;release_id=579770'>download cfix</a>!</div>
<p>
Of course, I&#8217;d love to read your feedback &#8212; you can reach me via passing at users.sourceforge.net!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jpassing.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jpassing.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpassing.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpassing.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpassing.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpassing.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpassing.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpassing.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpassing.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpassing.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpassing.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpassing.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpassing.wordpress.com&blog=1468393&post=46&subd=jpassing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jpassing.wordpress.com/2008/02/26/introducing-cfix-a-unit-testing-framework-for-cc-on-win32/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2568ab9d93774268403af71d7cadbf11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpassing</media:title>
		</media:content>
	</item>
	</channel>
</rss>