<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Improving QtTest usability with QtTestUtil</title>
	<atom:link href="http://el-tramo.be/blog/qttestutil/feed" rel="self" type="application/rss+xml" />
	<link>http://el-tramo.be/blog/qttestutil</link>
	<description>Remko Tronçon&#039;s Homepage</description>
	<lastBuildDate>Wed, 14 Jul 2010 08:39:57 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Remko Tronçon</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-83295</link>
		<dc:creator>Remko Tronçon</dc:creator>
		<pubDate>Sat, 22 May 2010 07:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-83295</guid>
		<description>@Hogwarts If you have widgets in your test, Qt requires you to have a QApplication instantiated in your test application. Modify SimpleTestUtil.cpp, and change the QCoreApplication to QApplication. Maybe you need to do a app.run() at the end too.

However, having widgets in unit tests is typically a bad smell. There should be no logic in your GUI widgets, so testing them shouldn&#039;t make sense. GUI objects typically need user interaction, which is not something you can automate (and which may get you in trouble with the Qt event loop too). Try to pull all the non-GUI stuff out of your widget.</description>
		<content:encoded><![CDATA[<p>@Hogwarts If you have widgets in your test, Qt requires you to have a QApplication instantiated in your test application. Modify SimpleTestUtil.cpp, and change the QCoreApplication to QApplication. Maybe you need to do a app.run() at the end too.</p>
<p>However, having widgets in unit tests is typically a bad smell. There should be no logic in your GUI widgets, so testing them shouldn&#8217;t make sense. GUI objects typically need user interaction, which is not something you can automate (and which may get you in trouble with the Qt event loop too). Try to pull all the non-GUI stuff out of your widget.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hogwarts</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-83291</link>
		<dc:creator>Hogwarts</dc:creator>
		<pubDate>Sat, 22 May 2010 01:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-83291</guid>
		<description>I&#039;m using this util but I can&#039;t create a widget and test it...someone know why??

this is my code:

class MyFirstClassTest : public QObject
{
     Q_OBJECT
	
	private slots:
		void initTestCase() {
		}

		void cleanupTestCase() {
		}

		void testMyMethod() {
			CustomSlider* slider;
			slider = new CustomSlider(NULL);
			slider-&gt;setSpacing(8);
			QCOMPARE(slider-&gt;spacing(), 8);
		}
};


and this is the error:

********* Start testing of MyFirstClassTest *********
Config: Using QTest library 4.5.2, Qt 4.5.2
PASS   : MyFirstClassTest::initTestCase()
QFATAL : MyFirstClassTest::testMyMethod() QWidget: Cannot create a QWidget when no GUI is being used
FAIL!  : MyFirstClassTest::testMyMethod() Received a fatal error.
   Loc: [Unknown file(0)]
Totals: 1 passed, 1 failed, 0 skipped
********* Finished testing of MyFirstClassTest *********</description>
		<content:encoded><![CDATA[<p>I&#8217;m using this util but I can&#8217;t create a widget and test it&#8230;someone know why??</p>
<p>this is my code:</p>
<p>class MyFirstClassTest : public QObject<br />
{<br />
     Q_OBJECT</p>
<p>	private slots:<br />
		void initTestCase() {<br />
		}</p>
<p>		void cleanupTestCase() {<br />
		}</p>
<p>		void testMyMethod() {<br />
			CustomSlider* slider;<br />
			slider = new CustomSlider(NULL);<br />
			slider-&gt;setSpacing(8);<br />
			QCOMPARE(slider-&gt;spacing(), 8);<br />
		}<br />
};</p>
<p>and this is the error:</p>
<p>********* Start testing of MyFirstClassTest *********<br />
Config: Using QTest library 4.5.2, Qt 4.5.2<br />
PASS   : MyFirstClassTest::initTestCase()<br />
QFATAL : MyFirstClassTest::testMyMethod() QWidget: Cannot create a QWidget when no GUI is being used<br />
FAIL!  : MyFirstClassTest::testMyMethod() Received a fatal error.<br />
   Loc: [Unknown file(0)]<br />
Totals: 1 passed, 1 failed, 0 skipped<br />
********* Finished testing of MyFirstClassTest *********</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhuvnesh</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-81783</link>
		<dc:creator>Bhuvnesh</dc:creator>
		<pubDate>Fri, 30 Oct 2009 09:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-81783</guid>
		<description>Owsome remko it is really very generic test tool, Keep writing beautiful utils.</description>
		<content:encoded><![CDATA[<p>Owsome remko it is really very generic test tool, Keep writing beautiful utils.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conrad Pöpke</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-81172</link>
		<dc:creator>Conrad Pöpke</dc:creator>
		<pubDate>Mon, 06 Jul 2009 17:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-81172</guid>
		<description>Awesome, I love it. Great that you have done this. Do you thought about a UI where you can decide which tests to run ?</description>
		<content:encoded><![CDATA[<p>Awesome, I love it. Great that you have done this. Do you thought about a UI where you can decide which tests to run ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remko Tronçon</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-80979</link>
		<dc:creator>Remko Tronçon</dc:creator>
		<pubDate>Thu, 23 Apr 2009 18:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-80979</guid>
		<description>@Pablo Yes. See the QtTestLib manual example: http://doc.trolltech.com/4.5/qtesteventlist.html#details</description>
		<content:encoded><![CDATA[<p>@Pablo Yes. See the QtTestLib manual example: <a href="http://doc.trolltech.com/4.5/qtesteventlist.html#details" rel="nofollow">http://doc.trolltech.com/4.5/qtesteventlist.html#details</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-80978</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Thu, 23 Apr 2009 18:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-80978</guid>
		<description>Is possible create a automated test using QtTest?
For example ....write in LineEdit , change icons. clickmouse.
Good example.
Thanks!!</description>
		<content:encoded><![CDATA[<p>Is possible create a automated test using QtTest?<br />
For example &#8230;.write in LineEdit , change icons. clickmouse.<br />
Good example.<br />
Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kunal</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-80867</link>
		<dc:creator>kunal</dc:creator>
		<pubDate>Fri, 02 Jan 2009 12:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-80867</guid>
		<description>i was looking for someting like this. this will be great help.</description>
		<content:encoded><![CDATA[<p>i was looking for someting like this. this will be great help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shanker</title>
		<link>http://el-tramo.be/blog/qttestutil/comment-page-1#comment-80847</link>
		<dc:creator>Shanker</dc:creator>
		<pubDate>Thu, 11 Dec 2008 22:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://el-tramo.be/?p=223#comment-80847</guid>
		<description>This is awesome!  I can&#039;t wait to get home and test this out -- thanks for saving me the time to do this myself.</description>
		<content:encoded><![CDATA[<p>This is awesome!  I can&#8217;t wait to get home and test this out &#8212; thanks for saving me the time to do this myself.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
