diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-27 13:50:37 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-27 13:52:10 +0200 |
commit | 60d39b758dc9308d6ce7464875b3a17f26be3d79 (patch) | |
tree | b0708313ae88484eff0ddf1960bf77af2dc31d9c /test | |
parent | 7fd546207223f3a5d86f4d9399df52da9fbb9c23 (diff) |
add tolerance to chart regression test
Change-Id: I5e7694571815df48e54488a33435bb7d022e6889
Diffstat (limited to 'test')
-rw-r--r-- | test/inc/test/xmldiff.hxx | 2 | ||||
-rw-r--r-- | test/source/diff/diff.cxx | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/inc/test/xmldiff.hxx b/test/inc/test/xmldiff.hxx index a787132347d4..c0926371b8e0 100644 --- a/test/inc/test/xmldiff.hxx +++ b/test/inc/test/xmldiff.hxx @@ -78,7 +78,7 @@ class OOO_DLLPUBLIC_TEST XMLDiff public: XMLDiff(const std::string& file1, const std::string& file2, const std::string& toleranceFile); XMLDiff(const std::string& file1, const std::string& file2); - XMLDiff(const char* pFileName, const char* pContent, int size); + XMLDiff(const char* pFileName, const char* pContent, int size, const char* pToleranceFileName); ~XMLDiff(); bool compare(); 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; } |