Skip to content

Commit

Permalink
Added Touch tests for Mac and iOS
Browse files Browse the repository at this point in the history
Former-commit-id: dcae1c5
  • Loading branch information
Birkemose committed Sep 5, 2013
1 parent 01b2472 commit f58e68d
Show file tree
Hide file tree
Showing 10 changed files with 421 additions and 3 deletions.
Binary file added Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion cocos2d-tests-ios.xcodeproj/project.pbxproj.REMOVED.git-id
@@ -1 +1 @@
beebf58998216872b5e97e84aac2e9e262b2d9fc
5e199531156af63a8cdf6d0226b8e8f2c44e28de
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED000C17D893DB002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-ios.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED000C17D893DB002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-ios.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED000C17D893DB002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-ios.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED000C17D893DB002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-ios.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion cocos2d-tests-osx.xcodeproj/project.pbxproj.REMOVED.git-id
@@ -1 +1 @@
f8b7649a8e16c62cbed22e039850f3a11b39b80d
801458c2a2f3556c37fce90c26801052b74c6859
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED003717D8978A002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-osx.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED003717D8978A002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-osx.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED003717D8978A002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-osx.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6ED003717D8978A002B4973"
BuildableName = "TouchTest.app"
BlueprintName = "TouchTest"
ReferencedContainer = "container:cocos2d-tests-osx.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
11 changes: 11 additions & 0 deletions cocos2d/CCNode.m
Expand Up @@ -288,6 +288,14 @@ -(void) setVertexZ:(float)vertexZ
_vertexZ = vertexZ;
}

- (void)setVisible:(BOOL)visible
{
if (visible == _visible) return;

[self.responderManager markAsDirty];
_visible = visible;
}

-(float) scale
{
NSAssert( _scaleX == _scaleY, @"CCNode#scale. ScaleX != ScaleY. Don't know which one to return");
Expand Down Expand Up @@ -976,6 +984,9 @@ - (BOOL)hitTestWithWorldPos:(CGPoint)pos {

-( void )buildResponderList {

// dont add invisible nodes
if (self.visible == NO) return;

if ( _children != nil ) {

// add children with zOrder < 0
Expand Down
21 changes: 21 additions & 0 deletions tests/TouchTest.h
@@ -0,0 +1,21 @@
#import "cocos2d.h"
#import "BaseAppController.h"
@class CCLabel;

//CLASS INTERFACE
@interface AppController : BaseAppController
@end

@interface MainLayer : CCLayer

- (void)nextStep;

@end

@interface TouchSprite : CCSprite

@end

@interface CrashSprite : CCSprite

@end

0 comments on commit f58e68d

Please sign in to comment.