0

This is my class method:

class func sharedManager() -> DBSearchOptionsManager {

    struct Static {
        static var onceToken: dispatch_once_t = 0
        static var instance: DBSearchOptionsManager? = nil
    }

    dispatch_once(&Static.onceToken) {
        Static.instance = DBSearchOptionsManager()
    }

    return Static.instance!
}

And this is how it looks in code coverage:

enter image description here

Although that function was called 5 times, the dispatch_once seems to be not called at all, since it must have been called exactly once.

The question is:

What to do to make dispatch_once as covered?

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358

0 Answers0