-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Parse file metadata into reports when incomplete
The bare minimum for determining the type of a report and gathering diagnostic data is for there to be a `crash.error` section of the underlying report. This is used to determine if the report is incomplete. Fallback values are distributed and used as needed without depending on an individual value to determine "incomplete-ness".
- Loading branch information
Showing
13 changed files
with
228 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// BSGFilepathTests.m | ||
// Tests | ||
// | ||
// Created by Delisa on 2/19/19. | ||
// Copyright © 2019 Bugsnag. All rights reserved. | ||
// | ||
|
||
#import <XCTest/XCTest.h> | ||
#include <string.h> | ||
|
||
|
||
int bsg_create_filepath(char *base, char filepath[512], char severity, char error_class[21]); | ||
|
||
@interface BSGFilepathTests : XCTestCase | ||
|
||
@end | ||
|
||
@implementation BSGFilepathTests | ||
|
||
- (void)testEncodeCharacters { | ||
char *base = "/path/to/it/imagine this is a UUID.json"; | ||
char filepath[512]; | ||
bsg_create_filepath(base, filepath, 'w', "😃 HappyError"); | ||
XCTAssertEqual(0, strcmp(filepath, "/path/to/it/imagine this is a UUID-w-u- HappyError.json")); | ||
} | ||
|
||
- (void)testTruncateUnicodeCharacters { | ||
char *base = "/path/to/it/imagine this is a UUID.json"; | ||
char filepath[512]; | ||
// The char limit is not on a character boundary | ||
bsg_create_filepath(base, filepath, 'e', "AnExtremelyLongLong😃"); | ||
XCTAssertEqual(0, strcmp(filepath, "/path/to/it/imagine this is a UUID-e-u-AnExtremelyLongLong.json")); | ||
} | ||
|
||
- (void)testEmptyErrorClassFromUnicode { | ||
char *base = "/path/to/it/imagine this is a UUID.json"; | ||
char filepath[512]; | ||
bsg_create_filepath(base, filepath, 'e', "🀦🀨🁺😃"); | ||
XCTAssertEqual(0, strcmp(filepath, "/path/to/it/imagine this is a UUID-e-u-.json")); | ||
} | ||
|
||
- (void)testErrorClassLength { | ||
char *base = "imagine this is a UUID.json"; | ||
char filepath[512]; | ||
bsg_create_filepath(base, filepath, 'i', "AnExtremelyLongLongErrorNameOmg"); | ||
XCTAssertEqual(0, strcmp(filepath, "imagine this is a UUID-i-u-AnExtremelyLongLongEr.json")); | ||
} | ||
|
||
@end |
Oops, something went wrong.