Commit a5f605e4 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[fuzzycompare]

fixed error occuring with last commit, that "test passed" was printed
even though the test failed and output of the corresponding vtu file
paths was suppressed

reviewed by Beatrix



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14421 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent dd9d5b98
...@@ -9,6 +9,7 @@ def isFuzzyEqualXml(xml1, xml2, absolute, relative): ...@@ -9,6 +9,7 @@ def isFuzzyEqualXml(xml1, xml2, absolute, relative):
# fuzzy compare of XML nodes # fuzzy compare of XML nodes
def isFuzzyEqualNode(node1, node2, absolute, relative): def isFuzzyEqualNode(node1, node2, absolute, relative):
noError = True
if node1.tagName != node2.tagName: if node1.tagName != node2.tagName:
print 'The name of the node differs in ', node1.tagName, ' and ', node2.tagName print 'The name of the node differs in ', node1.tagName, ' and ', node2.tagName
return False return False
...@@ -24,10 +25,12 @@ def isFuzzyEqualNode(node1, node2, absolute, relative): ...@@ -24,10 +25,12 @@ def isFuzzyEqualNode(node1, node2, absolute, relative):
return False return False
if node1child.nodeType == node1child.TEXT_NODE and not isFuzzyEqualText(node1child.data, node2child.data, absolute, relative): if node1child.nodeType == node1child.TEXT_NODE and not isFuzzyEqualText(node1child.data, node2child.data, absolute, relative):
print 'Data differs in parameter ', node2.attributes.items(), ' at node ', node2child.nodeType print 'Data differs in parameter ', node2.attributes.items(), ' at node ', node2child.nodeType
noError = False
continue continue
if node1child.nodeType == node1child.ELEMENT_NODE and not isFuzzyEqualNode(node1child, node2child, absolute, relative): if node1child.nodeType == node1child.ELEMENT_NODE and not isFuzzyEqualNode(node1child, node2child, absolute, relative):
return False noError = False
return True continue
return noError
# fuzzy compare of text consisting of whitespace separated numbers # fuzzy compare of text consisting of whitespace separated numbers
def isFuzzyEqualText(text1, text2, absolute, relative): def isFuzzyEqualText(text1, text2, absolute, relative):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment