Skip to content

Commit

Permalink
chore: Fix tests for Xcode 16
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin committed Oct 14, 2024
1 parent 5a6e387 commit 6b86347
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Sources/Swift/Helper/SentryCurrentDateProvider.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
@_implementationOnly import _SentryPrivate
import Foundation

@objcMembers class SentryCurrentDateProvider: NSObject {
#if TEST
@objcMembers
public class SentryCurrentDateProvider: NSObject {
public func date() -> Date {
return Date()
}

public func timezoneOffset() -> Int {
return TimeZone.current.secondsFromGMT()
}

public func systemTime() -> UInt64 {
getAbsoluteTime()
}

public func systemUptime() -> TimeInterval {
ProcessInfo.processInfo.systemUptime
}
}
#else
@objcMembers
class SentryCurrentDateProvider: NSObject {

func date() -> Date {
return Date()
Expand All @@ -19,3 +40,4 @@ import Foundation
ProcessInfo.processInfo.systemUptime
}
}
#endif

0 comments on commit 6b86347

Please sign in to comment.