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.
精彩评论