Skip to content

Commit

Permalink
Fixed failing xml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srinner committed Aug 13, 2021
1 parent a1416ec commit 9d9c4bc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ + (instancetype)parseFromElement:(GDataXMLElement*)xmlElement withContext:(CBXML
[XMLError exceptionIfNode:referencedObjectElement isNilOrNodeNameNotEquals:@"object"];
} else if([referencedObjectElement.name isEqualToString:@"destinationSprite"]) {
[XMLError exceptionIfNode:referencedObjectElement isNilOrNodeNameNotEquals:@"destinationSprite"];
} if ([referencedObjectElement.name isEqualToString:@"objectToClone"]) {
} else if ([referencedObjectElement.name isEqualToString:@"objectToClone"]) {
[XMLError exceptionIfNode:referencedObjectElement isNilOrNodeNameNotEquals:@"objectToClone"];
} else {
[XMLError exceptionIfNode:referencedObjectElement isNilOrNodeNameNotEquals:@"pointedObject"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,11 @@
<brick type="CloneBrick">
<commentedOut>false</commentedOut>
</brick>
</brickList>
<brick type="CloneBrick">
<brick type="CloneBrick">
<commentedOut>false</commentedOut>
<objectToClone reference="../../../../../../object[1]"/>
</brick>
</brickList>
<commentedOut>false</commentedOut>
<isUserScript>false</isUserScript>
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,15 @@ class XMLParserTests0992: XMLAbstractTest {

XCTAssertTrue(setTempoToBrick.isKind(of: SetTempoToBrick.self), "Invalid brick type")
}

func testCreateCloneOfBrick() {
let project = self.getProjectForXML(xmlFile: "ValidProjectAllBricks0992")
var createCloneOfBrick = (project.scene.object(at: 1)!.scriptList.object(at: 0) as! Script).brickList.object(at: 6) as! Brick

XCTAssertTrue(createCloneOfBrick.isKind(of: CloneBrick.self), "Invalid brick type")

createCloneOfBrick = (project.scene.object(at: 1)!.scriptList.object(at: 0) as! Script).brickList.object(at: 7) as! Brick

XCTAssertTrue(createCloneOfBrick.isKind(of: CloneBrick.self), "Invalid brick type")
}
}

0 comments on commit 9d9c4bc

Please sign in to comment.