Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement -debugDescription for Request and Response #76

Merged
merged 6 commits into from
Feb 2, 2016

Conversation

ChocoChipset
Copy link
Contributor

Implement -debugDescription methods for SPTDataLoaderRequest and SPTDataLoaderResponse.

Format of the output is the same as NSURLResponse and NSURLRequest.

@ChocoChipset
Copy link
Contributor Author

Review: @rastersize, @8W9aG, @jgavris

Cast enumeration to `long` for a -stringWithFormat: in `-debugDescription` of SPTDataLoaderRequest.
@8W9aG
Copy link
Contributor

8W9aG commented Feb 1, 2016

You'll need to add tests for this (in order to keep coverage up)

@@ -181,4 +181,10 @@ - (NSDate *)retryAfterForHeaders:(NSDictionary *)headers
return [httpDateFormatter dateFromString:retryAfterValue];
}

- (NSString *)debugDescription
{
return [NSString stringWithFormat:@"%@ { URL: %@ } { status code: %lu, headers: %@ }", [super debugDescription], self.response.URL, (long)self.statusCode, self.responseHeaders];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've specified that the status code should be long unsigned but you then cast it to only long.

@rastersize
Copy link
Contributor

With some tests and the type fix this will be golden 😃

Hector Zarate and others added 3 commits February 2, 2016 10:34
Implement unit tests for debugDescription methods of SPTDataLoaderRequest and SPTDataLoaderResponse.
@ChocoChipset
Copy link
Contributor Author

Good catch, @rastersize. Changed them to %ld (SPTDataLoaderResponseHTTPStatusCode is signed). Added unit tests.

@rastersize
Copy link
Contributor

👍

rastersize added a commit that referenced this pull request Feb 2, 2016
Implement -debugDescription for Request and Response
@rastersize rastersize merged commit 4e2bd2b into spotify:master Feb 2, 2016
@ChocoChipset
Copy link
Contributor Author

hooray! 🎉

@jgavris
Copy link
Contributor

jgavris commented Feb 2, 2016

Can also use %tu for unsigned and and %zd for signed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants