Skip to content

Commit d190fd5

Browse files
committed
Update live capture test with updated durations of input data, and streamline app startup when running app just for tests
1 parent 687c055 commit d190fd5

File tree

7 files changed

+674
-1133
lines changed

7 files changed

+674
-1133
lines changed

Loop/AppDelegate.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, WindowProvider {
2222

2323
setenv("CFNETWORK_DIAGNOSTICS", "3", 1)
2424

25-
loopAppManager.initialize(windowProvider: self, launchOptions: launchOptions)
26-
loopAppManager.launch()
25+
if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil {
26+
// Code only executes when not running tests
27+
loopAppManager.initialize(windowProvider: self, launchOptions: launchOptions)
28+
loopAppManager.launch()
29+
}
2730
return loopAppManager.isLaunchComplete
2831
}
2932

@@ -32,7 +35,10 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, WindowProvider {
3235
func applicationDidBecomeActive(_ application: UIApplication) {
3336
log.default(#function)
3437

35-
loopAppManager.didBecomeActive()
38+
if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil {
39+
// Code only executes when not running tests
40+
loopAppManager.didBecomeActive()
41+
}
3642
}
3743

3844
func applicationWillResignActive(_ application: UIApplication) {

Loop/Managers/LoopDataManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ final class LoopDataManager {
441441
if lastIntegralRetrospectiveCorrectionEnabled != currentIntegralRetrospectiveCorrectionEnabled || cachedRetrospectiveCorrection == nil {
442442
lastIntegralRetrospectiveCorrectionEnabled = currentIntegralRetrospectiveCorrectionEnabled
443443
if currentIntegralRetrospectiveCorrectionEnabled {
444-
cachedRetrospectiveCorrection = IntegralRetrospectiveCorrection(effectDuration: LoopSettings.retrospectiveCorrectionEffectDuration)
444+
cachedRetrospectiveCorrection = IntegralRetrospectiveCorrection(effectDuration: LoopMath.retrospectiveCorrectionEffectDuration)
445445
} else {
446-
cachedRetrospectiveCorrection = StandardRetrospectiveCorrection(effectDuration: LoopSettings.retrospectiveCorrectionEffectDuration)
446+
cachedRetrospectiveCorrection = StandardRetrospectiveCorrection(effectDuration: LoopMath.retrospectiveCorrectionEffectDuration)
447447
}
448448
}
449449

Loop/Models/LoopSettings+Loop.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@ extension LoopSettings {
1616
inputs.remove(.retrospection)
1717
}
1818
return inputs
19-
}
20-
21-
static let retrospectiveCorrectionEffectDuration = TimeInterval(hours: 1)
22-
19+
}
2320
}

0 commit comments

Comments
 (0)