summaryrefslogtreecommitdiff
path: root/test/source/diff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-27 13:50:37 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-27 13:52:10 +0200
commit60d39b758dc9308d6ce7464875b3a17f26be3d79 (patch)
treeb0708313ae88484eff0ddf1960bf77af2dc31d9c /test/source/diff
parent7fd546207223f3a5d86f4d9399df52da9fbb9c23 (diff)
add tolerance to chart regression test
Change-Id: I5e7694571815df48e54488a33435bb7d022e6889
Diffstat (limited to 'test/source/diff')
-rw-r--r--test/source/diff/diff.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/source/diff/diff.cxx b/test/source/diff/diff.cxx
index 8587fd799eb0..574805dc9c68 100644
--- a/test/source/diff/diff.cxx
+++ b/test/source/diff/diff.cxx
@@ -56,10 +56,14 @@ XMLDiff::XMLDiff(const std::string& file1, const std::string& file2)
xmlFile2 = xmlParseFile(file2.c_str());
}
-XMLDiff::XMLDiff( const char* pFileName, const char* pContent, int size)
+XMLDiff::XMLDiff( const char* pFileName, const char* pContent, int size, const char* pToleranceFile)
{
xmlFile1 = xmlParseFile(pFileName);
xmlFile2 = xmlParseMemory(pContent, size);
+
+ xmlDocPtr xmlToleranceFile = xmlParseFile(pToleranceFile);
+ loadToleranceFile(xmlToleranceFile);
+ xmlFreeDoc(xmlToleranceFile);
}
XMLDiff::~XMLDiff()
@@ -84,7 +88,9 @@ void readAttributesForTolerance(xmlNodePtr node, tolerance& tol)
tol.value = val;
xmlChar* relative = xmlGetProp(node, BAD_CAST("relative"));
- bool rel = xmlXPathCastStringToBoolean(relative);
+ bool rel = false;
+ if(xmlStrEqual(relative, BAD_CAST("true")))
+ rel = true;
xmlFree(relative);
tol.relative = rel;
}