Skip to content

Commit 5400f31

Browse files
author
Yasir Ali
committed
Merge branch 'master' into yasir/ondecision-activate-getvariation
2 parents 6589d6a + ca7b467 commit 5400f31

File tree

5 files changed

+33
-14
lines changed

5 files changed

+33
-14
lines changed

OptimizelySDK/Extensions/OptimizelyManager+Extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension OptimizelyManager {
2525
HandlerRegistryService.shared.registerBinding(binder:Binder<OPTNotificationCenter>(service: OPTNotificationCenter.self).singetlon().reInitializeStrategy(strategy: .reUse).using(instance:notificationCenter).sdkKey(key: sdkKey))
2626

2727
// the decision service is also a singleton that will reCreate on re-initalize
28-
HandlerRegistryService.shared.registerBinding(binder:Binder<OPTDecisionService>(service: OPTDecisionService.self).singetlon().using(instance:decisionService).sdkKey(key: sdkKey))
28+
HandlerRegistryService.shared.registerBinding(binder:Binder<OPTDecisionService>(service: OPTDecisionService.self).singetlon().using(instance:decisionService).reInitializeStrategy(strategy: .reUse).sdkKey(key: sdkKey))
2929

3030
// An event dispatcher. We rely on the factory to create and mantain. Again, recreate on re-initalize.
3131
HandlerRegistryService.shared.registerBinding(binder:Binder<OPTEventDispatcher>(service: OPTEventDispatcher.self).singetlon().reInitializeStrategy(strategy: .reUse).using(instance: eventDispatcher).sdkKey(key: sdkKey))

OptimizelySDK/OptimizelyTests/OptimizelyTests-Common/EventDispatcherTest.swift

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ class EventDispatcherTest: XCTestCase {
5555

5656
eventDispatcher?.dispatcher.sync {
5757
}
58-
59-
XCTAssert(eventDispatcher?.dataStore.count == 1)
60-
58+
59+
if #available(iOS 10.0, tvOS 10.0, *) {
60+
XCTAssert(eventDispatcher?.dataStore.count == 1)
61+
}
62+
else {
63+
XCTAssert(eventDispatcher?.dataStore.count == 0)
64+
}
6165
eventDispatcher?.flushEvents()
6266

6367
eventDispatcher?.dispatcher.sync {
@@ -86,8 +90,13 @@ class EventDispatcherTest: XCTestCase {
8690
}
8791
wait()
8892

89-
XCTAssert(eventDispatcher?.dataStore.count == 1)
90-
93+
if #available(iOS 10.0, tvOS 10.0, *) {
94+
XCTAssert(eventDispatcher?.dataStore.count == 1)
95+
}
96+
else {
97+
XCTAssert(eventDispatcher?.dataStore.count == 0)
98+
}
99+
91100
eventDispatcher?.flushEvents()
92101
wait()
93102

@@ -114,8 +123,13 @@ class EventDispatcherTest: XCTestCase {
114123
}
115124
wait()
116125

117-
XCTAssert(eventDispatcher?.dataStore.count == 1)
118-
126+
if #available(iOS 10.0, tvOS 10.0, *) {
127+
XCTAssert(eventDispatcher?.dataStore.count == 1)
128+
}
129+
else {
130+
XCTAssert(eventDispatcher?.dataStore.count == 0)
131+
}
132+
119133
eventDispatcher?.flushEvents()
120134
wait()
121135

@@ -141,8 +155,13 @@ class EventDispatcherTest: XCTestCase {
141155
}
142156
wait()
143157

144-
XCTAssert(eventDispatcher?.dataStore.count == 1)
145-
158+
if #available(iOS 10.0, tvOS 10.0, *) {
159+
XCTAssert(eventDispatcher?.dataStore.count == 1)
160+
}
161+
else {
162+
XCTAssert(eventDispatcher?.dataStore.count == 0)
163+
}
164+
146165
eventDispatcher?.flushEvents()
147166
wait()
148167

OptimizelySDK/OptimizelyTests/OptimizelyTests-DataModel/AttributeValueTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AttributeValueTests: XCTestCase {
7777
// Float80 is not supported JSON parser (it's not expected to see this from datafile, but it still
7878
// can be passed as attribute values from client app
7979
let testsAttributesOnly = [
80-
[Float80(value), Double(value)]
80+
[CLongDouble(value), Double(value)]
8181
]
8282

8383
for (idx, test) in testsAttributesOnly.enumerated() {

OptimizelySDK/OptimizelyTests/OptimizelyTests-DataModel/AttributeValueTests_Evaluate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ extension AttributeValueTests_Evaluate {
251251
}
252252

253253
func allNumTypes(value: Double) -> [Any] {
254-
return [Double(value), Float(value), Float32(value), Float64(value), Float80(value)]
254+
return [Double(value), Float(value), Float32(value), Float64(value), CLongDouble(value)]
255255
}
256256

257257
func allValueTypes(value: Double) -> [Any] {

OptimizelySDK/Utils/Utils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Utils {
3232
static func isDoubleType(_ value: Any) -> Bool {
3333
// Float32 === Float, Float64 ==== Double
3434
let allSwiftNumTypes: [Any.Type] = [Double.self,
35-
Float.self, Float80.self]
35+
Float.self, CLongDouble.self]
3636

3737
let isSwiftNumType = allSwiftNumTypes.contains{ $0 == type(of: value) }
3838
let isNSNumberNumType = (value is Double) && !isNSNumberBoolType(value)
@@ -78,7 +78,7 @@ class Utils {
7878
switch value {
7979
case is Double: finalValue = Double(value as! Double)
8080
case is Float: finalValue = Double(value as! Float)
81-
case is Float80: finalValue = Double(value as! Float80)
81+
case is CLongDouble: finalValue = Double(value as! CLongDouble)
8282
default: finalValue = nil
8383
}
8484

0 commit comments

Comments
 (0)