test/source/screenshot_test.cxx | 47 ++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 25 deletions(-)
New commits: commit dc946a0195781d69770ce709fc77ce13a6164f41 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Oct 22 10:22:05 2018 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Oct 22 15:33:36 2018 +0200 Let CppuniTest's unoexceptionprotector handle uncaught exceptions (it nicely prints exceptions' messages, too) Change-Id: I66bb4fd856d0249a7dc5bc58975b6ea322f9a9ca Reviewed-on: https://gerrit.libreoffice.org/62165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index c20968fd0a88..fbe6ca10b501 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <iostream> + #include <test/screenshot_test.hxx> #include <com/sun/star/util/XCloseable.hpp> @@ -246,34 +250,27 @@ void ScreenshotTest::processDialogBatchFile(const OUString& rFile) while (aStream.ReadLine(aNextUIFile)) { - try + if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment)) { - if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment)) + std::cout << "processing " << aNextUIFile << ":\n"; + + // first check if it's a known dialog + ScopedVclPtr<VclAbstractDialog> pDlg(createDialogByName(aNextUIFile)); + + if (pDlg) { - // first check if it's a known dialog - ScopedVclPtr<VclAbstractDialog> pDlg(createDialogByName(aNextUIFile)); - - if (pDlg) - { - // known dialog, dump screenshot to path - dumpDialogToPath(*pDlg); - } - else - { - // unknown dialog, try fallback to generic created - // VclBuilder-generated instance. Keep in mind that Dialogs - // using this mechanism will probably not be layouted well - // since the setup/initialization part is missing. Thus, - // only use for fallback when only the UI file is available. - dumpDialogToPath(aNextUIFile); - } + // known dialog, dump screenshot to path + dumpDialogToPath(*pDlg); + } + else + { + // unknown dialog, try fallback to generic created + // VclBuilder-generated instance. Keep in mind that Dialogs + // using this mechanism will probably not be layouted well + // since the setup/initialization part is missing. Thus, + // only use for fallback when only the UI file is available. + dumpDialogToPath(aNextUIFile); } - } - catch(...) - { - OString aMsg("Exception while processing "); - aMsg += aNextUIFile; - CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), false); } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits