From cdf070c8d76ffc4eaa24e8671756cbbe9ceb2890 Mon Sep 17 00:00:00 2001 From: thomasvl Date: Mon, 14 Apr 2008 17:21:02 +0000 Subject: See the ReleaseNotes for the full details, highlights: - bug fixes - code coverage support - more complete unittests - full support for unittesting UIs - support for the iphone sdk (include ui unittesting) --- AppKit/GTMNSBezierPath+RoundRectTest.m | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m') 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 #import "GTMNSBezierPath+RoundRect.h" -#import "GTMNSView+UnitTesting.h" +#import "GTMAppKit+UnitTesting.h" @interface GTMNSBezierPath_RoundRectTest : SenTestCase @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; -- cgit v1.2.3