[Libreoffice-commits] core.git: test/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 22 13:34:00 UTC 2018


 test/source/screenshot_test.cxx |   47 ++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

New commits:
commit dc946a0195781d69770ce709fc77ce13a6164f41
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Oct 22 10:22:05 2018 +0200
Commit:     Stephan Bergmann <sbergman at 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 <sbergman at 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);
         }
     }
 }


More information about the Libreoffice-commits mailing list