Automated test question

Harald Sitter apachelogger at ubuntu.com
Sun Feb 16 11:30:47 UTC 2014


On Sun, Feb 16, 2014 at 3:25 AM, Michael Stemle <themanchicken at gmail.com> wrote:
> So, I'm still getting used to the dpointer paradigm. Is anybody familiar
> with how to use QTest to simulate code paths dependent on values in the
> dpointer which have no exposed mutators?

To be honest, you might get more useful answers from the kde-devel or
a qt mailing list.

Since you don't want a mock library, you can either mock the object
yourself manually (i.e. write a dummy version) or you do the
following:

- move TransactionPrivate to Transaction_p.h (i.e. own header)
- in your test include that header and you should be able to cast
Transaction::dptr approriately so you now have acces so the private
class of Transaction

depending on the specifics this may be a bit of cheating, but it
should be the easiest way to set stuff for which there are no setters.

HS



More information about the kubuntu-devel mailing list