diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-22 10:22:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-22 15:33:36 +0200 |
commit | dc946a0195781d69770ce709fc77ce13a6164f41 (patch) | |
tree | 2b2e7bcb847512cad170416bf80febc7f4d2306d /test/source | |
parent | 1a6552c5d96626112608eee204f51bdc71da1fc2 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'test/source')
-rw-r--r-- | test/source/screenshot_test.cxx | 47 |
1 files changed, 22 insertions, 25 deletions
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); } } } |