Skip to content

Commit

Permalink
Replace deprecated dataWithContentsOfMappedFile: method
Browse files Browse the repository at this point in the history
Issue: PLCR-584
  • Loading branch information
lumaxis committed Jan 20, 2016
1 parent 356901d commit 8b5462e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/PLCrashLogWriterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ - (void) checkException: (Plcrash__CrashReport *) crashReport {

- (Plcrash__CrashReport *) loadReport {
/* Reading the report */
NSData *data = [NSData dataWithContentsOfMappedFile: _logPath];
NSData *data = [NSData dataWithContentsOfFile:_logPath options:NSDataReadingMappedAlways error:nil];
STAssertNotNil(data, @"Could not map pages");


Expand Down
3 changes: 2 additions & 1 deletion Source/PLCrashReportTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ - (void) testWriteReport {
plcrash_async_file_close(&file);

/* Try to parse it */
PLCrashReport *crashLog = [[[PLCrashReport alloc] initWithData: [NSData dataWithContentsOfMappedFile: _logPath] error: &error] autorelease];
NSData *data = [NSData dataWithContentsOfFile:_logPath options:NSDataReadingMappedIfSafe error:nil];
PLCrashReport *crashLog = [[[PLCrashReport alloc] initWithData: data error: &error] autorelease];
STAssertNotNil(crashLog, @"Could not decode crash log: %@", error);

/* Report info */
Expand Down

0 comments on commit 8b5462e

Please sign in to comment.