[Libreoffice-commits] .: slideshow/test

Thorsten Behrens thorsten at kemper.freedesktop.org
Mon Nov 15 09:38:47 PST 2010


 slideshow/test/demoshow.cxx  |   12 ++++++++++--
 slideshow/test/export.map    |    2 +-
 slideshow/test/makefile.mk   |   12 +++++++++++-
 slideshow/test/slidetest.cxx |    9 +++++++--
 slideshow/test/testshape.cxx |    5 ++++-
 slideshow/test/testview.cxx  |   19 ++++++++++++++++++-
 slideshow/test/views.cxx     |   12 ++++--------
 7 files changed, 55 insertions(+), 16 deletions(-)

New commits:
commit 237451956a5b98a0169001f2617a43c3cbff615d
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Sun Nov 7 00:15:27 2010 +0100

    Make slideshow unittest work again
    
    Well, it still fails. But for all the right reasons.

diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx
index be3edd1..d7825db 100644
--- a/slideshow/test/demoshow.cxx
+++ b/slideshow/test/demoshow.cxx
@@ -54,6 +54,7 @@
 #include <ucbhelper/configurationkeys.hxx>
 
 #include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <basegfx/tools/canvastools.hxx>
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
@@ -199,6 +200,11 @@ private:
     {
     }
 
+    virtual awt::Rectangle SAL_CALL getCanvasArea(  ) throw (uno::RuntimeException)
+    {
+        return awt::Rectangle(0,0,maSize.Width(),maSize.Height());
+    }
+
     uno::Reference< rendering::XSpriteCanvas > mxCanvas;
     ::cppu::OInterfaceContainerHelper          maPaintListeners;
     ::cppu::OInterfaceContainerHelper          maTransformationListeners;
@@ -418,7 +424,7 @@ DemoWindow::DemoWindow() :
     maUpdateTimer(),
     mbSlideDisplayed( false )
 {
-    SetText( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Slideshow Demo" )) );
+    SetText( rtl::OUString::createFromAscii( "Slideshow Demo" ) );
     SetSizePixel( Size( 640, 480 ) );
     EnablePaint( true );
 
@@ -456,11 +462,13 @@ void DemoWindow::init()
         if( mxShow.is() && !mbSlideDisplayed )
         {
             uno::Reference< drawing::XDrawPage > xSlide( new DummySlide );
+            uno::Reference< drawing::XDrawPages > xDrawPages;
             mxShow->displaySlide( xSlide,
+                                  uno::Reference< drawing::XDrawPagesSupplier >(),
                                   uno::Reference< animations::XAnimationNode >(), 
                                   uno::Sequence< beans::PropertyValue >() );
             mxShow->setProperty( beans::PropertyValue( 
-                                     rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RehearseTimings")),
+                                     rtl::OUString::createFromAscii("RehearseTimings"),
                                      0,
                                      uno::makeAny( sal_True ),
                                      beans::PropertyState_DIRECT_VALUE ));
diff --git a/slideshow/test/export.map b/slideshow/test/export.map
index f313c44..0dbbcc5 100644
--- a/slideshow/test/export.map
+++ b/slideshow/test/export.map
@@ -27,7 +27,7 @@
 
 UDK_3_0_0 {
     global:
-        registerAllTestFunction;
+        cppunitTestPlugIn;
 
     local:
         *;
diff --git a/slideshow/test/makefile.mk b/slideshow/test/makefile.mk
index c86d166..c7f63bb 100644
--- a/slideshow/test/makefile.mk
+++ b/slideshow/test/makefile.mk
@@ -39,6 +39,15 @@ ENABLE_EXCEPTIONS=TRUE
 .INCLUDE :  settings.mk
 .INCLUDE : $(PRJ)$/util$/makefile.pmk
 
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
 # --- Common ----------------------------------------------------------
 
 # BEGIN target1 -------------------------------------------------------
@@ -53,7 +62,6 @@ SHL1STDLIBS= 	$(SALLIB)		 \
                 $(BASEGFXLIB)	 \
                 $(CPPUHELPERLIB) \
                 $(CPPULIB)		 \
-                                $(TESTSHL2LIB)    \
                 $(CPPUNITLIB)	 \
                 $(UNOTOOLSLIB)	 \
                 $(VCLLIB)
@@ -68,6 +76,8 @@ SHL1IMPLIB= i$(SHL1TARGET)
 
 DEF1NAME    =$(SHL1TARGET)
 SHL1VERSIONMAP = export.map
+SHL1RPATH = NONE
+
 # END target1 ----------------------------------------------------------
 
 # BEGIN target2 --------------------------------------------------------
diff --git a/slideshow/test/slidetest.cxx b/slideshow/test/slidetest.cxx
index f868b8f..c8589cc 100644
--- a/slideshow/test/slidetest.cxx
+++ b/slideshow/test/slidetest.cxx
@@ -26,7 +26,11 @@
  *
  ************************************************************************/
 
-#include <testshl/simpleheader.hxx>
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "cppunit/plugin/TestPlugIn.h"
+
 #include <cppuhelper/compbase1.hxx>
 #include <comphelper/broadcasthelper.hxx>
 
@@ -365,8 +369,9 @@ public:
 }; // class LayerManagerTest
 
 // -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(LayerManagerTest, "LayerManagerTest");
+CPPUNIT_TEST_SUITE_REGISTRATION(LayerManagerTest);
 } // namespace
 
+CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/test/testshape.cxx b/slideshow/test/testshape.cxx
index 0dee26c..e0d290b 100644
--- a/slideshow/test/testshape.cxx
+++ b/slideshow/test/testshape.cxx
@@ -26,7 +26,10 @@
  *
  ************************************************************************/
 
-#include <testshl/simpleheader.hxx>
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
 #include <cppuhelper/compbase1.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <comphelper/make_shared_from_uno.hxx>
diff --git a/slideshow/test/testview.cxx b/slideshow/test/testview.cxx
index 0f47670..1b06b71 100644
--- a/slideshow/test/testview.cxx
+++ b/slideshow/test/testview.cxx
@@ -26,7 +26,10 @@
  *
  ************************************************************************/
 
-#include <testshl/simpleheader.hxx>
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
 #include <cppuhelper/compbase1.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <comphelper/make_shared_from_uno.hxx>
@@ -134,6 +137,11 @@ public:
     {
     }
 
+    virtual awt::Rectangle SAL_CALL getCanvasArea(  ) throw (uno::RuntimeException)
+    {
+        return awt::Rectangle(0,0,100,100);
+    }
+
     // TestView
     virtual bool isClearCalled() const
     {
@@ -276,6 +284,15 @@ public:
     {
         mbDisposed = true;
     }
+
+    virtual bool isSoundEnabled (void) const
+    {
+        return true;
+    }
+
+    virtual void setIsSoundEnabled (const bool /*bValue*/)
+    {
+    }
 };
 
 
diff --git a/slideshow/test/views.cxx b/slideshow/test/views.cxx
index c04adc7..964e7ec 100644
--- a/slideshow/test/views.cxx
+++ b/slideshow/test/views.cxx
@@ -26,7 +26,10 @@
  *
  ************************************************************************/
 
-#include <testshl/simpleheader.hxx>
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
 #include <cppuhelper/compbase1.hxx>
 #include <comphelper/broadcasthelper.hxx>
 
@@ -82,11 +85,4 @@ public:
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(UnoViewContainerTest, "UnoViewContainerTest");
 } // namespace
 
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-NOADDITIONAL;
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list