[Libreoffice-commits] .: 2 commits - test/inc test/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jul 1 01:10:04 PDT 2011


 test/inc/test/gettestargument.hxx                               |    3 
 test/inc/test/uniquepipename.hxx                                |    3 
 test/source/cpp/getargument.hxx                                 |    3 
 test/source/cpp/gettestargument.cxx                             |    3 
 test/source/cpp/uniquepipename.cxx                              |    3 
 test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx |   33 ++++++++--
 6 files changed, 44 insertions(+), 4 deletions(-)

New commits:
commit 3e5b29719087d32cbb7c3c13406fd3e5251973bb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 30 16:02:33 2011 +0100

    add mode-lines

diff --git a/test/inc/test/gettestargument.hxx b/test/inc/test/gettestargument.hxx
index 21b9df7..4fe1114 100644
--- a/test/inc/test/gettestargument.hxx
+++ b/test/inc/test/gettestargument.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,3 +45,5 @@ OOO_DLLPUBLIC_TEST bool getTestArgument(
 }
 
 #endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/inc/test/uniquepipename.hxx b/test/inc/test/uniquepipename.hxx
index 4b96586..b66492c 100644
--- a/test/inc/test/uniquepipename.hxx
+++ b/test/inc/test/uniquepipename.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ OOO_DLLPUBLIC_TEST rtl::OUString uniquePipeName(rtl::OUString const & name);
 }
 
 #endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/cpp/getargument.hxx b/test/source/cpp/getargument.hxx
index 4ba7e0f..3380fdd 100644
--- a/test/source/cpp/getargument.hxx
+++ b/test/source/cpp/getargument.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
@@ -42,3 +43,5 @@ bool getArgument(
 }
 
 #endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/cpp/gettestargument.cxx b/test/source/cpp/gettestargument.cxx
index 757faa7..0bc0006 100644
--- a/test/source/cpp/gettestargument.cxx
+++ b/test/source/cpp/gettestargument.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,3 +42,5 @@ bool getTestArgument(rtl::OUString const & name, rtl::OUString * value) {
 }
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/cpp/uniquepipename.cxx b/test/source/cpp/uniquepipename.cxx
index c7614f4..8cb409f 100644
--- a/test/source/cpp/uniquepipename.cxx
+++ b/test/source/cpp/uniquepipename.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@ rtl::OUString uniquePipeName(rtl::OUString const & name) {
 }
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
index b6ac122..e58c78e 100644
--- a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
+++ b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
@@ -116,3 +117,5 @@ extern "C" SAL_DLLPUBLIC_EXPORT CppUnit::Protector * SAL_CALL
 unoexceptionprotector() {
     return new Prot;
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit aa6235b3c80ca629c824a0457bb61d126adba59e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 30 16:00:46 2011 +0100

    implement additional context-less protection api

diff --git a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
index da54d62..b6ac122 100644
--- a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
+++ b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
@@ -28,6 +28,7 @@
 
 #include <limits>
 #include <string>
+#include <iostream>
 
 #include "boost/noncopyable.hpp"
 #include "com/sun/star/uno/Any.hxx"
@@ -39,8 +40,8 @@
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
 
+#include "protectorfactory.hxx"
 #include "cppunit/Message.h"
-#include "cppunit/Protector.h"
 
 namespace {
 
@@ -57,7 +58,8 @@ std::string convert(rtl::OUString const & s16) {
          : static_cast< std::string::size_type >(s8.getLength())));
 }
 
-class Prot: public CppUnit::Protector, private boost::noncopyable {
+class Prot : public cppunittester::LibreOfficeProtector, private boost::noncopyable
+{
 public:
     Prot() {}
 
@@ -66,6 +68,8 @@ public:
     virtual bool protect(
         CppUnit::Functor const & functor,
         CppUnit::ProtectorContext const & context);
+
+    virtual bool protect(CppUnit::Functor const & functor);
 };
 
 bool Prot::protect(
@@ -73,7 +77,7 @@ bool Prot::protect(
 {
     try {
         return functor();
-    } catch (css::uno::Exception & e) {
+    } catch (const css::uno::Exception &e) {
         css::uno::Any a(cppu::getCaughtException());
         reportError(
             context,
@@ -81,13 +85,31 @@ bool Prot::protect(
                 convert(
                     rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM(
-                            "uncaught exception of type "))
+                            "An uncaught exception of type "))
                     + a.getValueTypeName()),
                 convert(e.Message)));
     }
     return false;
 }
 
+bool Prot::protect(CppUnit::Functor const & functor)
+{
+    try {
+        return functor();
+    } catch (const css::uno::Exception &e) {
+        css::uno::Any a(cppu::getCaughtException());
+        std::cerr
+            << convert(rtl::OUString(
+                        RTL_CONSTASCII_USTRINGPARAM(
+                            "An uncaught exception of type "))
+                        + a.getValueTypeName())
+            << std::endl << "Exception Message was: " << convert(e.Message)
+            << std::endl;
+        throw;
+    }
+    return false;
+}
+
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT CppUnit::Protector * SAL_CALL


More information about the Libreoffice-commits mailing list