mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
fixed clang warnings for nullability
Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user