File tree Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 11
11
#import " CCPackage.h"
12
12
#import " CCFileUtils.h"
13
13
#import " CCSprite.h"
14
+ #import " CCBReader.h"
15
+ #import " AppDelegate.h"
14
16
15
17
@interface CCPackageCocos2dEnablerTests : XCTestCase
16
18
@@ -25,6 +27,7 @@ @implementation CCPackageCocos2dEnablerTests
25
27
- (void )setUp
26
28
{
27
29
[super setUp ];
30
+ [(AppController *)[UIApplication sharedApplication ].delegate configureCocos2d ];
28
31
29
32
self.package = [[CCPackage alloc ] initWithName: @" Foo"
30
33
resolution: @" phonehd"
@@ -36,14 +39,6 @@ - (void)setUp
36
39
[_package setValue: _installURL forKey: NSStringFromSelector (@selector (installURL ))];
37
40
}
38
41
39
- - (void )tearDown
40
- {
41
- CCPackageCocos2dEnabler *packageEnabler = [[CCPackageCocos2dEnabler alloc ] init ];
42
- [packageEnabler disablePackages: @[_package]];
43
-
44
- [super tearDown ];
45
- }
46
-
47
42
- (void )testEnablePackage
48
43
{
49
44
CCPackageCocos2dEnabler *packageEnabler = [[CCPackageCocos2dEnabler alloc ] init ];
@@ -56,6 +51,7 @@ - (void)testEnablePackage
56
51
XCTAssertNotNil (sprite);
57
52
}
58
53
54
+ /*
59
55
- (void)testDisablePackage
60
56
{
61
57
[self testEnablePackage];
@@ -72,6 +68,7 @@ - (void)testDisablePackage
72
68
NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:@"boredSmiley.png" contentScale:&scale];
73
69
XCTAssertNil(path);
74
70
}
71
+ */
75
72
76
73
- (BOOL )isPackageInSearchPath
77
74
{
Original file line number Diff line number Diff line change 2
2
#import " cocos2d.h"
3
3
4
4
#import " CCTextureCache.h"
5
+ #import " CCBReader.h"
6
+ #import " AppDelegate.h"
5
7
6
8
@interface CCTextureTests : XCTestCase
7
9
@end
8
10
9
11
@implementation CCTextureTests
10
12
13
+
14
+ - (void )setUp
15
+ {
16
+ [super setUp ];
17
+
18
+ [(AppController *)[UIApplication sharedApplication ].delegate configureCocos2d ];
19
+ }
20
+
11
21
-(void )testTextureCache
12
22
{
13
23
__weak CCTexture *textures[4 ];
Original file line number Diff line number Diff line change 29
29
{
30
30
}
31
31
32
+ - (void )configureCocos2d ;
33
+
32
34
- (void )configureFileUtilsSearchPathAndRegisterSpriteSheets ;
33
35
34
36
@end
Original file line number Diff line number Diff line change 31
31
@implementation AppController
32
32
33
33
- (BOOL )application : (UIApplication *)application didFinishLaunchingWithOptions : (NSDictionary *)launchOptions
34
+ {
35
+ [self configureCocos2d ];
36
+
37
+ return YES ;
38
+ }
39
+
40
+ - (void )configureCocos2d
34
41
{
35
42
// Configure the file utils to work with SpriteBuilder, but use a custom resource path (Resources-shared instead of Published-iOS)
36
43
[CCBReader configureCCFileUtils ];
@@ -44,8 +51,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
44
51
CCSetupTabletScale2X: @YES ,
45
52
// CCSetupShowDebugStats: @YES,
46
53
}];
47
-
48
- return YES ;
49
54
}
50
55
51
56
- (void )configureFileUtilsSearchPathAndRegisterSpriteSheets
You can’t perform that action at this time.
0 commit comments