                 }
                 dispatch_semaphore_signal(semaphore)
                 while !stop {
-                    NSRunLoop.currentRunLoop().runMode(NSDefaultRunLoopMode, beforeDate: NSDate.distantFuture() as NSDate)
+                    NSRunLoop.currentRunLoop().runMode(NSDefaultRunLoopMode, beforeDate: NSDate.distantFuture() as! NSDate)
                 }
                 realm.removeNotification(token)
             }


    func testQueryConstruction() {
        let realm = realmWithTestPath()
        let predicate = NSPredicate(format: "boolCol = false and (intCol = 5 or floatCol = 1.0) and objectCol = nil and doubleCol != 7.0 and stringCol IN {'a', 'b', 'c'}")!

        measureBlock {
            for _ in 0..<100 {

                }
                dispatch_semaphore_signal(semaphore)
                while object.intCol < stopValue {
                    NSRunLoop.currentRunLoop().runMode(NSDefaultRunLoopMode, beforeDate: NSDate.distantFuture() as! NSDate)
                }
                realm.removeNotification(token)
            }
