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+CGPathTest.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+CGPathTest.m')
-rw-r--r-- | AppKit/GTMNSBezierPath+CGPathTest.m | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/AppKit/GTMNSBezierPath+CGPathTest.m b/AppKit/GTMNSBezierPath+CGPathTest.m index c8506d7..3ca11c3 100644 --- a/AppKit/GTMNSBezierPath+CGPathTest.m +++ b/AppKit/GTMNSBezierPath+CGPathTest.m @@ -20,7 +20,8 @@ #import <SenTestingKit/SenTestingKit.h> #import "GTMNSBezierPath+CGPath.h" -#import "GTMNSView+UnitTesting.h" +#import "GTMAppKit+UnitTesting.h" +#import "GTMSenTestCase.h" @interface GTMNSBezierPath_CGPathTest : SenTestCase<GTMUnitTestViewDrawer> @end @@ -32,8 +33,8 @@ } -// Draws all of our tests so that we can compare this to our stored TIFF file. -- (void)unitTestViewDrawRect:(NSRect)rect contextInfo:(void*)contextInfo{ +// Draws all of our tests so that we can compare this to our stored image file. +- (void)gtm_unitTestViewDrawRect:(NSRect)rect contextInfo:(void*)contextInfo{ NSBezierPath *thePath = [NSBezierPath bezierPath]; NSPoint theStart = NSMakePoint(20.0f, 20.0f); @@ -59,17 +60,11 @@ [thePath closePath]; CGPathRef cgPath = [thePath gtm_createCGPath]; - if (nil == cgPath) { - @throw [NSException failureInFile:[NSString stringWithCString:__FILE__] - atLine:__LINE__ - withDescription:@"Nil CGPath"]; - } + STAssertNotNULL(cgPath, @"Nil CGPath"); + CGContextRef cgContext = [[NSGraphicsContext currentContext] graphicsPort]; - if (nil == cgContext) { - @throw [NSException failureInFile:[NSString stringWithCString:__FILE__] - atLine:__LINE__ - withDescription:@"Nil CGContext"]; - } + STAssertNotNULL(cgContext, @"Nil cgContext"); + CGContextAddPath(cgContext, cgPath); CGContextStrokePath(cgContext); CGPathRelease(cgPath); |