0

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?

Puneet
  • 291
  • 1
  • 5
  • 15

2 Answers2

0

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

hmuelner
  • 8,093
  • 1
  • 28
  • 39
0

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?

Dan Milburn
  • 5,600
  • 1
  • 25
  • 18
  • I dont think it as different...but for other objects we could check for each and every value....but in this we cant check for each value....I have to do the same thing again for checking ...which will obviously give me the correct results – Puneet Aug 12 '11 at 15:29