Fixed documentation & spaces

This commit is contained in:
Vladimir Shevchenko committed 2012-07-12 02:47:12 +07:00
1 parent 2905cd1586
commit d6b9daf7ca
2 files changed
+104 -34

No files matched your search

+70
View File
@@ -29,18 +29,88 @@ CPMaxXEdge = 2;
CPMaxYEdge = 3;
// FIXME: the rest!
/*!
Makes a CGPoint object out of two numbers provided as arguments
@group CGPoint
@param x the x-coordinate of the CGPoint
@param y the y-coordinate of the CGPoint
@return CGPoint a CGPoint with an X and Y coordinate equal to the function arguments
*/
CPMakePoint = CGPointMake;
/*!
Creates and returns a new CGSize object from the provided dimensions.
@group CGSize
@param width the width for the new CGSize
@param height the height for the new CGSize
@return CGSize the new CGSize
*/
CPMakeSize = CGSizeMake;
/*!
Returns a CGRect made of the specified arguments
@group CGRect
@param x the x-coordinate of the rectangle's origin
@param y the y-coordinate of the rectangle's origin
@param width the width of the new rectangle
@param height the height of the new rectangle
@return CGRect the new rectangle
*/
CPMakeRect = CGRectMake;
/*!
Creates a copy of a specified point and returns the copy
@group CGPoint
@param the point to be copied
@return CGPoint the copy of the provided CGPoint
*/
CPPointCreateCopy = CGPointMakeCopy;
/*!
Tests whether the two CGPoints are equal to each other by comparing their
\c x and \c y members.
@group @CGPoint
@param lhsPoint the first CGPoint to check
@param rhsPoint the second CGPoint to check
@return BOOL \c YES if the two points have the same x's, and the same y's.
*/
CPPointEqualToPoint = CGPointEqualToPoint;
/*!
Test whether the two CGRects have the same origin and size
@group CGRect
@param lhsRect the first CGRect to compare
@param rhsRect the second CGRect to compare
@return BOOL \c YES if the two rectangles have the same origin and size. \c NO, otherwise.
*/
CPRectEqualToRect = CGRectEqualToRect;
/*!
Returns \c YES if the CGRect has no area.
The test is performed by checking if the width and height are both zero.
@group CGRect
@param aRect the CGRect to test
@return BOOL \c YES if the CGRect has no area, and \c NO, otherwise.
*/
CPRectIsEmpty = CGRectIsEmpty;
/*!
Returns a \c BOOL indicating whether CGRect \c possibleOuter
contains CGRect \c possibleInner.
@group CGRect
@param possibleOuter the CGRect to test if \c possibleInner is inside of
@param possibleInner the CGRect to test if it fits inside \c possibleOuter.
@return BOOL \c YES if \c possibleInner fits inside \c possibleOuter.
*/
CPRectContainsRect = CGRectContainsRect;
/*!
Returns the intersection of the two provided rectangles as a new rectangle
@group CGRect
@param lhsRect the first rectangle used for calculation
@param rhsRect the second rectangle used for calculation
@return CGRect the intersection of the two rectangles
*/
CPRectIntersection = CGRectIntersection;
/*!
+34 -34
View File
@@ -14,54 +14,54 @@
[self assertFalse:CPRectContainsRect(CGRectMake(0, 0, 500, 500), CGRectMake(500, 500, 1, 1))];
}
-(void)testCPPointEqualToPoint
- (void)testCPPointEqualToPoint
{
[self assertTrue:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(0, 10), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(0, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 0), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(10, 0))];
[self assertTrue:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(0, 10), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(0, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 0), CGPointMake(10, 10))];
[self assertFalse:CPPointEqualToPoint(CGPointMake(10, 10), CGPointMake(10, 0))];
}
-(void)testCPRectEqualToRect
- (void)testCPRectEqualToRect
{
[self assertTrue:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(50, 0, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(50, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 50, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 50, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 50, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 50, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 50), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 100, 50))];
[self assertTrue:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(50, 0, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(50, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 50, 100, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 50, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 50, 100), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 50, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 50), CGRectMake(0, 0, 100, 100))];
[self assertFalse:CPRectEqualToRect(CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 100, 50))];
}
-(void)textCPRectIsEmpty
- (void)textCPRectIsEmpty
{
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 0, 10))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 10, 0))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, -10, 10))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 10, -10))];
[self assertFalse:CPRectIsEmpty(CGRectMake(0, 0, 10, 10))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 0, 10))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 10, 0))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, -10, 10))];
[self assertTrue:CPRectIsEmpty(CGRectMake(0, 0, 10, -10))];
[self assertFalse:CPRectIsEmpty(CGRectMake(0, 0, 10, 10))];
}
-(void)testCPRectIntersection
- (void)testCPRectIntersection
{
var lhsRect = CGRectMake(0, 0, 20, 20),
rhsRect = CGRectMake(10, 10, 20, 20),
intersectionResultRect = CGRectMake(10, 10, 10, 10);
var lhsRect = CGRectMake(0, 0, 20, 20),
rhsRect = CGRectMake(10, 10, 20, 20),
intersectionResultRect = CGRectMake(10, 10, 10, 10);
[self assertTrue:CPRectEqualToRect(CPRectIntersection(lhsRect, rhsRect), intersectionResultRect)];
intersectionResultRect.origin.x = 30;
intersectionResultRect.origin.y = 30;
[self assertFalse:CPRectEqualToRect(CPRectIntersection(lhsRect, rhsRect), intersectionResultRect)];
[self assertTrue:CPRectEqualToRect(CPRectIntersection(lhsRect, rhsRect), intersectionResultRect)];
intersectionResultRect.origin.x = 30;
intersectionResultRect.origin.y = 30;
[self assertFalse:CPRectEqualToRect(CPRectIntersection(lhsRect, rhsRect), intersectionResultRect)];
}
-(void)testCPPointCreateCopy
- (void)testCPPointCreateCopy
{
var point = CGPointMake(1, 1);
[self assertTrue:CPPointEqualToPoint(CPPointCreateCopy(point),point)];
[self assertFalse:CPPointEqualToPoint(CPPointCreateCopy(point), CGPointMake(0,1))];
var point = CGPointMake(1, 1);
[self assertTrue:CPPointEqualToPoint(CPPointCreateCopy(point),point)];
[self assertFalse:CPPointEqualToPoint(CPPointCreateCopy(point), CGPointMake(0,1))];
}
@end