summaryrefslogtreecommitdiff
path: root/testxml/testxml.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-20 00:32:53 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-20 00:32:53 +0200
commit274882231e3996948849ceabd2dbeadc5bca0494 (patch)
tree5c21fede126c2ce04c9414289005c2560745a081 /testxml/testxml.py
parentc933307f77af600ccd0f0c0e80ad8e57a81e7c89 (diff)
downloadtools-274882231e3996948849ceabd2dbeadc5bca0494.tar.gz
tools-274882231e3996948849ceabd2dbeadc5bca0494.tar.bz2
tools-274882231e3996948849ceabd2dbeadc5bca0494.tar.xz
tools-274882231e3996948849ceabd2dbeadc5bca0494.zip
Add to testxml checking in monsters.xml for targetcursor and is particle file exist.
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-xtestxml/testxml.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index ca1dab1..8d1804a 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -655,8 +655,30 @@ def testMonsters(fileName):
errors = errors + 1
name = ""
+ testTargetCursor(id, node, fileName)
testSprites(id, node, False, True)
testSounds(id, node, "monster")
+ testParticles(id, node, "particlefx")
+
+
+def testTargetCursor(id, node, file):
+ try:
+ targetCursor = node.attributes["targetCursor"].value
+ if targetCursor != "small" and targetCursor != "medium" and targetCursor != "large":
+ showMsgFile(id, "unknown target cursor " + targetCursor)
+ except:
+ None
+
+def testParticles(id, node, nodeName):
+ particles = node.getElementsByTagName(nodeName)
+ for particle in particles:
+ try:
+ particlefx = particle.childNodes[0].data
+ except:
+ showMsgFile(id, "particle tag have incorrect data", True)
+
+ testParticle(particlefx)
+
def testSounds(id, node, type):
@@ -675,6 +697,7 @@ def testSounds(id, node, type):
elif type == "item":
if event != "hit" and event != "strike":
print "error: incorrect sound event name " + event + " in id=" + id
+ errors = errors + 1
testSound(sound.childNodes[0].data)