diff options
author | Michael Stahl <mst@openoffice.org> | 2010-01-26 14:45:09 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-01-26 14:45:09 +0100 |
commit | 778dd44593d7d5dd7c1021f3de6b5f474dd96cb4 (patch) | |
tree | ca121990da00defeb8022bffdf2c4eb44487a6cb /cppuhelper | |
parent | eaaef94391cd44104989e32939c766ff4ca7d3c9 (diff) | |
parent | b634a5945fc6db6f9587e4504a3f6cafe2279bb0 (diff) |
merge DEV300_m70
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx | 18 | ||||
-rw-r--r-- | cppuhelper/qa/ifcontainer/makefile.mk | 5 | ||||
-rw-r--r-- | cppuhelper/qa/propertysetmixin/makefile.mk | 4 | ||||
-rw-r--r-- | cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/qa/unourl/cppu_unourl.cxx | 24 | ||||
-rw-r--r-- | cppuhelper/qa/unourl/makefile.mk | 5 | ||||
-rw-r--r-- | cppuhelper/qa/weak/makefile.mk | 6 | ||||
-rw-r--r-- | cppuhelper/qa/weak/test_weak.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/interfacecontainer.cxx | 7 | ||||
-rw-r--r-- | cppuhelper/test/testidlclass.cxx | 19 | ||||
-rw-r--r-- | cppuhelper/test/testproptyphlp.cxx | 22 |
11 files changed, 51 insertions, 67 deletions
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx index 89c008195..cfcfebf24 100644 --- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx +++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,7 +28,7 @@ * ************************************************************************/ -#include <cppunit/simpleheader.hxx> +#include <testshl/simpleheader.hxx> #include "com/sun/star/lang/XEventListener.hpp" #include "cppuhelper/interfacecontainer.hxx" @@ -43,7 +43,7 @@ using namespace com::sun::star::lang; struct equalStr { - bool operator()( + bool operator()( const char * const &rA, const char * const &rB) const { return !strcmp(rA, rB); } @@ -119,7 +119,7 @@ namespace cppu_ifcontainer delete pContainer; } - + void testEnumerate() { int i; @@ -205,7 +205,7 @@ namespace cppu_ifcontainer // remove the 1st half of the rest for (i = 0; i < nTests / 2; i++) pContainer->removeInterface(pTypes[i], xRefs[i*2]); - + // check it is half there for (i = 0; i < nTests / 2; i++) { @@ -222,7 +222,7 @@ namespace cppu_ifcontainer void testOMultiTypeInterfaceContainerHelper() { - uno::Type pTypes[nTests] = + uno::Type pTypes[nTests] = { ::cppu::UnoType< bool >::get(), ::cppu::UnoType< float >::get(), @@ -241,7 +241,7 @@ namespace cppu_ifcontainer void testOMultiTypeInterfaceContainerHelperInt32() { - sal_Int32 pTypes[nTests] = + sal_Int32 pTypes[nTests] = { 0, -1, @@ -262,13 +262,13 @@ namespace cppu_ifcontainer typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< const char *,hashStr,equalStr> StrContainer; - const char *pTypes[nTests] = + const char *pTypes[nTests] = { "this_is", "such", "fun", "writing", "unit", "tests", "when", "it", "works", "anyway" }; doContainerTest< StrContainer, const char *> (pTypes); } - + // Automatic registration code CPPUNIT_TEST_SUITE(IfTest); CPPUNIT_TEST(testCreateDispose); diff --git a/cppuhelper/qa/ifcontainer/makefile.mk b/cppuhelper/qa/ifcontainer/makefile.mk index dd6c13fea..624bc797a 100644 --- a/cppuhelper/qa/ifcontainer/makefile.mk +++ b/cppuhelper/qa/ifcontainer/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ ENABLE_EXCEPTIONS=TRUE # BEGIN ---------------------------------------------------------------- -# auto generated Target:joblist by codegen.pl +# auto generated Target:joblist by codegen.pl SHL1OBJS= \ $(SLO)$/cppu_ifcontainer.obj SHL1TARGET= cppu_ifcontainer @@ -49,6 +49,7 @@ SHL1STDLIBS=\ $(CPPUHELPERLIB) \ $(SALLIB) \ $(CPPULIB) \ + $(TESTSHL2LIB)\ $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) diff --git a/cppuhelper/qa/propertysetmixin/makefile.mk b/cppuhelper/qa/propertysetmixin/makefile.mk index b081274d8..2ad56c05f 100644 --- a/cppuhelper/qa/propertysetmixin/makefile.mk +++ b/cppuhelper/qa/propertysetmixin/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ INCPRE += -I$(MISC)$/$(TARGET)$/inc SHL1TARGET = $(TARGET) SHL1OBJS = $(SLO)$/test_propertysetmixin.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) diff --git a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx index 15213132c..ecb7220d1 100644 --- a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx +++ b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,7 +64,7 @@ #include "com/sun/star/uno/XComponentContext.hpp" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/servicefactory.hxx" -#include "cppunit/simpleheader.hxx" +#include "testshl/simpleheader.hxx" #include "osl/mutex.hxx" #include "osl/thread.h" #include "rtl/ref.hxx" diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx index 5d39de84f..f80388d5d 100644 --- a/cppuhelper/qa/unourl/cppu_unourl.cxx +++ b/cppuhelper/qa/unourl/cppu_unourl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,7 +28,7 @@ * ************************************************************************/ -#include <cppunit/simpleheader.hxx> +#include <testshl/simpleheader.hxx> #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -144,7 +144,7 @@ namespace cppu_unourl {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly", aDescriptor.equalsAscii( aTests[i].pDescriptor)); } @@ -191,11 +191,11 @@ namespace cppu_unourl {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly", aName.equalsAscii(aTests[i].pName)); } - } - + } + void testDescriptorKey(void) { struct Test @@ -237,7 +237,7 @@ namespace cppu_unourl {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to detect parameter correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to detect parameter correctly", bPresent == aTests[i].bPresent); } } @@ -306,7 +306,7 @@ namespace cppu_unourl catch (rtl::MalformedUriException &) {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly", aValue.equalsAscii(aTests[i].pValue)); } } @@ -386,7 +386,7 @@ namespace cppu_unourl catch (rtl::MalformedUriException &) {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly", aConnection.equalsAscii( aTests[i].pConnection)); } @@ -420,12 +420,12 @@ namespace cppu_unourl catch (rtl::MalformedUriException &) {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly", aProtocol.equalsAscii( aTests[i].pProtocol)); } } - + void testUrlObjectName() { struct Test @@ -456,7 +456,7 @@ namespace cppu_unourl catch (rtl::MalformedUriException &) {} CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid); - CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly", + CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly", aObjectName.equalsAscii( aTests[i].pObjectName)); } diff --git a/cppuhelper/qa/unourl/makefile.mk b/cppuhelper/qa/unourl/makefile.mk index a611b135c..a999532c5 100644 --- a/cppuhelper/qa/unourl/makefile.mk +++ b/cppuhelper/qa/unourl/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ ENABLE_EXCEPTIONS=TRUE # BEGIN ---------------------------------------------------------------- -# auto generated Target:joblist by codegen.pl +# auto generated Target:joblist by codegen.pl SHL1OBJS= \ $(SLO)$/cppu_unourl.obj SHL1TARGET= cppu_unourl @@ -49,6 +49,7 @@ SHL1STDLIBS=\ $(CPPUHELPERLIB) \ $(SALLIB) \ $(CPPULIB) \ + $(TESTSHL2LIB)\ $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) diff --git a/cppuhelper/qa/weak/makefile.mk b/cppuhelper/qa/weak/makefile.mk index 95f1697ef..bb0072b4d 100644 --- a/cppuhelper/qa/weak/makefile.mk +++ b/cppuhelper/qa/weak/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) SHL1OBJS = $(SLO)$/test_weak.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) SHL1VERSIONMAP = version.map SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) @@ -53,4 +53,4 @@ SLOFILES = $(SHL1OBJS) ALLTAR: test test .PHONY: $(SHL1TARGETN) - testshl2 $(SHL1TARGETN) + $(TESTSHL2) $(SHL1TARGETN) diff --git a/cppuhelper/qa/weak/test_weak.cxx b/cppuhelper/qa/weak/test_weak.cxx index 3b0210823..0cf128d51 100644 --- a/cppuhelper/qa/weak/test_weak.cxx +++ b/cppuhelper/qa/weak/test_weak.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ #include "com/sun/star/uno/XWeak.hpp" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/weak.hxx" -#include "cppunit/simpleheader.hxx" +#include "testshl/simpleheader.hxx" #include "rtl/ref.hxx" #include "sal/types.h" diff --git a/cppuhelper/source/interfacecontainer.cxx b/cppuhelper/source/interfacecontainer.cxx index bf85843ed..8c1c88e71 100644 --- a/cppuhelper/source/interfacecontainer.cxx +++ b/cppuhelper/source/interfacecontainer.cxx @@ -40,13 +40,6 @@ #include <hash_map> -#if OSL_DEBUG_LEVEL == 0 -# ifndef NDEBUG -# define NDEBUG -# endif -#endif -#include <assert.h> - #include <com/sun/star/lang/XEventListener.hpp> diff --git a/cppuhelper/test/testidlclass.cxx b/cppuhelper/test/testidlclass.cxx index 4c96c011e..27a9fac58 100644 --- a/cppuhelper/test/testidlclass.cxx +++ b/cppuhelper/test/testidlclass.cxx @@ -30,11 +30,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppuhelper.hxx" -#if OSL_DEBUG_LEVEL == 0 -#undef NDEBUG -#define NDEBUG -#endif -#include <assert.h> #include <cppuhelper/stdidlclass.hxx> @@ -65,18 +60,18 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr) (XServiceInfo * ) 0 ); - assert( r.is() ); + OSL_ASSERT( r.is() ); { // test the xidlclassprovider interface ! Reference< XIdlClassProvider > rProv( r , UNO_QUERY ); - assert( rProv.is() ); + OSL_ASSERT( rProv.is() ); { Sequence < Reference < XIdlClass > > seq = rProv->getIdlClasses(); // is always one - assert( seq.getLength() == 1 ); + OSL_ASSERT( seq.getLength() == 1 ); // test the weak reference rProv->getIdlClasses(); @@ -89,7 +84,7 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr) } - assert( r->getName() == sImplName ); + OSL_ASSERT( r->getName() == sImplName ); // test equals Reference < XIdlClass > r2 = @@ -101,18 +96,18 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr) (XServiceInfo * ) 0 ); // test for implementation name - assert( r2->equals( r ) ); + OSL_ASSERT( r2->equals( r ) ); Sequence < Reference < XIdlClass > > seqIdlClass = r->getInterfaces(); //TODO ! // one idl class for one interface // this test fails, if core reflection fails ! -// assert( 1 == seqIdlClass.getLength() ); +// OSL_ASSERT( 1 == seqIdlClass.getLength() ); // Reference < XIdlClass > rIdlInterface = seqIdlClass.getArray()[0]; // check for IdlClass interface returned by Core Reflection -// assert( rIdlInterface.is() ); +// OSL_ASSERT( rIdlInterface.is() ); diff --git a/cppuhelper/test/testproptyphlp.cxx b/cppuhelper/test/testproptyphlp.cxx index bb1137393..6a10d7e0e 100644 --- a/cppuhelper/test/testproptyphlp.cxx +++ b/cppuhelper/test/testproptyphlp.cxx @@ -34,12 +34,6 @@ #include <com/sun/star/beans/Property.hpp> -#if OSL_DEBUG_LEVEL == 0 -#undef NDEBUG -#define NDEBUG -#endif -#include <assert.h> - using namespace ::com::sun::star::uno; using namespace ::cppu; @@ -51,27 +45,27 @@ void testPropertyTypeHelper() sal_Int32 i; convertPropertyValue( i , a ); - assert( 25 == i ); + OSL_ASSERT( 25 == i ); sal_Int16 i16; convertPropertyValue( i16 , a ); - assert( 25 == i16 ); + OSL_ASSERT( 25 == i16 ); sal_Int8 i8; convertPropertyValue( i8 , a ); - assert( 25 == i8 ); + OSL_ASSERT( 25 == i8 ); sal_uInt32 i32; convertPropertyValue( i32 , a ); - assert( 25 == i32 ); + OSL_ASSERT( 25 == i32 ); double d; convertPropertyValue( d , a ); - assert( 25. == d ); + OSL_ASSERT( 25. == d ); float f; convertPropertyValue( f , a ); - assert( 25. == f ); + OSL_ASSERT( 25. == f ); ::com::sun::star::beans::Property prop; @@ -83,11 +77,11 @@ void testPropertyTypeHelper() ::com::sun::star::beans::Property prop2; convertPropertyValue( prop2 , a ); - assert( prop.Handle == prop2.Handle && prop.Name == prop2.Name && prop.Attributes == prop2.Attributes ); + OSL_ASSERT( prop.Handle == prop2.Handle && prop.Name == prop2.Name && prop.Attributes == prop2.Attributes ); ::rtl::OUString ow; a <<= prop.Name; convertPropertyValue( ow , a ); - assert( ow == prop.Name ); + OSL_ASSERT( ow == prop.Name ); } |