Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, July 2007
infor required about Unit test frame in QT


Message 1 in thread

HI,

 

I have to do unit testing for QT applications. In the Qtest lib manual
currently given examples are for standard classes such as QString,
QLineEdit. But I need to be able to do the same for customized
user-defined classes.

Is it possible to test more than one class in a single test class.

Does QT support any kind of stubs for dependent classes.

 

Regards

Naveen




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Message 2 in thread

On Wednesday 04 July 2007 15:43, naveen.kmrvm@xxxxxxxxx wrote:
> I have to do unit testing for QT applications. In the Qtest lib manual
> currently given examples are for standard classes such as QString,
> QLineEdit. But I need to be able to do the same for customized
> user-defined classes.
This should be no different. Conceptually, all QTestLib does is provide a 
special way of running methods, and a few macros that do comparisons.

The only thing you may need to do is add QMetaType support. 

There is some more information on the KDE Techbase site:
http://techbase.kde.org/Development/Tutorials/Unittests

> Is it possible to test more than one class in a single test class.
It is possible, but is probably not a good way to structure your tests. The 
reason is that if your test fails, you may have trouble isolating where the 
problem is.

> Does QT support any kind of stubs for dependent classes.
I'm not aware of any, and it is sometimes hard to add dummy or mock versions 
of some classes because of the way some Qt classes are structured.

If you are having problems, it might help to post a small, compileable example 
to the list.

Brad

Attachment:

Attachment: pgpoqbEZJcIGo.pgp
Description: PGP signature