fixed clang warnings for nullability

Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
michael starke
2015-10-13 16:36:56 +02:00
parent 5256941e44
commit d49098d7a9
2 changed files with 5 additions and 5 deletions

View File

@@ -43,7 +43,7 @@
XCTAssertNotNil(imageRep, @"One image rep shoudl be there"); XCTAssertNotNil(imageRep, @"One image rep shoudl be there");
XCTAssertTrue([imageRep isKindOfClass:repClass], @"Representation should be bitmap"); XCTAssertTrue([imageRep isKindOfClass:repClass], @"Representation should be bitmap");
NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)imageRep; NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)imageRep;
NSData *pngData = [bitmapRep representationUsingType:NSPNGFileType properties:nil]; NSData *pngData = [bitmapRep representationUsingType:NSPNGFileType properties:@{}];
XCTAssertEqualObjects(pngData, _imageData, @"Image and PNG data shoudl be identical"); XCTAssertEqualObjects(pngData, _imageData, @"Image and PNG data shoudl be identical");
} }

View File

@@ -83,16 +83,16 @@
KPKIcon *icon = [[KPKIcon alloc] initWithImageAtURL:imageURL]; KPKIcon *icon = [[KPKIcon alloc] initWithImageAtURL:imageURL];
NSData *data = [self encode:icon]; NSData *data = [self encode:icon];
KPKIcon *decodedIcon = [self decode:data ofClass:[KPKIcon class]]; KPKIcon *decodedIcon = [self decode:data ofClass:[KPKIcon class]];
NSBitmapImageRep *originalRep = [[icon.image representations] lastObject]; NSImageRep *originalRep = icon.image.representations.lastObject;
NSBitmapImageRep *decodedRep = [[decodedIcon.image representations] lastObject]; NSImageRep *decodedRep = decodedIcon.image.representations.lastObject;
XCTAssertTrue([originalRep isKindOfClass:[NSBitmapImageRep class]]); XCTAssertTrue([originalRep isKindOfClass:[NSBitmapImageRep class]]);
XCTAssertTrue([decodedRep isKindOfClass:[NSBitmapImageRep class]]); XCTAssertTrue([decodedRep isKindOfClass:[NSBitmapImageRep class]]);
/* /*
We cannot assert bit depth since TIFF conversion might just strip a full white alpha channel We cannot assert bit depth since TIFF conversion might just strip a full white alpha channel
XCTAssertEqual([originalRep bitsPerPixel], [decodedRep bitsPerPixel]); XCTAssertEqual([originalRep bitsPerPixel], [decodedRep bitsPerPixel]);
*/ */
XCTAssertEqual([originalRep pixelsHigh], [decodedRep pixelsHigh]); XCTAssertEqual(originalRep.pixelsHigh, decodedRep.pixelsHigh);
XCTAssertEqual([originalRep pixelsWide], [decodedRep pixelsWide]); XCTAssertEqual(originalRep.pixelsWide, decodedRep.pixelsWide);
NSData *originalData = [icon.image TIFFRepresentation]; NSData *originalData = [icon.image TIFFRepresentation];
NSData *decodedData = [decodedIcon.image TIFFRepresentation]; NSData *decodedData = [decodedIcon.image TIFFRepresentation];