lundi 28 mars 2016

Delegating contstructors in XCode test coverage

Currently I'm writing unit tests in XCode for a simple utility class which has these constructors:

Interval::Interval() : Interval(-1, -2) {
}

Interval::Interval(int a_, int b_) {
  a = a_;
  b = b_;
}

When I run tests for them I see that the second one is properly covered, but not the first one, even though my tests of course also use the default constructor. It seems that XCode has a problem with delegating constructors, because when I remove the call Interval(-1, -2) then I get full coverage. Is this an inherent limitation of XCode test coverage or is there a trick/hack to make delegating constructors still be covered?

Aucun commentaire:

Enregistrer un commentaire