开发者

Unit Testing with QVariant

I want to make a unit-test for a function returning a qvariant to make sure if the qvariant is holding 开发者_如何学运维the right vlaue or not Please give me some idea to how should i proceed?


Create a QVariant containing the value you're expecting and then compare it with the return value. Why do you think this is different to testing any other return type?


The methos QVariant::type() and QVariant::typename() should give you enough information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜