Re: Range checking needed in -scanJSONValue: ??

3 views
Skip to first unread message
Message has been deleted

Bill Garrison

unread,
Apr 29, 2010, 2:19:17 AM4/29/10
to bsjsona...@googlegroups.com
Jerry,

I couldn't replicate the exception you saw. I created a unit test to read the Google Chrome bookmark from a file into a string, then create a dictionary from it. It all worked fine for me with the tip of my fork (that sounds a little naughty).

http://github.com/billgarrison/bsjsonadditions

Here's the test I used (added to NSDictionary_UnitTests.m).

- (void) testParseGoogleChromeBookmarks
{
NSBundle *unitTestBundle = [NSBundle bundleForClass:[self class]];
NSString *testFile = [unitTestBundle pathForResource:@"google-chrome-bookmarks" ofType:@"json"];
STAssertNotNil( testFile, @"Can't locate data file for this test");

NSError *error = nil;
NSString *encoded = [NSString stringWithContentsOfFile:testFile encoding:NSUTF8StringEncoding error:&error];
STAssertNotNil( encoded, @"Error reading test data: %@", error);

NSDictionary *decodedDict = [NSDictionary dictionaryWithJSONString:encoded];
STAssertNotNil( decodedDict, @"Couldn't decode Gooogle Chrome bookmarks file");
}

And the data file.

google-chrome-bookmarks.json
Reply all
Reply to author
Forward
0 new messages