diff --git a/Code/Support/RKMIMETypeSerialization.m b/Code/Support/RKMIMETypeSerialization.m index fc2cf90b..2680f210 100644 --- a/Code/Support/RKMIMETypeSerialization.m +++ b/Code/Support/RKMIMETypeSerialization.m @@ -146,6 +146,9 @@ + (id)objectFromData:(NSData *)data MIMEType:(NSString *)MIMEType error:(NSError **)error { + NSParameterAssert(data); + NSParameterAssert(MIMEType); + Class serializationClass = [self serializationClassForMIMEType:MIMEType]; if (!serializationClass) { if (error) { @@ -161,6 +164,8 @@ + (id)dataFromObject:(id)object MIMEType:(NSString *)MIMEType error:(NSError **)error { + NSParameterAssert(object); + NSParameterAssert(MIMEType); Class serializationClass = [self serializationClassForMIMEType:MIMEType]; if (!serializationClass) { if (error) { diff --git a/Code/Testing/RKTestFixture.m b/Code/Testing/RKTestFixture.m index 702a858f..920fd6c6 100644 --- a/Code/Testing/RKTestFixture.m +++ b/Code/Testing/RKTestFixture.m @@ -86,14 +86,12 @@ static NSBundle *fixtureBundle = nil; { NSError *error = nil; NSData *resourceContents = [self dataWithContentsOfFixture:fixtureName]; + NSAssert(resourceContents, @"Failed to read fixture named '%@'", fixtureName); NSString *MIMEType = [self MIMETypeForFixture:fixtureName]; + NSAssert(MIMEType, @"Failed to determine MIME type of fixture named '%@'", fixtureName); id object = [RKMIMETypeSerialization objectFromData:resourceContents MIMEType:MIMEType error:&error]; - if (object == nil) { - RKLogCritical(@"Failed to parse fixture name '%@' in bundle %@. Error: %@", fixtureName, [self fixtureBundle], [error localizedDescription]); - return nil; - } - + NSAssert(object, @"Failed to parse fixture name '%@' in bundle %@. Error: %@", fixtureName, [self fixtureBundle], [error localizedDescription]); return object; }