Kaydet (Commit) 9c88837f authored tarafından Miklos Vajna's avatar Miklos Vajna

SwModelTestBase: allow validating only a subset of the test files

Also, as a start, enable export validation for zoom.docx.

Change-Id: I4620fbd516eeb4001770a4d69a89e7831566af92
üst 2b2246bb
...@@ -295,6 +295,14 @@ protected: ...@@ -295,6 +295,14 @@ protected:
return true; return true;
} }
/**
* Override this function if validation is wanted
*/
virtual bool mustValidate(const char* /*filename*/) const
{
return false;
}
private: private:
void dumpLayout() void dumpLayout()
{ {
...@@ -574,15 +582,18 @@ protected: ...@@ -574,15 +582,18 @@ protected:
xComponent->dispose(); xComponent->dispose();
mbExported = true; mbExported = true;
mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument"); mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument");
if(aFilterName == "Office Open XML Text") if (mustValidate(filename))
{ {
// too many validation errors right now if(aFilterName == "Office Open XML Text")
// validate(maTempFile.GetFileName(), test::OOXML); {
} // too many validation errors right now
else if(aFilterName == "writer8") validate(maTempFile.GetFileName(), test::OOXML);
{ }
// still a few validation errors else if(aFilterName == "writer8")
// validate(maTempFile.GetFileName(), test::ODF); {
// still a few validation errors
validate(maTempFile.GetFileName(), test::ODF);
}
} }
if (mpXmlBuffer) if (mpXmlBuffer)
......
...@@ -74,6 +74,19 @@ protected: ...@@ -74,6 +74,19 @@ protected:
// If the testcase is stored in some other format, it's pointless to test. // 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()); 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) #if !defined(WNT)
......
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