aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMNSBezierPath+RoundRectTest.m
diff options
context:
space:
mode:
Diffstat (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m')
-rw-r--r--AppKit/GTMNSBezierPath+RoundRectTest.m25
1 files changed, 15 insertions, 10 deletions
diff --git a/AppKit/GTMNSBezierPath+RoundRectTest.m b/AppKit/GTMNSBezierPath+RoundRectTest.m
index 61bd2dd..6ff4a18 100644
--- a/AppKit/GTMNSBezierPath+RoundRectTest.m
+++ b/AppKit/GTMNSBezierPath+RoundRectTest.m
@@ -20,7 +20,7 @@
#import <SenTestingKit/SenTestingKit.h>
#import "GTMNSBezierPath+RoundRect.h"
-#import "GTMNSView+UnitTesting.h"
+#import "GTMAppKit+UnitTesting.h"
@interface GTMNSBezierPath_RoundRectTest : SenTestCase<GTMUnitTestViewDrawer>
@end
@@ -28,12 +28,12 @@
@implementation GTMNSBezierPath_RoundRectTest
- (void)testRoundRects {
- GTMAssertDrawingEqualToFile(self, NSMakeSize(330, 430), @"GTMNSBezierPath+RoundRectTest", nil, nil);
+ GTMAssertDrawingEqualToFile(self, NSMakeSize(330, 430),
+ @"GTMNSBezierPath+RoundRectTest", nil, nil);
}
-
// Draws all of our tests so that we can compare this to our stored TIFF file.
-- (void)unitTestViewDrawRect:(NSRect)rect contextInfo:(void*)contextInfo{
+- (void)gtm_unitTestViewDrawRect:(NSRect)rect contextInfo:(void*)contextInfo{
NSRect theRects[] = {
NSMakeRect(0.0f, 10.0f, 0.0f, 0.0f), //Empty Rect test
NSMakeRect(50.0f, 10.0f, 30.0f, 30.0f), //Square Test
@@ -50,25 +50,29 @@
for (i = 0; i < theLineWidthCount; ++i) {
for (j = 0; j < theRectCount; ++j) {
- NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j] cornerRadius:20.0f];
+ NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j]
+ cornerRadius:20.0f];
[roundRect setLineWidth: theLineWidths[i]];
[roundRect stroke];
float newWidth = 35.0f;
- if (i < theLineWidthCount - 1) newWidth += theLineWidths[i + 1] + theLineWidths[i];
+ if (i < theLineWidthCount - 1) {
+ newWidth += theLineWidths[i + 1] + theLineWidths[i];
+ }
theRects[j].origin.y += newWidth;
}
}
// Fill test
NSColor *theColors[] = {
- [NSColor colorWithDeviceRed:1.0f green:0.0f blue:0.0f alpha:1.0f],
- [NSColor colorWithDeviceRed:0.2f green:0.4f blue:0.6f alpha:0.4f]
+ [NSColor colorWithCalibratedRed:1.0f green:0.0f blue:0.0f alpha:1.0f],
+ [NSColor colorWithCalibratedRed:0.2f green:0.4f blue:0.6f alpha:0.4f]
};
const unsigned int theColorCount = sizeof(theColors)/sizeof(NSColor);
for (i = 0; i < theColorCount; ++i) {
for (j = 0; j < theRectCount; ++j) {
- NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j] cornerRadius:10.0f];
+ NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j]
+ cornerRadius:10.0f];
[theColors[i] setFill];
[roundRect fill];
theRects[j].origin.y += 35.0f;
@@ -81,7 +85,8 @@
for (i = 0; i < theFlatnessCount; i++) {
for (j = 0; j < theRectCount; ++j) {
- NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j] cornerRadius:6.0f];
+ NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:theRects[j]
+ cornerRadius:6.0f];
[roundRect setFlatness:theFlatness[i]];
[roundRect stroke];
theRects[j].origin.y += 35.0f;