Skip to content

Commit

Permalink
test: Fix failing FileIOTracking tests (#2902)
Browse files Browse the repository at this point in the history
When running the SentryFileIOTrackingIntegrationObjCTests locally they failed. This
is fixed now by using the SentryByteCountFormatter instead of the NSByteCountFormatter.
  • Loading branch information
philipphofmann authored Apr 14, 2023
1 parent 211f63b commit aa27ac0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "SentryByteCountFormatter.h"
#import "SentryNSDataTracker.h"
#import "SentryOptions.h"
#import "SentrySDK.h"
Expand Down Expand Up @@ -218,10 +219,9 @@ - (void)assertTransactionForOperation:(NSString *)operation block:(void (^)(void
if ([operation isEqualToString:SENTRY_FILE_READ_OPERATION]) {
XCTAssertEqualObjects(ioSpan.spanDescription, filename);
} else {
NSString *expectedString = [NSString
stringWithFormat:@"%@ (%@)", filename,
[NSByteCountFormatter stringFromByteCount:someData.length
countStyle:NSByteCountFormatterCountStyleBinary]];
NSString *expectedString =
[NSString stringWithFormat:@"%@ (%@)", filename,
[SentryByteCountFormatter bytesCountDescription:someData.length]];

XCTAssertEqualObjects(ioSpan.spanDescription, expectedString);
}
Expand Down

0 comments on commit aa27ac0

Please sign in to comment.