summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-29 20:45:27 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-29 20:45:56 +0200
commit9c88837f0d8e2f679d779ebb5128ac6e15f022b9 (patch)
treec4ef0d286bbbce765d4d9065d041cd66e2198ba0
parent2b2246bb164ae58a39843218dcbcc425e4c38803 (diff)
SwModelTestBase: allow validating only a subset of the test files
Also, as a start, enable export validation for zoom.docx. Change-Id: I4620fbd516eeb4001770a4d69a89e7831566af92
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx27
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx13
2 files changed, 32 insertions, 8 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index e283bc3050b8..2658f1213d43 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -295,6 +295,14 @@ protected:
return true;
}
+ /**
+ * Override this function if validation is wanted
+ */
+ virtual bool mustValidate(const char* /*filename*/) const
+ {
+ return false;
+ }
+
private:
void dumpLayout()
{
@@ -574,15 +582,18 @@ protected:
xComponent->dispose();
mbExported = true;
mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument");
- if(aFilterName == "Office Open XML Text")
+ if (mustValidate(filename))
{
- // too many validation errors right now
- // validate(maTempFile.GetFileName(), test::OOXML);
- }
- else if(aFilterName == "writer8")
- {
- // still a few validation errors
- // validate(maTempFile.GetFileName(), test::ODF);
+ if(aFilterName == "Office Open XML Text")
+ {
+ // too many validation errors right now
+ validate(maTempFile.GetFileName(), test::OOXML);
+ }
+ else if(aFilterName == "writer8")
+ {
+ // still a few validation errors
+ validate(maTempFile.GetFileName(), test::ODF);
+ }
}
if (mpXmlBuffer)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 78fbb7ece004..32a63d5de784 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -74,6 +74,19 @@ protected:
// If the testcase is stored in some other format, it's pointless to test.
return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end());
}
+
+ /**
+ * Validation handling
+ */
+ bool mustValidate(const char* filename) const SAL_OVERRIDE
+ {
+ const char* aWhitelist[] = {
+ "zoom.docx"
+ };
+ std::vector<const char*> vWhitelist(aWhitelist, aWhitelist + SAL_N_ELEMENTS(aWhitelist));
+
+ return std::find(vWhitelist.begin(), vWhitelist.end(), filename) != vWhitelist.end();
+ }
};
#if !defined(WNT)