forked from core-plot/core-plot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPTColorSpaceTests.m
More file actions
31 lines (22 loc) · 801 Bytes
/
Copy pathCPTColorSpaceTests.m
File metadata and controls
31 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "CPTColorSpaceTests.h"
#import "CPTColorSpace.h"
@implementation CPTColorSpaceTests
#pragma mark -
#pragma mark NSCoding Methods
-(void)testKeyedArchivingRoundTrip
{
CPTColorSpace *colorSpace = [CPTColorSpace genericRGBSpace];
CPTColorSpace *newColorSpace = [self archiveRoundTrip:colorSpace];
CFDataRef iccProfile = CGColorSpaceCopyICCProfile(colorSpace.cgColorSpace);
CFDataRef newIccProfile = CGColorSpaceCopyICCProfile(newColorSpace.cgColorSpace);
if ( iccProfile && newIccProfile ) {
XCTAssertTrue([(__bridge NSData *) iccProfile isEqualToData:(__bridge NSData *)newIccProfile], @"Color spaces not equal");
}
if ( iccProfile ) {
CFRelease(iccProfile);
}
if ( newIccProfile ) {
CFRelease(newIccProfile);
}
}
@end