From e0d8cad5b1e01ebde69031091007720c4b9d78b4 Mon Sep 17 00:00:00 2001 From: slembcke Date: Wed, 28 Oct 2015 14:30:36 -0500 Subject: [PATCH] ObjectiveChipmunk fixes. --- objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h | 1 + objectivec/src/ChipmunkSpace.m | 1 + xcode/ObjectiveChipmunkTests/MemoryTest.m | 1 + xcode/ObjectiveChipmunkTests/SpaceTest.m | 6 +++--- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h b/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h index b037a811..07d5cfd2 100644 --- a/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h +++ b/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h @@ -32,6 +32,7 @@ #endif #import "chipmunk/chipmunk.h" +#import "chipmunk/chipmunk_structs.h" /** Allows you to add composite objects to a space in a single method call. diff --git a/objectivec/src/ChipmunkSpace.m b/objectivec/src/ChipmunkSpace.m index 7d56b676..347aa95a 100644 --- a/objectivec/src/ChipmunkSpace.m +++ b/objectivec/src/ChipmunkSpace.m @@ -20,6 +20,7 @@ */ #import "ObjectiveChipmunk/ObjectiveChipmunk.h" +#import "chipmunk/chipmunk_private.h" #import "chipmunk/cpHastySpace.h" #import diff --git a/xcode/ObjectiveChipmunkTests/MemoryTest.m b/xcode/ObjectiveChipmunkTests/MemoryTest.m index a517230d..77a12a12 100644 --- a/xcode/ObjectiveChipmunkTests/MemoryTest.m +++ b/xcode/ObjectiveChipmunkTests/MemoryTest.m @@ -22,6 +22,7 @@ #import #import "ObjectiveChipmunk/ObjectiveChipmunk.h" +#import "chipmunk/chipmunk_private.h" #define AssertRetainCount(obj, count) XCTAssertEqual([obj retainCount], (NSUInteger)count, @"") diff --git a/xcode/ObjectiveChipmunkTests/SpaceTest.m b/xcode/ObjectiveChipmunkTests/SpaceTest.m index 425fd274..c956053f 100644 --- a/xcode/ObjectiveChipmunkTests/SpaceTest.m +++ b/xcode/ObjectiveChipmunkTests/SpaceTest.m @@ -99,7 +99,7 @@ -(void)testProperties { XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, nil]), @""); set = pointQueryInfoToShapes([space pointQueryAll:cpv(-1,-1) maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); - XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + XCTAssertEqualObjects(set, ([NSSet set]), @""); cpSpacePointQuery_b(space.space, cpv(-0.6, -0.6), 0.0, CP_SHAPE_FILTER_ALL, ^(cpShape *shape, cpVect p, cpFloat d, cpVect g){ XCTAssertEqual(shape, segment.shape, @""); @@ -129,7 +129,7 @@ -(void)testProperties { XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(2,2) to:cpv(3,3) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); - XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + XCTAssertEqualObjects(set, ([NSSet set]), @""); ChipmunkSegmentQueryInfo *segmentInfo = nil; segmentInfo = [space segmentQueryFirstFrom:cpv(-2,-2) to:cpv(1,1) radius:0.0 filter:CP_SHAPE_FILTER_ALL]; @@ -191,7 +191,7 @@ -(void)testProperties { queryBody.position = cpv(4,4); set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); - XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + XCTAssertEqualObjects(set, ([NSSet set]), @""); [space remove:circle]; [space remove:segment];