diff options
author | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
---|---|---|
committer | thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2008-04-14 17:21:02 +0000 |
commit | cdf070c8d76ffc4eaa24e8671756cbbe9ceb2890 (patch) | |
tree | faa9ae3a72a6591d6a6add7ceed7f91e92ade11f /AppKit/GTMNSBezierPath+RoundRectTest.m | |
parent | 0aaecac6ff2bc89e58a0c8c6d6ad62e02fb2b011 (diff) |
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)
Diffstat (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m')
-rw-r--r-- | AppKit/GTMNSBezierPath+RoundRectTest.m | 25 |
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; |