Qt, unit testing and mock objects.
Posted
by Eye of Hell
on Stack Overflow
See other posts from Stack Overflow
or by Eye of Hell
Published on 2010-05-12T11:00:56Z
Indexed on
2010/05/12
11:24 UTC
Read the original article
Hit count: 575
Hello.
Qt framework has internal support for testing via QtTest package. Unfortunately, i didn't find any facilities in it that can assist in creating mock objects. Qt signals and slots offers a natural way to create a unit-testing friendly units with input (slots) and output (signals). But is it any easy way to test that calling specified slot in object will result in emitting correct signals with correct arguments? Of course i can manually create a mock objects and connect them to objects being tested, but it's a lot of code. Maybe it's some techniques exists that allows to somehow automate mock objects creation while unit-testing Qt-based applications?
© Stack Overflow or respective owner