summaryrefslogtreecommitdiff
path: root/test/inc/test/xmldiff.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/inc/test/xmldiff.hxx')
-rw-r--r--test/inc/test/xmldiff.hxx70
1 files changed, 3 insertions, 67 deletions
diff --git a/test/inc/test/xmldiff.hxx b/test/inc/test/xmldiff.hxx
index 0d768ae08fdb..cdba298dcc05 100644
--- a/test/inc/test/xmldiff.hxx
+++ b/test/inc/test/xmldiff.hxx
@@ -26,74 +26,10 @@
* instead of those above.
*/
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/xmlmemory.h>
-#include <string>
-#include <set>
#include <test/testdllapi.hxx>
-#define USE_CPPUNIT 1
-
-struct tolerance
-{
- ~tolerance()
- {
- xmlFree(elementName);
- xmlFree(attribName);
- }
-
- tolerance()
- {
- elementName = NULL;
- attribName = NULL;
- }
-
- tolerance(const tolerance& tol)
- {
- elementName = xmlStrdup(tol.elementName);
- attribName = xmlStrdup(tol.attribName);
- relative = tol.relative;
- value = tol.value;
- }
-
- xmlChar* elementName;
- xmlChar* attribName;
- bool relative;
- double value;
- bool operator==(const tolerance& rTol) const { return xmlStrEqual(elementName, rTol.elementName) && xmlStrEqual(attribName, rTol.attribName); }
- bool operator<(const tolerance& rTol) const
- {
- int cmp = xmlStrcmp(elementName, rTol.elementName);
- if(cmp == 0)
- {
- cmp = xmlStrcmp(attribName, rTol.attribName);
- }
-
- if(cmp>=0)
- return false;
- else
- return true;
- }
-};
-
-class OOO_DLLPUBLIC_TEST XMLDiff
-{
-public:
- XMLDiff(const char* pFileName, const char* pContent, int size, const char* pToleranceFileName);
- ~XMLDiff();
-
- bool compare();
-private:
- typedef std::set<tolerance> ToleranceContainer;
-
- void loadToleranceFile(xmlDocPtr xmlTolerance);
- bool compareAttributes(xmlNodePtr node1, xmlNodePtr node2);
- bool compareElements(xmlNodePtr node1, xmlNodePtr node2);
-
- ToleranceContainer toleranceContainer;
- xmlDocPtr xmlFile1;
- xmlDocPtr xmlFile2;
-};
+bool OOO_DLLPUBLIC_TEST
+doXMLDiff(const char* pFileName, const char* pContent, int size,
+ const char* pToleranceFileName);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */