diff --git a/CHANGELOG.md b/CHANGELOG.md index f63f5d9e1cf..34162776c4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 7.26.0 ### Features @@ -15,6 +15,7 @@ - Sentry-trace header incorrectly assigned to http requests (#2167) - Use the `component` name source for SentryPerformanceTracker (#2168) - Add support for arm64 architecture to the device context (#2185) +- Align core data span operations (#2222) ## 7.25.1 diff --git a/Gemfile.lock b/Gemfile.lock index 1f6e5efa3da..3672cac1952 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,8 +17,8 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.631.0) - aws-sdk-core (3.148.0) + aws-partitions (1.636.0) + aws-sdk-core (3.154.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -86,7 +86,7 @@ GEM escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) - excon (0.92.4) + excon (0.92.5) faraday (1.10.2) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -116,7 +116,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.210.0) + fastlane (2.210.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -161,9 +161,9 @@ GEM fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.26.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-core (0.7.2) + google-apis-androidpublisher_v3 (0.28.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-core (0.9.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -172,10 +172,10 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.13.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-playcustomapp_v1 (0.10.0) - google-apis-core (>= 0.7, < 2.a) + google-apis-iamcredentials_v1 (0.15.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-playcustomapp_v1 (0.11.0) + google-apis-core (>= 0.9.0, < 2.a) google-apis-storage_v1 (0.17.0) google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) @@ -184,7 +184,7 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.0) - google-cloud-storage (1.40.0) + google-cloud-storage (1.42.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj index 8347424e8e8..88b2f5c7c53 100644 --- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj @@ -1082,7 +1082,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.25.1; + MARKETING_VERSION = 7.26.0; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift"; @@ -1111,7 +1111,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.25.1; + MARKETING_VERSION = 7.26.0; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift"; @@ -1310,7 +1310,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.25.1; + MARKETING_VERSION = 7.26.0; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip"; @@ -1345,7 +1345,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.25.1; + MARKETING_VERSION = 7.26.0; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift.Clip"; diff --git a/Sentry.podspec b/Sentry.podspec index 9df635a26f9..afaffdac64f 100644 --- a/Sentry.podspec +++ b/Sentry.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Sentry" - s.version = "7.25.1" + s.version = "7.26.0" s.summary = "Sentry client for cocoa" s.homepage = "https://github.com/getsentry/sentry-cocoa" s.license = "mit" diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index c8d5ada9c11..adbf6c0014e 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -55,6 +55,7 @@ 0A9BF4E428A114B50068D266 /* SentryViewHierarchyIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A9BF4E328A114B50068D266 /* SentryViewHierarchyIntegration.h */; }; 0A9BF4E928A125390068D266 /* TestSentryViewHierarchy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4E628A123270068D266 /* TestSentryViewHierarchy.swift */; }; 0A9BF4EB28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */; }; + 0A9E917128DC7E7000FB4182 /* SentryInternalDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A9E917028DC7E7000FB4182 /* SentryInternalDefines.h */; }; 0AABE2ED2885924A0057ED69 /* SentryPermissionsObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AABE2EC2885924A0057ED69 /* SentryPermissionsObserver.m */; }; 0ACBA10128A6406400D711F7 /* UIView+Sentry.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ACBA10028A6406400D711F7 /* UIView+Sentry.m */; }; 0ACBA10328A6407200D711F7 /* UIView+Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ACBA10228A6407200D711F7 /* UIView+Sentry.h */; }; @@ -758,6 +759,7 @@ 0A9BF4E628A123270068D266 /* TestSentryViewHierarchy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryViewHierarchy.swift; sourceTree = ""; }; 0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyIntegrationTests.swift; sourceTree = ""; }; 0AA0F74328E2FCD900AB840C /* SentryNetworkTracker+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryNetworkTracker+Private.h"; sourceTree = ""; }; + 0A9E917028DC7E7000FB4182 /* SentryInternalDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalDefines.h; path = include/SentryInternalDefines.h; sourceTree = ""; }; 0AABE2EC2885924A0057ED69 /* SentryPermissionsObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryPermissionsObserver.m; sourceTree = ""; }; 0AABE2EE288592750057ED69 /* SentryPermissionsObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryPermissionsObserver.h; path = include/SentryPermissionsObserver.h; sourceTree = ""; }; 0AABE2EF2885C2120057ED69 /* TestSentryPermissionsObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryPermissionsObserver.swift; sourceTree = ""; }; @@ -1809,6 +1811,7 @@ 7B2A70DC27D6083D008B0D15 /* SentryThreadWrapper.m */, 7B18DE3F28D9F748004845C6 /* SentryNSNotificationCenterWrapper.h */, 7B18DE4128D9F794004845C6 /* SentryNSNotificationCenterWrapper.m */, + 0A9E917028DC7E7000FB4182 /* SentryInternalDefines.h */, ); name = Helper; sourceTree = ""; @@ -2959,6 +2962,7 @@ D8479328278873A100BE8E99 /* SentryByteCountFormatter.h in Headers */, 63AA76981EB9C1C200D153DE /* SentryClient.h in Headers */, 63AA76971EB9C1C200D153DE /* Sentry.h in Headers */, + 0A9E917128DC7E7000FB4182 /* SentryInternalDefines.h in Headers */, 63FE711F20DA4C1000CDBAE8 /* SentryCrashObjC.h in Headers */, 7BC3936825B1AB3E004F03D3 /* SentryLevelMapper.h in Headers */, 8E4E7C6E25DAAAFE006AB9E2 /* SentrySpan.h in Headers */, diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index ae2619e2c93..ea5e714ee39 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -29,7 +29,7 @@ MACH_O_TYPE = mh_dylib FRAMEWORK_VERSION = A PRODUCT_NAME = Sentry -CURRENT_PROJECT_VERSION = 7.25.1 +CURRENT_PROJECT_VERSION = 7.26.0 INFOPLIST_FILE = Sources/Sentry/Info.plist PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry ALWAYS_SEARCH_USER_PATHS = NO diff --git a/Sources/Sentry/SentryClient.m b/Sources/Sentry/SentryClient.m index 7daef95bb01..55b04360815 100644 --- a/Sources/Sentry/SentryClient.m +++ b/Sources/Sentry/SentryClient.m @@ -768,35 +768,35 @@ - (void)applyCultureContextToEvent:(SentryEvent *)event - (void)applyExtraDeviceContextToEvent:(SentryEvent *)event { - [self modifyContext:event - key:@"device" - block:^(NSMutableDictionary *device) { - device[SentryDeviceContextFreeMemoryKey] = @(self.crashWrapper.freeMemory); - device[@"free_storage"] = @(self.crashWrapper.freeStorage); + [self + modifyContext:event + key:@"device" + block:^(NSMutableDictionary *device) { + device[SentryDeviceContextFreeMemoryKey] = @(self.crashWrapper.freeMemorySize); + device[@"free_storage"] = @(self.crashWrapper.freeStorageSize); #if TARGET_OS_IOS - if (self.deviceWrapper.orientation != UIDeviceOrientationUnknown) { - device[@"orientation"] - = UIDeviceOrientationIsPortrait(self.deviceWrapper.orientation) - ? @"portrait" - : @"landscape"; - } - - if (self.deviceWrapper.isBatteryMonitoringEnabled) { - device[@"charging"] - = self.deviceWrapper.batteryState == UIDeviceBatteryStateCharging - ? @(YES) - : @(NO); - device[@"battery_level"] = - @((int)(self.deviceWrapper.batteryLevel * 100)); - } + if (self.deviceWrapper.orientation != UIDeviceOrientationUnknown) { + device[@"orientation"] + = UIDeviceOrientationIsPortrait(self.deviceWrapper.orientation) + ? @"portrait" + : @"landscape"; + } + + if (self.deviceWrapper.isBatteryMonitoringEnabled) { + device[@"charging"] + = self.deviceWrapper.batteryState == UIDeviceBatteryStateCharging + ? @(YES) + : @(NO); + device[@"battery_level"] = @((int)(self.deviceWrapper.batteryLevel * 100)); + } #endif - }]; + }]; [self modifyContext:event key:@"app" block:^(NSMutableDictionary *app) { - app[SentryDeviceContextAppMemoryKey] = @(self.crashWrapper.appMemory); + app[SentryDeviceContextAppMemoryKey] = @(self.crashWrapper.appMemorySize); }]; } diff --git a/Sources/Sentry/SentryCrashIntegration.m b/Sources/Sentry/SentryCrashIntegration.m index 0c53d0ed554..7bcd76b394b 100644 --- a/Sources/Sentry/SentryCrashIntegration.m +++ b/Sources/Sentry/SentryCrashIntegration.m @@ -249,8 +249,8 @@ + (void)enrichScope:(SentryScope *)scope crashWrapper:(SentryCrashWrapper *)cras [deviceData setValue:systemInfo[@"cpuArchitecture"] forKey:@"arch"]; [deviceData setValue:systemInfo[@"machine"] forKey:@"model"]; [deviceData setValue:systemInfo[@"model"] forKey:@"model_id"]; - [deviceData setValue:systemInfo[@"freeMemory"] forKey:SentryDeviceContextFreeMemoryKey]; - [deviceData setValue:systemInfo[@"usableMemory"] forKey:@"usable_memory"]; + [deviceData setValue:systemInfo[@"freeMemorySize"] forKey:SentryDeviceContextFreeMemoryKey]; + [deviceData setValue:systemInfo[@"usableMemorySize"] forKey:@"usable_memory"]; [deviceData setValue:systemInfo[@"memorySize"] forKey:@"memory_size"]; [deviceData setValue:systemInfo[@"totalStorageSize"] forKey:@"storage_size"]; [deviceData setValue:systemInfo[@"freeStorageSize"] forKey:@"free_storage"]; diff --git a/Sources/Sentry/SentryCrashWrapper.m b/Sources/Sentry/SentryCrashWrapper.m index bc3643dffd5..db599881906 100644 --- a/Sources/Sentry/SentryCrashWrapper.m +++ b/Sources/Sentry/SentryCrashWrapper.m @@ -71,17 +71,17 @@ - (NSDictionary *)systemInfo return sharedInfo; } -- (uint64_t)freeMemory +- (bytes)freeMemorySize { - return sentrycrashcm_system_freememory(); + return sentrycrashcm_system_freememory_size(); } -- (uint64_t)freeStorage +- (bytes)freeStorageSize { - return sentrycrashcm_system_freestorage(); + return sentrycrashcm_system_freestorage_size(); } -- (uint64_t)appMemory +- (bytes)appMemorySize { task_vm_info_data_t info; mach_msg_type_number_t size = TASK_VM_INFO_COUNT; diff --git a/Sources/Sentry/SentryMeta.m b/Sources/Sentry/SentryMeta.m index 9ef89d66c40..158c357937b 100644 --- a/Sources/Sentry/SentryMeta.m +++ b/Sources/Sentry/SentryMeta.m @@ -5,7 +5,7 @@ @implementation SentryMeta // Don't remove the static keyword. If you do the compiler adds the constant name to the global // symbol table and it might clash with other constants. When keeping the static keyword the // compiler replaces all occurrences with the value. -static NSString *versionString = @"7.25.1"; +static NSString *versionString = @"7.26.0"; static NSString *sdkName = @"sentry.cocoa"; + (NSString *)versionString diff --git a/Sources/Sentry/include/SentryCoreDataTracker.h b/Sources/Sentry/include/SentryCoreDataTracker.h index 463eb4722bd..a6967e1ae96 100644 --- a/Sources/Sentry/include/SentryCoreDataTracker.h +++ b/Sources/Sentry/include/SentryCoreDataTracker.h @@ -4,9 +4,8 @@ NS_ASSUME_NONNULL_BEGIN -static NSString *const SENTRY_COREDATA_FETCH_OPERATION = @"db.query"; - -static NSString *const SENTRY_COREDATA_SAVE_OPERATION = @"db.transaction"; +static NSString *const SENTRY_COREDATA_FETCH_OPERATION = @"db.sql.query"; +static NSString *const SENTRY_COREDATA_SAVE_OPERATION = @"db.sql.transaction"; @interface SentryCoreDataTracker : NSObject diff --git a/Sources/Sentry/include/SentryCrashWrapper.h b/Sources/Sentry/include/SentryCrashWrapper.h index 3e15fc9dba5..e069ad73c65 100644 --- a/Sources/Sentry/include/SentryCrashWrapper.h +++ b/Sources/Sentry/include/SentryCrashWrapper.h @@ -1,4 +1,5 @@ #import "SentryDefines.h" +#import "SentryInternalDefines.h" #import NS_ASSUME_NONNULL_BEGIN @@ -30,11 +31,11 @@ SENTRY_NO_INIT - (NSDictionary *)systemInfo; -- (uint64_t)freeMemory; +- (bytes)freeMemorySize; -- (uint64_t)appMemory; +- (bytes)appMemorySize; -- (uint64_t)freeStorage; +- (bytes)freeStorageSize; @end diff --git a/Sources/Sentry/include/SentryInternalDefines.h b/Sources/Sentry/include/SentryInternalDefines.h new file mode 100644 index 00000000000..47c21f81fb4 --- /dev/null +++ b/Sources/Sentry/include/SentryInternalDefines.h @@ -0,0 +1 @@ +typedef unsigned long long bytes; diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h index 90d83fe2e23..1ada1e2f6bd 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h @@ -204,8 +204,8 @@ typedef struct SentryCrash_MonitorContext { uint64_t totalStorageSize; uint64_t freeStorageSize; uint64_t memorySize; - uint64_t freeMemory; - uint64_t usableMemory; + uint64_t freeMemorySize; + uint64_t usableMemorySize; } System; struct { diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.h b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.h index ee3429c7001..468c4fcc859 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.h +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.h @@ -32,6 +32,7 @@ extern "C" { #endif #include "SentryCrashMonitor.h" +#import "SentryInternalDefines.h" /** Access the Monitor API. */ @@ -39,8 +40,8 @@ SentryCrashMonitorAPI *sentrycrashcm_system_getAPI(void); bool sentrycrash_isSimulatorBuild(void); -uint64_t sentrycrashcm_system_freememory(void); -uint64_t sentrycrashcm_system_freestorage(void); +bytes sentrycrashcm_system_freememory_size(void); +bytes sentrycrashcm_system_freestorage_size(void); #ifdef __cplusplus } diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m index 12268e166ac..3d43b1d79fc 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m @@ -71,9 +71,9 @@ int parentProcessID; const char *deviceAppHash; const char *buildType; - uint64_t totalStorageSize; - uint64_t freeStorageSize; - uint64_t memorySize; + bytes totalStorageSize; + bytes freeStorageSize; + bytes memorySize; } SystemData; static SystemData g_systemData; @@ -188,30 +188,30 @@ return true; } -static uint64_t -freeMemory(void) +static bytes +freeMemorySize(void) { vm_statistics_data_t vmStats; vm_size_t pageSize; if (VMStats(&vmStats, &pageSize)) { - return ((uint64_t)pageSize) * vmStats.free_count; + return ((bytes)pageSize) * vmStats.free_count; } return 0; } -uint64_t -sentrycrashcm_system_freememory(void) +bytes +sentrycrashcm_system_freememory_size(void) { - return freeMemory(); + return freeMemorySize(); } -static uint64_t -usableMemory(void) +static bytes +usableMemorySize(void) { vm_statistics_data_t vmStats; vm_size_t pageSize; if (VMStats(&vmStats, &pageSize)) { - return ((uint64_t)pageSize) + return ((bytes)pageSize) * (vmStats.active_count + vmStats.inactive_count + vmStats.wire_count + vmStats.free_count); } @@ -486,7 +486,7 @@ return "unknown"; } -static uint64_t +static bytes getTotalStorageSize() { NSNumber *storageSize = [[[NSFileManager defaultManager] @@ -495,7 +495,7 @@ return storageSize.unsignedLongLongValue; } -static uint64_t +static bytes getFreeStorageSize() { NSNumber *storageSize = [[[NSFileManager defaultManager] @@ -504,8 +504,8 @@ return storageSize.unsignedLongLongValue; } -uint64_t -sentrycrashcm_system_freestorage(void) +bytes +sentrycrashcm_system_freestorage_size(void) { return getFreeStorageSize(); } @@ -642,8 +642,8 @@ COPY_REFERENCE(totalStorageSize); COPY_REFERENCE(freeStorageSize); COPY_REFERENCE(memorySize); - eventContext->System.freeMemory = freeMemory(); - eventContext->System.usableMemory = usableMemory(); + eventContext->System.freeMemorySize = freeMemorySize(); + eventContext->System.usableMemorySize = usableMemorySize(); } } diff --git a/Sources/SentryCrash/Recording/SentryCrash.m b/Sources/SentryCrash/Recording/SentryCrash.m index cebf7309dc0..36b51320c8b 100644 --- a/Sources/SentryCrash/Recording/SentryCrash.m +++ b/Sources/SentryCrash/Recording/SentryCrash.m @@ -261,8 +261,8 @@ - (NSDictionary *)systemInfo COPY_PRIMITIVE(totalStorageSize); COPY_PRIMITIVE(freeStorageSize); COPY_PRIMITIVE(memorySize); - COPY_PRIMITIVE(freeMemory); - COPY_PRIMITIVE(usableMemory); + COPY_PRIMITIVE(freeMemorySize); + COPY_PRIMITIVE(usableMemorySize); return dict; } diff --git a/Sources/SentryCrash/Recording/SentryCrashReport.c b/Sources/SentryCrash/Recording/SentryCrashReport.c index b5849b788cd..79693f07837 100644 --- a/Sources/SentryCrash/Recording/SentryCrashReport.c +++ b/Sources/SentryCrash/Recording/SentryCrashReport.c @@ -1252,9 +1252,9 @@ writeMemoryInfo(const SentryCrashReportWriter *const writer, const char *const k writer->addUIntegerElement( writer, SentryCrashField_Size, monitorContext->System.memorySize); writer->addUIntegerElement( - writer, SentryCrashField_Usable, monitorContext->System.usableMemory); + writer, SentryCrashField_Usable, monitorContext->System.usableMemorySize); writer->addUIntegerElement( - writer, SentryCrashField_Free, monitorContext->System.freeMemory); + writer, SentryCrashField_Free, monitorContext->System.freeMemorySize); } writer->endContainer(writer); } diff --git a/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackerTest.swift b/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackerTest.swift index b63d1148ceb..22b6825b138 100644 --- a/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackerTest.swift +++ b/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackerTest.swift @@ -31,9 +31,8 @@ class SentryCoreDataTrackerTests: XCTestCase { func testConstants() { //Test constants to make sure we don't accidentally change it - XCTAssertEqual(SENTRY_COREDATA_FETCH_OPERATION, "db.query") - XCTAssertEqual(SENTRY_COREDATA_SAVE_OPERATION, "db.transaction") - + XCTAssertEqual(SENTRY_COREDATA_FETCH_OPERATION, "db.sql.query") + XCTAssertEqual(SENTRY_COREDATA_SAVE_OPERATION, "db.sql.transaction") } func testFetchRequest() { diff --git a/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackingIntegrationTest.swift b/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackingIntegrationTest.swift index aeb73507ac2..2f635c52e35 100644 --- a/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackingIntegrationTest.swift +++ b/Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackingIntegrationTest.swift @@ -78,7 +78,7 @@ class SentryCoreDataTrackingIntegrationTests: XCTestCase { try? stack.managedObjectContext.save() XCTAssertEqual(transaction.children.count, 1) - XCTAssertEqual(transaction.children[0].context.operation, "db.transaction") + XCTAssertEqual(transaction.children[0].context.operation, "db.sql.transaction") } func test_Save_noChanges() { diff --git a/Tests/SentryTests/SentryClientTests.swift b/Tests/SentryTests/SentryClientTests.swift index 33a6a5017a3..8f169d9a579 100644 --- a/Tests/SentryTests/SentryClientTests.swift +++ b/Tests/SentryTests/SentryClientTests.swift @@ -561,9 +561,9 @@ class SentryClientTest: XCTestCase { event.threads = nil event.debugMeta = nil - fixture.crashWrapper.internalFreeMemory = 123_456 - fixture.crashWrapper.internalAppMemory = 234_567 - fixture.crashWrapper.internalFreeStorage = 345_678 + fixture.crashWrapper.internalFreeMemorySize = 123_456 + fixture.crashWrapper.internalAppMemorySize = 234_567 + fixture.crashWrapper.internalFreeStorageSize = 345_678 fixture.getSut().captureCrash(event, with: fixture.scope) assertLastSentEventWithAttachment { actual in diff --git a/Tests/SentryTests/SentryCrash/SentryCrashMonitor_AppState_Tests.m b/Tests/SentryTests/SentryCrash/SentryCrashMonitor_AppState_Tests.m index ae0e1e65215..19b5fcfdf0a 100644 --- a/Tests/SentryTests/SentryCrash/SentryCrashMonitor_AppState_Tests.m +++ b/Tests/SentryTests/SentryCrash/SentryCrashMonitor_AppState_Tests.m @@ -55,38 +55,38 @@ - (void)testInitRelaunch [self initializeCrashState]; SentryCrash_AppState context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertFalse(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertFalse(context.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 2); + XCTAssertEqual(context.sessionsSinceLastCrash, 2); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertFalse(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertFalse(context.crashedLastLaunch); } - (void)testInitCrash @@ -100,45 +100,43 @@ - (void)testInitCrash sentrycrashstate_notifyAppCrash(); SentryCrash_AppState checkpointC = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive, @""); + XCTAssertTrue(checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive); XCTAssertTrue( - checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpointC.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpointC.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertTrue(checkpointC.crashedThisLaunch, @""); - XCTAssertFalse(checkpointC.crashedLastLaunch, @""); + XCTAssertTrue(checkpointC.crashedThisLaunch); + XCTAssertFalse(checkpointC.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertTrue(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertTrue(context.crashedLastLaunch); } - (void)testInitWithWrongCrashState @@ -153,32 +151,32 @@ - (void)testInitWithWrongCrashState [self initializeCrashState]; SentryCrash_AppState context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertFalse(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertFalse(context.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertEqual(context.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(context.launchesSinceLastCrash, 2); + XCTAssertEqual(context.sessionsSinceLastCrash, 2); [jsonData writeToFile:stateFile atomically:true]; [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); } - (void)testActRelaunch @@ -193,47 +191,45 @@ - (void)testActRelaunch SentryCrash_AppState checkpoint1 = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpoint1.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpoint1.applicationIsActive != checkpoint0.applicationIsActive, @""); - XCTAssertTrue(checkpoint1.applicationIsActive, @""); + XCTAssertTrue(checkpoint1.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpoint1.applicationIsActive != checkpoint0.applicationIsActive); + XCTAssertTrue(checkpoint1.applicationIsActive); XCTAssertTrue( - checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpoint1.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpoint1.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertFalse(checkpoint1.crashedThisLaunch, @""); - XCTAssertFalse(checkpoint1.crashedLastLaunch, @""); + XCTAssertFalse(checkpoint1.crashedThisLaunch); + XCTAssertFalse(checkpoint1.crashedLastLaunch); usleep(1); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 2); + XCTAssertEqual(context.sessionsSinceLastCrash, 2); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertFalse(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertFalse(context.crashedLastLaunch); } - (void)testActCrash @@ -247,45 +243,43 @@ - (void)testActCrash sentrycrashstate_notifyAppCrash(); SentryCrash_AppState checkpointC = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive, @""); + XCTAssertTrue(checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive); XCTAssertTrue( - checkpointC.activeDurationSinceLastCrash > checkpoint0.activeDurationSinceLastCrash, @""); + checkpointC.activeDurationSinceLastCrash > checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpointC.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpointC.activeDurationSinceLaunch > checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpointC.activeDurationSinceLaunch > checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpointC.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertTrue(checkpointC.crashedThisLaunch, @""); - XCTAssertFalse(checkpointC.crashedLastLaunch, @""); + XCTAssertTrue(checkpointC.crashedThisLaunch); + XCTAssertFalse(checkpointC.crashedLastLaunch); [self initializeCrashState]; SentryCrash_AppState context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertTrue(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertTrue(context.crashedLastLaunch); } - (void)testActDeactRelaunch @@ -299,48 +293,46 @@ - (void)testActDeactRelaunch sentrycrashstate_notifyAppActive(false); SentryCrash_AppState checkpoint1 = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpoint1.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpoint1.applicationIsActive != checkpoint0.applicationIsActive, @""); - XCTAssertFalse(checkpoint1.applicationIsActive, @""); + XCTAssertTrue(checkpoint1.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpoint1.applicationIsActive != checkpoint0.applicationIsActive); + XCTAssertFalse(checkpoint1.applicationIsActive); XCTAssertTrue( - checkpoint1.activeDurationSinceLastCrash > checkpoint0.activeDurationSinceLastCrash, @""); + checkpoint1.activeDurationSinceLastCrash > checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpoint1.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpoint1.activeDurationSinceLaunch > checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpoint1.activeDurationSinceLaunch > checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpoint1.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertFalse(checkpoint1.crashedThisLaunch, @""); - XCTAssertFalse(checkpoint1.crashedLastLaunch, @""); + XCTAssertFalse(checkpoint1.crashedThisLaunch); + XCTAssertFalse(checkpoint1.crashedLastLaunch); usleep(1); [self initializeCrashState]; SentryCrash_AppState checkpointR = *sentrycrashstate_currentState(); - XCTAssertTrue(checkpointR.applicationIsInForeground, @""); - XCTAssertFalse(checkpointR.applicationIsActive, @""); + XCTAssertTrue(checkpointR.applicationIsInForeground); + XCTAssertFalse(checkpointR.applicationIsActive); // We don't save after going inactive, so this will still be 0. - XCTAssertEqual(checkpointR.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(checkpointR.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2); + XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2); - XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1); - XCTAssertFalse(checkpointR.crashedThisLaunch, @""); - XCTAssertFalse(checkpointR.crashedLastLaunch, @""); + XCTAssertFalse(checkpointR.crashedThisLaunch); + XCTAssertFalse(checkpointR.crashedLastLaunch); } - (void)testActDeactCrash @@ -357,45 +349,43 @@ - (void)testActDeactCrash sentrycrashstate_notifyAppCrash(); SentryCrash_AppState checkpointC = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive, @""); + XCTAssertTrue(checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive); XCTAssertTrue( - checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpointC.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpointC.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertTrue(checkpointC.crashedThisLaunch, @""); - XCTAssertFalse(checkpointC.crashedLastLaunch, @""); + XCTAssertTrue(checkpointC.crashedThisLaunch); + XCTAssertFalse(checkpointC.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertTrue(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertTrue(context.crashedLastLaunch); } - (void)testActDeactBGRelaunch @@ -411,47 +401,45 @@ - (void)testActDeactBGRelaunch sentrycrashstate_notifyAppInForeground(false); SentryCrash_AppState checkpoint1 = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpoint1.applicationIsInForeground != checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpoint1.applicationIsActive == checkpoint0.applicationIsActive, @""); - XCTAssertFalse(checkpoint1.applicationIsInForeground, @""); + XCTAssertTrue(checkpoint1.applicationIsInForeground != checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpoint1.applicationIsActive == checkpoint0.applicationIsActive); + XCTAssertFalse(checkpoint1.applicationIsInForeground); XCTAssertTrue( - checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpoint1.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpoint1.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertFalse(checkpoint1.crashedThisLaunch, @""); - XCTAssertFalse(checkpoint1.crashedLastLaunch, @""); + XCTAssertFalse(checkpoint1.crashedThisLaunch); + XCTAssertFalse(checkpoint1.crashedLastLaunch); usleep(1); [self initializeCrashState]; SentryCrash_AppState checkpointR = *sentrycrashstate_currentState(); - XCTAssertTrue(checkpointR.applicationIsInForeground, @""); - XCTAssertFalse(checkpointR.applicationIsActive, @""); + XCTAssertTrue(checkpointR.applicationIsInForeground); + XCTAssertFalse(checkpointR.applicationIsActive); - XCTAssertTrue(checkpointR.activeDurationSinceLastCrash > 0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2, @""); + XCTAssertTrue(checkpointR.activeDurationSinceLastCrash > 0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2); + XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2); - XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1); - XCTAssertFalse(checkpointR.crashedThisLaunch, @""); - XCTAssertFalse(checkpointR.crashedLastLaunch, @""); + XCTAssertFalse(checkpointR.crashedThisLaunch); + XCTAssertFalse(checkpointR.crashedLastLaunch); } - (void)testActDeactBGTerminate @@ -471,21 +459,21 @@ - (void)testActDeactBGTerminate [self initializeCrashState]; SentryCrash_AppState checkpointR = *sentrycrashstate_currentState(); - XCTAssertTrue(checkpointR.applicationIsInForeground, @""); - XCTAssertFalse(checkpointR.applicationIsActive, @""); + XCTAssertTrue(checkpointR.applicationIsInForeground); + XCTAssertFalse(checkpointR.applicationIsActive); XCTAssertTrue( checkpointR.backgroundDurationSinceLastCrash > checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2); + XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2); - XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1); - XCTAssertFalse(checkpointR.crashedThisLaunch, @""); - XCTAssertFalse(checkpointR.crashedLastLaunch, @""); + XCTAssertFalse(checkpointR.crashedThisLaunch); + XCTAssertFalse(checkpointR.crashedLastLaunch); } - (void)testActDeactBGCrash @@ -504,44 +492,42 @@ - (void)testActDeactBGCrash sentrycrashstate_notifyAppCrash(); SentryCrash_AppState checkpointC = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive, @""); + XCTAssertTrue(checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive); XCTAssertTrue( - checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue( checkpointC.backgroundDurationSinceLastCrash > checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); + XCTAssertTrue(checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( - checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); - XCTAssertTrue( - checkpointC.backgroundDurationSinceLaunch > checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + checkpointC.backgroundDurationSinceLaunch > checkpoint0.backgroundDurationSinceLaunch); + XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertTrue(checkpointC.crashedThisLaunch, @""); - XCTAssertFalse(checkpointC.crashedLastLaunch, @""); + XCTAssertTrue(checkpointC.crashedThisLaunch); + XCTAssertFalse(checkpointC.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertTrue(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertTrue(context.crashedLastLaunch); } - (void)testActDeactBGFGRelaunch @@ -560,48 +546,45 @@ - (void)testActDeactBGFGRelaunch sentrycrashstate_notifyAppInForeground(true); SentryCrash_AppState checkpoint1 = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpoint1.applicationIsInForeground != checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpoint1.applicationIsActive == checkpoint0.applicationIsActive, @""); - XCTAssertTrue(checkpoint1.applicationIsInForeground, @""); + XCTAssertTrue(checkpoint1.applicationIsInForeground != checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpoint1.applicationIsActive == checkpoint0.applicationIsActive); + XCTAssertTrue(checkpoint1.applicationIsInForeground); XCTAssertTrue( - checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpoint1.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue( checkpoint1.backgroundDurationSinceLastCrash > checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue( - checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash + 1, @""); + XCTAssertTrue(checkpoint1.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpoint1.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash + 1); + XCTAssertTrue(checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( - checkpoint1.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); - XCTAssertTrue( - checkpoint1.backgroundDurationSinceLaunch > checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch + 1, @""); + checkpoint1.backgroundDurationSinceLaunch > checkpoint0.backgroundDurationSinceLaunch); + XCTAssertTrue(checkpoint1.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch + 1); - XCTAssertFalse(checkpoint1.crashedThisLaunch, @""); - XCTAssertFalse(checkpoint1.crashedLastLaunch, @""); + XCTAssertFalse(checkpoint1.crashedThisLaunch); + XCTAssertFalse(checkpoint1.crashedLastLaunch); usleep(1); [self initializeCrashState]; SentryCrash_AppState checkpointR = *sentrycrashstate_currentState(); - XCTAssertTrue(checkpointR.applicationIsInForeground, @""); - XCTAssertFalse(checkpointR.applicationIsActive, @""); + XCTAssertTrue(checkpointR.applicationIsInForeground); + XCTAssertFalse(checkpointR.applicationIsActive); - XCTAssertTrue(checkpointR.activeDurationSinceLastCrash > 0, @""); + XCTAssertTrue(checkpointR.activeDurationSinceLastCrash > 0); // We don't save after going to FG, so this will still be 0. - XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2, @""); - XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2, @""); + XCTAssertEqual(checkpointR.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(checkpointR.launchesSinceLastCrash, 2); + XCTAssertEqual(checkpointR.sessionsSinceLastCrash, 2); - XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(checkpointR.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(checkpointR.sessionsSinceLaunch, 1); - XCTAssertFalse(checkpointR.crashedThisLaunch, @""); - XCTAssertFalse(checkpointR.crashedLastLaunch, @""); + XCTAssertFalse(checkpointR.crashedThisLaunch); + XCTAssertFalse(checkpointR.crashedLastLaunch); } - (void)testActDeactBGFGCrash @@ -622,45 +605,43 @@ - (void)testActDeactBGFGCrash sentrycrashstate_notifyAppCrash(); SentryCrash_AppState checkpointC = *sentrycrashstate_currentState(); - XCTAssertTrue( - checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground, @""); - XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive, @""); + XCTAssertTrue(checkpointC.applicationIsInForeground == checkpoint0.applicationIsInForeground); + XCTAssertTrue(checkpointC.applicationIsActive == checkpoint0.applicationIsActive); XCTAssertTrue( - checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash, @""); + checkpointC.activeDurationSinceLastCrash == checkpoint0.activeDurationSinceLastCrash); XCTAssertTrue(checkpointC.backgroundDurationSinceLastCrash == checkpoint0.backgroundDurationSinceLastCrash, @""); - XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash, @""); - XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash, @""); + XCTAssertTrue(checkpointC.launchesSinceLastCrash == checkpoint0.launchesSinceLastCrash); + XCTAssertTrue(checkpointC.sessionsSinceLastCrash == checkpoint0.sessionsSinceLastCrash); - XCTAssertTrue( - checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch, @""); + XCTAssertTrue(checkpointC.activeDurationSinceLaunch == checkpoint0.activeDurationSinceLaunch); XCTAssertTrue( checkpointC.backgroundDurationSinceLaunch == checkpoint0.backgroundDurationSinceLaunch, @""); - XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch, @""); + XCTAssertTrue(checkpointC.sessionsSinceLaunch == checkpoint0.sessionsSinceLaunch); - XCTAssertTrue(checkpointC.crashedThisLaunch, @""); - XCTAssertFalse(checkpointC.crashedLastLaunch, @""); + XCTAssertTrue(checkpointC.crashedThisLaunch); + XCTAssertFalse(checkpointC.crashedLastLaunch); [self initializeCrashState]; context = *sentrycrashstate_currentState(); - XCTAssertTrue(context.applicationIsInForeground, @""); - XCTAssertFalse(context.applicationIsActive, @""); + XCTAssertTrue(context.applicationIsInForeground); + XCTAssertFalse(context.applicationIsActive); - XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0, @""); - XCTAssertEqual(context.launchesSinceLastCrash, 1, @""); - XCTAssertEqual(context.sessionsSinceLastCrash, 1, @""); + XCTAssertEqual(context.activeDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLastCrash, 0.0); + XCTAssertEqual(context.launchesSinceLastCrash, 1); + XCTAssertEqual(context.sessionsSinceLastCrash, 1); - XCTAssertEqual(context.activeDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0, @""); - XCTAssertEqual(context.sessionsSinceLaunch, 1, @""); + XCTAssertEqual(context.activeDurationSinceLaunch, 0.0); + XCTAssertEqual(context.backgroundDurationSinceLaunch, 0.0); + XCTAssertEqual(context.sessionsSinceLaunch, 1); - XCTAssertFalse(context.crashedThisLaunch, @""); - XCTAssertTrue(context.crashedLastLaunch, @""); + XCTAssertFalse(context.crashedThisLaunch); + XCTAssertTrue(context.crashedLastLaunch); } @end diff --git a/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.h b/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.h index 53c8d800736..e2ba87fe97b 100644 --- a/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.h +++ b/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.h @@ -25,11 +25,11 @@ SENTRY_NO_INIT @property (nonatomic, assign) BOOL closeCalled; -@property (nonatomic, assign) uint64_t internalFreeMemory; +@property (nonatomic, assign) uint64_t internalFreeMemorySize; -@property (nonatomic, assign) uint64_t internalAppMemory; +@property (nonatomic, assign) uint64_t internalAppMemorySize; -@property (nonatomic, assign) uint64_t internalFreeStorage; +@property (nonatomic, assign) uint64_t internalFreeStorageSize; @end diff --git a/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.m b/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.m index 28eb052b078..90c17aff8fb 100644 --- a/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.m +++ b/Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.m @@ -14,9 +14,9 @@ + (instancetype)sharedInstance instance.internalIsApplicationInForeground = YES; instance.installAsyncHooksCalled = NO; instance.closeCalled = NO; - instance.internalFreeMemory = 0; - instance.internalAppMemory = 0; - instance.internalFreeStorage = 0; + instance.internalFreeMemorySize = 0; + instance.internalAppMemorySize = 0; + instance.internalFreeStorageSize = 0; return instance; } @@ -60,19 +60,19 @@ - (NSDictionary *)systemInfo return @{}; } -- (uint64_t)freeMemory +- (bytes)freeMemorySize { - return self.internalFreeMemory; + return self.internalFreeMemorySize; } -- (uint64_t)appMemory +- (bytes)appMemorySize { - return self.internalAppMemory; + return self.internalAppMemorySize; } -- (uint64_t)freeStorage +- (bytes)freeStorageSize { - return self.internalFreeStorage; + return self.internalFreeStorageSize; } @end