Skip to content

Commit

Permalink
Merge 2ecb347 into b15627c
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin authored Oct 17, 2022
2 parents b15627c + 2ecb347 commit e71f14d
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 72 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- Sentry Swift framework (#2162)
- [Custom measurements API](https://docs.sentry.io/platforms/apple/performance/instrumentation/custom-instrumentation/) (#2268)

### Fixes
Expand Down
7 changes: 7 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ let package = Package(
.library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"])
],
targets: [
.target( name: "SentrySwift",
path: "Sources",
sources: [
"SentrySwift"
]
),
.target(
name: "Sentry",
dependencies: ["SentrySwift"],
path: "Sources",
sources: [
"Sentry/",
Expand Down
2 changes: 1 addition & 1 deletion Samples/Carthage-Validation/Framework/input.xcfilelist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$(SRCROOT)/Carthage/Build/iOS/Sentry.framework
$(SRCROOT)/Carthage/Build/iOS/Sentry.framework
2 changes: 1 addition & 1 deletion Samples/Carthage-Validation/Framework/output.xcfilelist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework
6 changes: 3 additions & 3 deletions Sentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.frameworks = 'Foundation'
s.libraries = 'z', 'c++'
s.static_framework = true
s.swift_versions = "5.0"
s.pod_target_xcconfig = {
'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
Expand All @@ -29,10 +31,8 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |sp|
sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}",
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}"

"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/SentrySwift/**/*.{swift}"
sp.public_header_files =
"Sources/Sentry/Public/*.h"

end
end
22 changes: 21 additions & 1 deletion Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@
A811D867248E2770008A41EA /* SentrySystemEventBreadcrumbsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A811D866248E2770008A41EA /* SentrySystemEventBreadcrumbsTest.swift */; };
A839D89824864B80003B7AFD /* SentrySystemEventBreadcrumbs.h in Headers */ = {isa = PBXBuildFile; fileRef = A839D89724864B80003B7AFD /* SentrySystemEventBreadcrumbs.h */; };
A839D89A24864BA8003B7AFD /* SentrySystemEventBreadcrumbs.m in Sources */ = {isa = PBXBuildFile; fileRef = A839D89924864BA8003B7AFD /* SentrySystemEventBreadcrumbs.m */; };
D800942728F82F3A005D3943 /* SwiftDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D800942628F82F3A005D3943 /* SwiftDescriptor.swift */; };
D8019910286B089000C277F0 /* SentryCrashReportSinkTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D801990F286B089000C277F0 /* SentryCrashReportSinkTest.swift */; };
D808FB88281AB33C009A2A33 /* SentryUIEventTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D808FB86281AB31D009A2A33 /* SentryUIEventTrackerTests.swift */; };
D808FB8B281BCE96009A2A33 /* TestSentrySwizzleWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D808FB89281BCE46009A2A33 /* TestSentrySwizzleWrapper.swift */; };
Expand Down Expand Up @@ -702,6 +703,7 @@
D8ACE3CF2762187D00F5A213 /* SentryFileIOTrackingIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = D8ACE3CC2762187D00F5A213 /* SentryFileIOTrackingIntegration.h */; };
D8B76B062808066D000A58C4 /* SentryScreenshotIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8B76B042808060E000A58C4 /* SentryScreenshotIntegrationTests.swift */; };
D8B76B0828081461000A58C4 /* TestSentryScreenShot.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8B76B0728081461000A58C4 /* TestSentryScreenShot.swift */; };
D8BBD32728FD9FC00011F850 /* SentrySwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D8BBD32628FD9FBF0011F850 /* SentrySwift.h */; };
D8C67E9B28000E24007E326E /* SentryUIApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9928000E23007E326E /* SentryUIApplication.h */; };
D8C67E9C28000E24007E326E /* SentryScreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9A28000E23007E326E /* SentryScreenshot.h */; };
D8CE69BC277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D8CE69BB277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m */; };
Expand Down Expand Up @@ -1436,6 +1438,7 @@
A811D866248E2770008A41EA /* SentrySystemEventBreadcrumbsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySystemEventBreadcrumbsTest.swift; sourceTree = "<group>"; };
A839D89724864B80003B7AFD /* SentrySystemEventBreadcrumbs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySystemEventBreadcrumbs.h; path = include/SentrySystemEventBreadcrumbs.h; sourceTree = "<group>"; };
A839D89924864BA8003B7AFD /* SentrySystemEventBreadcrumbs.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySystemEventBreadcrumbs.m; sourceTree = "<group>"; };
D800942628F82F3A005D3943 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
D801990F286B089000C277F0 /* SentryCrashReportSinkTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashReportSinkTest.swift; sourceTree = "<group>"; };
D808FB86281AB31D009A2A33 /* SentryUIEventTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIEventTrackerTests.swift; sourceTree = "<group>"; };
D808FB89281BCE46009A2A33 /* TestSentrySwizzleWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentrySwizzleWrapper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1482,6 +1485,7 @@
D8ACE3CC2762187D00F5A213 /* SentryFileIOTrackingIntegration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryFileIOTrackingIntegration.h; path = include/SentryFileIOTrackingIntegration.h; sourceTree = "<group>"; };
D8B76B042808060E000A58C4 /* SentryScreenshotIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenshotIntegrationTests.swift; sourceTree = "<group>"; };
D8B76B0728081461000A58C4 /* TestSentryScreenShot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryScreenShot.swift; sourceTree = "<group>"; };
D8BBD32628FD9FBF0011F850 /* SentrySwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySwift.h; path = include/SentrySwift.h; sourceTree = "<group>"; };
D8C67E9928000E23007E326E /* SentryUIApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryUIApplication.h; path = include/SentryUIApplication.h; sourceTree = "<group>"; };
D8C67E9A28000E23007E326E /* SentryScreenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryScreenshot.h; path = include/SentryScreenshot.h; sourceTree = "<group>"; };
D8CE69BB277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryFileIOTrackingIntegrationObjCTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1844,6 +1848,7 @@
63AA756E1EB8AEDB00D153DE /* Sources */ = {
isa = PBXGroup;
children = (
D800942328F82E8D005D3943 /* SentrySwift */,
63AA75A31EB8AFDF00D153DE /* Configuration */,
63FE6FB920DA4C1000CDBAE8 /* SentryCrash */,
63AA75C61EB8B06100D153DE /* Sentry */,
Expand Down Expand Up @@ -1937,6 +1942,7 @@
8ECC673625C23936000E2BF6 /* Transaction */,
8E25C94F25F836AB00DC215B /* Tools */,
63AA76931EB9C1C200D153DE /* Sentry.h */,
D8BBD32628FD9FBF0011F850 /* SentrySwift.h */,
7B6D125E265F778500C9BE4B /* PrivateSentrySDKOnly.h */,
7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.m */,
63AA76941EB9C1C200D153DE /* SentryClient.h */,
Expand Down Expand Up @@ -2801,6 +2807,14 @@
name = Transaction;
sourceTree = "<group>";
};
D800942328F82E8D005D3943 /* SentrySwift */ = {
isa = PBXGroup;
children = (
D800942628F82F3A005D3943 /* SwiftDescriptor.swift */,
);
path = SentrySwift;
sourceTree = "<group>";
};
D808FB85281AB2EF009A2A33 /* UIEvents */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2897,6 +2911,7 @@
0ADC33EE28D9BB890078D980 /* SentryUIDeviceWrapper.h in Headers */,
8E133FA625E72EB400ABD0BF /* SentrySamplingContext.h in Headers */,
0A9BF4E428A114B50068D266 /* SentryViewHierarchyIntegration.h in Headers */,
D8BBD32728FD9FC00011F850 /* SentrySwift.h in Headers */,
8E4E7C7425DAAB49006AB9E2 /* SentrySpanProtocol.h in Headers */,
8EC4CF4A25C38DAA0093DEE9 /* SentrySpanStatus.h in Headers */,
8ECC673D25C23996000E2BF6 /* SentrySpanId.h in Headers */,
Expand Down Expand Up @@ -3163,9 +3178,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 63AA75A01EB8AEF500D153DE /* Build configuration list for PBXNativeTarget "Sentry" */;
buildPhases = (
63AA75981EB8AEF500D153DE /* Headers */,
63AA75961EB8AEF500D153DE /* Sources */,
63AA75971EB8AEF500D153DE /* Frameworks */,
63AA75981EB8AEF500D153DE /* Headers */,
63AA75991EB8AEF500D153DE /* Resources */,
);
buildRules = (
Expand Down Expand Up @@ -3470,6 +3485,7 @@
632F43521F581D5400A18A36 /* SentryCrashExceptionApplication.m in Sources */,
0AABE2ED2885924A0057ED69 /* SentryPermissionsObserver.m in Sources */,
7B77BE3727EC8460003C9020 /* SentryDiscardReasonMapper.m in Sources */,
D800942728F82F3A005D3943 /* SwiftDescriptor.swift in Sources */,
63FE712520DA4C1000CDBAE8 /* SentryCrashSignalInfo.c in Sources */,
63FE70F320DA4C1000CDBAE8 /* SentryCrashMonitor_Signal.c in Sources */,
D859696F27BECDA20036A46E /* SentryCoreDataTracker.m in Sources */,
Expand Down Expand Up @@ -3926,6 +3942,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -3954,6 +3971,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -4093,6 +4111,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -4226,6 +4245,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/Public/SentryStacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ NS_ASSUME_NONNULL_BEGIN

@class SentryFrame;

NS_SWIFT_NAME(Stacktrace)
@interface SentryStacktrace : NSObject <SentrySerializable>
SENTRY_NO_INIT

Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/Public/SentryThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ NS_ASSUME_NONNULL_BEGIN

@class SentryStacktrace;

NS_SWIFT_NAME(Thread)
@interface SentryThread : NSObject <SentrySerializable>
SENTRY_NO_INIT

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryBreadcrumbTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller
{
NSMutableDictionary *info = @{}.mutableCopy;

info[@"screen"] = [SentryUIViewControllerSanitizer
sanitizeViewControllerName:[NSString stringWithFormat:@"%@", controller]];
info[@"screen"] = [SentryUIViewControllerSanitizer sanitizeViewControllerName:controller];

if ([controller.navigationItem.title length] != 0) {
info[@"title"] = controller.navigationItem.title;
Expand Down
27 changes: 2 additions & 25 deletions Sources/Sentry/SentryUIViewControllerSanitizer.m
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
#import "SentryUIViewControllerSanitizer.h"
#import "SentrySwift.h"

@implementation SentryUIViewControllerSanitizer

+ (NSRegularExpression *)viewControllerRegex
{
static dispatch_once_t onceTokenRegex;
static NSRegularExpression *regex = nil;
dispatch_once(&onceTokenRegex, ^{
NSString *pattern = @"[<.](\\w+)";
regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
});
return regex;
}

+ (NSString *)sanitizeViewControllerName:(id)controller
{
NSString *description = [NSString stringWithFormat:@"%@", controller];

NSRange searchedRange = NSMakeRange(0, [description length]);
NSArray *matches = [[self.class viewControllerRegex] matchesInString:description
options:0
range:searchedRange];
NSMutableArray *strings = [NSMutableArray array];
for (NSTextCheckingResult *match in matches) {
[strings addObject:[description substringWithRange:[match rangeAtIndex:1]]];
}
if ([strings count] > 0) {
return [strings componentsJoinedByString:@"."];
}
return description;
return [SwiftDescriptor getDescription:controller];
}

@end
13 changes: 13 additions & 0 deletions Sources/Sentry/include/SentrySwift.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef SentrySwift_h
#define SentrySwift_h

#if SWIFT_PACKAGE
@import SentrySwift;
#else
# if __has_include(<Sentry/Sentry-Swift.h>)
# import <Sentry/Sentry-Swift.h>
# else
# import "Sentry-Swift.h"
# endif
#endif
#endif
11 changes: 11 additions & 0 deletions Sources/SentrySwift/SwiftDescriptor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Foundation

@objc
public class SwiftDescriptor: NSObject {

@objc
public static func getDescription(_ object: AnyObject) -> String {
return String(describing: type(of: object))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase {
let frame1 = Sentry.Frame()
frame1.function = "Second_frame_function"

let thread1 = Sentry.Thread(threadId: 0)
thread1.stacktrace = Stacktrace(frames: [frame1], registers: [:])
let thread1 = SentryThread(threadId: 0)
thread1.stacktrace = SentryStacktrace(frames: [frame1], registers: [:])
thread1.current = true

let frame2 = Sentry.Frame()
frame2.function = "main"

let thread2 = Sentry.Thread(threadId: 1)
thread2.stacktrace = Stacktrace(frames: [frame2], registers: [:])
let thread2 = SentryThread(threadId: 1)
thread2.stacktrace = SentryStacktrace(frames: [frame2], registers: [:])
thread2.current = false

threadInspector.allThreads = [
Expand Down
8 changes: 4 additions & 4 deletions Tests/SentryTests/Protocol/SentryThreadEquality.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation

extension Sentry.Thread {
extension SentryThread {
open override func isEqual(_ object: Any?) -> Bool {
if let other = object as? Sentry.Thread {
if let other = object as? SentryThread {
return threadId == other.threadId &&
name == other.name &&
stacktrace == other.stacktrace &&
Expand All @@ -17,9 +17,9 @@ extension Sentry.Thread {
}
}

extension Sentry.Stacktrace {
extension SentryStacktrace {
open override func isEqual(_ object: Any?) -> Bool {
if let other = object as? Sentry.Stacktrace {
if let other = object as? SentryStacktrace {
return frames == other.frames &&
registers == other.registers
} else {
Expand Down
8 changes: 4 additions & 4 deletions Tests/SentryTests/Protocol/TestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class TestData {
return mechanismMeta
}

static var thread: Sentry.Thread {
let thread = Sentry.Thread(threadId: 10)
static var thread: SentryThread {
let thread = SentryThread(threadId: 10)
thread.crashed = false
thread.current = true
thread.name = "main"
Expand All @@ -129,8 +129,8 @@ class TestData {
return thread
}

static var stacktrace: Stacktrace {
let stacktrace = Stacktrace(frames: [frame], registers: ["register": "one"])
static var stacktrace: SentryStacktrace {
let stacktrace = SentryStacktrace(frames: [frame], registers: ["register": "one"])
return stacktrace
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/SentryTests/SentryClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ class SentryClientTest: XCTestCase {

private func givenEventWithThreads() -> Event {
let event = Event(level: SentryLevel.fatal)
let thread = Sentry.Thread(threadId: 1)
let thread = SentryThread(threadId: 1)
thread.crashed = true
let threads = [thread]
event.threads = threads
Expand Down Expand Up @@ -1344,13 +1344,13 @@ class SentryClientTest: XCTestCase {
}
}

private func assertValidDebugMeta(actual: [DebugMeta]?, forThreads threads: [Sentry.Thread]?) {
private func assertValidDebugMeta(actual: [DebugMeta]?, forThreads threads: [SentryThread]?) {
let debugMetas = fixture.debugImageBuilder.getDebugImages(for: threads ?? [])

XCTAssertEqual(debugMetas, actual ?? [])
}

private func assertValidThreads(actual: [Sentry.Thread]?) {
private func assertValidThreads(actual: [SentryThread]?) {
let expected = fixture.threadInspector.getCurrentThreads()
XCTAssertEqual(expected.count, actual?.count)
XCTAssertEqual(expected, actual)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ class SentryDebugImageProviderTests: XCTestCase {
func testImagesForThreads() {
let sut = fixture.getSut(images: fixture.getTestImages())

let thread = Sentry.Thread(threadId: NSNumber(value: 1))
let thread = SentryThread(threadId: NSNumber(value: 1))
let frame = Sentry.Frame()
frame.imageAddress = "0x0000000105705000"
thread.stacktrace = Stacktrace(frames: [frame], registers: [:])
thread.stacktrace = SentryStacktrace(frames: [frame], registers: [:])

var actual = sut.getDebugImages(for: [thread])

Expand All @@ -137,7 +137,7 @@ class SentryDebugImageProviderTests: XCTestCase {
frame2.imageAddress = "0x00000001410b1a00"
let frame3 = Sentry.Frame()
frame3.imageAddress = "0x000000017ca5e400"
thread.stacktrace = Stacktrace(frames: [frame2, frame3], registers: [:])
thread.stacktrace = SentryStacktrace(frames: [frame2, frame3], registers: [:])

actual = sut.getDebugImages(for: [thread])

Expand All @@ -151,7 +151,7 @@ class SentryDebugImageProviderTests: XCTestCase {

func test_NoImage_ForThread_WithoutStackTrace() {
let sut = fixture.getSut(images: fixture.getTestImages())
let thread = Sentry.Thread(threadId: NSNumber(value: 1))
let thread = SentryThread(threadId: NSNumber(value: 1))
let actual = sut.getDebugImages(for: [thread])

XCTAssertEqual(actual.count, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ import XCTest

private class TestSentryStacktraceBuilder: SentryStacktraceBuilder {

var stackTraces = [SentryCrashThread: Stacktrace]()
override func buildStacktrace(forThread thread: SentryCrashThread, context: OpaquePointer) -> Stacktrace {
return stackTraces[thread] ?? Stacktrace(frames: [], registers: [:])
var stackTraces = [SentryCrashThread: SentryStacktrace]()
override func buildStacktrace(forThread thread: SentryCrashThread, context: OpaquePointer) -> SentryStacktrace {
return stackTraces[thread] ?? SentryStacktrace(frames: [], registers: [:])
}

}
Expand Down
Loading

0 comments on commit e71f14d

Please sign in to comment.