@@ -26,7 +26,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
2626 let breadcrumbProcessor : SentryWatchdogTerminationBreadcrumbProcessor
2727 let contextProcessor : SentryWatchdogTerminationContextProcessor
2828
29- init ( ) {
29+ init ( ) throws {
3030 SentryDependencyContainer . sharedInstance ( ) . sysctlWrapper = sysctl
3131 options = Options ( )
3232 options. maxBreadcrumbs = 2
@@ -37,7 +37,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
3737
3838 breadcrumbProcessor = SentryWatchdogTerminationBreadcrumbProcessor ( maxBreadcrumbs: Int ( options. maxBreadcrumbs) , fileManager: fileManager)
3939 let backgroundQueueWrapper = TestSentryDispatchQueueWrapper ( )
40- let scopeContextStore = SentryScopeContextPersistentStore ( fileManager: fileManager)
40+ let scopeContextStore = try XCTUnwrap ( SentryScopeContextPersistentStore ( fileManager: fileManager) )
4141 contextProcessor = SentryWatchdogTerminationContextProcessor (
4242 withDispatchQueueWrapper: backgroundQueueWrapper,
4343 scopeContextStore: scopeContextStore
@@ -51,11 +51,11 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
5151 SentrySDK . setCurrentHub ( hub)
5252 }
5353
54- func getSut( ) -> SentryWatchdogTerminationTracker {
55- return getSut ( fileManager: fileManager )
54+ func getSut( ) throws -> SentryWatchdogTerminationTracker {
55+ return try getSut ( fileManager: fileManager )
5656 }
5757
58- func getSut( fileManager: SentryFileManager ) -> SentryWatchdogTerminationTracker {
58+ func getSut( fileManager: SentryFileManager ) throws -> SentryWatchdogTerminationTracker {
5959 let appStateManager = SentryAppStateManager (
6060 options: options,
6161 crashWrapper: crashWrapper,
@@ -68,9 +68,9 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
6868 crashAdapter: crashWrapper,
6969 appStateManager: appStateManager
7070 )
71- let scopePersistentStore = SentryScopeContextPersistentStore (
71+ let scopePersistentStore = try XCTUnwrap ( SentryScopeContextPersistentStore (
7272 fileManager: fileManager
73- )
73+ ) )
7474 return SentryWatchdogTerminationTracker (
7575 options: options,
7676 watchdogTerminationLogic: logic,
@@ -85,11 +85,11 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
8585 private var fixture : Fixture !
8686 private var sut : SentryWatchdogTerminationTracker !
8787
88- override func setUp ( ) {
89- super. setUp ( )
88+ override func setUpWithError ( ) throws {
89+ try super. setUpWithError ( )
9090
91- fixture = Fixture ( )
92- sut = fixture. getSut ( )
91+ fixture = try Fixture ( )
92+ sut = try fixture. getSut ( )
9393 SentrySDK . startInvocations = 1
9494 }
9595
@@ -101,8 +101,8 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
101101 clearTestState ( )
102102 }
103103
104- func testStart_StoresAppState( ) {
105- sut = fixture. getSut ( )
104+ func testStart_StoresAppState( ) throws {
105+ sut = try fixture. getSut ( )
106106
107107 XCTAssertNil ( fixture. fileManager. readAppState ( ) )
108108
@@ -116,8 +116,8 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
116116 XCTAssertEqual ( 1 , fixture. dispatchQueue. dispatchAsyncCalled)
117117 }
118118
119- func testGoToForeground_SetsIsActive( ) {
120- sut = fixture. getSut ( )
119+ func testGoToForeground_SetsIsActive( ) throws {
120+ sut = try fixture. getSut ( )
121121
122122 sut. start ( )
123123
@@ -248,8 +248,8 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
248248 assertNoOOMSent ( )
249249 }
250250
251- func testDifferentBootTime_NoOOM( ) {
252- sut = fixture. getSut ( )
251+ func testDifferentBootTime_NoOOM( ) throws {
252+ sut = try fixture. getSut ( )
253253 sut. start ( )
254254 let appState = SentryAppState ( releaseName: fixture. options. releaseName ?? " " , osVersion: UIDevice . current. systemVersion, vendorId: TestData . someUUID, isDebugging: false , systemBootTimestamp: fixture. sysctl. systemBootTimestamp. addingTimeInterval ( 1 ) )
255255
@@ -260,7 +260,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
260260 }
261261
262262 func testAppWasInForeground_OOM( ) throws {
263- sut = fixture. getSut ( )
263+ sut = try fixture. getSut ( )
264264
265265 sut. start ( )
266266 goToForeground ( )
@@ -283,7 +283,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
283283 }
284284
285285 func testAppOOM_WithBreadcrumbs( ) throws {
286- sut = fixture. getSut ( )
286+ sut = try fixture. getSut ( )
287287
288288 let breadcrumb = TestData . crumb
289289 let sentryWatchdogTerminationScopeObserver = SentryWatchdogTerminationScopeObserver (
@@ -308,7 +308,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
308308 }
309309
310310 func testAppOOM_WithOnlyHybridSdkDidBecomeActive( ) throws {
311- sut = fixture. getSut ( )
311+ sut = try fixture. getSut ( )
312312
313313 sut. start ( )
314314 hybridSdkDidBecomeActive ( )
@@ -319,7 +319,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
319319 }
320320
321321 func testAppOOM_Foreground_And_HybridSdkDidBecomeActive( ) throws {
322- sut = fixture. getSut ( )
322+ sut = try fixture. getSut ( )
323323
324324 sut. start ( )
325325 goToForeground ( )
@@ -331,7 +331,7 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
331331 }
332332
333333 func testAppOOM_HybridSdkDidBecomeActive_and_Foreground( ) throws {
334- sut = fixture. getSut ( )
334+ sut = try fixture. getSut ( )
335335
336336 sut. start ( )
337337 hybridSdkDidBecomeActive ( )
@@ -361,9 +361,9 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase {
361361 assertNoOOMSent ( )
362362 }
363363
364- func testStop_StopsObserving_NoMoreFileManagerInvocations( ) {
364+ func testStop_StopsObserving_NoMoreFileManagerInvocations( ) throws {
365365 let fileManager = try ! TestFileManager ( options: Options ( ) )
366- sut = fixture. getSut ( fileManager: fileManager)
366+ sut = try fixture. getSut ( fileManager: fileManager)
367367
368368 sut. start ( )
369369 sut. stop ( )
0 commit comments