diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-25 10:18:11 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-25 11:24:43 +0200 |
commit | ff97d047393c955af2f3173a9c7e2534a059a058 (patch) | |
tree | 8263409f12317204d5a24ad78bb9e9b51ed6e853 /test/source | |
parent | 42a7b48065977d11bc99ab32dadbfde5f1209438 (diff) |
UnoApiTest: use validate when saving files
Change-Id: I0f04fae8b4ff922f5e14ae413cd63cc92a66077e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141797
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'test/source')
-rw-r--r-- | test/source/unoapi_test.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 0cc8bf0e33cc..395a10db1c37 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -22,7 +22,8 @@ using namespace css; using namespace css::uno; UnoApiTest::UnoApiTest(OUString path) - : m_aBaseString(std::move(path)) + : mbSkipValidation(false) + , m_aBaseString(std::move(path)) { } @@ -83,6 +84,32 @@ utl::TempFileNamed UnoApiTest::save(const OUString& rFilter) mxComponent->dispose(); mxComponent.clear(); + if (!mbSkipValidation) + { + if (rFilter == "Office Open XML Text") + validate(aTempFile.GetFileName(), test::OOXML); + else if (rFilter == "Calc Office Open XML") + validate(aTempFile.GetFileName(), test::OOXML); + else if (rFilter == "Impress Office Open XML") + validate(aTempFile.GetFileName(), test::OOXML); + else if (rFilter == "writer8") + validate(aTempFile.GetFileName(), test::ODF); + else if (rFilter == "calc8") + validate(aTempFile.GetFileName(), test::ODF); + else if (rFilter == "impress8") + validate(aTempFile.GetFileName(), test::ODF); + else if (rFilter == "draw8") + validate(aTempFile.GetFileName(), test::ODF); + else if (rFilter == "OpenDocument Text Flat XML") + validate(aTempFile.GetFileName(), test::ODF); + else if (rFilter == "MS Word 97") + validate(aTempFile.GetFileName(), test::MSBINARY); + else if (rFilter == "MS Excel 97") + validate(aTempFile.GetFileName(), test::MSBINARY); + else if (rFilter == "MS PowerPoint 97") + validate(aTempFile.GetFileName(), test::MSBINARY); + } + return aTempFile; } |