diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
commit | 4e5441dc51affb4fd2529bcd9557202be2e5c8ba (patch) | |
tree | 98660d6bdc3a2b151643ce3f768def0cf9ef0eeb | |
parent | 0518cf8899d02f1d0810fd971fe4dca2474c26c6 (diff) | |
parent | 99ff4b156eae57e51ffef715a6184038df745236 (diff) |
cws tl74: merge with DEV300_m81
393 files changed, 4218 insertions, 13530 deletions
diff --git a/bridges/prj/build.lst b/bridges/prj/build.lst index c6e342520672..0e7979742562 100644 --- a/bridges/prj/build.lst +++ b/bridges/prj/build.lst @@ -12,16 +12,17 @@ br bridges\source\cpp_uno\gcc3_os2_intel nmake - p br_gcc3os br_cppuno_shared br br bridges\source\cpp_uno\gcc3_freebsd_intel nmake - u br_gcc3fi br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_linux_x86-64 nmake - u br_gcc3lx br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_freebsd_x86-64 nmake - u br_gcc3fx br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_powerpc nmake - u br_gcclp3 br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_powerpc64 nmake - u br_gcclp3_64 br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_mips nmake - u br_gcc3mips br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_m68k nmake - u br_gcc3m68k br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_s390 nmake - u br_gccl33 br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gccl3x br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gccl3s br_unotypes br_cppuno_shared br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gccl3r br_unotypes NULL -br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gccl3a br_unotypes NULL -br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gccl3h br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_powerpc nmake - u br_gcc3lp br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_powerpc64 nmake - u br_gcc3lp_64 br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_mips nmake - u br_gcc3lmips br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_m68k nmake - u br_gcc3lm68k br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_s390 nmake - u br_gcc3l3 br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gcc3l3_64 br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gcc3ls br_unotypes br_cppuno_shared br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gcc3lr br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gcc3la br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gcc3lh br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_alpha nmake - u br_gcc3ll br_unotypes NULL br bridges\source\cpp_uno\gcc3_macosx_intel nmake - u br_gcc3macoxi br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_macosx_powerpc nmake - u br_gcc3macoxp br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\cc50_solaris_sparc nmake - u br_cc50sols br_unotypes br_cppuno_shared br_inc NULL diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk index 1e00634bd6a3..87ff690dd653 100644 --- a/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk @@ -77,8 +77,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx new file mode 100644 index 000000000000..abc5ce67e4b4 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -0,0 +1,676 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <com/sun/star/uno/genfunc.hxx> +#include <uno/data.h> +#include <typelib/typedescription.hxx> + +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/vtablefactory.hxx" + +#include "share.hxx" +#include <stdio.h> + +//Calling Standards: +// "Calling Standard for Alpha Systems" +// (Tru64 UNIX Version 5.1 or higher, August 2000) +//http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V51_HTML/ARH9MBTE/TITLE.HTM + +using namespace ::com::sun::star::uno; + +namespace +{ +static typelib_TypeClass cpp2uno_call( + bridges::cpp_uno::shared::CppInterfaceProxy * pThis, + const typelib_TypeDescription * pMemberTypeDescr, + typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return + sal_Int32 nParams, typelib_MethodParameter * pParams, + void ** gpreg, void ** fpreg, void ** ovrflw, + sal_Int64 * pRegisterReturn /* space for register return */ ) +{ +#ifdef CMC_DEBUG + fprintf(stderr, "as far as cpp2uno_call\n"); +#endif + int nregs = 0; //number of words passed in registers + + // gpreg: [ret *], this, [gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] + + // return + typelib_TypeDescription * pReturnTypeDescr = 0; + if (pReturnTypeRef) + TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); + + void * pUnoReturn = 0; + void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need + + if (pReturnTypeDescr) + { + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) + { + pUnoReturn = pRegisterReturn; // direct way for simple types + } + else // complex return via ptr (pCppReturn) + { + pCppReturn = *(void **)gpreg; + gpreg++; + fpreg++; + nregs++; + + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) + ? alloca( pReturnTypeDescr->nSize ) + : pCppReturn); // direct way + } + } + // pop this + gpreg++; + fpreg++; + nregs++; + + // stack space + OSL_ENSURE( sizeof(void *) == sizeof(sal_Int64), "### unexpected size!" ); + // parameters + void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); + void ** pCppArgs = pUnoArgs + nParams; + // indizes of values this have to be converted (interface conversion cpp<=>uno) + sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); + // type descriptions for reconversions + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); + + sal_Int32 nTempIndizes = 0; + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) + { + const typelib_MethodParameter & rParam = pParams[nPos]; + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + +#ifdef CMC_DEBUG + fprintf(stderr, "arg %d of %d\n", nPos, nParams); +#endif + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value + { +#ifdef CMC_DEBUG + fprintf(stderr, "simple type is %d\n", pParamTypeDescr->eTypeClass); +#endif + + switch (pParamTypeDescr->eTypeClass) + { + case typelib_TypeClass_FLOAT: + case typelib_TypeClass_DOUBLE: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + if (pParamTypeDescr->eTypeClass == typelib_TypeClass_FLOAT) + { + float tmp = (float) (*((double *)fpreg)); + (*((float *) fpreg)) = tmp; + } + + pCppArgs[nPos] = pUnoArgs[nPos] = fpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_BYTE: + case typelib_TypeClass_BOOLEAN: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + default: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + } + + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + else // ptr to complex value | ref + { +#ifdef CMC_DEBUG + fprintf(stderr, "complex, nregs is %d\n", nregs); +#endif + + void *pCppStack; //temporary stack pointer + + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pCppStack = *gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pCppStack = *ovrflw; + ovrflw++; + } + + if (! rParam.bIn) // is pure out + { + // uno out is unconstructed mem! + pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ); + pTempIndizes[nTempIndizes] = nPos; + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + // is in/inout + else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) + { + uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pCppStack, pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + else // direct way + { + pUnoArgs[nPos] = pCppStack; + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + } + } + +#ifdef CMC_DEBUG + fprintf(stderr, "end of params\n"); +#endif + + // ExceptionHolder + uno_Any aUnoExc; // Any will be constructed by callee + uno_Any * pUnoExc = &aUnoExc; + + // invoke uno dispatch call + (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); + + // in case an exception occured... + if (pUnoExc) + { + // destruct temporary in/inout params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + + if (pParams[nIndex].bIn) // is in/inout => was constructed + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); + TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); + } + if (pReturnTypeDescr) + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any + // is here for dummy + return typelib_TypeClass_VOID; + } + else // else no exception occured... + { + // temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; + + if (pParams[nIndex].bOut) // inout/out + { + // convert and assign + uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); + uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + } + // destroy temp uno param + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); + + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + // return + if (pCppReturn) // has complex return + { + if (pUnoReturn != pCppReturn) // needs reconversion + { + uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + // destroy temp uno return + uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); + } + // complex return ptr is set to return reg + *(void **)pRegisterReturn = pCppReturn; + } + if (pReturnTypeDescr) + { + typelib_TypeClass eRet = (typelib_TypeClass)pReturnTypeDescr->eTypeClass; + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + return eRet; + } + else + return typelib_TypeClass_VOID; + } +} + + +//============================================================================ +static typelib_TypeClass cpp_mediate( + sal_uInt64 nOffsetAndIndex, + void ** gpreg, void ** fpreg, void ** ovrflw, + sal_Int64 * pRegisterReturn /* space for register return */ ) +{ + OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); + + sal_Int32 nVtableOffset = (nOffsetAndIndex >> 32); + sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF); + +#ifdef CMC_DEBUG + fprintf(stderr, "nVTableOffset, nFunctionIndex are %x %x\n", nVtableOffset, nFunctionIndex); +#endif + +#ifdef CMC_DEBUG + // Let's figure out what is really going on here + { + fprintf( stderr, "= cpp_mediate () =\nGPR's (%d): ", 6 ); + for ( unsigned int i = 0; i < 6; ++i ) + fprintf( stderr, "0x%lx, ", gpreg[i] ); + fprintf( stderr, "\n"); + fprintf( stderr, "\nFPR's (%d): ", 6 ); + for ( unsigned int i = 0; i < 6; ++i ) + fprintf( stderr, "0x%lx (%f), ", fpreg[i], fpreg[i] ); + fprintf( stderr, "\n"); + } +#endif + + + // gpreg: [ret *], this, [other gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] + + // _this_ ptr is patched cppu_XInterfaceProxy object + void * pThis; + if( nFunctionIndex & 0x80000000 ) + { + nFunctionIndex &= 0x7fffffff; + pThis = gpreg[1]; + } + else + { + pThis = gpreg[0]; + } + + pThis = static_cast< char * >(pThis) - nVtableOffset; + + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI + = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( + pThis); + + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); + + + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); + if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) + { + throw RuntimeException( + rtl::OUString::createFromAscii("illegal vtable index!"), + (XInterface *)pCppI ); + } + + // determine called method + OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); + sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; + OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); + + TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); + + typelib_TypeClass eRet; + switch (aMemberDescr.get()->eTypeClass) + { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex) + { + // is GET method + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef, + 0, 0, // no params + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + else + { + // is SET method + typelib_MethodParameter aParam; + aParam.pTypeRef = + ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; + aParam.bIn = sal_True; + aParam.bOut = sal_False; + + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + 0, // indicates void return + 1, &aParam, + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + break; + } + case typelib_TypeClass_INTERFACE_METHOD: + { + // is METHOD + switch (nFunctionIndex) + { + case 1: // acquire() + pCppI->acquireProxy(); // non virtual call! + eRet = typelib_TypeClass_VOID; + break; + case 2: // release() + pCppI->releaseProxy(); // non virtual call! + eRet = typelib_TypeClass_VOID; + break; + case 0: // queryInterface() opt + { + typelib_TypeDescription * pTD = 0; + TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( gpreg[2] )->getTypeLibType() ); + if (pTD) + { + XInterface * pInterface = 0; + (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( + pCppI->getBridge()->getCppEnv(), + (void **)&pInterface, pCppI->getOid().pData, + (typelib_InterfaceTypeDescription *)pTD ); + + if (pInterface) + { + ::uno_any_construct( + reinterpret_cast< uno_Any * >( gpreg[0] ), + &pInterface, pTD, cpp_acquire ); + pInterface->release(); + TYPELIB_DANGER_RELEASE( pTD ); + *(void **)pRegisterReturn = gpreg[0]; + eRet = typelib_TypeClass_ANY; + break; + } + TYPELIB_DANGER_RELEASE( pTD ); + } + } // else perform queryInterface() + default: + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef, + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams, + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams, + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + break; + } + default: + { + throw RuntimeException( + rtl::OUString::createFromAscii("no member description found!"), + (XInterface *)pCppI ); + // is here for dummy + eRet = typelib_TypeClass_VOID; + } + } + + return eRet; +} + +long cpp_vtable_call(long r16, long r17, long r18, long r19, long r20, long r21, long firstonstack) +{ + register long r1 asm("$1"); + sal_uInt64 nOffsetAndIndex = r1; + + long sp = (long)&firstonstack; + + sal_uInt64 gpreg[axp::MAX_GPR_REGS]; + gpreg[0] = r16; + gpreg[1] = r17; + gpreg[2] = r18; + gpreg[3] = r19; + gpreg[4] = r20; + gpreg[5] = r21; + + double fpreg[axp::MAX_SSE_REGS]; + register double f16 asm("$f16"); fpreg[0] = f16; + register double f17 asm("$f17"); fpreg[1] = f17; + register double f18 asm("$f18"); fpreg[2] = f18; + register double f19 asm("$f19"); fpreg[3] = f19; + register double f20 asm("$f20"); fpreg[4] = f20; + register double f21 asm("$f21"); fpreg[5] = f21; + + volatile long nRegReturn[1]; +#ifdef CMC_DEBUG + fprintf(stderr, "before mediate with %lx\n",nOffsetAndIndex); + fprintf(stderr, "non-doubles are %x %x %x %x %x %x\n", gpreg[0], gpreg[1], gpreg[2], gpreg[3], gpreg[4], gpreg[5]); + fprintf(stderr, "doubles are %f %f %f %f %f %f\n", fpreg[0], fpreg[1], fpreg[2], fpreg[3], fpreg[4], fpreg[5]); +#endif + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, + (sal_Int64*)nRegReturn ); +#ifdef CMC_DEBUG + fprintf(stderr, "after mediate ret is %lx %ld\n", nRegReturn[0], nRegReturn[0]); +#endif + + switch( aType ) + { + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + nRegReturn[0] = (unsigned long)(*(unsigned char *)nRegReturn); + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + case typelib_TypeClass_SHORT: + nRegReturn[0] = (unsigned long)(*(unsigned short *)nRegReturn); + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_LONG: + nRegReturn[0] = (unsigned long)(*(unsigned int *)nRegReturn); + break; + case typelib_TypeClass_VOID: + default: + break; + case typelib_TypeClass_FLOAT: + { + double tmp = (double) (*((float *)nRegReturn)); + (*((double *) nRegReturn)) = tmp; + } + //deliberate fall through + case typelib_TypeClass_DOUBLE: + __asm__ ( "ldt $f0,%0\n\t" + : : "m" (*((double*)nRegReturn)) : "$f0"); + break; + } + return nRegReturn[0]; +} + +const int codeSnippetSize = 32; + +unsigned char *codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool simple_ret_type ) +{ + if (! simple_ret_type) + nFunctionIndex |= 0x80000000; + + unsigned char * p = code; + *(unsigned int*)&p[0] = 0x47fb0401; /* mov $27,$1 */ + *(unsigned int*)&p[4] = 0xa43b0010; /* ldq $1,16($27) */ + *(unsigned int*)&p[8] = 0xa77b0018; /* ldq $27,24($27) */ + *(unsigned int*)&p[12] = 0x6bfb0000; /* jmp $31,($27),0 */ + *(unsigned int*)&p[16] = nFunctionIndex; + *(unsigned int*)&p[20] = nVtableOffset; + *(unsigned long*)&p[24] = (unsigned long)cpp_vtable_call; + return (code + codeSnippetSize); +} +} + +void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const *, unsigned char const *) +{ + //http://www.gnu.org/software/lightning/manual/html_node/Standard-functions.html + __asm__ __volatile__("call_pal 0x86"); +} + +struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; + +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) +{ + return static_cast< Slot * >(block) + 2; +} + +sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( + sal_Int32 slotCount) +{ + return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; +} + +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::initializeBlock( + void * block, sal_Int32 slotCount) +{ + Slot * slots = mapBlockToVtable(block); + slots[-2].fn = 0; + slots[-1].fn = 0; + return slots + slotCount; +} + +unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( + Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff, + typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, + sal_Int32 functionCount, sal_Int32 vtableOffset) +{ + (*slots) -= functionCount; + Slot * s = *slots; +#ifdef CMC_DEBUG + fprintf(stderr, "in addLocalFunctions functionOffset is %x\n",functionOffset); + fprintf(stderr, "in addLocalFunctions vtableOffset is %x\n",vtableOffset); +#endif + + for (sal_Int32 i = 0; i < type->nMembers; ++i) { + typelib_TypeDescription * member = 0; + TYPELIB_DANGER_GET(&member, type->ppMembers[i]); + OSL_ASSERT(member != 0); + switch (member->eTypeClass) { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + // Getter: + (s++)->fn = code + writetoexecdiff; + code = codeSnippet( + code, functionOffset++, vtableOffset, + bridges::cpp_uno::shared::isSimpleType( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription * >( + member)->pAttributeTypeRef)); + + // Setter: + if (!reinterpret_cast< + typelib_InterfaceAttributeTypeDescription * >( + member)->bReadOnly) + { + (s++)->fn = code + writetoexecdiff; + code = codeSnippet(code, functionOffset++, vtableOffset, true); + } + break; + + case typelib_TypeClass_INTERFACE_METHOD: + (s++)->fn = code + writetoexecdiff; + code = codeSnippet( + code, functionOffset++, vtableOffset, + bridges::cpp_uno::shared::isSimpleType( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription * >( + member)->pReturnTypeRef)); + break; + + default: + OSL_ASSERT(false); + break; + } + TYPELIB_DANGER_RELEASE(member); + } + return code; +} + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx new file mode 100644 index 000000000000..3e666a11cdd0 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx @@ -0,0 +1,287 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <stdio.h> +#include <string.h> +#include <dlfcn.h> +#include <cxxabi.h> +#include <hash_map> + +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> +#include <osl/diagnose.h> +#include <osl/mutex.hxx> + +#include <com/sun/star/uno/genfunc.hxx> +#include <typelib/typedescription.hxx> +#include <uno/any2.h> + +#include "share.hxx" + + +using namespace ::std; +using namespace ::osl; +using namespace ::rtl; +using namespace ::com::sun::star::uno; +using namespace ::__cxxabiv1; + + +namespace CPPU_CURRENT_NAMESPACE +{ + +void dummy_can_throw_anything( char const * ) +{ +} + +//================================================================================================== +static OUString toUNOname( char const * p ) SAL_THROW( () ) +{ +#if OSL_DEBUG_LEVEL > 1 + char const * start = p; +#endif + + // example: N3com3sun4star4lang24IllegalArgumentExceptionE + + OUStringBuffer buf( 64 ); + OSL_ASSERT( 'N' == *p ); + ++p; // skip N + + while ('E' != *p) + { + // read chars count + long n = (*p++ - '0'); + while ('0' <= *p && '9' >= *p) + { + n *= 10; + n += (*p++ - '0'); + } + buf.appendAscii( p, n ); + p += n; + if ('E' != *p) + buf.append( (sal_Unicode)'.' ); + } + +#if OSL_DEBUG_LEVEL > 1 + OUString ret( buf.makeStringAndClear() ); + OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); + fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() ); + return ret; +#else + return buf.makeStringAndClear(); +#endif +} + +//================================================================================================== +class RTTI +{ + typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; + + Mutex m_mutex; + t_rtti_map m_rttis; + t_rtti_map m_generatedRttis; + + void * m_hApp; + +public: + RTTI() SAL_THROW( () ); + ~RTTI() SAL_THROW( () ); + + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); +}; +//__________________________________________________________________________________________________ +RTTI::RTTI() SAL_THROW( () ) + : m_hApp( dlopen( 0, RTLD_LAZY ) ) +{ +} +//__________________________________________________________________________________________________ +RTTI::~RTTI() SAL_THROW( () ) +{ + dlclose( m_hApp ); +} + +//__________________________________________________________________________________________________ +type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) +{ + type_info * rtti; + + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; + + MutexGuard guard( m_mutex ); + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) + { + // RTTI symbol + OStringBuffer buf( 64 ); + buf.append( RTL_CONSTASCII_STRINGPARAM("_ZTIN") ); + sal_Int32 index = 0; + do + { + OUString token( unoName.getToken( 0, '.', index ) ); + buf.append( token.getLength() ); + OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) ); + buf.append( c_token ); + } + while (index >= 0); + buf.append( 'E' ); + + OString symName( buf.makeStringAndClear() ); + rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); + + if (rtti) + { + pair< t_rtti_map::iterator, bool > insertion( + m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); + OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" ); + } + else + { + // try to lookup the symbol in the generated rtti map + t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) ); + if (iFind == m_generatedRttis.end()) + { + // we must generate it ! + // symbol and rtti-name is nearly identical, + // the symbol is prefixed with _ZTI + char const * rttiName = symName.getStr() +4; +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr,"generated rtti for %s\n", rttiName ); +#endif + if (pTypeDescr->pBaseTypeDescription) + { + // ensure availability of base + type_info * base_rtti = getRTTI( + (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription ); + rtti = new __si_class_type_info( + strdup( rttiName ), (__class_type_info *)base_rtti ); + } + else + { + // this class has no base class + rtti = new __class_type_info( strdup( rttiName ) ); + } + + pair< t_rtti_map::iterator, bool > insertion( + m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); + OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); + } + else // taking already generated rtti + { + rtti = iFind->second; + } + } + } + else + { + rtti = iRttiFind->second; + } + + return rtti; +} + +//-------------------------------------------------------------------------------------------------- +static void deleteException( void * pExc ) +{ + __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); + typelib_TypeDescription * pTD = 0; + OUString unoName( toUNOname( header->exceptionType->name() ) ); + ::typelib_typedescription_getByName( &pTD, unoName.pData ); + OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" ); + if (pTD) + { + ::uno_destructData( pExc, pTD, cpp_release ); + ::typelib_typedescription_release( pTD ); + } +} + +//================================================================================================== +void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) +{ + void * pCppExc; + type_info * rtti; + + { + // construct cpp exception object + typelib_TypeDescription * pTypeDescr = 0; + TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType ); + OSL_ASSERT( pTypeDescr ); + if (! pTypeDescr) + terminate(); + + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); + ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); + + // destruct uno exception + ::uno_any_destruct( pUnoExc, 0 ); + // avoiding locked counts + static RTTI * s_rtti = 0; + if (! s_rtti) + { + MutexGuard guard( Mutex::getGlobalMutex() ); + if (! s_rtti) + { +#ifdef LEAK_STATIC_DATA + s_rtti = new RTTI(); +#else + static RTTI rtti_data; + s_rtti = &rtti_data; +#endif + } + } + rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); + TYPELIB_DANGER_RELEASE( pTypeDescr ); + OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); + if (! rtti) + terminate(); + } + + __cxa_throw( pCppExc, rtti, deleteException ); +} + +//================================================================================================== +void fillUnoException( __cxa_exception * header, uno_Any * pExc, uno_Mapping * pCpp2Uno ) +{ + OSL_ENSURE( header, "### no exception header!!!" ); + if (! header) + terminate(); + + typelib_TypeDescription * pExcTypeDescr = 0; + OUString unoName( toUNOname( header->exceptionType->name() ) ); + ::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); + OSL_ENSURE( pExcTypeDescr, "### can not get type description for exception!!!" ); + if (! pExcTypeDescr) + terminate(); + + // construct uno exception any + ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno ); + ::typelib_typedescription_release( pExcTypeDescr ); +} + +} +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/sal/qa/osl/semaphore/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_alpha/makefile.mk index 3cab9d650477..2650c4376933 100644 --- a/sal/qa/osl/semaphore/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/makefile.mk @@ -27,35 +27,51 @@ PRJ=..$/..$/.. -PRJNAME=sal -TARGET=qa_osl_semaphore - +PRJNAME=bridges +TARGET=gcc3_uno +LIBTARGET=no ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk -CFLAGS+= $(LFS_CFLAGS) -CXXFLAGS+= $(LFS_CFLAGS) +# --- Files -------------------------------------------------------- + +.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXL" + +.IF "$(cppu_no_leak)" == "" +CFLAGS += -DLEAK_STATIC_DATA +.ENDIF + +# In case someone enabled the non-standard -fomit-frame-pointer which does not +# work with the .cxx sources in this directory: +CFLAGSCXX += -fno-omit-frame-pointer -# BEGIN ---------------------------------------------------------------- -# auto generated Target:Semaphore by codegen.pl -SHL1OBJS= \ - $(SLO)$/osl_Semaphore.obj +CFLAGSNOOPT=-O0 -SHL1TARGET= osl_Semaphore -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SLOFILES= \ + $(SLO)$/except.obj \ + $(SLO)$/cpp2uno.obj \ + $(SLO)$/uno2cpp.obj -SHL1IMPLIB= i$(SHL1TARGET) +SHL1TARGET= $(TARGET) -DEF1NAME =$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +SHL1IMPLIB=i$(TARGET) +SHL1VERSIONMAP=..$/..$/bridge_exports.map +SHL1RPATH=URELIB -# auto generated Target:Semaphore -# END ------------------------------------------------------------------ +SHL1OBJS = $(SLOFILES) +SHL1LIBS = $(SLB)$/cpp_uno_shared.lib + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(SALLIB) + +.ENDIF # --- Targets ------------------------------------------------------ .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx new file mode 100644 index 000000000000..c2f0189a2065 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "uno/mapping.h" + +#include <typeinfo> +#include <exception> +#include <cstddef> + +namespace CPPU_CURRENT_NAMESPACE +{ + + void dummy_can_throw_anything( char const * ); + + +// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h + +struct _Unwind_Exception +{ + unsigned exception_class __attribute__((__mode__(__DI__))); + void * exception_cleanup; + unsigned private_1 __attribute__((__mode__(__word__))); + unsigned private_2 __attribute__((__mode__(__word__))); +} __attribute__((__aligned__)); + +struct __cxa_exception +{ + ::std::type_info *exceptionType; + void (*exceptionDestructor)(void *); + + ::std::unexpected_handler unexpectedHandler; + ::std::terminate_handler terminateHandler; + + __cxa_exception *nextException; + + int handlerCount; + + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + void *catchTemp; + void *adjustedPtr; + + _Unwind_Exception unwindHeader; +}; + +extern "C" void *__cxa_allocate_exception( + std::size_t thrown_size ) throw(); +extern "C" void __cxa_throw ( + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); + +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; +extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); + +// ----- + +//================================================================================================== +void raiseException( + uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); +//================================================================================================== +void fillUnoException( + __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); +} + +namespace axp +{ + enum axplimits { MAX_WORDS_IN_REGS = 6, MAX_GPR_REGS = 6, MAX_SSE_REGS = 6 }; +} + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx new file mode 100644 index 000000000000..7f51d425806c --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx @@ -0,0 +1,532 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <malloc.h> + +#include <com/sun/star/uno/genfunc.hxx> +#include <uno/data.h> + +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" +#include "bridges/cpp_uno/shared/vtables.hxx" + +#include "share.hxx" + +#include <stdio.h> +#include <string.h> + + +using namespace ::rtl; +using namespace ::com::sun::star::uno; + +void MapReturn(long r0, typelib_TypeClass eTypeClass, sal_uInt64* pRegisterReturn) +{ + register float fret asm("$f0"); + register double dret asm("$f0"); + +#ifdef CMC_DEBUG + fprintf(stderr,"Mapping Return with %lx %ld %f\n", r0, r0, dret); +#endif + switch (eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: + *pRegisterReturn = r0; + break; + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: + *(unsigned int*)pRegisterReturn = (unsigned int)r0; + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + *(unsigned short*)pRegisterReturn = (unsigned short)r0; + break; + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + *(unsigned char*)pRegisterReturn = (unsigned char)r0; + break; + case typelib_TypeClass_FLOAT: + *reinterpret_cast<float *>( pRegisterReturn ) = fret; + break; + case typelib_TypeClass_DOUBLE: + *reinterpret_cast<double *>( pRegisterReturn ) = dret; + break; + default: + break; + } +#ifdef CMC_DEBUG + fprintf(stderr, "end of MapReturn with %x\n", pRegisterReturn ? *pRegisterReturn : 0); +#endif +} + +#define INSERT_FLOAT( pSV, nr, pFPR, pDS ) \ + { \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + { \ + pFPR[nr++] = *reinterpret_cast<float *>( pSV ); \ + } \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); \ + } + +#define INSERT_DOUBLE( pSV, nr, pFPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim! + +#define INSERT_INT64( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt64 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); + +#define INSERT_INT32( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV ); + +#define INSERT_INT16( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV ); + +#define INSERT_INT8( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); + +namespace +{ +//================================================================================================== +void callVirtualMethod( + void * pThis, sal_Int32 nVtableIndex, + void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, + sal_uInt64 *pStack, sal_uInt32 nStack, + sal_uInt64 *pGPR, sal_uInt32 nGPR, + double *pFPR, sal_uInt32 nFPR) +{ + // Should not happen, but... + if ( nFPR > axp::MAX_SSE_REGS ) + nFPR = axp::MAX_SSE_REGS; + if ( nGPR > axp::MAX_GPR_REGS ) + nGPR = axp::MAX_GPR_REGS; + +#ifdef CMC_DEBUG + // Let's figure out what is really going on here + { + fprintf( stderr, "= nStack is %d\n", nStack ); + fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR ); + for ( unsigned int i = 0; i < nGPR; ++i ) + fprintf( stderr, "0x%lx, ", pGPR[i] ); + fprintf( stderr, "\nFPR's (%d): ", nFPR ); + for ( unsigned int i = 0; i < nFPR; ++i ) + fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); + fprintf( stderr, "\nStack (%d): ", nStack ); + for ( unsigned int i = 0; i < nStack; ++i ) + fprintf( stderr, "0x%lx, ", pStack[i] ); + fprintf( stderr, "\n" ); + fprintf( stderr, "pRegisterReturn is %p\n", pRegisterReturn); + } +#endif + + // Load parameters to stack, if necessary + // Stack, if used, must be 8-bytes aligned + sal_uInt64 *stack = (sal_uInt64 *) __builtin_alloca( nStack * 8 ); + memcpy( stack, pStack, nStack * 8 ); + + // To get pointer to method + // a) get the address of the vtable + sal_uInt64 pMethod = *((sal_uInt64 *)pThis); + // b) get the address from the vtable entry at offset + pMethod += 8 * nVtableIndex; + pMethod = *((sal_uInt64 *)pMethod); + + typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 ); + FunctionCall pFunc = (FunctionCall)pMethod; + + switch (nFPR) //deliberate fall through + { + case 6: + asm volatile("ldt $f16,%0" :: "m"(pFPR[5]) : "$f16"); + case 5: + asm volatile("ldt $f17,%0" :: "m"(pFPR[4]) : "$f17"); + case 4: + asm volatile("ldt $f18,%0" :: "m"(pFPR[3]) : "$f18"); + case 3: + asm volatile("ldt $f19,%0" :: "m"(pFPR[2]) : "$f19"); + case 2: + asm volatile("ldt $f20,%0" :: "m"(pFPR[1]) : "$f20"); + case 1: + asm volatile("ldt $f21,%0" :: "m"(pFPR[0]) : "$f21"); + default: + break; + } + + (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5]); + register sal_uInt64 r0 __asm__("$0"); + MapReturn(r0, pReturnTypeDescr->eTypeClass, (sal_uInt64*)pRegisterReturn); +} + + +//============================================================================ +static void cpp_call( + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, + bridges::cpp_uno::shared::VtableSlot aVtableSlot, + typelib_TypeDescriptionReference * pReturnTypeRef, + sal_Int32 nParams, typelib_MethodParameter * pParams, + void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) +{ + // max space for: [complex ret ptr], values|ptr ... + sal_uInt64 * pStack = (sal_uInt64 *)alloca( (nParams+3) * sizeof(sal_Int64) ); + sal_uInt64 * pStackStart = pStack; + + sal_uInt64 pGPR[axp::MAX_GPR_REGS]; + double pFPR[axp::MAX_SSE_REGS]; + sal_uInt32 nRegs = 0; + + // return + typelib_TypeDescription * pReturnTypeDescr = 0; + TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); + OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); + + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion + + if (pReturnTypeDescr) + { + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) + { + pCppReturn = pUnoReturn; // direct way for simple types + } + else + { + // complex return via ptr + pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) + ? alloca( pReturnTypeDescr->nSize ) + : pUnoReturn); // direct way + INSERT_INT64( &pCppReturn, nRegs, pGPR, pStack ); + } + } + // push "this" pointer + void * pAdjustedThisPtr = reinterpret_cast< void ** >( pThis->getCppI() ) + aVtableSlot.offset; + + INSERT_INT64( &pAdjustedThisPtr, nRegs, pGPR, pStack ); + + // stack space + OSL_ENSURE( sizeof(void *) == sizeof(sal_Int64), "### unexpected size!" ); + // args + void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); + // indizes of values this have to be converted (interface conversion cpp<=>uno) + sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); + // type descriptions for reconversions + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); + + sal_Int32 nTempIndizes = 0; + + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) + { + const typelib_MethodParameter & rParam = pParams[nPos]; + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + { + uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + + switch (pParamTypeDescr->eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: + INSERT_INT64( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: + INSERT_INT32( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_SHORT: + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + INSERT_INT16( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + INSERT_INT8( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_FLOAT: + INSERT_FLOAT( pCppArgs[nPos], nRegs, pFPR, pStack ); + break; + case typelib_TypeClass_DOUBLE: + INSERT_DOUBLE( pCppArgs[nPos], nRegs, pFPR, pStack ); + break; + default: + break; + } + + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + else // ptr to complex value | ref + { + if (! rParam.bIn) // is pure out + { + // cpp out is constructed mem, uno out is not! + uno_constructData( + pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pParamTypeDescr ); + pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + // is in/inout + else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) + { + uno_copyAndConvertData( + pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); + + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + else // direct way + { + pCppArgs[nPos] = pUnoArgs[nPos]; + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + INSERT_INT64( &(pCppArgs[nPos]), nRegs, pGPR, pStack ); + } + } + + try + { + callVirtualMethod( + pAdjustedThisPtr, aVtableSlot.index, + pCppReturn, pReturnTypeDescr, + pStackStart, (pStack - pStackStart), + pGPR, nRegs, + pFPR, nRegs ); + // NO exception occured... + *ppUnoExc = 0; + + // reconvert temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; + + if (pParams[nIndex].bIn) + { + if (pParams[nIndex].bOut) // inout + { + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value + uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + } + } + else // pure out + { + uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + } + // destroy temp cpp param => cpp: every param was constructed + uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); + + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + // return value + if (pCppReturn && pUnoReturn != pCppReturn) + { + uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release ); + } + } + catch (...) + { + // fill uno exception + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + + + // temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + // destroy temp cpp param => cpp: every param was constructed + uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); + TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); + } + // return type + if (pReturnTypeDescr) + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + } +} +} + +namespace bridges { namespace cpp_uno { namespace shared { + +void unoInterfaceProxyDispatch( + uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr, + void * pReturn, void * pArgs[], uno_Any ** ppException ) +{ +#ifdef CMC_DEBUG + fprintf(stderr, "unoInterfaceProxyDispatch\n"); +#endif + + + // is my surrogate + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); + + switch (pMemberDescr->eTypeClass) + { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription const * >( + pMemberDescr))); + + if (pReturn) + { + // dependent dispatch + cpp_call( + pThis, aVtableSlot, + ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, + 0, 0, // no params + pReturn, pArgs, ppException ); + } + else + { + // is SET + typelib_MethodParameter aParam; + aParam.pTypeRef = + ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; + aParam.bIn = sal_True; + aParam.bOut = sal_False; + + typelib_TypeDescriptionReference * pReturnTypeRef = 0; + OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); + typelib_typedescriptionreference_new( + &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); + + // dependent dispatch + aVtableSlot.index += 1; //get then set method + cpp_call( + pThis, aVtableSlot, + pReturnTypeRef, + 1, &aParam, + pReturn, pArgs, ppException ); + + typelib_typedescriptionreference_release( pReturnTypeRef ); + } + + break; + } + case typelib_TypeClass_INTERFACE_METHOD: + { + + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription const * >( + pMemberDescr))); + switch (aVtableSlot.index) + { + // standard calls + case 1: // acquire uno interface + (*pUnoI->acquire)( pUnoI ); + *ppException = 0; + break; + case 2: // release uno interface + (*pUnoI->release)( pUnoI ); + *ppException = 0; + break; + case 0: // queryInterface() opt + { + typelib_TypeDescription * pTD = 0; + TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() ); + if (pTD) + { + uno_Interface * pInterface = 0; + (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( + pThis->pBridge->getUnoEnv(), + (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); + + if (pInterface) + { + ::uno_any_construct( + reinterpret_cast< uno_Any * >( pReturn ), + &pInterface, pTD, 0 ); + (*pInterface->release)( pInterface ); + TYPELIB_DANGER_RELEASE( pTD ); + *ppException = 0; + break; + } + TYPELIB_DANGER_RELEASE( pTD ); + } + } // else perform queryInterface() + default: + // dependent dispatch + cpp_call( + pThis, aVtableSlot, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, + pReturn, pArgs, ppException ); + } + break; + } + default: + { + ::com::sun::star::uno::RuntimeException aExc( + OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); + + Type const & rExcType = ::getCppuType( &aExc ); + // binary identical null reference + ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); + } + } +} + +} } } +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S new file mode 100644 index 000000000000..d5faf15eed6f --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S @@ -0,0 +1,38 @@ +@ ARM support code for OpenOffice C++/UNO bridging +@ +@ Written by Peter Naulls <peter@chocky.org> +@ Modified by Caolan McNamara <caolanm@redhat.com> +@ Fixed by Michael Casadevall <mcasadevall@kubuntu.org> + +#ifdef __ARM_EABI__ +# define UNWIND +#else +# define UNWIND @ +#endif + + .file "armhelper.s" + .text + .align 4 + .global privateSnippetExecutor + .type privateSnippetExecutor, %function +privateSnippetExecutor: + UNWIND .fnstart @ start of unwinder entry + + stmfd sp!, {r0-r3} @ follow other parameters on stack + UNWIND .pad #16 @ throw this data away on exception + mov r0, ip @ r0 points to functionoffset/vtable + mov r1, sp @ r1 points to this and params + @ (see cppuno.cxx:codeSnippet()) + stmfd sp!, {r4,lr} @ save return address + @ (r4 pushed to preserve stack alignment) + UNWIND .save {r4,lr} @ restore these regs on exception + + bl cpp_vtable_call(PLT) + + add sp, sp, #4 @ no need to restore r4 (we didn't touch it) + ldr pc, [sp], #20 @ return, discarding function arguments + + UNWIND .fnend @ end of unwinder entry + + .size privateSnippetExecutor, . - privateSnippetExecutor + .section .note.GNU-stack,"",%progbits diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s deleted file mode 100644 index 8fd1a38e4f51..000000000000 --- a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s +++ /dev/null @@ -1,22 +0,0 @@ -@ ARM support code for OpenOffice C++/UNO bridging -@ -@ Written by Peter Naulls <peter@chocky.org> -@ Modified by Caolan McNamara <caolanm@redhat.com> - .file "armhelper.s" - .text - .align 4 - .global privateSnippetExecutor - .type privateSnippetExecutor, %function -privateSnippetExecutor: - stmfd sp!, {r0-r3} @ follow other parameters on stack - mov r0, ip @ r0 points to functionoffset/vtable - mov ip, sp @ fix up the ip - stmfd sp!, {fp,ip,lr,pc} @ 8 x 4 => stack remains 8 aligned - sub fp, ip, #4 @ set frame pointer - - add r1, sp, #16 @ r1 points to this and params - bl cpp_vtable_call(PLT) - - add sp, sp, #32 @ restore stack - ldr fp, [sp, #-32] @ restore frame pointer - ldr pc, [sp, #-24] @ return diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index 98c213a53a83..0e801ab4433e 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -76,10 +76,8 @@ namespace if (pReturnTypeDescr) { - if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) - { + if (!arm::return_in_hidden_param(pReturnTypeRef)) pUnoReturn = pRegisterReturn; // direct way for simple types - } else // complex return via ptr (pCppReturn) { pCppReturn = *(void **)pCppStack; @@ -410,8 +408,30 @@ extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset, void **pCallStack ) { sal_Int64 nRegReturn; - cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack, + typelib_TypeClass aType = cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack, &nRegReturn ); + + switch( aType ) + { + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn); + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + case typelib_TypeClass_SHORT: + nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn); + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_LONG: + nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn); + break; + case typelib_TypeClass_VOID: + default: + break; + } + return nRegReturn; } @@ -422,9 +442,9 @@ namespace const int codeSnippetSize = 20; unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, - sal_Int32 vtableOffset, bool simple_ret_type ) + sal_Int32 vtableOffset, bool bHasHiddenParam) { - if (!simple_ret_type) + if (bHasHiddenParam) functionIndex |= 0x80000000; unsigned long * p = (unsigned long *)code; @@ -478,24 +498,25 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( switch (member->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + typelib_InterfaceAttributeTypeDescription *pAttrTD = + reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( member ); + // Getter: (s++)->fn = code + writetoexecdiff; code = codeSnippet( code, functionOffset++, vtableOffset, - bridges::cpp_uno::shared::isSimpleType( - reinterpret_cast< - typelib_InterfaceAttributeTypeDescription * >( - member)->pAttributeTypeRef)); + arm::return_in_hidden_param( pAttrTD->pAttributeTypeRef )); + // Setter: - if (!reinterpret_cast< - typelib_InterfaceAttributeTypeDescription * >( - member)->bReadOnly) + if (!pAttrTD->bReadOnly) { (s++)->fn = code + writetoexecdiff; code = codeSnippet( - code, functionOffset++, vtableOffset, true); + code, functionOffset++, vtableOffset, false); } break; + } case typelib_TypeClass_INTERFACE_METHOD: { (s++)->fn = code + writetoexecdiff; @@ -504,11 +525,8 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(member); - bool issimple = bridges::cpp_uno::shared::isSimpleType( - pMethodTD->pReturnTypeRef); - code = codeSnippet(code, functionOffset++, vtableOffset, - issimple); + arm::return_in_hidden_param(pMethodTD->pReturnTypeRef)); break; } default: diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx index df717fe1f279..ec1e671a72ba 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx @@ -162,8 +162,8 @@ namespace CPPU_CURRENT_NAMESPACE else { // try to lookup the symbol in the generated rtti map - t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) ); - if (iFind == m_generatedRttis.end()) + t_rtti_map::const_iterator iFind2( m_generatedRttis.find( unoName ) ); + if (iFind2 == m_generatedRttis.end()) { // we must generate it ! // symbol and rtti-name is nearly identical, @@ -192,7 +192,7 @@ namespace CPPU_CURRENT_NAMESPACE } else // taking already generated rtti { - rtti = iFind->second; + rtti = iFind2->second; } } } diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk index 44c557795510..0900ec11f41f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk @@ -80,5 +80,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk -$(SLO)$/%.obj: %.s +$(SLO)$/%.obj: %.S $(CXX) -c -o $(SLO)$/$(@:b).o $< -fPIC ; touch $@ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx index cfe220abaf17..fb72c360fd45 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx @@ -89,5 +89,12 @@ namespace CPPU_CURRENT_NAMESPACE void fillUnoException( __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); } + +namespace arm +{ + enum armlimits { MAX_GPR_REGS = 4 }; + bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ); +} + #endif /* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 154ae52027bb..be67ed8fd830 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -105,50 +105,94 @@ using namespace ::com::sun::star::uno; namespace arm { - enum armlimits { MAX_GPR_REGS = 4 }; + bool is_complex_struct(const typelib_TypeDescription * type) + { + const typelib_CompoundTypeDescription * p + = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); + for (sal_Int32 i = 0; i < p->nMembers; ++i) + { + if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || + p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) + { + typelib_TypeDescription * t = 0; + TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); + bool b = is_complex_struct(t); + TYPELIB_DANGER_RELEASE(t); + if (b) { + return true; + } + } + else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) + return true; + } + if (p->pBaseTypeDescription != 0) + return is_complex_struct(&p->pBaseTypeDescription->aBase); + return false; + } + + bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) + { + if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) + return false; + else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) + { + typelib_TypeDescription * pTypeDescr = 0; + TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); + + //A Composite Type not larger than 4 bytes is returned in r0 + bool bRet = pTypeDescr->nSize > 4 || is_complex_struct(pTypeDescr); + + TYPELIB_DANGER_RELEASE( pTypeDescr ); + return bRet; + } + return true; + } } -void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn) +void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pReturnType, sal_uInt32* pRegisterReturn) { #if !defined(__ARM_EABI__) && !defined(__SOFTFP__) register float fret asm("f0"); register double dret asm("f0"); #endif - switch( eReturnType ) + switch( pReturnType->eTypeClass ) { case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - ((long*)pRegisterReturn)[1] = r1; + pRegisterReturn[1] = r1; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_ENUM: - ((long*)pRegisterReturn)[0] = r0; - break; case typelib_TypeClass_CHAR: case typelib_TypeClass_SHORT: case typelib_TypeClass_UNSIGNED_SHORT: - *(unsigned short*)pRegisterReturn = (unsigned short)r0; - break; case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BYTE: - *(unsigned char*)pRegisterReturn = (unsigned char)r0; + pRegisterReturn[0] = r0; break; case typelib_TypeClass_FLOAT: #if defined(__ARM_EABI__) || defined(__SOFTFP__) - ((long*)pRegisterReturn)[0] = r0; + pRegisterReturn[0] = r0; #else *(float*)pRegisterReturn = fret; #endif break; case typelib_TypeClass_DOUBLE: #if defined(__ARM_EABI__) || defined(__SOFTFP__) - ((long*)pRegisterReturn)[1] = r1; - ((long*)pRegisterReturn)[0] = r0; + pRegisterReturn[1] = r1; + pRegisterReturn[0] = r0; #else *(double*)pRegisterReturn = dret; #endif break; + case typelib_TypeClass_STRUCT: + case typelib_TypeClass_EXCEPTION: + { + if (!arm::return_in_hidden_param(pReturnType)) + pRegisterReturn[0] = r0; + break; + } default: break; } @@ -162,7 +206,7 @@ void callVirtualMethod( void * pThis, sal_Int32 nVtableIndex, void * pRegisterReturn, - typelib_TypeClass eReturnType, + typelib_TypeDescriptionReference * pReturnType, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, @@ -172,7 +216,7 @@ void callVirtualMethod( void * pThis, sal_Int32 nVtableIndex, void * pRegisterReturn, - typelib_TypeClass eReturnType, + typelib_TypeDescriptionReference * pReturnType, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, @@ -201,23 +245,10 @@ void callVirtualMethod( typedef void (*FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32); FunctionCall pFunc = (FunctionCall)pMethod; - // fill registers - __asm__ __volatile__ ( - "ldr r0, [%0, #0]\n\t" - "ldr r1, [%0, #4]\n\t" - "ldr r2, [%0, #8]\n\t" - "ldr r3, [%0, #12]\n\t" - : : "r" (pGPR) - : "r0", "r1", "r2", "r3" - ); - - // tell gcc that r0 to r3 are not available to it - register sal_uInt32 r0 asm("r0"); - register sal_uInt32 r1 asm("r1"); - register sal_uInt32 r2 asm("r2"); - register sal_uInt32 r3 asm("r3"); - - (*pFunc)(r0, r1, r2, r3); + (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]); + + sal_uInt32 r0; + sal_uInt32 r1; // get return value __asm__ __volatile__ ( @@ -225,7 +256,7 @@ void callVirtualMethod( "mov %1, r1\n\t" : "=r" (r0), "=r" (r1) : ); - MapReturn(r0, r1, eReturnType, pRegisterReturn); + MapReturn(r0, r1, pReturnType, (sal_uInt32*)pRegisterReturn); } } @@ -312,14 +343,14 @@ static void cpp_call( void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; - + bool bSimpleReturn = true; if (pReturnTypeDescr) { + if (arm::return_in_hidden_param( pReturnTypeRef ) ) + bSimpleReturn = false; - if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) - { + if (bSimpleReturn) pCppReturn = pUnoReturn; // direct way for simple types - } else { // complex return via ptr @@ -390,6 +421,8 @@ static void cpp_call( case typelib_TypeClass_DOUBLE: INSERT_DOUBLE( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart, bOverFlow ); break; + default: + break; } // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); @@ -431,7 +464,7 @@ static void cpp_call( { callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, - pCppReturn, pReturnTypeDescr->eTypeClass, + pCppReturn, pReturnTypeRef, pStackStart, (pStack - pStackStart), pGPR, nGPR); @@ -504,15 +537,19 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); +#if OSL_DEBUG_LEVEL > 0 typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; +#endif switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: { +#if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); +#endif VtableSlot aVtableSlot( getVtableSlot( @@ -557,9 +594,11 @@ void unoInterfaceProxyDispatch( } case typelib_TypeClass_INTERFACE_METHOD: { +#if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); +#endif VtableSlot aVtableSlot( getVtableSlot( diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index 8b37b633f59e..959452b4d985 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -61,7 +61,7 @@ namespace long r8, void ** gpreg, double *fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { - void ** startovrflw; + void ** startovrflw = ovrflw; int nregs = 0; //number of words passed in registers #ifdef CMC_DEBUG @@ -143,7 +143,7 @@ namespace } else { - if ((startovrflw-ovrflw) & 4) + if ((startovrflw-ovrflw) & 1) ovrflw--; pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4); bOverFlowUsed = true; @@ -182,7 +182,7 @@ namespace } else { - if ((startovrflw-ovrflw) & 4) + if ((startovrflw-ovrflw) & 1) ovrflw--; pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4); bOverFlowUsed = true; diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk index 50cf80654a94..d5eb2dd6e1d9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk @@ -77,8 +77,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx index c0166b720f0b..0483e86b7280 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx @@ -100,8 +100,6 @@ enum x86_64_reg_class #define MAX_CLASSES 4 -#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) - /* x86-64 register passing implementation. See x86-64 ABI for details. Goal of this code is to classify each 8bytes of incoming argument by the register class and assign registers accordingly. */ @@ -153,11 +151,8 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) See the x86-64 PS ABI for details. */ static int -classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_class classes[], int &rByteOffset ) +classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_class classes[], int byteOffset ) { - /* First, align to the right place. */ - rByteOffset = ALIGN( rByteOffset, pTypeRef->pType->nAlignment ); - switch ( pTypeRef->eTypeClass ) { case typelib_TypeClass_VOID: @@ -173,13 +168,13 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_ENUM: - if ( ( rByteOffset % 8 + pTypeRef->pType->nSize ) <= 4 ) + if ( ( byteOffset % 8 + pTypeRef->pType->nSize ) <= 4 ) classes[0] = X86_64_INTEGERSI_CLASS; else classes[0] = X86_64_INTEGER_CLASS; return 1; case typelib_TypeClass_FLOAT: - if ( ( rByteOffset % 8 ) == 0 ) + if ( ( byteOffset % 8 ) == 0 ) classes[0] = X86_64_SSESF_CLASS; else classes[0] = X86_64_SSE_CLASS; @@ -226,9 +221,9 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c for ( sal_Int32 nMember = 0; nMember < pStruct->nMembers; ++nMember ) { typelib_TypeDescriptionReference *pTypeInStruct = pStruct->ppTypeRefs[ nMember ]; - rByteOffset = pStruct->pMemberOffsets[ nMember ]; + int offset = byteOffset + pStruct->pMemberOffsets[ nMember ]; - int num = classify_argument( pTypeInStruct, subclasses, rByteOffset ); + int num = classify_argument( pTypeInStruct, subclasses, offset ); if ( num == 0 ) { @@ -238,7 +233,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c for ( int i = 0; i < num; i++ ) { - int pos = rByteOffset / 8; + int pos = offset / 8; classes[i + pos] = merge_classes( subclasses[i], classes[i + pos] ); } } @@ -281,10 +276,9 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool bInReturn, int &nUsedGPR, int &nUsedSSE ) { enum x86_64_reg_class classes[MAX_CLASSES]; - int offset = 0; int n; - n = classify_argument( pTypeRef, classes, offset ); + n = classify_argument( pTypeRef, classes, 0 ); if ( n == 0 ) return false; @@ -330,10 +324,9 @@ bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) { enum x86_64_reg_class classes[MAX_CLASSES]; - int offset = 0; int n; - n = classify_argument( pTypeRef, classes, offset ); + n = classify_argument( pTypeRef, classes, 0 ); sal_uInt64 *pStructAlign = reinterpret_cast<sal_uInt64 *>( pStruct ); for ( n--; n >= 0; n-- ) @@ -441,10 +434,10 @@ ffi_prep_args (stackLayout *stack, extended_cif *ecif) /* All easy cases are eliminated. Now fire the big guns. */ enum x86_64_reg_class classes[MAX_CLASSES]; - int offset = 0, j, num; + int j, num; void *a; - num = classify_argument (*p_arg, classes, &offset); + num = classify_argument (*p_arg, classes, 0); for (j=0, a=*p_argv; j<num; j++, a+=8) { switch (classes[j]) @@ -571,7 +564,7 @@ ffi_fill_return_value (return_value *rv, extended_cif *ecif) ; } - num = classify_argument (ecif->cif->rtype, classes, &i); + num = classify_argument (ecif->cif->rtype, classes, 0); if (num == 0) /* Return in memory. */ diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk index 92d575a14dfb..7bca40bbaf97 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk @@ -72,8 +72,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx index 219c2053770b..6ba8b2e319b5 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx @@ -144,7 +144,7 @@ RTTI::~RTTI() SAL_THROW( () ) //__________________________________________________________________________________________________ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { - type_info * rtti; + type_info * rtti = NULL; OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; diff --git a/bridges/source/cpp_uno/mingw_intel/makefile.mk b/bridges/source/cpp_uno/mingw_intel/makefile.mk index a23288f9f677..2c7a8da48527 100644 --- a/bridges/source/cpp_uno/mingw_intel/makefile.mk +++ b/bridges/source/cpp_uno/mingw_intel/makefile.mk @@ -87,8 +87,5 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).obj $< touch $@ diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 99ec6e32fce2..81ae922ae717 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -848,7 +848,7 @@ void SAL_CALL UNO_proxy_dispatch( #if OSL_DEBUG_LEVEL > 0 OString cstr_msg2( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, cstr_msg2.getStr() ); + OSL_TRACE( "%s", cstr_msg2.getStr() ); #endif } catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &) diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx index f0e338e4728c..ce58b1f3f779 100644 --- a/bridges/source/remote/urp/urp_job.hxx +++ b/bridges/source/remote/urp/urp_job.hxx @@ -76,9 +76,6 @@ public: ~Job(); - inline void setUnmarshal( Unmarshal *p ) - { m_pUnmarshal = p; } - public: remote_Context *m_pContext; Unmarshal *m_pUnmarshal; @@ -87,7 +84,7 @@ public: ::bridges_remote::RemoteThreadCounter m_counter; }; -class ClientJob : public Job +class ClientJob : private Job { public: // pContext is null for bridge-internal UrpProtocolProperties requests @@ -123,6 +120,9 @@ public: { return m_bBridgePropertyCall; } inline sal_Bool isOneway() { return m_bOneway; } + + inline void setUnmarshal( Unmarshal *p ) + { m_pUnmarshal = p; } public: typelib_InterfaceMethodTypeDescription *m_pMethodType; typelib_InterfaceAttributeTypeDescription *m_pAttributeType; @@ -172,7 +172,7 @@ struct ServerJobEntry sal_Bool m_bIgnoreCache; }; -class ServerMultiJob : public Job +class ServerMultiJob : private Job { public: ServerMultiJob( uno_Environment *pEnvRemote, diff --git a/bridges/test/java_uno/acquire/makefile.mk b/bridges/test/java_uno/acquire/makefile.mk index 96ee48f62889..def12dd53c49 100644 --- a/bridges/test/java_uno/acquire/makefile.mk +++ b/bridges/test/java_uno/acquire/makefile.mk @@ -43,7 +43,7 @@ SLOFILES = $(SLO)$/testacquire.obj SHL1TARGET = testacquire.uno SHL1OBJS = $(SLOFILES) SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) -SHL1VERSIONMAP = testacquire.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1IMPLIB = itestacquire JAVAFILES = TestAcquire.java @@ -52,10 +52,10 @@ JARFILES = OOoRunner.jar juh.jar jurt.jar ridl.jar .INCLUDE: target.mk ALLTAR: \ - $(BIN)$/testacquire-java-client$(SCRIPTEXT) \ - $(BIN)$/testacquire-java-server$(SCRIPTEXT) \ - $(BIN)$/testacquire-native-client$(SCRIPTEXT) \ - $(BIN)$/testacquire-native-server$(SCRIPTEXT) + $(BIN)$/testacquire-java-client \ + $(BIN)$/testacquire-java-server \ + $(BIN)$/testacquire-native-client \ + $(BIN)$/testacquire-native-server .IF "$(GUI)" == "WNT" GIVE_EXEC_RIGHTS = @echo @@ -86,7 +86,7 @@ $(SLOFILES) $(JAVACLASSFILES): $(BIN)$/$(TARGET).rdb TEST_JAVAUNO_ACQUIRE_UNO_URL := \ \"'uno:socket,host=127.0.0.1,port=2002;urp;test'\" -$(BIN)$/testacquire-java-client$(SCRIPTEXT): +$(BIN)$/testacquire-java-client: echo java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ @@ -94,7 +94,7 @@ $(BIN)$/testacquire-java-client$(SCRIPTEXT): $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-java-server$(SCRIPTEXT): +$(BIN)$/testacquire-java-server: echo java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ @@ -102,14 +102,14 @@ $(BIN)$/testacquire-java-server$(SCRIPTEXT): $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-native-client$(SCRIPTEXT): +$(BIN)$/testacquire-native-client: echo '$(AUGMENT_LIBRARY_PATH)' uno \ -c com.sun.star.test.bridges.testacquire.impl \ -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb -- \ $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-native-server$(SCRIPTEXT): +$(BIN)$/testacquire-native-server: echo '$(AUGMENT_LIBRARY_PATH)' uno \ -c com.sun.star.test.bridges.testacquire.impl \ -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb \ diff --git a/bridges/test/java_uno/acquire/testacquire.map b/bridges/test/java_uno/acquire/testacquire.map deleted file mode 100644 index 227274db922d..000000000000 --- a/bridges/test/java_uno/acquire/testacquire.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3.1 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/bridges/test/java_uno/any/makefile.mk b/bridges/test/java_uno/any/makefile.mk index 564ee80c2e80..888fae21d3d2 100644 --- a/bridges/test/java_uno/any/makefile.mk +++ b/bridges/test/java_uno/any/makefile.mk @@ -100,16 +100,16 @@ $(SLOFILES) : $(MISC)$/gen_files.flag $(JAVACLASSFILES) : $(MISC)$/gen_files.flag ALLTAR : \ - $(OUT)$/bin$/TestRemote$(SCRIPTEXT) \ - $(OUT)$/bin$/TestJni$(SCRIPTEXT) + $(OUT)$/bin$/TestRemote \ + $(OUT)$/bin$/TestJni -$(OUT)$/bin$/TestRemote$(SCRIPTEXT) : $(JAVACLASSFILES) +$(OUT)$/bin$/TestRemote : $(JAVACLASSFILES) -rm -f $@ echo java -classpath ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ test.java_uno.anytest.TestRemote > $@ $(GIVE_EXEC_RIGHTS) $@ -$(OUT)$/bin$/TestJni$(SCRIPTEXT) : $(JAVACLASSFILES) +$(OUT)$/bin$/TestJni : $(JAVACLASSFILES) -rm -f $@ echo '$(AUGMENT_LIBRARY_PATH)' java -classpath \ .$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ diff --git a/bridges/test/java_uno/any/test_javauno_any.map b/bridges/test/java_uno/any/test_javauno_any.map index 4959db8fccc8..c50f7b162db7 100644 --- a/bridges/test/java_uno/any/test_javauno_any.map +++ b/bridges/test/java_uno/any/test_javauno_any.map @@ -1,4 +1,4 @@ -UDK_3.1 { +UDK_3_0_0 { global: Java_test_java_1uno_anytest_TestJni_create_1jni_1transport; local: diff --git a/bridges/test/java_uno/equals/makefile.mk b/bridges/test/java_uno/equals/makefile.mk index 3b71858498fb..9ac266f80ff5 100644 --- a/bridges/test/java_uno/equals/makefile.mk +++ b/bridges/test/java_uno/equals/makefile.mk @@ -50,7 +50,7 @@ SLOFILES = $(SLO)$/testequals.obj SHL1TARGET = testequals.uno SHL1OBJS = $(SLOFILES) SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) -SHL1VERSIONMAP = testequals.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1IMPLIB = itestequals JAVAFILES = TestEquals.java @@ -58,7 +58,7 @@ JARFILES = juh.jar jurt.jar ridl.jar .INCLUDE: target.mk -ALLTAR: $(BIN)$/testequals$(SCRIPTEXT) +ALLTAR: $(BIN)$/testequals .IF "$(GUI)" == "WNT" GIVE_EXEC_RIGHTS = @echo @@ -81,7 +81,7 @@ $(MISC)$/$(TARGET).rdb: types.idl $(SLOFILES) $(JAVACLASSFILES): $(MISC)$/$(TARGET).rdb -$(BIN)$/testequals$(SCRIPTEXT): $(BIN)$/testequals_services.rdb +$(BIN)$/testequals: $(BIN)$/testequals_services.rdb echo '$(AUGMENT_LIBRARY_PATH)' java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ diff --git a/bridges/test/java_uno/equals/testequals.map b/bridges/test/java_uno/equals/testequals.map deleted file mode 100644 index 227274db922d..000000000000 --- a/bridges/test/java_uno/equals/testequals.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3.1 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/bridges/test/java_uno/nativethreadpool/makefile.mk b/bridges/test/java_uno/nativethreadpool/makefile.mk index 162c5c225175..d4926e07307b 100644 --- a/bridges/test/java_uno/nativethreadpool/makefile.mk +++ b/bridges/test/java_uno/nativethreadpool/makefile.mk @@ -97,7 +97,7 @@ $(BIN)$/$(TARGET).rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ $(REGCOMP) -register -r $(MISC)$/$(TARGET)$/bootstrap.rdb \ -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST) \ -c stocservices.uno$(DLLPOST) -.IF "$(GUI)" == "WNT" || "$(USE_SHELL)" != "bash" +.IF "$(GUI)" == "WNT" ERROR -- missing platform .ELSE # GUI, WNT + export OO_JAVA_PROPERTIES='RuntimeLib=$(JVM_LIB_URL)' && \ @@ -107,7 +107,7 @@ $(BIN)$/$(TARGET).rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ .ENDIF # GUI, WNT test .PHONY: $(SHL1TARGETN) $(BIN)$/$(TARGET).uno.jar $(BIN)$/$(TARGET).rdb -.IF "$(GUI)" == "WNT" || "$(USE_SHELL)" != "bash" +.IF "$(GUI)" == "WNT" ERROR -- missing platform .ELSE # GUI, WNT $(AUGMENT_LIBRARY_PATH) uno -c test.javauno.nativethreadpool.server \ diff --git a/cli_ure/source/basetypes/makefile.mk b/cli_ure/source/basetypes/makefile.mk index 83269c4193a3..5547c32de0df 100644 --- a/cli_ure/source/basetypes/makefile.mk +++ b/cli_ure/source/basetypes/makefile.mk @@ -37,13 +37,6 @@ TARGET = basetypes .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - .IF "$(BUILD_FOR_CLI)" != "" .INCLUDE : $(BIN)$/cliureversion.mk @@ -73,15 +66,15 @@ CSFILES = \ .IF "$(CCNUMVER)" <= "001399999999" $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")] \ - [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")] \ + [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]' \ >> $@ .ELSE $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")]' \ >> $@ .ENDIF diff --git a/cli_ure/source/climaker/makefile.mk b/cli_ure/source/climaker/makefile.mk index 8bea8f5c60e7..b001a1545fae 100644 --- a/cli_ure/source/climaker/makefile.mk +++ b/cli_ure/source/climaker/makefile.mk @@ -122,9 +122,7 @@ ALLTAR: \ #Create the config file that is used with the policy assembly $(CLIMAKER_CONFIG): climaker.exe.config $(COPY) $< $@ -.IF "$(USE_SHELL)"!="4nt" chmod +x $@ -.ENDIF # "$(USE_SHELL)"!="4nt" .IF "$(BUILD_FOR_CLI)" != "" diff --git a/cli_ure/source/native/makefile.mk b/cli_ure/source/native/makefile.mk index 333884bcdf73..2c8be1a9b5b9 100644 --- a/cli_ure/source/native/makefile.mk +++ b/cli_ure/source/native/makefile.mk @@ -45,13 +45,6 @@ CCACHE_DISABLE=TRUE use_shl_versions= -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - - .IF "$(BUILD_FOR_CLI)" == "" #do not even build the cxx files because they contain cli cpp all: @@ -143,11 +136,11 @@ CFLAGSCXX += -clr:oldSyntax $(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk @echo $(ASSEMBLY_KEY_X) $(GNUCOPY) -p assembly.cxx $@ - echo $(ECHOQUOTE) \ - [assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )]; $(ECHOQUOTE) \ + echo \ + '[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' \ >> $(OUT)$/misc$/assembly_cppuhelper.cxx - echo $(ECHOQUOTE) \ - [assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))]; $(ECHOQUOTE) \ + echo \ + '[assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))];' \ >> $(OUT)$/misc$/assembly_cppuhelper.cxx diff --git a/cli_ure/source/native/msvc.map b/cli_ure/source/native/msvc.map index 2fba6b6d3e7e..429f750cc2b0 100644 --- a/cli_ure/source/native/msvc.map +++ b/cli_ure/source/native/msvc.map @@ -1,4 +1,4 @@ -UDK_3.1 { +UDK_3_0_0 { global: local: diff --git a/cli_ure/source/ure/makefile.mk b/cli_ure/source/ure/makefile.mk index 29e9c7770a8c..3e0290888cc5 100644 --- a/cli_ure/source/ure/makefile.mk +++ b/cli_ure/source/ure/makefile.mk @@ -37,13 +37,6 @@ TARGET = ure .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - .IF "$(BUILD_FOR_CLI)" != "" .INCLUDE : $(BIN)$/cliureversion.mk @@ -69,15 +62,15 @@ CSFILES = \ .IF "$(CCNUMVER)" <= "001399999999" $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")] \ - [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")] \ + [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]' \ >> $@ .ELSE $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")]' \ >> $@ .ENDIF diff --git a/cli_ure/version/makefile.mk b/cli_ure/version/makefile.mk index e71a63746e54..2b5913100be4 100644 --- a/cli_ure/version/makefile.mk +++ b/cli_ure/version/makefile.mk @@ -37,15 +37,6 @@ TARGET = cliureversion.mk .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - - - ALLTAR : \ $(BIN)$/cliureversion.mk diff --git a/codemaker/test/cppumaker/makefile.mk b/codemaker/test/cppumaker/makefile.mk index 3aa9dc65d90c..964ae166cdf5 100644 --- a/codemaker/test/cppumaker/makefile.mk +++ b/codemaker/test/cppumaker/makefile.mk @@ -33,6 +33,8 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) + DLLPRE = # no leading "lib" on .so files INCPRE += $(MISC)$/$(TARGET)$/inc diff --git a/cppu/qa/makefile.mk b/cppu/qa/makefile.mk index 51d9dfe22374..b40d3512e575 100644 --- a/cppu/qa/makefile.mk +++ b/cppu/qa/makefile.mk @@ -33,6 +33,8 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) + DLLPRE = # no leading "lib" on .so files INCPRE += $(MISC)$/$(TARGET)$/inc diff --git a/cppu/test/AffineBridge/AffineBridge.test.pl b/cppu/test/AffineBridge/AffineBridge.test.pl deleted file mode 100755 index 6b667efd299c..000000000000 --- a/cppu/test/AffineBridge/AffineBridge.test.pl +++ /dev/null @@ -1,72 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests = ( - "EnvStack.tester :A:affine :A:affine \"-enter:A[0,not entered]-leave:A[0,not entered]\" :A:affine", # initially not entered&leave - "EnvStack.tester :affine:A :affine:A \"-enter:affine:A[1,OK]-leave:affine:A[1,OK]\" :affine", # enter - "EnvStack.tester \"\" :affine:A \"-into:affine:A[1,OK]\" :affine", # call into - "EnvStack.tester :affine :A \"-into:A[0,wrong thread]\" :affine", # call out - "EnvStack.tester \"\" :affine:affine:A \"-into:affine:affine:A[0,wrong thread]\" :affine", # wrong thread - "env.tester.bin CPP:affine" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/AffineBridge/makefile.mk b/cppu/test/AffineBridge/makefile.mk deleted file mode 100644 index f282d05cf357..000000000000 --- a/cppu/test/AffineBridge/makefile.mk +++ /dev/null @@ -1,42 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := AffineBridge.test.pl - - -.INCLUDE : settings.mk - - -.INCLUDE : target.mk - - -ALLTAR: $(BIN)$/$(TARGET) - -$(BIN)$/$(TARGET): AffineBridge.test.pl - @+$(COPY) $^ $@ diff --git a/cppu/test/AntiEnvGuard/AntiEnvGuard.test.cxx b/cppu/test/AntiEnvGuard/AntiEnvGuard.test.cxx deleted file mode 100644 index 885600141255..000000000000 --- a/cppu/test/AntiEnvGuard/AntiEnvGuard.test.cxx +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "sal/main.h" - -#include "cppu/EnvGuards.hxx" -#include "uno/environment.hxx" - -#include <iostream> - - -using namespace com::sun::star; - -static rtl::OUString s_message; - - -static void s_test__ctor(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__ctor")); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("uno")); - - rtl::OUString current_EnvDcp; - { - cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe")), NULL)); - - { - cppu::AntiEnvGuard antiGuard; - - current_EnvDcp = uno::Environment::getCurrent(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).getTypeName(); - } - } - - if (current_EnvDcp == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += current_EnvDcp; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -static void s_test__dtor(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__dtor")); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe")); - - rtl::OUString current_EnvDcp; - { - cppu::EnvGuard envGuard(uno::Environment(ref, NULL)); - - { - cppu::AntiEnvGuard antiGuard; - } - current_EnvDcp = uno::Environment::getCurrent(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).getTypeName(); - } - - - if (current_EnvDcp == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += current_EnvDcp; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__ctor(); - s_test__dtor(); - - int ret; - if (s_message.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_message, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/AntiEnvGuard/makefile.mk b/cppu/test/AntiEnvGuard/makefile.mk deleted file mode 100644 index 3164ca17650d..000000000000 --- a/cppu/test/AntiEnvGuard/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := AntiEnvGuard.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/AntiEnvGuard.test.obj -APP1STDLIBS := $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/EnvDcp/EnvDcp.test.cxx b/cppu/test/EnvDcp/EnvDcp.test.cxx deleted file mode 100644 index d9f78468ef3f..000000000000 --- a/cppu/test/EnvDcp/EnvDcp.test.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "sal/main.h" - -#include "cppu/EnvDcp.hxx" - -#include <iostream> - - -static rtl::OUString s_message; - -static void s_test__getTypeName(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__getTypeName")); - - rtl::OUString envDcp(RTL_CONSTASCII_USTRINGPARAM("acaQEQWE123:asda:2342")); - - rtl::OUString typeName(cppu::EnvDcp::getTypeName(envDcp)); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("acaQEQWE123")); - - if (typeName == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += typeName; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -static void s_test__getPurpose(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__getPurpose")); - - rtl::OUString envDcp(RTL_CONSTASCII_USTRINGPARAM("acaQEQWE123:asda:2342")); - - rtl::OUString purpose(cppu::EnvDcp::getPurpose(envDcp)); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM(":asda:2342")); - - if (purpose == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += purpose; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__getTypeName(); - s_test__getPurpose(); - - int ret; - if (s_message.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_message, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/EnvGuard/EnvGuard.test.cxx b/cppu/test/EnvGuard/EnvGuard.test.cxx deleted file mode 100644 index ec926fa56670..000000000000 --- a/cppu/test/EnvGuard/EnvGuard.test.cxx +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "sal/main.h" - -#include "cppu/EnvGuards.hxx" -#include "uno/environment.hxx" - -#include <iostream> - - -using namespace com::sun::star; - -static rtl::OUString s_message; - - -static void s_test__entered(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__entered")); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe")); - - rtl::OUString current_EnvDcp; - { - cppu::EnvGuard envGuard(uno::Environment(ref, NULL)); - - current_EnvDcp = uno::Environment::getCurrent(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).getTypeName(); - } - - if (current_EnvDcp == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += current_EnvDcp; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -static void s_test__left(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__left")); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("uno")); - - rtl::OUString current_EnvDcp; - { - cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe")), NULL)); - } - current_EnvDcp = uno::Environment::getCurrent(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).getTypeName(); - - - if (current_EnvDcp == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += current_EnvDcp; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -static void s_test__clear(void) -{ - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__clear")); - - rtl::OUString ref(RTL_CONSTASCII_USTRINGPARAM("uno")); - - rtl::OUString current_EnvDcp; - { - cppu::EnvGuard envGuard(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe")), NULL)); - - envGuard.clear(); - current_EnvDcp = uno::Environment::getCurrent(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).getTypeName(); - } - - - if (current_EnvDcp == ref) - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t got: \"")); - s_message += current_EnvDcp; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t expected: \"")); - s_message += ref; - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__entered(); - s_test__left(); - s_test__clear(); - - int ret; - if (s_message.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_message, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/EnvGuard/makefile.mk b/cppu/test/EnvGuard/makefile.mk deleted file mode 100644 index bb851af3fb25..000000000000 --- a/cppu/test/EnvGuard/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := EnvGuard.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/EnvGuard.test.obj -APP1STDLIBS := $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/EnvStack/EnvStack.test.pl b/cppu/test/EnvStack/EnvStack.test.pl deleted file mode 100755 index 842b2ebab5da..000000000000 --- a/cppu/test/EnvStack/EnvStack.test.pl +++ /dev/null @@ -1,89 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests = ( - "EnvStack.tester \"\" \"\" \"\"", - "EnvStack.tester \":A:a\" \":A:b\" \"-enter:A-enter:A:a-out:A:a-into:A:b-leave:A:a-leave:A\"", - "EnvStack.tester \":A:B:a\" \":A:B:b\" \"-enter:A-enter:A:B-enter:A:B:a-out:A:B:a-into:A:B:b-leave:A:B:a-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C:a\" \":A:B:C:b\" \"-enter:A-enter:A:B-enter:A:B:C-enter:A:B:C:a-out:A:B:C:a-into:A:B:C:b-leave:A:B:C:a-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C:D:a\" \":A:B:C:D:b\" \"-enter:A-enter:A:B-enter:A:B:C-enter:A:B:C:D-enter:A:B:C:D:a-out:A:B:C:D:a-into:A:B:C:D:b-leave:A:B:C:D:a-leave:A:B:C:D-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A:a:b\" \":A:c:d\" \"-enter:A-enter:A:a-enter:A:a:b-out:A:a:b-out:A:a-into:A:c-into:A:c:d-leave:A:a:b-leave:A:a-leave:A\"", - "EnvStack.tester \":A:B:a:b\" \":A:B:c:d\" \"-enter:A-enter:A:B-enter:A:B:a-enter:A:B:a:b-out:A:B:a:b-out:A:B:a-into:A:B:c-into:A:B:c:d-leave:A:B:a:b-leave:A:B:a-leave:A:B-leave:A\"", - "EnvStack.tester \":A\" \"\" \"-enter:A-out:A-leave:A\"", - "EnvStack.tester \":A:B\" \"\" \"-enter:A-enter:A:B-out:A:B-out:A-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C\" \"\" \"-enter:A-enter:A:B-enter:A:B:C-out:A:B:C-out:A:B-out:A-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C:D\" \"\" \"-enter:A-enter:A:B-enter:A:B:C-enter:A:B:C:D-out:A:B:C:D-out:A:B:C-out:A:B-out:A-leave:A:B:C:D-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \"\" \":a\" \"-into:a\"", - "EnvStack.tester \"\" \":a:b\" \"-into:a-into:a:b\"", - "EnvStack.tester \"\" \":a:b:c\" \"-into:a-into:a:b-into:a:b:c\"", - "EnvStack.tester \"\" \":a:b:c:d\" \"-into:a-into:a:b-into:a:b:c-into:a:b:c:d\"", - "EnvStack.tester \":A\" \":a\" \"-enter:A-out:A-into:a-leave:A\"", - "EnvStack.tester \":A:B\" \":a:b\" \"-enter:A-enter:A:B-out:A:B-out:A-into:a-into:a:b-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C\" \":a:b:c\" \"-enter:A-enter:A:B-enter:A:B:C-out:A:B:C-out:A:B-out:A-into:a-into:a:b-into:a:b:c-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C:D\" \":a:b:c:d\" \"-enter:A-enter:A:B-enter:A:B:C-enter:A:B:C:D-out:A:B:C:D-out:A:B:C-out:A:B-out:A-into:a-into:a:b-into:a:b:c-into:a:b:c:d-leave:A:B:C:D-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A\" \":A\" \"-enter:A-leave:A\"", - "EnvStack.tester \":A:B\" \":A:B\" \"-enter:A-enter:A:B-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C\" \":A:B:C\" \"-enter:A-enter:A:B-enter:A:B:C-leave:A:B:C-leave:A:B-leave:A\"", - "EnvStack.tester \":A:B:C:D\" \":A:B:C:D\" \"-enter:A-enter:A:B-enter:A:B:C-enter:A:B:C:D-leave:A:B:C:D-leave:A:B:C-leave:A:B-leave:A\"" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/EnvStack_tester/EnvStack.tester.cxx b/cppu/test/EnvStack_tester/EnvStack.tester.cxx deleted file mode 100644 index caa6660a91b6..000000000000 --- a/cppu/test/EnvStack_tester/EnvStack.tester.cxx +++ /dev/null @@ -1,200 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" - -#include "uno/lbnames.h" -#include "uno/environment.hxx" -#include "cppu/EnvDcp.hxx" -#include <com/sun/star/uno/Exception.hpp> - - -#define CPPU_test_EnvStack_tester_IMPL -#include "EnvStack.tester.hxx" - - -using namespace com::sun::star; - - -static rtl::OUString s_getCurrentEnvDcp(void) -{ - uno::Environment env(uno::Environment::getCurrent()); - rtl::OUString env_dcp(env.getTypeName()); - - return env_dcp; -} - -extern "C" { static void s_getCurrentEnvDcp_v(va_list * pParam) -{ - rtl_uString ** ppEnvDcp = va_arg(*pParam, rtl_uString **); - - rtl::OUString env_dcp(s_getCurrentEnvDcp()); - - rtl_uString_assign(ppEnvDcp, env_dcp.pData); -}} - -static rtl::OUString s_test__uno_Environment_invoke(rtl::OUString const & src_purpose, - rtl::OUString const & dst_purpose, - rtl::OUString const & ref) -{ - rtl::OUString result; - rtl::OUString target_envDcp; - - rtl::OUString src_envDcp(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)); - src_envDcp += src_purpose; - - rtl::OUString dst_envDcp(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)); - dst_envDcp += dst_purpose; - - uno::Environment cur_Env(src_envDcp.pData, NULL); - uno_Environment_enter(cur_Env.get()); - cur_Env.clear(); - - uno::Environment dst_Env(dst_envDcp.pData, NULL); - uno_Environment_invoke(dst_Env.get(), s_getCurrentEnvDcp_v, &target_envDcp.pData); - dst_Env.clear(); - - uno_Environment_enter(NULL); - - - if (cppu::EnvDcp::getPurpose(target_envDcp).equals(dst_purpose) - && g_commentStack.equals(ref)) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PASSED\n")); - - else - { - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FAILED -> ")); - result += target_envDcp; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\texpected: \"")); - result += ref; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tgot: \"")); - result += g_commentStack; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } - - - - return result; -} - -static rtl::OUString s_test__uno_Environment_invoke_v(va_list param) -{ - rtl::OUString const * pSrc_purpose = va_arg(param, rtl::OUString const *); - rtl::OUString const * pDst_purpose = va_arg(param, rtl::OUString const *); - rtl::OUString const * pRef = va_arg(param, rtl::OUString const *); - - - rtl::OUString result; - - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s_test__uno_Environment_invoke_v")); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - \"")); - result += *pSrc_purpose; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" -> \"")); - result += *pDst_purpose; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); - - result += s_test__uno_Environment_invoke(*pSrc_purpose, *pDst_purpose, *pRef); - - return result; -} - -static rtl::OUString s_do_a_test(rtl::OUString (* pTest)(va_list), ...) -{ - rtl::OUString result; - - va_list param; - - va_start(param, pTest); - try { - result += pTest(param); - } - catch (uno::Exception & exception) - { - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FAILED with exception: ")); - result += exception.Message; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - } - va_end(param); - - return result; -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) -{ - int result = 0; - rtl::OString message; - - if (argc >= 4 && argc <= 5) - { - rtl::OUString src_purpose(argv[1], rtl_str_getLength(argv[1]), RTL_TEXTENCODING_ASCII_US); - rtl::OUString dst_purpose(argv[2], rtl_str_getLength(argv[2]), RTL_TEXTENCODING_ASCII_US); - rtl::OUString ref (argv[3], rtl_str_getLength(argv[3]), RTL_TEXTENCODING_ASCII_US); - - if (argc == 5) - { - rtl::OUString test_env(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)); - test_env += rtl::OUString(argv[4], rtl_str_getLength(argv[4]), RTL_TEXTENCODING_ASCII_US); - g_env = uno::Environment(test_env); - } - - - message += rtl::OUStringToOString( - s_do_a_test(s_test__uno_Environment_invoke_v, &src_purpose, &dst_purpose, &ref), - RTL_TEXTENCODING_ASCII_US); - - - if (g_env.is()) - g_env.clear(); - - - if (message.indexOf(rtl::OString("FAILED")) == -1) - message += rtl::OString("TESTS PASSED\n"); - - else - { - message += rtl::OString("TESTS _NOT_ PASSED\n"); - result = -1; - } - } - else - { - message = "usage: EnvStack.tester <source purpose>" - " <destination purpose>" - " <reference string>" - " [<reference environment>]\n\n"; - } - - std::cout << message.getStr(); - - - return result; -} - diff --git a/cppu/test/EnvStack_tester/ProbeEnv.cxx b/cppu/test/EnvStack_tester/ProbeEnv.cxx deleted file mode 100644 index a6b1ce1aaac2..000000000000 --- a/cppu/test/EnvStack_tester/ProbeEnv.cxx +++ /dev/null @@ -1,148 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "cppu/EnvDcp.hxx" - -#include "cppu/helper/purpenv/Environment.hxx" -#include "cppu/helper/purpenv/Mapping.hxx" - -#include "EnvStack.tester.hxx" - - -#define LOG_LIFECYCLE_TestEnv -#ifdef LOG_LIFECYCLE_TestEnv -# include <iostream> -# define LOG_LIFECYCLE_TestEnv_emit(x) x - -#else -# define LOG_LIFECYCLE_TestEnv_emit(x) - -#endif - - -class SAL_DLLPRIVATE TestEnv : public cppu::Enterable -{ - virtual ~TestEnv(void); - -public: - explicit TestEnv(uno_Environment * pEnv); - - uno_Environment * m_pEnv; - -protected: - virtual void v_enter(void); - virtual void v_leave(void); - - virtual void v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam); - virtual void v_callOut_v (uno_EnvCallee * pCallee, va_list * pParam); - - virtual int v_isValid (rtl::OUString * pReason); -}; - -TestEnv::TestEnv(uno_Environment * pEnv) - : m_pEnv(pEnv) -{ - LOG_LIFECYCLE_TestEnv_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestEnv::TestEnv(...)", this)); -} - -TestEnv::~TestEnv(void) -{ - LOG_LIFECYCLE_TestEnv_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestEnv::~TestEnv(void)", this)); -} - - -static void s_checkGEnvValidity(void) -{ - if (g_env.is()) - { - rtl::OUString reason; - int result = g_env.isValid(&reason); - - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[")); - g_commentStack += rtl::OUString::valueOf((sal_Int32)result); - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); - g_commentStack += reason; - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]")); - } -} - -void TestEnv::v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam) -{ - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-into")); - g_commentStack += cppu::EnvDcp::getPurpose(m_pEnv->pTypeName); - - s_checkGEnvValidity(); - - pCallee(pParam); -} - -void TestEnv::v_callOut_v(uno_EnvCallee * pCallee, va_list * pParam) -{ - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-out")); - g_commentStack += cppu::EnvDcp::getPurpose(m_pEnv->pTypeName); - - s_checkGEnvValidity(); - - pCallee(pParam); -} - -void TestEnv::v_enter(void) -{ - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-enter")); - g_commentStack += cppu::EnvDcp::getPurpose(m_pEnv->pTypeName); - - s_checkGEnvValidity(); -} - -void TestEnv::v_leave(void) -{ - g_commentStack += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-leave")); - g_commentStack += cppu::EnvDcp::getPurpose(m_pEnv->pTypeName); - - s_checkGEnvValidity(); -} - -int TestEnv::v_isValid(rtl::OUString * /*pReason*/) -{ - return 1; -} - -extern "C" void SAL_CALL uno_initEnvironment(uno_Environment * pEnv) SAL_THROW_EXTERN_C() -{ - cppu::helper::purpenv::Environment_initWithEnterable(pEnv, new TestEnv(pEnv)); -} - -extern "C" void uno_ext_getMapping(uno_Mapping ** ppMapping, - uno_Environment * pFrom, - uno_Environment * pTo ) -{ - cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo); -} - diff --git a/cppu/test/EnvStack_tester/ProbeEnv.def b/cppu/test/EnvStack_tester/ProbeEnv.def deleted file mode 100644 index 1444d92c13fa..000000000000 --- a/cppu/test/EnvStack_tester/ProbeEnv.def +++ /dev/null @@ -1,8 +0,0 @@ -HEAPSIZE 0 -EXPORTS - uno_initEnvironment - uno_ext_getMapping - - - - diff --git a/cppu/test/EnvStack_tester/makefile.mk b/cppu/test/EnvStack_tester/makefile.mk deleted file mode 100644 index 1ae0e4e89250..000000000000 --- a/cppu/test/EnvStack_tester/makefile.mk +++ /dev/null @@ -1,126 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := EnvStack.tester - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk -.INCLUDE : ../../source/helper/purpenv/export.mk - -.IF "$(COM)" == "GCC" -LINKFLAGS += -rdynamic -.ENDIF - - -ENVINCPRE := -I$(OUT)$/inc$/$(TARGET) - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/EnvStack.tester.obj -APP1STDLIBS := $(CPPULIB) $(SALLIB) - - -SHL1TARGET := $(HLD_DLLPRE)A_uno_uno -SHL1IMPLIB := i$(SHL1TARGET) -SHL1OBJS := $(SLO)$/ProbeEnv.obj -SHL1STDLIBS := $(purpenv_helper_LIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) -.IF "$(GUI)"=="WNT" -SHL1STDLIBS += $(BIN)$/EnvStack.tester.lib -.ENDIF -SHL1DEF := ProbeEnv.def - -SHL2TARGET := $(HLD_DLLPRE)B_uno_uno -SHL2IMPLIB := i$(SHL2TARGET) -SHL2OBJS := $(SHL1OBJS) -SHL2STDLIBS := $(SHL1STDLIBS) -SHL2DEF := $(SHL1DEF) - -SHL3TARGET := $(HLD_DLLPRE)C_uno_uno -SHL3IMPLIB := i$(SHL3TARGET) -SHL3OBJS := $(SHL1OBJS) -SHL3STDLIBS := $(SHL1STDLIBS) -SHL3DEF := $(SHL1DEF) - -SHL4TARGET := $(HLD_DLLPRE)D_uno_uno -SHL4IMPLIB := i$(SHL4TARGET) -SHL4OBJS := $(SHL1OBJS) -SHL4STDLIBS := $(SHL1STDLIBS) -SHL4DEF := $(SHL1DEF) - -SHL5TARGET := $(HLD_DLLPRE)a_uno_uno -SHL5IMPLIB := i$(SHL5TARGET) -SHL5OBJS := $(SHL1OBJS) -SHL5STDLIBS := $(SHL1STDLIBS) -SHL5DEF := $(SHL1DEF) - -SHL6TARGET := $(HLD_DLLPRE)b_uno_uno -SHL6IMPLIB := i$(SHL6TARGET) -SHL6OBJS := $(SHL1OBJS) -SHL6STDLIBS := $(SHL1STDLIBS) -SHL6DEF := $(SHL1DEF) - -SHL7TARGET := $(HLD_DLLPRE)c_uno_uno -SHL7IMPLIB := i$(SHL7TARGET) -SHL7OBJS := $(SHL1OBJS) -SHL7STDLIBS := $(SHL1STDLIBS) -SHL7DEF := $(SHL1DEF) - -SHL8TARGET := $(HLD_DLLPRE)d_uno_uno -SHL8IMPLIB := i$(SHL8TARGET) -SHL8OBJS := $(SHL1OBJS) -SHL8STDLIBS := $(SHL1STDLIBS) -SHL8DEF := $(SHL1DEF) - - -.INCLUDE : target.mk - - -ALLTAR: \ - $(SHL1TARGETN) \ - $(SHL2TARGETN) \ - $(SHL3TARGETN) \ - $(SHL4TARGETN) \ - $(SHL5TARGETN) \ - $(SHL6TARGETN) \ - $(SHL7TARGETN) \ - $(SHL8TARGETN) - - -$(SHL1TARGETN) : $(APP1TARGETN) -$(SHL2TARGETN) : $(APP1TARGETN) -$(SHL3TARGETN) : $(APP1TARGETN) -$(SHL4TARGETN) : $(APP1TARGETN) -$(SHL5TARGETN) : $(APP1TARGETN) -$(SHL6TARGETN) : $(APP1TARGETN) -$(SHL7TARGETN) : $(APP1TARGETN) -$(SHL8TARGETN) : $(APP1TARGETN) diff --git a/cppu/test/Environment.test.cxx b/cppu/test/Environment.test.cxx deleted file mode 100644 index 446ffda7f545..000000000000 --- a/cppu/test/Environment.test.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// Test for uno/environment.hxx respectively com::sun::star::uno::Environment - -#include "uno/environment.hxx" -#include "uno/lbnames.h" -#include "sal/main.h" - -#include <iostream> - - -using namespace com::sun::star; - -static rtl::OUString s_comment; - -static void s_test__constructor_oustring_context(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__constructor_outstring_context\n")); - - uno::Environment environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)), NULL); - - if (!environment.get()) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get an Environment - FAILURE\n")); -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__constructor_oustring_context(); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/FreeReference/FreeReference.test.cxx b/cppu/test/FreeReference/FreeReference.test.cxx deleted file mode 100644 index 1d80f573b0f3..000000000000 --- a/cppu/test/FreeReference/FreeReference.test.cxx +++ /dev/null @@ -1,414 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" - -#include "uno/environment.hxx" - -#include "cppu/FreeReference.hxx" -#include "cppu/EnvGuards.hxx" - -#include "../ObjectFactory/ObjectFactory.hxx" - - - -using namespace com::sun::star; - -static rtl::OUString s_comment; -static uno::Environment s_env; - -extern "C" { -static void s_callee_in(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_in method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: ")); - s_comment += uno::Environment::getCurrent().getTypeName(); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: ")); - s_comment += reason; - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - } -} - -static void s_callee_out(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_out method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: ")); - s_comment += uno::Environment::getCurrent().getTypeName(); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (!valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: is in\n")); - } -} -} - -static cppu::FreeReference<uno::XInterface> s_get_envObject(void) -{ - cppu::EnvGuard envGuard(s_env); - - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - - cppu::FreeReference<uno::XInterface> env_obj(pObject, SAL_NO_ACQUIRE); - - return env_obj; -} - -static cppu::FreeReference<uno::XInterface> s_get_flatObject(void) -{ - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_out)); - - return cppu::FreeReference<uno::XInterface>(pObject, SAL_NO_ACQUIRE); -} - - -static void s_test_operator_arrow(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_operator_arrow:\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - - env_obj->acquire(); - env_obj->release(); -} - - -static void s_test_operator_assign_empty_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_operator_assign_empty_reference\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - cppu::FreeReference<uno::XInterface> empty_ref; - - flat_obj = empty_ref; -} - -static void s_test_operator_assign_inner_reference_inside(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_operator_assign_inner_reference_inside\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - { - cppu::EnvGuard envGuard(s_env); - env_obj = flat_obj; - } -} - -static void s_test_method_clear_inner_reference_inside(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_clear_inner_reference_inside\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - - { - cppu::EnvGuard envGuard(s_env); - env_obj.clear(); - } -} - -static void s_test_method_clear_inner_reference_outside(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_clear_inner_reference_outside\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - - env_obj.clear(); -} - -static void s_test_method_clear_outer_reference_inside(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_clear_outer_reference_inside\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - { - cppu::EnvGuard envGuard(s_env); - flat_obj.clear(); - } -} - -static void s_test_method_clear_outer_reference_outside(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_clear_outer_reference_outside\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - flat_obj.clear(); -} - -static void s_test_method_set_inside_with_inner_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_set_inside_with_inner_reference\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - - { - cppu::EnvGuard envGuard(s_env); - uno::XInterface * pObject2 = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - { - uno::Reference<uno::XInterface> ref(pObject2, SAL_NO_ACQUIRE); - - env_obj.set(ref); - } - } -} - -static void s_test_method_set_inside_with_outer_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_set_inside_with_outer_reference\n")); - - cppu::FreeReference<uno::XInterface> env_obj(s_get_envObject()); - - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_out)); - { - uno::Reference<uno::XInterface> ref(pObject, SAL_NO_ACQUIRE); - - env_obj.set(ref); - } -} - -static void s_test_method_set_with_empty_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_set_outside_with_empty_reference\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - { - uno::Reference<uno::XInterface> ref; - - flat_obj.set(ref); - } -} - -static void s_test_method_set_outside_with_inner_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_set_outside_with_inner_reference\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - { - cppu::EnvGuard envGuard(s_env); - - uno::XInterface * pObject2 = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - { - uno::Reference<uno::XInterface> ref(pObject2, SAL_NO_ACQUIRE); - - flat_obj.set(ref); - } - } -} - -static void s_test_method_set_outside_with_outer_reference(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_method_set_outside_with_outer_reference\n")); - - cppu::FreeReference<uno::XInterface> flat_obj(s_get_flatObject()); - - uno::XInterface * pObject2 = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_out)); - { - uno::Reference<uno::XInterface> ref(pObject2, SAL_NO_ACQUIRE); - - flat_obj.set(ref); - } -} - -static void s_test_operator_equal(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_operator_equal\n")); - - - cppu::FreeReference<uno::XInterface> env_obj; - uno::XInterface * pObject = NULL; - { - cppu::EnvGuard envGuard(s_env); - pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - - env_obj = cppu::FreeReference<uno::XInterface>(pObject, SAL_NO_ACQUIRE); - } - - - uno::Mapping mapping(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV) ":unsafe")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV)))); - uno::Reference<uno::XInterface> tmp; - uno::XInterface * pMappedObject = reinterpret_cast<uno::XInterface *>(mapping.mapInterface(pObject, ::getCppuType(&tmp))); - - - cppu::FreeReference<uno::XInterface> flat_obj(pMappedObject, SAL_NO_ACQUIRE); - - { - cppu::EnvGuard envGuard(s_env); - - if (!(env_obj == flat_obj)) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\trefs are not equal inside - FAILURE\n")); - } - - if (!(env_obj == flat_obj)) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\trefs are not equal outside - FAILURE\n")); -} - -static void s_test_operator_unequal(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_operator_unequal\n")); - - - uno::XInterface * pObject = NULL; - cppu::FreeReference<uno::XInterface> env_obj; - { - cppu::EnvGuard envGuard(s_env); - - pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - - env_obj = cppu::FreeReference<uno::XInterface>(pObject, SAL_NO_ACQUIRE); - } - - - uno::Mapping mapping(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV) ":unsafe")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV)))); - uno::Reference<uno::XInterface> tmp; - uno::XInterface * pMappedObject = reinterpret_cast<uno::XInterface *>(mapping.mapInterface(pObject, ::getCppuType(&tmp))); - - - cppu::FreeReference<uno::XInterface> flat_obj(pMappedObject, SAL_NO_ACQUIRE); - - { - cppu::EnvGuard envGuard(s_env); - - if (env_obj != flat_obj) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\trefs are not equal inside - FAILURE\n")); - } - - if (env_obj != flat_obj) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\trefs are not equal outside - FAILURE\n")); -} - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).enter(); - - s_env = uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe"))); - - - rtl::OUString result; - s_test_operator_arrow(); - s_test_operator_equal(); - s_test_operator_unequal(); - - s_test_operator_assign_empty_reference(); - s_test_operator_assign_inner_reference_inside(); - - s_test_method_set_with_empty_reference(); - s_test_method_set_inside_with_inner_reference(); - s_test_method_set_inside_with_outer_reference(); - s_test_method_set_outside_with_inner_reference(); - s_test_method_set_outside_with_outer_reference(); - - s_test_method_clear_inner_reference_inside(); - s_test_method_clear_inner_reference_outside(); - s_test_method_clear_outer_reference_inside(); - s_test_method_clear_outer_reference_outside(); - - s_env.clear(); - - - uno_Environment_enter(NULL); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/FreeReference/makefile.mk b/cppu/test/FreeReference/makefile.mk deleted file mode 100644 index 3d9a4069718b..000000000000 --- a/cppu/test/FreeReference/makefile.mk +++ /dev/null @@ -1,55 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := FreeReference.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" -ObjectFactory_LIB := -lObjectFactory.$(COMID) - -.ELSE -ObjectFactory_LIB := $(LIBPRE) iObjectFactory.$(COMID).lib - -.ENDIF - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/FreeReference.test.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/IdentityMapping.test.cxx b/cppu/test/IdentityMapping.test.cxx deleted file mode 100644 index 3b232ce0461e..000000000000 --- a/cppu/test/IdentityMapping.test.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// Test for uno/mapping.hxx respectively com::sun::star::uno::Mapping - - -#include <iostream> - -#include "sal/main.h" - -#include "uno/mapping.hxx" - - -using namespace com::sun::star; - -static rtl::OUString s_comment; - -static void s_test__get_identity_mapping(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__get_identity_mapping\n")); - - uno::Mapping mapping(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))), - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)))); - - if (!mapping.get()) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get a Mapping - FAILURE\n")); -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__get_identity_mapping(); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/Map/Map.test.cxx b/cppu/test/Map/Map.test.cxx deleted file mode 100644 index 171d72f99f34..000000000000 --- a/cppu/test/Map/Map.test.cxx +++ /dev/null @@ -1,258 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" - -#include "uno/environment.hxx" - -#include "cppu/Map.hxx" -#include "cppu/EnvGuards.hxx" - -#include "../ObjectFactory/ObjectFactory.hxx" - - -using namespace com::sun::star; - - -static rtl::OUString s_comment; -static uno::Environment s_env; - -extern "C" { -static void s_callee_in(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_in method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: \"")); - s_comment += uno::Environment::getCurrent().getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: ")); - s_comment += reason; - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - } -} - -static void s_callee_out(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_out method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: \"")); - s_comment += uno::Environment::getCurrent().getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (!valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: is in\n")); -} -} - -static uno::Reference<uno::XInterface> s_get_envObject(void) -{ - cppu::EnvGuard envGuard(s_env); - - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - - return uno::Reference<uno::XInterface>(pObject, SAL_NO_ACQUIRE); -} - -static uno::XInterface * s_x_get_flatObject(void) -{ - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_out)); - - return pObject; -} - -static uno::Reference<uno::XInterface> s_get_flatObject(void) -{ - return uno::Reference<uno::XInterface>(s_x_get_flatObject(), SAL_NO_ACQUIRE); -} - - -static void s_test__mapOut(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__mapOut:\n")); - - uno::Reference<uno::XInterface> obj; - - { - cppu::EnvGuard envGuard(s_env); - obj.set(cppu::mapOut(s_get_envObject().get(), - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)))), - SAL_NO_ACQUIRE); - } - - obj->acquire(); - obj->release(); -} - -static void s_test__mapIn(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__unshield:\n")); - - uno::Reference<uno::XInterface> obj; - - { - cppu::EnvGuard envGuard(s_env); - uno::XInterface * pObj = s_x_get_flatObject(); - obj.set(cppu::mapIn(pObj, - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)))), - SAL_NO_ACQUIRE); - - envGuard.clear(); - - pObj->release(); - } - - { - cppu::EnvGuard envGuard(s_env); - obj.clear(); - } -} - -static void s_test__mapOutAny(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__shieldAny:\n")); - - uno::Any out; - - { - cppu::EnvGuard envGuard(s_env); - uno::Any any; - any <<= s_get_envObject(); - cppu::mapOutAny(any, - &out, - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)))); - } - - uno::Reference<uno::XInterface> obj; - out >>= obj; - - obj->acquire(); - obj->release(); -} - -static void s_test__mapInAny(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__unshieldAny:\n")); - - uno::Any out; - { - uno::Any any(s_get_flatObject()); - - { - cppu::EnvGuard envGuard(s_env); - cppu::mapInAny(any, - &out, - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)))); - } - } - - { - cppu::EnvGuard envGuard(s_env); - - uno::Reference<uno::XInterface> obj; - out >>= obj; - - obj.clear(); - } -} - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).enter(); - - s_env = uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe"))); - - s_test__mapOut(); - s_test__mapOutAny(); - s_test__mapIn(); - s_test__mapInAny(); - - s_env.clear(); - - - uno_Environment_enter(NULL); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/Map/makefile.mk b/cppu/test/Map/makefile.mk deleted file mode 100644 index 6344efc48243..000000000000 --- a/cppu/test/Map/makefile.mk +++ /dev/null @@ -1,55 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := Map.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" -ObjectFactory_LIB := -lObjectFactory.$(COMID) - -.ELSE -ObjectFactory_LIB := $(LIBPRE) iObjectFactory.$(COMID).lib - -.ENDIF - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/Map.test.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/Mapping.test.cxx b/cppu/test/Mapping.test.cxx deleted file mode 100644 index 1b763dd71cf2..000000000000 --- a/cppu/test/Mapping.test.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// Test for uno/mapping.hxx respectively com::sun::star::uno::Mapping - - -#include <iostream> - -#include "sal/main.h" - -#include "uno/mapping.hxx" - - -using namespace com::sun::star; - -static rtl::OUString s_comment; - -static void s_test__constructor_env_env(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__constructor_env_env\n")); - - uno::Mapping mapping(uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))), - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)))); - - if (!mapping.get()) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tcouldn't get a Mapping - FAILURE\n")); -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test__constructor_env_env(); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/ObjectFactory/CppObject.cxx b/cppu/test/ObjectFactory/CppObject.cxx deleted file mode 100644 index 541a4172e3d8..000000000000 --- a/cppu/test/ObjectFactory/CppObject.cxx +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "cppu/EnvDcp.hxx" -#include "cppuhelper/implbase1.hxx" - -#include "com/sun/star/uno/XComponentContext.hpp" - -#include "CppObject.hxx" - - -using namespace ::com::sun::star; - - -#ifdef LOG_LIFECYCLE -#define LOG_LIFECYCLE_CppObject -#endif - -#define LOG_LIFECYCLE_CppObject -#ifdef LOG_LIFECYCLE_CppObject -# include <iostream> -# define LOG_LIFECYCLE_CppObject_emit(x) x - -#else -# define LOG_LIFECYCLE_CppObject_emit(x) - -#endif - -CppObject::CppObject(Callee * pCallee) SAL_THROW((uno::RuntimeException)) - : m_nRef (1), - m_pCallee(pCallee) -{ - LOG_LIFECYCLE_CppObject_emit(fprintf(stderr, "LIFE: %s -> %p\n", "CppObject::CppObject", this)); -} - -CppObject::~CppObject() SAL_THROW((uno::RuntimeException)) -{ - LOG_LIFECYCLE_CppObject_emit(fprintf(stderr, "LIFE: %s -> %p\n", "CppObject::~CppObject", this)); -} - -void SAL_CALL CppObject::acquire() throw () -{ - m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::acquire")).pData); - - osl_incrementInterlockedCount(&m_nRef); -} - -void SAL_CALL CppObject::release() throw () -{ - m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::release")).pData); - - if (osl_decrementInterlockedCount(&m_nRef) == 0) - delete this; -} - -uno::Any SAL_CALL CppObject::queryInterface(uno::Type const & rType ) throw (uno::RuntimeException) -{ - m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::queryInterface")).pData); - - void * bla = this; - - return uno::Any(&bla, rType); -} - - -uno::XInterface * CppObject::s_create(Callee * pCallee) -{ - return new CppObject(pCallee); -} - -void CppObject::s_call(uno::XInterface * pXInterface) -{ - uno::Reference<uno::XInterface> tmp; - - pXInterface->queryInterface(::getCppuType(&tmp)); -} diff --git a/cppu/test/ObjectFactory/ObjectFactory.cxx b/cppu/test/ObjectFactory/ObjectFactory.cxx deleted file mode 100644 index d4f251d028ee..000000000000 --- a/cppu/test/ObjectFactory/ObjectFactory.cxx +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#define CPPU_test_ObjectFactory_IMPL - -#include "UnoObject.hxx" -#include "CppObject.hxx" -#include "ObjectFactory.hxx" - - -using namespace com::sun::star; - - - -CPPU_test_ObjectFactory_EXPORT void * createObject(rtl::OUString const & envDcp, Callee * pCallee) -{ - void * result; - - if (envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))))) - result = CppObject::s_create(pCallee); - - else if (envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)))) - result = UnoObject_create(pCallee); - - else - abort(); - - return result; -} - -CPPU_test_ObjectFactory_EXPORT void callObject(rtl::OUString const & envDcp, void * pObject) -{ - if (envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))))) - CppObject::s_call(reinterpret_cast<uno::XInterface *>(pObject)); - - else if (envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)))) - UnoObject_call(reinterpret_cast<uno_Interface *>(pObject)); - - else - abort(); -} - diff --git a/cppu/test/ObjectFactory/UnoObject.cxx b/cppu/test/ObjectFactory/UnoObject.cxx deleted file mode 100644 index 9fa22c4ca52e..000000000000 --- a/cppu/test/ObjectFactory/UnoObject.cxx +++ /dev/null @@ -1,227 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "osl/interlck.h" -#include "uno/environment.h" -#include "uno/mapping.h" -#include "uno/dispatcher.h" -#include "typelib/typedescription.h" -#include "rtl/alloc.h" -#include "com/sun/star/uno/Any.hxx" - -#include "UnoObject.hxx" -#include "callee.hxx" - - -using namespace com::sun::star; - - -#ifdef LOG_LIFECYCLE -# define LOG_LIFECYCLE_UnoObject -#endif - -#define LOG_LIFECYCLE_UnoObject -#ifdef LOG_LIFECYCLE_UnoObject -# include <iostream> -# define LOG_LIFECYCLE_UnoObject_emit(x) x - -#else -# define LOG_LIFECYCLE_UnoObject_emit(x) - -#endif - - -struct UnoObject : public uno_Interface -{ - oslInterlockedCount m_nCount; - Callee * m_pCallee; -}; - - - -static bool s_isQueryInterfaceCall(rtl_uString * pMethod, - void * pArgs[], - const sal_Char * pQueriedType) -{ - static rtl::OString aPattern("com.sun.star.uno.XInterface::queryInterface"); - - bool bIsQueryInterfaceCall = - rtl_ustr_ascii_shortenedCompare_WithLength( - rtl_uString_getStr( pMethod ), - rtl_uString_getLength( pMethod ), - aPattern.getStr(), - aPattern.getLength() ) == 0; - - if (bIsQueryInterfaceCall) - { - typelib_TypeDescriptionReference * pTDR - = *(typelib_TypeDescriptionReference **)pArgs[ 0 ]; - - bIsQueryInterfaceCall = - rtl_ustr_ascii_compare( - rtl_uString_getStr( pTDR->pTypeName ), - pQueriedType ) == 0; - } - - return bIsQueryInterfaceCall; -} - -static void s_UnoObject_delete(UnoObject * pUnoObject) -{ - LOG_LIFECYCLE_UnoObject_emit(fprintf(stderr, "LIFE: %s -> %p\n", "s_UnoObject_delete", pUnoObject)); - - rtl_freeMemory(pUnoObject); -} - - -extern "C" { -static void SAL_CALL s_UnoObject_acquire(uno_Interface * pUnoI) -{ - UnoObject * pUnoObject = (UnoObject *)pUnoI; - - pUnoObject->m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::acquire")).pData); - - osl_incrementInterlockedCount(&pUnoObject->m_nCount); -} - -static void SAL_CALL s_UnoObject_release(uno_Interface * pUnoI) -{ - UnoObject * pUnoObject = (UnoObject *)pUnoI; - - pUnoObject->m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::release")).pData); - - if (osl_decrementInterlockedCount(&pUnoObject->m_nCount) == 0) - s_UnoObject_delete(pUnoObject); -} - -static void SAL_CALL s_UnoObject_dispatch( - uno_Interface * pUnoI, - typelib_TypeDescription const * pMemberType, - void * pReturn, - void * pArgs[], - uno_Any ** ppException ) -{ - UnoObject * pUnoObject = (UnoObject *)pUnoI; - *ppException = NULL; - - pUnoObject->m_pCallee(rtl::OUString(pMemberType->pTypeName).pData); - - if (s_isQueryInterfaceCall(pMemberType->pTypeName, pArgs, "com.sun.star.uno.XInterface")) - { - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_typedescriptionreference_acquire(type_XInterface); - - uno::Any * pRet = (uno::Any *)pReturn; - pRet->pType = type_XInterface; - pRet->pData = &pRet->pReserved; - pRet->pReserved = pUnoObject; - - s_UnoObject_acquire(pUnoObject); - } - else - abort(); -} -} - -uno_Interface * UnoObject_create(Callee * pCallee) -{ - UnoObject * pUnoObject = (UnoObject *)rtl_allocateMemory(sizeof(UnoObject)); - - LOG_LIFECYCLE_UnoObject_emit(fprintf(stderr, "LIFE: %s -> %p\n", "UnoObject_create", pUnoObject)); - - pUnoObject->m_nCount = 1; - pUnoObject->m_pCallee = pCallee; - - pUnoObject->acquire = s_UnoObject_acquire; - pUnoObject->release = s_UnoObject_release; - pUnoObject->pDispatcher = s_UnoObject_dispatch; - - pUnoObject->m_pCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UnoObject_create")).pData); - - return pUnoObject; -} - -void UnoObject_release(uno_Interface * pUnoI) -{ - pUnoI->release(pUnoI); -} - - -void UnoObject_call(uno_Interface * pUnoI) -{ - uno_Any exception; - uno_Any * pException = &exception; - - uno_Interface * pUno_XInv = NULL; - - { - typelib_TypeDescription * g_pQITD = NULL; - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0; - TYPELIB_DANGER_GET( (typelib_TypeDescription **) &pTXInterfaceDescr, type_XInterface ); - typelib_typedescriptionreference_getDescription( - &g_pQITD, pTXInterfaceDescr->ppAllMembers[ 0 ] ); - TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) pTXInterfaceDescr ); - - - - uno_Any result; - - void * args[ 1 ]; - args[ 0 ] = &type_XInterface; - - pUnoI->pDispatcher(pUnoI, g_pQITD, &result, args, &pException); - - - typelib_TypeDescriptionReference * ret_type = result.pType; - switch (ret_type->eTypeClass) - { - case typelib_TypeClass_VOID: // common case - typelib_typedescriptionreference_release( ret_type ); - break; - case typelib_TypeClass_INTERFACE: - // tweaky... avoiding acquire/ release pair - typelib_typedescriptionreference_release( ret_type ); - pUno_XInv = (uno_Interface *) result.pReserved; // serving acquired interface - break; - default: - uno_any_destruct(&result, 0); - break; - } - } - - - pUno_XInv->release(pUno_XInv); -} diff --git a/cppu/test/ObjectFactory/empty.def b/cppu/test/ObjectFactory/empty.def deleted file mode 100644 index b191c70cf03c..000000000000 --- a/cppu/test/ObjectFactory/empty.def +++ /dev/null @@ -1,5 +0,0 @@ -HEAPSIZE 0 -EXPORTS - - - diff --git a/cppu/test/ObjectFactory/makefile.mk b/cppu/test/ObjectFactory/makefile.mk deleted file mode 100644 index 1064c760d538..000000000000 --- a/cppu/test/ObjectFactory/makefile.mk +++ /dev/null @@ -1,48 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := ObjectFactory - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - -SHL1TARGET := ObjectFactory.$(COMID) -SHL1IMPLIB := i$(SHL1TARGET) -SHL1OBJS := $(SLO)$/UnoObject.obj $(SLO)$/CppObject.obj $(SLO)$/ObjectFactory.obj -SHL1STDLIBS := $(CPPULIB) $(SALHELPERLIB) $(SALLIB) -SHL1DEF := empty.def - - -.INCLUDE : target.mk - - diff --git a/cppu/test/Shield/Shield.test.cxx b/cppu/test/Shield/Shield.test.cxx deleted file mode 100644 index d08b60e59a45..000000000000 --- a/cppu/test/Shield/Shield.test.cxx +++ /dev/null @@ -1,249 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" - -#include "uno/environment.hxx" - -#include "cppu/Shield.hxx" -#include "cppu/EnvGuards.hxx" - -#include "../ObjectFactory/ObjectFactory.hxx" - - -using namespace com::sun::star; - - -static rtl::OUString s_comment; -static uno::Environment s_env; - -extern "C" { -static void s_callee_in(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_in method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: \"")); - s_comment += uno::Environment::getCurrent().getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: ")); - s_comment += reason; - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - } -} - -static void s_callee_out(rtl_uString * pMethod_name) -{ - rtl::OUString method_name(pMethod_name); - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\ts_callee_out method:\"")); - s_comment += method_name; - - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" env: \"")); - s_comment += uno::Environment::getCurrent().getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); - - if (!s_env.is()) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: s_env not set")); - return; - } - - rtl::OUString reason; - int valid = s_env.isValid(&reason); - - if (!valid) - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - else - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE: is in\n")); -} -} - -static uno::Reference<uno::XInterface> s_get_envObject(void) -{ - cppu::EnvGuard envGuard(s_env); - - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_in)); - - return uno::Reference<uno::XInterface>(pObject, SAL_NO_ACQUIRE); -} - -static uno::XInterface * s_x_get_flatObject(void) -{ - uno::XInterface * pObject = reinterpret_cast<uno::XInterface *>( - createObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))), - s_callee_out)); - - return pObject; -} - -static uno::Reference<uno::XInterface> s_get_flatObject(void) -{ - return uno::Reference<uno::XInterface>(s_x_get_flatObject(), SAL_NO_ACQUIRE); -} - - -static void s_test__shield(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__shield:\n")); - - uno::Reference<uno::XInterface> obj; - - { - cppu::EnvGuard envGuard(s_env); - obj.set(cppu::shield(s_get_envObject().get()), SAL_NO_ACQUIRE); - } - - obj->acquire(); - obj->release(); -} - -static void s_test__unshield(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__unshield:\n")); - - uno::Reference<uno::XInterface> obj; - - { - cppu::EnvGuard envGuard(s_env); - uno::XInterface * pObj = s_x_get_flatObject(); - obj.set(cppu::unshield(pObj), SAL_NO_ACQUIRE); - - envGuard.clear(); - pObj->release(); - } - - { - cppu::EnvGuard envGuard(s_env); - obj.clear(); - } -} - -static void s_test__shieldAny(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__shieldAny:\n")); - - uno::Any out; - - { - cppu::EnvGuard envGuard(s_env); - uno::Any any; - any <<= s_get_envObject(); - cppu::shieldAny(any, &out); - } - - uno::Reference<uno::XInterface> obj; - out >>= obj; - - obj->acquire(); - obj->release(); -} - -static void s_test__unshieldAny(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__unshieldAny:\n")); - - uno::Any out; - { - uno::Any any(s_get_flatObject()); - - { - cppu::EnvGuard envGuard(s_env); - cppu::unshieldAny(any, &out); - } - } - - { - cppu::EnvGuard envGuard(s_env); - - uno::Reference<uno::XInterface> obj; - out >>= obj; - - obj.clear(); - } -} - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))).enter(); - - s_env = uno::Environment(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe"))); - - s_test__shield(); - s_test__shieldAny(); - s_test__unshield(); - s_test__unshieldAny(); - - s_env.clear(); - - - uno_Environment_enter(NULL); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/Shield/makefile.mk b/cppu/test/Shield/makefile.mk deleted file mode 100644 index 119516ced695..000000000000 --- a/cppu/test/Shield/makefile.mk +++ /dev/null @@ -1,55 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := Shield.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" -ObjectFactory_LIB := -lObjectFactory.$(COMID) - -.ELSE -ObjectFactory_LIB := $(LIBPRE) iObjectFactory.$(COMID).lib - -.ENDIF - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/Shield.test.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/UnsafeBridge/UnsafeBridge.test.pl b/cppu/test/UnsafeBridge/UnsafeBridge.test.pl deleted file mode 100755 index b61b92013387..000000000000 --- a/cppu/test/UnsafeBridge/UnsafeBridge.test.pl +++ /dev/null @@ -1,72 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests = ( - "EnvStack.tester :A:unsafe :A:unsafe \"-enter:A[0,not entered]-leave:A[0,not entered]\" :A:unsafe", # initially not entered&leave - "EnvStack.tester :unsafe:A :unsafe:A \"-enter:unsafe:A[1,OK]-leave:unsafe:A[1,OK]\" :unsafe", # enter - "EnvStack.tester \"\" :unsafe:A \"-into:unsafe:A[1,OK]\" :unsafe", # call into - "EnvStack.tester :unsafe :A \"-into:A[0,not entered]\" :unsafe", # call out - "EnvStack.tester \"\" :unsafe:affine:A \"-into:unsafe:affine:A[0,wrong thread]\" :unsafe", # wrong thread - "env.tester.bin CPP:unsafe" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/UnsafeBridge/makefile.mk b/cppu/test/UnsafeBridge/makefile.mk deleted file mode 100644 index 33a1c5c32299..000000000000 --- a/cppu/test/UnsafeBridge/makefile.mk +++ /dev/null @@ -1,42 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := UnsafeBridge.test.pl - - -.INCLUDE : settings.mk - - -.INCLUDE : target.mk - - -ALLTAR: $(BIN)$/$(TARGET) - -$(BIN)$/$(TARGET): UnsafeBridge.test.pl - @+$(COPY) $^ $@ diff --git a/cppu/test/alignment.idl b/cppu/test/alignment.idl deleted file mode 100644 index 424c232fb14f..000000000000 --- a/cppu/test/alignment.idl +++ /dev/null @@ -1,205 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _TEST_ALIGNMENT_IDL_ -#define _TEST_ALIGNMENT_IDL_ - -#include <com/sun/star/uno/XInterface.idl> - -module test -{ -module alignment -{ - -struct C1 -{ - short n1; -}; -struct C2 : C1 -{ - long n2; -}; -struct C3 : C2 -{ - double d3; - long n3; -}; -struct C4 : C3 -{ - long n4; - double d4; -}; -struct C5 : C4 -{ - hyper n5; - boolean b5; -}; - -struct C6 : C1 -{ - C5 c; - boolean b6; -}; -struct C7 : C1 -{ - C1 c; - boolean b6; -}; -struct C8 : C1 -{ - any a; - boolean b6; -}; -struct C9 : C1 -{ - string s; - boolean b6; -}; -struct C10 : C1 -{ - float f; - boolean b6; -}; -struct C11 : C1 -{ - double d; - boolean b6; -}; -struct C12 : C1 -{ - hyper n; - boolean b6; -}; -struct C13 : C1 -{ - unsigned hyper n; - boolean b6; -}; -struct C14 : C1 -{ - ::com::sun::star::uno::XInterface x; - boolean b6; -}; - -struct C1x -{ - short sx; - double dx; -}; - -struct C6x : C1x -{ - C5 c; - boolean b6; -}; -struct C7x : C1x -{ - C1 c; - boolean b6; -}; -struct C8x : C1x -{ - any a; - boolean b6; -}; -struct C9x : C1x -{ - string s; - boolean b6; -}; -struct C10x : C1x -{ - float f; - boolean b6; -}; -struct C11x : C1x -{ - double d; - boolean b6; -}; -struct C12x : C1x -{ - hyper n; - boolean b6; -}; -struct C13x : C1x -{ - unsigned hyper n; - boolean b6; -}; -struct C14x : C1x -{ - ::com::sun::star::uno::XInterface x; - boolean b6; -}; - - -struct D -{ - short d; - long e; -}; -struct E -{ - boolean a; - boolean b; - boolean c; - short d; - long e; -}; - -struct M -{ - long n; - short o; -}; - -struct N : M -{ - short p; -}; -struct N2 -{ - M m; - short p; -}; -struct O : M -{ - double p; -}; -struct O2 : O -{ - double p2; -}; -struct P : N -{ - double p2; -}; - -}; // alignment -}; // test - -#endif diff --git a/cppu/test/alignment/diagnose.h b/cppu/test/alignment/diagnose.h deleted file mode 100644 index 1568f70adf47..000000000000 --- a/cppu/test/alignment/diagnose.h +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DIAGNOSE_H -#define DIAGNOSE_H - -#include <sal/types.h> -#include <stdio.h> - -#if defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD)) && defined(INTEL) -#define ALIGNMENT(s, n) __alignof__ (s) -#else -#define ALIGNMENT(s, n) n -#endif - -#define OFFSET_OF( s, m ) ((sal_Size)((char *)&((s *)16)->m -16)) - -#define BINTEST_VERIFY( c ) \ - if (! (c)) { fprintf( stderr, "### binary compatibility test failed: " #c " [line %d]!!!\n", __LINE__ ); abort(); } - -#if OSL_DEBUG_LEVEL > 1 - -#define BINTEST_VERIFYOFFSET( s, m, n ) \ - fprintf( stderr, "> OFFSET_OF(" #s ", " #m ") = %lu\n", static_cast< unsigned long >(OFFSET_OF(s, m)) ); \ - if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %d instead of expected %d!!!\n", OFFSET_OF(s, m), n ); abort(); } -#define BINTEST_VERIFYSIZE( s, n ) \ - fprintf( stderr, "> sizeof (" #s ") = %lu\n", static_cast< unsigned long >(sizeof(s)) ); \ - if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", sizeof(s), n ); abort(); } -#define BINTEST_VERIFYALIGNMENT( s, n ) \ - fprintf( stderr, "> alignment of " #s " = %d\n", ALIGNMENT(s, n) ); \ - if (ALIGNMENT(s, n) != n) { fprintf( stderr, "### alignment of " #s " = %d instead of expected %d!!!\n", ALIGNMENT(s, n), n ); abort(); } - -#else - -#define BINTEST_VERIFYOFFSET( s, m, n ) \ - if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %lu instead of expected %lu!!!\n", static_cast< unsigned long >(OFFSET_OF(s, m)), static_cast< unsigned long >(n) ); abort(); } -#define BINTEST_VERIFYSIZE( s, n ) \ - if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %lu instead of expected %lu!!!\n", static_cast< unsigned long >(sizeof(s)), static_cast< unsigned long >(n) ); abort(); } -#define BINTEST_VERIFYALIGNMENT( s, n ) \ - if (ALIGNMENT(s, n) != n) { fprintf( stderr, "### alignment of " #s " = %d instead of expected %d!!!\n", ALIGNMENT(s, n), n ); abort(); } - -#endif - -#endif diff --git a/cppu/test/alignment/makefile.mk b/cppu/test/alignment/makefile.mk deleted file mode 100644 index 03e4d2de23a8..000000000000 --- a/cppu/test/alignment/makefile.mk +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# -# build /test first, then /test/alignment -# - -PRJ=..$/.. -PRJNAME=cppu -TARGET=alignment -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE -NO_BSYMBOLIC=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -UNOUCRDEP=$(BIN)$/testcppu.rdb -UNOUCRRDB=$(BIN)$/testcppu.rdb -UNOUCROUT=$(INCCOM)$/test$/alignment -INCPRE+=$(INCCOM)$/test -I$(INCCOM)$/test$/alignment -I$(PRJ)$/test$/alignment - -.IF "$(src_env)" == "" -merge_rdb=$(SOLARBINDIR)$/udkapi.rdb -.ELSE -merge_rdb=$(SOLARBINDIR)$/applicat.rdb -.ENDIF - -DEPOBJFILES= \ - $(OBJ)$/pass1.obj \ - $(OBJ)$/pass2.obj - -APP1OBJS = $(OBJ)$/pass1.obj -APP1STDLIBS += $(CPPUHELPERLIB) $(CPPULIB) $(REGLIB) $(SALHELPERLIB) $(SALLIB) -APP1TARGET = pass1 - -APP2OBJS = $(OBJ)$/pass2.obj -APP2STDLIBS = $(SALLIB) -APP2TARGET = pass2 - -# --- Targets ------------------------------------------------------ - -.IF "$(depend)" == "" -ALLTAR: execute_pass2 -.ELSE -ALL: ALLDEP -.ENDIF - -.INCLUDE : target.mk - -$(MISC)$/pass2.cxx: $(APP1TARGETN) - regmerge $(UNOUCRRDB) / $(merge_rdb) - cppumaker @$(mktmp $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) $(foreach,c,$(shell @$(APP1TARGETN) -env:UNO_TYPES={$(subst,\,\\ $(UNOUCRRDB))} $(subst,\,\\ $(MISC)$/pass2.cxx) dump_types) -T$c) $(UNOUCRRDB)) - -execute_pass2: $(APP2TARGETN) - $(APP2TARGETN) - diff --git a/cppu/test/alignment/pass1.cxx b/cppu/test/alignment/pass1.cxx deleted file mode 100644 index f60446c82639..000000000000 --- a/cppu/test/alignment/pass1.cxx +++ /dev/null @@ -1,240 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "sal/main.h" - -#include <stdio.h> -#include <vector> - -#include <rtl/string.hxx> -#include <rtl/strbuf.hxx> -#include <rtl/bootstrap.hxx> -#include <rtl/process.h> - -#include <registry/reflread.hxx> - -// starting the executable: -// -env:UNO_CFG_URL=local;<absolute_path>..\\..\\test\\cfg_data;<absolute_path>\\cfg_update -// -env:UNO_TYPES=cpputest.rdb - -#include <cppuhelper/bootstrap.hxx> - -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/registry/XRegistryKey.hpp> -#include <com/sun/star/registry/XSimpleRegistry.hpp> - -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) -#define OSTR(x) ::rtl::OUStringToOString( x, RTL_TEXTENCODING_ASCII_US ) - - -using namespace ::cppu; -using namespace ::rtl; -using namespace ::osl; -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; - - -static void find_all_structs( - Reference< registry::XRegistryKey > const & xKey, - ::std::vector< OUString > * pNames ) -{ - if (xKey.is() && xKey->isValid()) - { - if (xKey->getValueType() == registry::RegistryValueType_BINARY) - { - Sequence< sal_Int8 > aBytes( xKey->getBinaryValue() ); - RegistryTypeReader aReader( - (const sal_uInt8 *)aBytes.getConstArray(), - aBytes.getLength(), sal_False ); - - switch (aReader.getTypeClass()) - { - case RT_TYPE_EXCEPTION: - case RT_TYPE_STRUCT: - pNames->push_back( aReader.getTypeName().replace( '/', '.' ) ); - break; - default: - break; - } - } - - Sequence< Reference< registry::XRegistryKey > > keys( xKey->openKeys() ); - Reference< registry::XRegistryKey > const * pKeys = keys.getConstArray(); - for ( sal_Int32 nPos = keys.getLength(); nPos--; ) - { - find_all_structs( pKeys[ nPos ], pNames ); - } - } -} - -static OString makeIncludeName( OUString const & name ) SAL_THROW( () ) -{ - return OSTR(name.replace( '.', '/' )); -} -static OString makeCppName( OUString const & name ) SAL_THROW( () ) -{ - OStringBuffer buf( 64 ); - OString str( OSTR(name) ); - sal_Int32 n = 0; - do - { - buf.append( str.getToken( 0, '.', n ) ); - if (n >= 0) - buf.append( "::" ); - } - while (n >= 0); - return buf.makeStringAndClear(); -} - -//================================================================================================== -SAL_IMPLEMENT_MAIN() -{ - sal_Int32 argc = rtl_getAppCommandArgCount(); - if (argc < 1) - { - fprintf( stderr, "usage: pass1 pass2_source [typelist_to_stdout]\n" ); - return 1; - } - - try - { - // determine types rdb - OUString rdb_name; - Bootstrap bootstrap; - if (!bootstrap.getFrom( OUSTR("UNO_TYPES"), rdb_name ) || !rdb_name.getLength()) - { - fprintf( - stderr, - "### no UNO_TYPES registry found!!!\n\n" - "usage: pass1 pass2_source [typelist_to_stdout]\n" ); - return 1; - } - - Reference< XComponentContext > xContext( defaultBootstrap_InitialComponentContext() ); - - // read out all struct names from given registry - Reference< registry::XSimpleRegistry > xSimReg( createSimpleRegistry() ); - OSL_ASSERT( xSimReg.is() ); - xSimReg->open( rdb_name, sal_True, sal_False ); - OSL_ASSERT( xSimReg->isValid() ); - Reference< registry::XRegistryKey > xKey( xSimReg->getRootKey() ); - OSL_ASSERT( xKey.is() && xKey->isValid() ); - - ::std::vector< OUString > names; - names.reserve( 128 ); - find_all_structs( xKey->openKey( OUSTR("UCR") ), &names ); - - OUString fileName; - OSL_VERIFY( osl_Process_E_None == rtl_getAppCommandArg( 0, &fileName.pData ) ); - bool bDumpStdOut = (argc > 1); - - // generate pass2 output file [and type list] - OString str( OSTR(fileName) ); - FILE * hPass2 = fopen( str.getStr(), "w" ); - OSL_ASSERT( hPass2 ); - - size_t nPos; - for ( nPos = names.size(); nPos--; ) - { - OUString const & name = names[ nPos ]; - if (bDumpStdOut) - { - // type name on stdout - OString str2( OSTR(name) ); - fprintf( stdout, "%s\n", str2.getStr() ); - } - // all includes - OString includeName( makeIncludeName( name ) ); - fprintf( hPass2, "#include <%s.hdl>\n", includeName.getStr() ); - } - // include diagnose.h - fprintf( - hPass2, - "\n#include <diagnose.h>\n" - "#include \"sal/main.h\"\n\n" - "SAL_IMPLEMENT_MAIN()\n{\n" ); - // generate all type checks - for ( nPos = names.size(); nPos--; ) - { - OUString const & name = names[ nPos ]; - typelib_TypeDescription * pTD = 0; - typelib_typedescription_getByName( &pTD, name.pData ); - if (pTD) - { - if (! pTD->bComplete) - { - typelib_typedescription_complete( &pTD ); - } - typelib_CompoundTypeDescription * pCTD = (typelib_CompoundTypeDescription *)pTD; - - OString cppName( makeCppName( name ) ); - fprintf( - hPass2, "\tBINTEST_VERIFYSIZE( %s, %ld );\n", - cppName.getStr(), static_cast< long >(pTD->nSize) ); - fprintf( - hPass2, "\tBINTEST_VERIFYALIGNMENT( %s, %ld );\n", - cppName.getStr(), static_cast< long >(pTD->nAlignment) ); - // offset checks - for ( sal_Int32 nPos2 = pCTD->nMembers; nPos2--; ) - { - OString memberName( OSTR(pCTD->ppMemberNames[ nPos2 ]) ); - fprintf( - hPass2, "\tBINTEST_VERIFYOFFSET( %s, %s, %ld );\n", - cppName.getStr(), memberName.getStr(), - static_cast< long >(pCTD->pMemberOffsets[ nPos2 ]) ); - } - typelib_typedescription_release( pTD ); - } - else - { - OString str2( OSTR(name) ); - fprintf( stderr, "### cannot dump type %s!!!\n", str2.getStr() ); - } - } - fprintf( - hPass2, - "\n\tfprintf( stdout, \"> alignment test succeeded.\\n\" );\n" - "\treturn 0;\n}\n\n" ); - fclose( hPass2 ); - - Reference< lang::XComponent > xComp( xContext, UNO_QUERY ); - if (xComp.is()) - { - xComp->dispose(); - } - return 0; - } - catch (Exception & exc) - { - OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); - ::fprintf( stderr, "# caught exception: %s\n", str.getStr() ); - return 1; - } -} diff --git a/cppu/test/cascade_mapping/TestMapping.cxx b/cppu/test/cascade_mapping/TestMapping.cxx deleted file mode 100644 index 724946c5b8c0..000000000000 --- a/cppu/test/cascade_mapping/TestMapping.cxx +++ /dev/null @@ -1,194 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "osl/interlck.h" -#include "uno/dispatcher.h" -#include "uno/mapping.hxx" - -#include "TestProxy.hxx" - - -#ifdef LOG_LIFECYCLE -#define LOG_LIFECYCLE_TestMapping -#endif - -#define LOG_LIFECYCLE_TestMapping -#ifdef LOG_LIFECYCLE_TestMapping -# include <iostream> -# define LOG_LIFECYCLE_TestMapping_emit(x) x - -#else -# define LOG_LIFECYCLE_TestMapping_emit(x) - -#endif - - -class SAL_DLLPRIVATE TestMapping : public uno_Mapping -{ -private: - oslInterlockedCount m_nCount; - uno_ExtEnvironment * m_pFrom; - uno_ExtEnvironment * m_pTo; - -public: - explicit TestMapping(uno_Environment * pFrom, uno_Environment * pTo); - ~TestMapping(void); - - void acquire() SAL_THROW(()); - void release() SAL_THROW(()); - - void SAL_CALL mapInterface(uno_Interface ** ppOut, - uno_Interface * pUnoI, - typelib_InterfaceTypeDescription * pTypeDescr - ) - SAL_THROW_EXTERN_C(); -}; - - -extern "C" { -static void SAL_CALL s_mapInterface( - uno_Mapping * pMapping, - void ** ppOut, - void * pUnoI, - typelib_InterfaceTypeDescription * pTypeDescr ) - SAL_THROW_EXTERN_C() -{ - TestMapping * pTestMapping = static_cast<TestMapping *>(pMapping); - pTestMapping->mapInterface((uno_Interface **)ppOut, (uno_Interface *)pUnoI, pTypeDescr); -} - - -static void SAL_CALL s_acquire(uno_Mapping * pMapping) SAL_THROW_EXTERN_C() -{ - TestMapping * pTestMapping = static_cast<TestMapping *>(pMapping); - pTestMapping->acquire(); -} - - -static void SAL_CALL s_release(uno_Mapping * pMapping) SAL_THROW_EXTERN_C() -{ - TestMapping * pTestMapping = static_cast<TestMapping * >(pMapping); - pTestMapping->release(); -} - -static void SAL_CALL s_free(uno_Mapping * pMapping) SAL_THROW_EXTERN_C() -{ - TestMapping * pTestMapping = static_cast<TestMapping * >(pMapping); - delete pTestMapping; -} -} - -TestMapping::TestMapping(uno_Environment * pFrom, uno_Environment * pTo) - SAL_THROW( () ) - : m_nCount(1), - m_pFrom(reinterpret_cast<uno_ExtEnvironment *>(pFrom)), - m_pTo (reinterpret_cast<uno_ExtEnvironment *>(pTo)) -{ - LOG_LIFECYCLE_TestMapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestMapping::TestMapping", this)); - - m_pFrom->aBase.acquire(&m_pFrom->aBase); - m_pTo ->aBase.acquire(&m_pTo ->aBase); - - uno_Mapping::acquire = s_acquire; - uno_Mapping::release = s_release; - uno_Mapping::mapInterface = s_mapInterface; -} - -TestMapping::~TestMapping(void) -{ - LOG_LIFECYCLE_TestMapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestMapping::~TestMapping", this)); - - m_pFrom->aBase.release(&m_pFrom->aBase); - m_pTo ->aBase.release(&m_pTo ->aBase); -} - - -void TestMapping::acquire() SAL_THROW(()) -{ - if (osl_incrementInterlockedCount(&m_nCount) == 1) - { - uno_Mapping * pMapping = this; - - ::uno_registerMapping(&pMapping, s_free, &m_pFrom->aBase, &m_pTo->aBase, NULL); - } -} - -void TestMapping::release() SAL_THROW(()) -{ - if (osl_decrementInterlockedCount(&m_nCount) == 0) - ::uno_revokeMapping(this); -} - - -void SAL_CALL TestMapping::mapInterface( - uno_Interface ** ppOut, - uno_Interface * pUnoI, - typelib_InterfaceTypeDescription * pTypeDescr ) - SAL_THROW_EXTERN_C() -{ - // get object id of uno interface to be wrapped - rtl_uString * pOId = 0; - m_pFrom->getObjectIdentifier(m_pFrom, &pOId, pUnoI); - - OSL_ASSERT(pOId); - - if (*ppOut) - { - (*ppOut)->release(*ppOut); - *ppOut = 0; - } - - // try to get any known interface from target environment - m_pTo->getRegisteredInterface(m_pTo, (void **)ppOut, pOId, pTypeDescr); - if (!*ppOut) // not yet there, register new proxy interface - { - // try to publish a new proxy (ref count initially 1) - TestProxy * pTestProxy = new TestProxy(pUnoI, pOId, pTypeDescr, m_pTo, m_pFrom); - - // proxy may be exchanged during registration - m_pTo->registerProxyInterface(m_pTo,(void **)&pTestProxy, TestProxy_free, pOId, pTypeDescr); - - *ppOut = pTestProxy; - } - - rtl_uString_release(pOId); -} - - -extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_initEnvironment(uno_Environment * /*pEnv*/) - SAL_THROW_EXTERN_C() -{ -} - -extern "C" void uno_ext_getMapping(uno_Mapping ** ppMapping, - uno_Environment * pFrom, - uno_Environment * pTo ) -{ - *ppMapping = new TestMapping(pFrom, pTo); - - ::uno_registerMapping(ppMapping, s_free, pFrom, pTo, NULL); -} diff --git a/cppu/test/cascade_mapping/TestMapping.def b/cppu/test/cascade_mapping/TestMapping.def deleted file mode 100644 index e8b4824657f9..000000000000 --- a/cppu/test/cascade_mapping/TestMapping.def +++ /dev/null @@ -1,11 +0,0 @@ -LIBRARY cppu3 -DESCRIPTION 'StarView 3.00 680 m124' -DATA READ WRITE SHARED -HEAPSIZE 0 -EXPORTS - uno_initEnvironment - uno_ext_getMapping - - - - diff --git a/cppu/test/cascade_mapping/TestProxy.cxx b/cppu/test/cascade_mapping/TestProxy.cxx deleted file mode 100644 index d72e11c2ecab..000000000000 --- a/cppu/test/cascade_mapping/TestProxy.cxx +++ /dev/null @@ -1,179 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "uno/mapping.hxx" -#include "cppu/EnvDcp.hxx" - -#include "../mapping_tester/Mapping.tester.hxx" - -#include "TestProxy.hxx" - - -#ifdef LOG_LIFECYCLE -#define LOG_LIFECYCLE_TestProxy -#endif - -#define LOG_LIFECYCLE_TestProxy -#ifdef LOG_LIFECYCLE_TestProxy -# include <iostream> -# define LOG_LIFECYCLE_TestProxy_emit(x) x - -#else -# define LOG_LIFECYCLE_TestProxy_emit(x) - -#endif - - -using namespace com::sun::star; - -extern "C" void SAL_CALL TestProxy_free(uno_ExtEnvironment * /*pEnv*/, void * pObject) - SAL_THROW_EXTERN_C() -{ - TestProxy * pTestProxy = reinterpret_cast<TestProxy *>(pObject); - delete pTestProxy; -} - - -extern "C" { -static void SAL_CALL s_acquire(uno_Interface * pUnoI) SAL_THROW_EXTERN_C() -{ - TestProxy * pTestProxy = static_cast<TestProxy *>(pUnoI); - pTestProxy->acquire(); -} - -static void SAL_CALL s_release(uno_Interface * pUnoI) SAL_THROW_EXTERN_C() -{ - TestProxy * pTestProxy = static_cast<TestProxy *>(pUnoI); - pTestProxy->release(); -} - -static void SAL_CALL s_dispatch(uno_Interface * pUnoI, - typelib_TypeDescription const * pMemberType, - void * pReturn, - void * pArgs[], - uno_Any ** ppException) - SAL_THROW_EXTERN_C() -{ - TestProxy * pThis = static_cast<TestProxy *>(pUnoI); - pThis->dispatch(pMemberType, pReturn, pArgs, ppException); -} -} - -TestProxy::TestProxy(uno_Interface * pObject, - rtl::OUString const & oid, - typelib_InterfaceTypeDescription * pTypeDescr, - uno_ExtEnvironment * pFrom_extEnv, - uno_ExtEnvironment * pTo_extEnv) - : m_nCount (1), - m_from_envDcp(pFrom_extEnv->aBase.pTypeName), - m_to_envDcp (pTo_extEnv ->aBase.pTypeName), - m_oid (oid), - m_pTypeDescr (pTypeDescr) -{ - LOG_LIFECYCLE_TestProxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestProxy::TestProxy", this)); - - // uno_Interface - uno_Interface::acquire = s_acquire; - uno_Interface::release = s_release; - uno_Interface::pDispatcher = s_dispatch; - - m_theObject = pObject; - m_theObject->acquire(m_theObject); - - typelib_typedescription_acquire(&pTypeDescr->aBase); - - m_pFrom_extEnv = pFrom_extEnv; - m_pFrom_extEnv->aBase.acquire(&m_pFrom_extEnv->aBase); - - m_pTo_extEnv = pTo_extEnv; - m_pTo_extEnv->aBase.acquire(&m_pTo_extEnv->aBase); - - m_pTo_extEnv->registerInterface(m_pTo_extEnv, reinterpret_cast<void **>(&pObject), oid.pData, pTypeDescr); -} - -TestProxy::~TestProxy(void) -{ - LOG_LIFECYCLE_TestProxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestProxy::~TestProxy", this)); - - m_pTo_extEnv->revokeInterface(m_pTo_extEnv, reinterpret_cast<void *>(m_theObject)); - - typelib_typedescription_release(&m_pTypeDescr->aBase); - m_theObject->release(m_theObject); - m_pFrom_extEnv->aBase.release(&m_pFrom_extEnv->aBase); - m_pTo_extEnv ->aBase.release(&m_pTo_extEnv->aBase); -} - -void TestProxy::acquire() SAL_THROW(()) -{ - if (osl_incrementInterlockedCount(&m_nCount) == 1) - { - uno_Interface * pThis = this; - m_pTo_extEnv->registerProxyInterface(m_pTo_extEnv, - (void **)&pThis, - TestProxy_free, - m_oid.pData, - m_pTypeDescr); - OSL_ASSERT(pThis == this); - } -} - -void TestProxy::release() SAL_THROW(()) -{ - if (osl_decrementInterlockedCount(&m_nCount) == 0) - { - m_pFrom_extEnv->revokeInterface(m_pFrom_extEnv, this); - } -} - -void TestProxy::dispatch(typelib_TypeDescription const * pMemberType, - void * pReturn, - void * pArgs[], - uno_Any ** ppException) -{ - { - rtl::OUString arrow(RTL_CONSTASCII_USTRINGPARAM("-->")); - - if (!g_custom.getLength()) - g_custom += m_from_envDcp; - - g_custom += arrow; - g_custom += m_to_envDcp; - - m_theObject->pDispatcher(m_theObject, pMemberType, pReturn, pArgs, ppException); - - uno_Any * any = (uno_Any *)pReturn; - - void * pout = NULL; - - uno::Mapping mapping(m_to_envDcp, m_from_envDcp); - mapping.mapInterface(&pout, any->pReserved, any->pType); - - ((uno_Interface *)any->pReserved)->release((uno_Interface*)any->pReserved); - any->pReserved = pout; - } -} - diff --git a/cppu/test/cascade_mapping/TestProxy.hxx b/cppu/test/cascade_mapping/TestProxy.hxx deleted file mode 100644 index 3dae15ee8620..000000000000 --- a/cppu/test/cascade_mapping/TestProxy.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_TestProxy_hxx -#define INCLUDED_TestProxy_hxx - -#include "osl/interlck.h" -#include "uno/dispatcher.h" -#include "uno/environment.hxx" - - -extern "C" void SAL_CALL TestProxy_free(uno_ExtEnvironment * pEnv, void * pObject) SAL_THROW_EXTERN_C(); - - -class SAL_DLLPRIVATE TestProxy : public uno_Interface -{ -private: - uno_Interface * m_theObject; - uno_ExtEnvironment * m_pFrom_extEnv; - uno_ExtEnvironment * m_pTo_extEnv; - oslInterlockedCount m_nCount; - rtl::OUString m_from_envDcp; - rtl::OUString m_to_envDcp; - rtl::OUString m_oid; - typelib_InterfaceTypeDescription * m_pTypeDescr; - -public: - explicit TestProxy(uno_Interface * pObject, - rtl::OUString const & oid, - typelib_InterfaceTypeDescription * pTypeDescr, - uno_ExtEnvironment * pFrom_env, - uno_ExtEnvironment * pExtEnvironment); - ~TestProxy(void); - - - void acquire() SAL_THROW(()); - void release() SAL_THROW(()); - - void dispatch(typelib_TypeDescription const * pMemberType, - void * pReturn, - void * pArgs[], - uno_Any ** ppException); -}; - - -#endif diff --git a/cppu/test/cascade_mapping/cascade_mapping.test.pl b/cppu/test/cascade_mapping/cascade_mapping.test.pl deleted file mode 100755 index 265010a56abb..000000000000 --- a/cppu/test/cascade_mapping/cascade_mapping.test.pl +++ /dev/null @@ -1,91 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests=( -"mapping.tester uno:test uno -s path.test \"uno:test-->uno\"", -"mapping.tester uno uno:test -s path.test \"uno-->uno:test\"", -"mapping.tester uno:test:bla uno -s path.test \"uno:test:bla-->uno:test-->uno\"", -"mapping.tester uno uno:test:bla -s path.test \"uno-->uno:test-->uno:test:bla\"", -"mapping.tester uno:test:bla:blubb uno -s path.test \"uno:test:bla:blubb-->uno:test:bla-->uno:test-->uno\"", -"mapping.tester uno uno:test:bla:blubb -s path.test \"uno-->uno:test-->uno:test:bla-->uno:test:bla:blubb\"", -"mapping.tester uno:bla uno:test -s path.test \"uno:bla-->uno-->uno:test\"", -"mapping.tester uno:test uno:bla -s path.test \"uno:test-->uno-->uno:bla\"", -"mapping.tester uno:test:blubb uno:bla -s path.test \"uno:test:blubb-->uno:test-->uno-->uno:bla\"", -"mapping.tester uno:test uno:bla:blubb -s path.test \"uno:test-->uno-->uno:bla-->uno:bla:blubb\"", -"mapping.tester uno:test:bla uno:test:blubb -s path.test \"uno:test:bla-->uno:test-->uno:test:blubb\"", -"mapping.tester CPP:bla uno -s path.test \"CPP:bla-->uno:bla-->uno\"", -"mapping.tester uno CPP:bla -s path.test \"uno-->uno:bla-->CPP:bla\"", -"mapping.tester CPP uno:bla -s path.test \"CPP-->uno-->uno:bla\"", -"mapping.tester CPP:bla uno:blubb -s path.test \"CPP:bla-->uno:bla-->uno-->uno:blubb\"", -"mapping.tester CPP:test:bla uno:test:blubb -s path.test \"CPP:test:bla-->uno:test:bla-->uno:test-->uno:test:blubb\"", -"mapping.tester CPP:bla CPP -s path.test \"CPP:bla-->uno:bla-->uno-->CPP\"", -"mapping.tester CPP CPP:bla -s path.test \"CPP-->uno-->uno:bla-->CPP:bla\"", -"mapping.tester CPP:bla:test CPP -s path.test \"CPP:bla:test-->uno:bla:test-->uno:bla-->uno-->CPP\"", -"mapping.tester CPP CPP:bla:test -s path.test \"CPP-->uno-->uno:bla-->uno:bla:test-->CPP:bla:test\"", -"mapping.tester CPP:bla CPP:blubb -s path.test \"CPP:bla-->uno:bla-->uno-->uno:blubb-->CPP:blubb\"", -"mapping.tester CPP:test:bla CPP:blubb -s path.test \"CPP:test:bla-->uno:test:bla-->uno:test-->uno-->uno:blubb-->CPP:blubb\"", -"mapping.tester CPP:bla CPP:test:blubb -s path.test \"CPP:bla-->uno:bla-->uno-->uno:test-->uno:test:blubb-->CPP:test:blubb\"", -"mapping.tester CPP:bae:bla CPP:test:blubb -s path.test \"CPP:bae:bla-->uno:bae:bla-->uno:bae-->uno-->uno:test-->uno:test:blubb-->CPP:test:blubb\"", -"mapping.tester CPP:test:bla CPP:test:blubb -s path.test \"CPP:test:bla-->uno:test:bla-->uno:test-->uno:test:blubb-->CPP:test:blubb\"" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/cascade_mapping/makefile.mk b/cppu/test/cascade_mapping/makefile.mk deleted file mode 100644 index 1d5434a6b940..000000000000 --- a/cppu/test/cascade_mapping/makefile.mk +++ /dev/null @@ -1,90 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := cascade_mappping.test.pl - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE - - -.INCLUDE : settings.mk - -CFLAGS += -fPIC - -VERSIONOBJ := # NO GetVersionInfo symbols :-) -ENVINCPRE := -I$(OUT)$/inc$/$(TARGET) - -HLD_DLLPRE := $(DLLPRE) -DLLPRE := - - -SHL1TARGET := path.test -SHL1IMPLIB := i$(SHL1TARGET) -SHL1OBJS := $(OBJ)$/path.test.obj -SHL1DEF := path.test.def -SHL1STDLIBS := $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) -.IF "$(GUI)"=="WNT" -SHL1STDLIBS += $(BIN)$/mapping.tester.lib -.ENDIF - -SHL2TARGET := $(HLD_DLLPRE)bla_uno_uno -SHL2IMPLIB := i$(SHL2TARGET) -SHL2OBJS := $(SLO)$/TestMapping.obj $(SLO)$/TestProxy.obj -SHL2STDLIBS := $(CPPULIB) $(SALHELPERLIB) $(SALLIB) -SHL2DEF := TestMapping.def -.IF "$(GUI)"=="WNT" -SHL2STDLIBS += $(BIN)$/mapping.tester.lib -.ENDIF - -SHL3TARGET := $(HLD_DLLPRE)blubb_uno_uno -SHL3IMPLIB := i$(SHL3TARGET) -SHL3OBJS := $(SHL2OBJS) -SHL3STDLIBS := $(SHL2STDLIBS) -SHL3DEF := $(SHL2DEF) - -SHL4TARGET := $(HLD_DLLPRE)bae_uno_uno -SHL4IMPLIB := i$(SHL4TARGET) -SHL4OBJS := $(SHL2OBJS) -SHL4STDLIBS := $(SHL2STDLIBS) -SHL4DEF := $(SHL2DEF) - -SHL5TARGET := $(HLD_DLLPRE)test_uno_uno -SHL5IMPLIB := i$(SHL5TARGET) -SHL5OBJS := $(SHL2OBJS) -SHL5STDLIBS := $(SHL2STDLIBS) -SHL5DEF := $(SHL2DEF) - - -.INCLUDE : target.mk - - -ALLTAR: $(BIN)$/$(TARGET) - -$(BIN)$/$(TARGET): cascade_mapping.test.pl - @+$(COPY) $^ $@ diff --git a/cppu/test/cascade_mapping/path.test.cxx b/cppu/test/cascade_mapping/path.test.cxx deleted file mode 100644 index 1b2ddb1ebdfe..000000000000 --- a/cppu/test/cascade_mapping/path.test.cxx +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "rtl/ustring.hxx" - -#include "../mapping_tester/Mapping.tester.hxx" - - -D_CALLEE -{ - rtl::OUString const method_name(pMethod_name); - - if (g_check) - { - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tmethod: ")); - g_result += method_name; - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - mapping purpose path test --> ")); - - if (g_ref.compareTo(g_custom) == 0) - { - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - } - else - { - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\t\texpected: ")); - g_result += g_ref; - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\t\t got: ")); - g_result += g_custom; - g_result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - } - } -} - diff --git a/cppu/test/cascade_mapping/path.test.def b/cppu/test/cascade_mapping/path.test.def deleted file mode 100644 index ab7d8b00c62c..000000000000 --- a/cppu/test/cascade_mapping/path.test.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY cppu3 -DESCRIPTION 'StarView 3.00 680 m124' -DATA READ WRITE SHARED -HEAPSIZE 0 -EXPORTS - CALLEE - - diff --git a/cppu/test/cpputest.idl b/cppu/test/cpputest.idl deleted file mode 100644 index 89302cb02585..000000000000 --- a/cppu/test/cpputest.idl +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _TEST_CPPUTEST_IDL_ -#define _TEST_CPPUTEST_IDL_ - -#include <com/sun/star/uno/XInterface.idl> -#include <com/sun/star/uno/TypeClass.idl> - -module test -{ - -struct Test1 -{ - short nInt16; - double dDouble; - boolean bBool; -}; - -struct Test2 -{ - short nInt16; - Test1 aTest1; -}; - -typedef Test1 TdTest1; - -struct Test3 -{ - byte nInt8; - float nFloat; - double nDouble; - short nInt16; - string aString; - unsigned short nuInt16; - hyper nInt64; - long nInt32; - unsigned hyper nuInt64; - unsigned long nuInt32; - com::sun::star::uno::TypeClass eType; - char wChar; - TdTest1 td; - boolean bBool; - any aAny; -}; - - -struct Base -{ - long n; - short o; -}; - -struct Base1 : Base -{ - short p; -}; - -struct Base2 : Base1 -{ - double p2; -}; - -interface XSimpleInterface : com::sun::star::uno::XInterface -{ - void method(); -}; - -}; //module test - -#endif diff --git a/cppu/test/env_substs/env_subst.test.cxx b/cppu/test/env_substs/env_subst.test.cxx deleted file mode 100644 index 585fcbf02d8a..000000000000 --- a/cppu/test/env_substs/env_subst.test.cxx +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "sal/main.h" - -#include "uno/environment.hxx" - -#include <iostream> - - -using namespace com::sun::star; - -static rtl::OUString s_comment; - -static void s_test_substituting(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_substituting\n")); - - putenv(strdup("UNO_ENV_SUBST:uno:unsafe=uno:affine")); - - uno::Environment env(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:unsafe"))); - if (!env.getTypeName().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:affine")))) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE - expected \"uno:affine\" instead of \"")); - s_comment += env.getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -static void s_test_not_substituting(void) -{ - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_not_substituting\n")); - - putenv(strdup("UNO_ENV_SUBST:uno:unsafe=uno:affine")); - - uno::Environment env(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:affine"))); - if (!env.getTypeName().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:affine")))) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE - expected \"uno:affine\" instead of \"")); - s_comment += env.getTypeName(); - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")); - } -} - -SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) -{ - s_test_substituting(); - s_test_not_substituting(); - - - int ret; - if (s_comment.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - - std::cerr - << argv[0] - << std::endl - << rtl::OUStringToOString(s_comment, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} - diff --git a/cppu/test/env_substs/makefile.mk b/cppu/test/env_substs/makefile.mk deleted file mode 100644 index 58564ba8cce2..000000000000 --- a/cppu/test/env_substs/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := env_subst.test - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/env_subst.test.obj -APP1STDLIBS := $(CPPULIB) $(SALLIB) - - -.INCLUDE : target.mk diff --git a/cppu/test/env_tester/TestEnvironment.cxx b/cppu/test/env_tester/TestEnvironment.cxx deleted file mode 100644 index f91f78659316..000000000000 --- a/cppu/test/env_tester/TestEnvironment.cxx +++ /dev/null @@ -1,37 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "uno/environment.h" - - -extern "C" void SAL_CALL uno_initEnvironment(uno_Environment * /*pEnv*/) - SAL_THROW_EXTERN_C() -{ -} diff --git a/cppu/test/env_tester/TestEnvironment.def b/cppu/test/env_tester/TestEnvironment.def deleted file mode 100644 index f59a32c4a174..000000000000 --- a/cppu/test/env_tester/TestEnvironment.def +++ /dev/null @@ -1,7 +0,0 @@ -LIBRARY cppu3 -DESCRIPTION 'StarView 3.00 680 m124' -DATA READ WRITE SHARED -HEAPSIZE 0 -EXPORTS - uno_initEnvironment - diff --git a/cppu/test/env_tester/env.tester.cxx b/cppu/test/env_tester/env.tester.cxx deleted file mode 100644 index fcc4cbfcd845..000000000000 --- a/cppu/test/env_tester/env.tester.cxx +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" -#include "rtl/ustring.hxx" -#include "rtl/string.hxx" -#include "rtl/alloc.h" -#include "uno/environment.hxx" -#include "uno/lbnames.h" - -using namespace com::sun::star; - - -static rtl::OUString s_replaceCPP(rtl::OUString const & str) -{ - rtl::OUString cpp(RTL_CONSTASCII_USTRINGPARAM("CPP")); - - rtl::OUString result; - - sal_Int32 index_old = 0; - sal_Int32 index = str.indexOf(cpp, index_old); - while (index != -1) - { - result += str.copy(index_old, index - index_old); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV))); - - index_old = index + 3; - index = str.indexOf(cpp, index_old); - } - result += str.copy(index_old); - - return result; -} - - -rtl::OUString register_test(rtl::OUString const & envDcp); -rtl::OUString purpenv_test(rtl::OUString const & envDcp); - - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) -{ - int ret = 0; - rtl::OUString message; - - if (argc == 2) - { - message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - rtl::OUString envDcp(argv[1], rtl_str_getLength(argv[1]), RTL_TEXTENCODING_ASCII_US); - envDcp = s_replaceCPP(envDcp); - - - message += register_test(envDcp); - message += purpenv_test(envDcp); - - if (message.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE"))) == -1) - { - message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); - ret = 0; - } - else - { - message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); - ret = -1; - } - } - else - message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<env. descriptor>")); - - std::cerr - << argv[0] - << " " - << rtl::OUStringToOString(message, RTL_TEXTENCODING_ASCII_US).getStr() - << std::endl; - - return ret; -} diff --git a/cppu/test/env_tester/makefile.mk b/cppu/test/env_tester/makefile.mk deleted file mode 100644 index c418749e66bf..000000000000 --- a/cppu/test/env_tester/makefile.mk +++ /dev/null @@ -1,67 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := env.tester.bin - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE - - -.INCLUDE : settings.mk -.INCLUDE : ../../source/helper/purpenv/export.mk - - -.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" -ObjectFactory_LIB := -lObjectFactory.$(COMID) - -.ELSE -ObjectFactory_LIB := $(LIBPRE) iObjectFactory.$(COMID).lib - -.ENDIF - - -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/env.tester.obj $(OBJ)$/purpenv.test.obj $(OBJ)$/register.test.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(CPPULIB) $(SALLIB) - - -SHL1TARGET := purpA_uno_uno -SHL1IMPLIB := i$(SHL1TARGET) -SHL1OBJS := $(SLO)$/TestEnvironment.obj -SHL1STDLIBS := $(CPPULIB) $(SALHELPERLIB) $(SALLIB) -SHL1DEF := TestEnvironment.def - -SHL2TARGET := purpB_uno_uno -SHL2IMPLIB := i$(SHL2TARGET) -SHL2OBJS := $(SHL1OBJS) -SHL2STDLIBS := $(SHL1STDLIBS) -SHL2DEF := $(SHL1DEF) - - -.INCLUDE : target.mk diff --git a/cppu/test/env_tester/purpenv.test.cxx b/cppu/test/env_tester/purpenv.test.cxx deleted file mode 100644 index 42da4d300189..000000000000 --- a/cppu/test/env_tester/purpenv.test.cxx +++ /dev/null @@ -1,401 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" - -#include "uno/environment.hxx" -#include "uno/dispatcher.h" - -#include "typelib/typedescription.h" - -#include "com/sun/star/uno/Any.h" - -#include "../ObjectFactory/ObjectFactory.hxx" - - -using namespace com::sun::star; - - -static rtl::OUString g_usret(RTL_CONSTASCII_USTRINGPARAM("\n")); -static rtl::OUString g_ustab(RTL_CONSTASCII_USTRINGPARAM("\t")); -static rtl::OUString g_comment; -static uno::Environment g_env; -static bool g_check = 0; - -extern "C" { static void s_callee(rtl_uString * pMethod_name) -{ - if (g_check) - { - g_comment += g_ustab; - g_comment += g_ustab; - g_comment += rtl::OUString(pMethod_name); - - rtl::OUString reason; - int valid = g_env.isValid(&reason); - - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[")); - g_comment += rtl::OUString::valueOf((sal_Int32)valid); - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); - g_comment += reason; - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]")); - - if (!valid) - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE")); - - g_comment += g_usret; - } -}} - - -static rtl::OUString s_test_registerInterface(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_registerInterface")); - g_comment += g_usret; - - rtl::OUString id(RTL_CONSTASCII_USTRINGPARAM("blabla")); - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_TypeDescription * pRet = NULL; - typelib_typedescriptionreference_getDescription(&pRet, type_XInterface); - - void * pObject = createObject(envDcp, s_callee); - g_check = 1; - g_env.get()->pExtEnv->registerInterface(g_env.get()->pExtEnv, - &pObject, - id.pData, - (struct _typelib_InterfaceTypeDescription *)pRet); - g_check = 0; - - g_env.get()->pExtEnv->revokeInterface(g_env.get()->pExtEnv, pObject); - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - - g_env.clear(); - - return g_comment; -} - -extern "C" { static void s_freeFunc(struct _uno_ExtEnvironment * /*pEnv*/, void * /*pProxy*/ ) -{ - if (g_check) - { - g_comment += g_ustab; - g_comment += g_ustab; - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s_freeFunc")); - - rtl::OUString reason; - int valid = g_env.isValid(&reason); - - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[")); - g_comment += rtl::OUString::valueOf((sal_Int32)valid); - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); - g_comment += reason; - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]")); - - if (!valid) - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - FAILURE")); - - g_comment += g_usret; - } -}} - -static rtl::OUString s_test_registerProxyInterface(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_registerProxyInterface")); - g_comment += g_usret; - - rtl::OUString id(RTL_CONSTASCII_USTRINGPARAM("blabla")); - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_TypeDescription * pRet = NULL; - typelib_typedescriptionreference_getDescription(&pRet, type_XInterface); - - void * pObject = createObject(envDcp, s_callee); - g_check = 1; - g_env.get()->pExtEnv->registerProxyInterface(g_env.get()->pExtEnv, - &pObject, - s_freeFunc, - id.pData, - (typelib_InterfaceTypeDescription *)pRet); - g_check = 0; - - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - g_check = 1; - g_env.get()->pExtEnv->revokeInterface(g_env.get()->pExtEnv, pObject); - g_check = 0; - - g_env.clear(); - - - return g_comment; -} - -static rtl::OUString s_test_revokeInterface(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_revokeInterface")); - g_comment += g_usret; - - rtl::OUString id(RTL_CONSTASCII_USTRINGPARAM("blabla")); - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_TypeDescription * pRet = NULL; - typelib_typedescriptionreference_getDescription(&pRet, type_XInterface); - - void * pObject = createObject(envDcp, s_callee); - g_env.get()->pExtEnv->registerInterface(g_env.get()->pExtEnv, - &pObject, - id.pData, - (struct _typelib_InterfaceTypeDescription *)pRet); - - g_check = 1; - g_env.get()->pExtEnv->revokeInterface(g_env.get()->pExtEnv, pObject); - g_check = 0; - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_getObjectIdentifier(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_getObjectIdentifier")); - g_comment += g_usret; - - rtl::OUString oId; - void * pObject = createObject(envDcp, s_callee); - g_check = 1; - g_env.get()->pExtEnv->getObjectIdentifier(g_env.get()->pExtEnv, &oId.pData, pObject); - g_check = 0; - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_getRegisteredInterface(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_getRegisteredInterface")); - g_comment += g_usret; - - rtl::OUString id(RTL_CONSTASCII_USTRINGPARAM("blabla")); - - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_TypeDescription * pRet = NULL; - typelib_typedescriptionreference_getDescription(&pRet, type_XInterface); - - void * pObject = createObject(envDcp, s_callee); - g_env.get()->pExtEnv->registerInterface(g_env.get()->pExtEnv, - &pObject, - id.pData, - (typelib_InterfaceTypeDescription *)pRet); - - - g_check = 1; - g_env.get()->pExtEnv->getRegisteredInterface(g_env.get()->pExtEnv, &pObject, id.pData, - (typelib_InterfaceTypeDescription *)pRet); - g_check = 0; - - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - g_env.get()->pExtEnv->revokeInterface(g_env.get()->pExtEnv, pObject); - - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_getRegisteredInterfaces(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_getRegisteredInterfaces")); - g_comment += g_usret; - - rtl::OUString id(RTL_CONSTASCII_USTRINGPARAM("blabla")); - - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_TypeDescription * pRet = NULL; - typelib_typedescriptionreference_getDescription(&pRet, type_XInterface); - - void * pObject = createObject(envDcp, s_callee); - g_env.get()->pExtEnv->registerInterface(g_env.get()->pExtEnv, - &pObject, - id.pData, - (typelib_InterfaceTypeDescription *)pRet); - - g_check = 1; - void ** ppObject; - sal_Int32 nCount; - g_env.get()->pExtEnv->getRegisteredInterfaces(g_env.get()->pExtEnv, &ppObject, &nCount, rtl_allocateMemory); - g_check = 0; - - - if (nCount != 1) - { - g_comment += g_ustab; - g_comment += g_ustab; - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("more than one object registered -> FAILURE")); - g_comment += g_usret; - } - - if (*ppObject != pObject) - { - g_comment += g_ustab; - g_comment += g_ustab; - g_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("returned object is not the registerd one -> FAILURE")); - g_comment += g_usret; - } - - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, *ppObject); - - g_env.get()->pExtEnv->revokeInterface(g_env.get()->pExtEnv, pObject); - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - - rtl_freeMemory(ppObject); - - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_computeObjectIdentifier(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_computeObjectIdentifier")); - g_comment += g_usret; - - rtl::OUString oId; - void * pObject = createObject(envDcp, s_callee); - g_check = 1; - g_env.get()->pExtEnv->computeObjectIdentifier(g_env.get()->pExtEnv, &oId.pData, pObject); - g_check = 0; - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_acquire(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_acquire")); - g_comment += g_usret; - void * pObject = createObject(envDcp, s_callee); - - g_check = 1; - g_env.get()->pExtEnv->acquireInterface(g_env.get()->pExtEnv, pObject); - g_check = 0; - - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - g_env.clear(); - - return g_comment; -} - -static rtl::OUString s_test_release(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - g_comment = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test_release")); - g_comment += g_usret; - void * pObject = createObject(envDcp, s_callee); - - g_check = 1; - g_env.get()->pExtEnv->releaseInterface(g_env.get()->pExtEnv, pObject); - g_check = 0; - - g_env.clear(); - - return g_comment; -} - - -rtl::OUString purpenv_test(rtl::OUString const & envDcp) -{ - g_env = uno::Environment(envDcp); - - rtl::OUString result; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("purpenv_test")); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - result += s_test_registerInterface(envDcp); - result += g_usret; - - result += s_test_registerProxyInterface(envDcp); - result += g_usret; - - result += s_test_revokeInterface(envDcp); - result += g_usret; - - result += s_test_getObjectIdentifier(envDcp); - result += g_usret; - - result += s_test_getRegisteredInterface(envDcp); - result += g_usret; - - result += s_test_getRegisteredInterfaces(envDcp); - result += g_usret; - - result += s_test_computeObjectIdentifier(envDcp); - result += g_usret; - - result += s_test_acquire(envDcp); - result += g_usret; - - result += s_test_release(envDcp); - result += g_usret; - - return result; -} diff --git a/cppu/test/env_tester/register.test.cxx b/cppu/test/env_tester/register.test.cxx deleted file mode 100644 index a98a14cac69b..000000000000 --- a/cppu/test/env_tester/register.test.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <iostream> - -#include "sal/main.h" -#include "rtl/ustring.hxx" -#include "rtl/string.hxx" -#include "rtl/alloc.h" -#include "uno/environment.hxx" -#include "uno/lbnames.h" - -using namespace com::sun::star; - - -static rtl::OUString s_test_getEnvironment(rtl::OUString const & envDcp, void * pContext) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\ts_test_getEnvironment(")); - result += envDcp; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += rtl::OUString::valueOf((long)pContext); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")\n")); - - uno::Environment env(envDcp, pContext); - - if (!env.is()) - { - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE: couldn't get env.\n")); - return result; - } - - if (rtl::OUString(env.getTypeName()).compareTo(envDcp)) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE: got environment has wrong descriptor.\n")); - - if (env.getContext() != pContext) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE: got environment has wrong context.\n")); - - - return result; -} - -static rtl::OUString s_test_regetEnvironment(rtl::OUString const & envDcp1, - rtl::OUString const & envDcp2 , - void * pContext1, void * pContext2) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\ts_test_regetEnvironment(")); - result += envDcp1; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += envDcp2; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += rtl::OUString::valueOf((long)pContext1); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", " )); - result += rtl::OUString::valueOf((long)pContext2); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")\n")); - - uno::Environment env1(envDcp1, pContext1); - uno::Environment env2(envDcp2, pContext2); - - if (! ((pContext1 == pContext2 && envDcp1 == envDcp2) ? env1.get() == env2.get() : env1.get() != env2.get()) - && env1.is() && env2.is()) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE:\n")); - - return result; -} - -static rtl::OUString s_test_regetEnvironment(rtl::OUString const & envDcp, void * pContext) -{ - return s_test_regetEnvironment(envDcp, envDcp, pContext, pContext); -} - -// static rtl::OUString s_test_regetEnvironment(rtl::OUString const & envDcp, void * pContext1, void * pContext2) -// { -// return s_test_regetEnvironment(envDcp, envDcp, pContext1, pContext2); -// } - -static rtl::OUString s_test_regetEnvironment(rtl::OUString const & envDcp1, rtl::OUString const & envDcp2, void * pContext) -{ - return s_test_regetEnvironment(envDcp1, envDcp2, pContext, pContext); -} - - -static int s_is_registered(rtl::OUString const & envDcp, void * pContext) -{ - int result = 0; - - uno_Environment ** ppEnvs = NULL; - sal_Int32 nLen = 0; - - uno_getRegisteredEnvironments(&ppEnvs, &nLen, rtl_allocateMemory, envDcp.pData); - for (sal_Int32 i = 0; !result && i < nLen; ++ i) - { - result = result || (ppEnvs[i]->pContext == pContext && !rtl::OUString(ppEnvs[i]->pTypeName).compareTo(envDcp)); - - ppEnvs[i]->release(ppEnvs[i]); - } - rtl_freeMemory(ppEnvs); - - return result; -} - -static rtl::OUString s_test_uno_getRegisteredEnvironments_registered(rtl::OUString const & envDcp, void * pContext) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\ts_test_uno_getRegisteredEnvironments_registered(")); - result += envDcp; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += rtl::OUString::valueOf((long)pContext); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")\n")); - - uno::Environment env(envDcp, pContext); - - if (!env.is() || !s_is_registered(envDcp, pContext)) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE:\n")); - - return result; -} - -static rtl::OUString s_test_uno_getRegisteredEnvironments_notRegistered(rtl::OUString const & envDcp, void * pContext) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\ts_test_uno_getRegisteredEnvironments_notRegistered(")); - result += envDcp; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += rtl::OUString::valueOf((long)pContext); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")\n")); - - uno::Environment env(envDcp, pContext); - - if (!env.is() && !s_is_registered(envDcp, pContext)) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE:\n")); - - return result; -} - - -static rtl::OUString s_test_uno_createEnvironment(rtl::OUString const & envDcp, void * pContext) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\ts_test_uno_createEnvironment(")); - result += envDcp; - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")); - result += rtl::OUString::valueOf((long)pContext); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")\n")); - - uno_Environment * pEnv = NULL; - uno_createEnvironment(&pEnv, envDcp.pData, pContext); - - if (!pEnv && !s_is_registered(envDcp, pContext)) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tFAILURE:\n")); - - if (pEnv) - pEnv->release(pEnv); - - return result; -} - - -rtl::OUString register_test(rtl::OUString const & envDcp) -{ - rtl::OUString env_A(envDcp); - env_A += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":purpA")); - - rtl::OUString env_B(envDcp); - env_B += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":purpB")); - - rtl::OUString result; - - result = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("registration_test")); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); - - result += s_test_getEnvironment(envDcp, NULL); - result += s_test_getEnvironment(env_A, NULL); - result += s_test_getEnvironment(env_B, NULL); - - result += s_test_regetEnvironment(envDcp, NULL); - result += s_test_regetEnvironment(envDcp, (void *)0x1); - result += s_test_regetEnvironment(env_A, NULL) ; - result += s_test_regetEnvironment(env_A, (void *)0x1); - result += s_test_regetEnvironment(env_B, NULL) ; - result += s_test_regetEnvironment(env_B, (void *)0x1); - - result += s_test_regetEnvironment(envDcp, env_A, (void *)NULL); - result += s_test_regetEnvironment(envDcp, env_A, (void *)0x1) ; - result += s_test_regetEnvironment(envDcp, env_B, (void *)NULL); - result += s_test_regetEnvironment(envDcp, env_B, (void *)0x1) ; - result += s_test_regetEnvironment(env_A, env_B, (void *)NULL); - result += s_test_regetEnvironment(env_A, env_B, (void *)0x1) ; - - result += s_test_regetEnvironment(env_A, env_B, (void *)NULL, (void *)0x1); - - result += s_test_uno_getRegisteredEnvironments_registered(envDcp, (void *)NULL); - result += s_test_uno_getRegisteredEnvironments_registered(envDcp, (void *)0x1) ; - result += s_test_uno_getRegisteredEnvironments_registered(env_A, (void *)NULL); - result += s_test_uno_getRegisteredEnvironments_registered(env_A, (void *)0x1) ; - result += s_test_uno_getRegisteredEnvironments_registered(env_B, (void *)NULL); - result += s_test_uno_getRegisteredEnvironments_registered(env_B, (void *)0x1) ; - - result += s_test_uno_getRegisteredEnvironments_notRegistered(envDcp, NULL) ; - result += s_test_uno_getRegisteredEnvironments_notRegistered(envDcp, (void *)0x1); - result += s_test_uno_getRegisteredEnvironments_notRegistered(env_A, NULL) ; - result += s_test_uno_getRegisteredEnvironments_notRegistered(env_A, (void *)0x1); - result += s_test_uno_getRegisteredEnvironments_notRegistered(env_B, NULL) ; - result += s_test_uno_getRegisteredEnvironments_notRegistered(env_B, (void *)0x1); - - result += s_test_uno_createEnvironment(envDcp, NULL) ; - result += s_test_uno_createEnvironment(envDcp, (void *)0x1); - result += s_test_uno_createEnvironment(env_A, NULL) ; - result += s_test_uno_createEnvironment(env_A, (void *)0x1); - result += s_test_uno_createEnvironment(env_B, NULL) ; - result += s_test_uno_createEnvironment(env_B, (void *)0x1); - - return result; -} diff --git a/cppu/test/language_binding.idl b/cppu/test/language_binding.idl deleted file mode 100644 index 2a708ad56ee6..000000000000 --- a/cppu/test/language_binding.idl +++ /dev/null @@ -1,239 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _TEST_LANGUAGE_BINDING_IDL_ -#define _TEST_LANGUAGE_BINDING_IDL_ - -#include <com/sun/star/uno/XInterface.idl> -#include <com/sun/star/lang/IllegalArgumentException.idl> - -module test -{ - -enum TestEnum -{ - TEST, - ONE, - TWO, - CHECK, - LOLA, - PALOO, - ZA -}; - -/** - * simple c++ types - */ -struct TestSimple -{ - boolean Bool; - char Char; - byte Byte; - short Short; - unsigned short UShort; - long Long; - unsigned long ULong; - hyper Hyper; - unsigned hyper UHyper; - float Float; - double Double; - test::TestEnum Enum; -}; -/** - * equal to max size returned in registers on x86_64 - */ -struct SmallStruct -{ - hyper a; - hyper b; -}; -/** - * equal to max size returned in registers on ia64 - */ -struct MediumStruct -{ - hyper a; - hyper b; - hyper c; - hyper d; -}; -/** - * bigger than max size returned in registers on ia64 - */ -struct BigStruct -{ - hyper a; - hyper b; - hyper c; - hyper d; - hyper e; - hyper f; - hyper g; - hyper h; -}; -/** - * all floats, ia64 claims to handle them specially - */ -struct AllFloats -{ - float a; - float b; - float c; - float d; -}; - -/** - * complex c++ types - */ -struct TestElement : test::TestSimple -{ - string String; - com::sun::star::uno::XInterface Interface; - any Any; -}; -struct TestDataElements : test::TestElement -{ - sequence<test::TestElement > Sequence; -}; - -typedef TestDataElements TestData; - -/** - * Monster test interface to test language binding calls. - * - * @author Daniel Boelzle - */ -interface XLBTestBase : com::sun::star::uno::XInterface -{ - /** - * in parameter test, tests by calls reference also (complex types) - */ - [oneway] void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte, - [in] short nShort, [in] unsigned short nUShort, - [in] long nLong, [in] unsigned long nULong, - [in] hyper nHyper, [in] unsigned hyper nUHyper, - [in] float fFloat, [in] double fDouble, - [in] test::TestEnum eEnum, [in] string aString, - [in] com::sun::star::uno::XInterface xInterface, [in] any aAny, - [in] sequence<test::TestElement > aSequence, - [in] test::TestData aStruct ); - /** - * inout parameter test - */ - test::TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte, - [inout] short nShort, [inout] unsigned short nUShort, - [inout] long nLong, [inout] unsigned long nULong, - [inout] hyper nHyper, [inout] unsigned hyper nUHyper, - [inout] float fFloat, [inout] double fDouble, - [inout] test::TestEnum eEnum, [inout] string aString, - [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny, - [inout] sequence<test::TestElement > aSequence, - [inout] test::TestData aStruct ); - - /** - * out parameter test - */ - test::TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte, - [out] short nShort, [out] unsigned short nUShort, - [out] long nLong, [out] unsigned long nULong, - [out] hyper nHyper, [out] unsigned hyper nUHyper, - [out] float fFloat, [out] double fDouble, - [out] test::TestEnum eEnum, [out] string aString, - [out] com::sun::star::uno::XInterface xInterface, [out] any aAny, - [out] sequence<test::TestElement > aSequence, - [out] test::TestData aStruct ); - - /** - * register return test 1 - */ - test::SmallStruct echoSmallStruct( [in] test::SmallStruct aStruct ); - - /** - * register return test 2 - */ - test::MediumStruct echoMediumStruct( [in] test::MediumStruct aStruct ); - - /** - * register return test 3 - */ - test::BigStruct echoBigStruct( [in] test::BigStruct aStruct ); - - /** - * register return test 4 - */ - test::AllFloats echoAllFloats( [in] test::AllFloats aStruct ); - - [attribute] boolean Bool; - [attribute] byte Byte; - [attribute] char Char; - [attribute] short Short; - [attribute] unsigned short UShort; - [attribute] long Long; - [attribute] unsigned long ULong; - [attribute] hyper Hyper; - [attribute] unsigned hyper UHyper; - [attribute] float Float; - [attribute] double Double; - [attribute] test::TestEnum Enum; - [attribute] string String; - [attribute] com::sun::star::uno::XInterface Interface; - [attribute] any Any; - [attribute] sequence<test::TestElement > Sequence; - [attribute] test::TestData Struct; -}; - - -/** - * Inherting from monster; adds raiseException(). - * - * @author Daniel Boelzle - */ -interface XLanguageBindingTest : test::XLBTestBase -{ - /** - * params are there only for dummy, to test if all temp out params will be released. - */ - test::TestData raiseException( [out] boolean bBool, [out] char cChar, [out] byte nByte, - [out] short nShort, [out] unsigned short nUShort, - [out] long nLong, [out] unsigned long nULong, - [out] hyper nHyper, [out] unsigned hyper nUHyper, - [out] float fFloat, [out] double fDouble, - [out] test::TestEnum eEnum, [out] string aString, - [out] com::sun::star::uno::XInterface xInterface, [out] any aAny, - [out] sequence<test::TestElement > aSequence, - [out] test::TestData aStruct ) - raises( com::sun::star::lang::IllegalArgumentException ); - - /** - * raises runtime exception - */ - [attribute] long RuntimeException; -}; - -}; // test - - -#endif diff --git a/cppu/test/makefile.mk b/cppu/test/makefile.mk deleted file mode 100644 index 8eecf6bbf452..000000000000 --- a/cppu/test/makefile.mk +++ /dev/null @@ -1,156 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=.. - -PRJNAME=testcppu -TARGET= testcppu -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE -NO_BSYMBOLIC=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb -UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb -UNOUCROUT=$(OUT)$/inc$/test -INCPRE+=$(OUT)$/inc$/test - -OBJFILES= \ - $(OBJ)$/testcppu.obj \ - $(OBJ)$/test_di.obj \ - $(OBJ)$/test_Cincludes.obj -# $(OBJ)$/test_cuno.obj \ -# $(OBJ)$/test_sec.obj \ - -APP1TARGET= testcppu -APP1OBJS= \ - $(OBJ)$/testcppu.obj \ - $(OBJ)$/test_di.obj -# $(OBJ)$/test_cuno.obj -# $(OBJ)$/test_sec.obj - -APP1STDLIBS+= \ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(SALHELPERLIB) \ - $(SALLIB) - -APP1DEF=$(MISC)$/$(APP1TARGET).def - -ALLIDLFILES:= \ - cpputest.idl \ - language_binding.idl \ - alignment.idl - - -APP2TARGET := Mapping.test -APP2OBJS := $(OBJ)$/Mapping.test.obj -APP2STDLIBS := $(CPPULIB) $(SALLIB) - -APP3TARGET := Environment.test -APP3OBJS := $(OBJ)$/Environment.test.obj -APP3STDLIBS := $(CPPULIB) $(SALLIB) - -APP4TARGET := IdentityMapping.test -APP4OBJS := $(OBJ)$/IdentityMapping.test.obj -APP4STDLIBS := $(CPPULIB) $(SALLIB) - - - -# --- Targets ------------------------------------------------------ - -.IF "$(depend)" == "" -ALL : $(BIN)$/testcppu.rdb unoheader ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF - -.IF "$(COM)" == "MSC" -.IF "$(debug)" != "" -CFLAGS += /Ob0 -.ENDIF -.ENDIF - -.IF "$(extra_mapping)" != "" -CFLAGS += -DEXTRA_MAPPING -.ENDIF - -.INCLUDE : target.mk - -CPPUMAKERFLAGS = -L - -TYPES:= -Ttest.XLanguageBindingTest \ - -Ttest.XSimpleInterface \ - -Ttest.Test1 \ - -Ttest.Test2 \ - -Ttest.TdTest1 \ - -Ttest.Test3 \ - -Ttest.Base \ - -Ttest.Base1 \ - -Ttest.Base2 \ - -Tcom.sun.star.lang.XMultiServiceFactory \ - -Tcom.sun.star.lang.XSingleServiceFactory \ - -Tcom.sun.star.lang.XInitialization \ - -Tcom.sun.star.lang.XServiceInfo \ - -Tcom.sun.star.lang.XEventListener \ - -Tcom.sun.star.lang.XTypeProvider \ - -Tcom.sun.star.lang.DisposedException \ - -Tcom.sun.star.registry.XSimpleRegistry \ - -Tcom.sun.star.registry.XRegistryKey \ - -Tcom.sun.star.loader.XImplementationLoader \ - -Tcom.sun.star.registry.XImplementationRegistration \ - -Tcom.sun.star.lang.XComponent \ - -Tcom.sun.star.uno.XComponentContext \ - -Tcom.sun.star.container.XSet \ - -Tcom.sun.star.container.XNameContainer \ - -Tcom.sun.star.uno.TypeClass \ - -Tcom.sun.star.uno.XReference \ - -Tcom.sun.star.uno.XAdapter \ - -Tcom.sun.star.uno.XAggregation \ - -Tcom.sun.star.uno.XWeak \ - -Tcom.sun.star.beans.XPropertySet \ - -Tcom.sun.star.reflection.XIdlClassProvider \ - -Tcom.sun.star.container.XHierarchicalNameAccess \ - -Tcom.sun.star.uno.XCurrentContext - -$(BIN)$/testcppu.rdb: $(ALLIDLFILES) - idlc -I$(PRJ) -I$(SOLARIDLDIR) -O$(BIN) $? - regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)} - regmerge $@ / $(UNOUCRRDB) - touch $@ - -# regcomp -register -r $@ -c javaloader.dll -# regcomp -register -r $@ -c jen.dll - -unoheader: $(BIN)$/testcppu.rdb - cppumaker $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) $(TYPES) $(BIN)$/testcppu.rdb -# cunomaker -BUCR -O$(UNOUCROUT) $(TYPES) $(BIN)$/testcppu.rdb - diff --git a/cppu/test/mapping_tester/Mapping.tester.hxx b/cppu/test/mapping_tester/Mapping.tester.hxx deleted file mode 100644 index 6a2573a105f8..000000000000 --- a/cppu/test/mapping_tester/Mapping.tester.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_Mapping_tester_hxx -#define INCLUDED_Mapping_tester_hxx - - -#include "../ObjectFactory/callee.hxx" - - -#ifdef CPPU_TEST_MAPPING_TESTER_TESTS_IMPL -# define CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT SAL_DLLPUBLIC_EXPORT - -#elif defined(CPPU_TEST_MAPPING_TESTER_TESTS_LIB) -# define CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT extern - -#elif defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE) -# define CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT extern __attribute__ ((weak)) - -#elif defined(__SUNPRO_CC) -# define CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT extern - extern rtl::OUString g_from_envDcp; - extern rtl::OUString g_to_envDcp; - extern rtl::OUString g_ref; - extern rtl::OUString g_custom; - extern rtl::OUString g_result; - extern int g_check; -# pragma weak g_from_envDcp -# pragma weak g_to_envDcp -# pragma weak g_ref -# pragma weak g_custom -# pragma weak g_result -# pragma weak g_check - -#else -# define CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT SAL_DLLPUBLIC_IMPORT - -#endif - -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT rtl::OUString g_from_envDcp; -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT rtl::OUString g_to_envDcp; -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT rtl::OUString g_ref; -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT rtl::OUString g_custom; -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT rtl::OUString g_result; -CPPU_TEST_MAPPING_TESTER_TESTS_EXPORT int g_check; - - -#define D_CALLEE extern "C" void CALLEE(rtl_uString * pMethod_name) - - -#endif diff --git a/cppu/test/mapping_tester/makefile.mk b/cppu/test/mapping_tester/makefile.mk deleted file mode 100644 index db62dcd5b14a..000000000000 --- a/cppu/test/mapping_tester/makefile.mk +++ /dev/null @@ -1,63 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := mapping.tester - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE - - -.INCLUDE : settings.mk - -VERSIONOBJ := # NO GetVersionInfo symbols :-) -ENVINCPRE := -I$(OUT)$/inc$/$(TARGET) -#CDEFS += -DLOG_LIFECYCLE - -.IF "$(COM)" == "GCC" -LINKFLAGS += -rdynamic -.ENDIF - - -.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC" -ObjectFactory_LIB := -lObjectFactory.$(COMID) - -.ELSE -ObjectFactory_LIB := $(LIBPRE) iObjectFactory.$(COMID).lib - -.ENDIF - - -APP1TARGET := mapping.tester -APP1OBJS := $(OBJ)$/mapping.tester.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB) - - -.INCLUDE : target.mk - - diff --git a/cppu/test/mapping_tester/mapping.tester.cxx b/cppu/test/mapping_tester/mapping.tester.cxx deleted file mode 100644 index bed213daefba..000000000000 --- a/cppu/test/mapping_tester/mapping.tester.cxx +++ /dev/null @@ -1,456 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define CPPU_TEST_MAPPING_TESTER_TESTS_IMPL - - -#include <iostream> - -#include "sal/main.h" -#include "osl/module.hxx" -#include "rtl/ustring.hxx" -#include "uno/environment.hxx" -#include "uno/mapping.hxx" - -#include "../ObjectFactory/ObjectFactory.hxx" -#include "Mapping.tester.hxx" - -using namespace ::com::sun::star; - - - -static uno::Mapping s_getMapping(rtl::OUString const & from_envDcp, - rtl::OUString const & to_envDcp, - uno::Environment * pSourceEnv, - uno::Environment * pTargetEnv) -{ - uno::Environment sourceEnv(from_envDcp); - uno::Environment targetEnv(to_envDcp); - - uno::Mapping mapping(sourceEnv, targetEnv); - - if (pSourceEnv) - *pSourceEnv = sourceEnv; - - if (pTargetEnv) - *pTargetEnv = targetEnv; - - return mapping; -} - -static void * s_mapObject(rtl::OUString const & from_envDcp, - rtl::OUString const & to_envDcp, - void * object, - uno::Environment * pSourceEnv, - uno::Environment * pTargetEnv) -{ - uno::Mapping mapping(s_getMapping(from_envDcp, to_envDcp, pSourceEnv, pTargetEnv)); - - void * mapped_object = NULL; - - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0; - - TYPELIB_DANGER_GET( (typelib_TypeDescription **) &pTXInterfaceDescr, type_XInterface ); - mapping.mapInterface(&mapped_object, object, pTXInterfaceDescr); - TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) pTXInterfaceDescr ); - - return mapped_object; -} - - -static rtl::OUString s_test_regetMapping(void) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tmapping reget test --> ")); - - uno::Mapping mapping1(g_from_envDcp, g_to_envDcp); - uno::Mapping mapping2(g_from_envDcp, g_to_envDcp); - - if (mapping2.get() == mapping1.get()) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - - else - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - - result += g_result; - - return result; -} - -static rtl::OUString s_test_mapObject(Callee * pCallee) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tobject map test --> ")); - - void * pObject = createObject(g_to_envDcp, pCallee); - - uno::Environment sourceEnv; - uno::Environment targetEnv; - void * mapped_object = s_mapObject(g_to_envDcp, g_from_envDcp, pObject, &sourceEnv, &targetEnv); - sourceEnv.get()->pExtEnv->releaseInterface(sourceEnv.get()->pExtEnv, pObject); - sourceEnv.clear(); - - if (mapped_object) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - - else - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, mapped_object); - - result += g_result; - - return result; -} - -static rtl::OUString s_test_remapObject(Callee * pCallee) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tobject remap test --> ")); - - void * pObject = createObject(g_to_envDcp, pCallee); - - uno::Environment sourceEnv; - uno::Environment targetEnv; - void * mapped_object1 = s_mapObject(g_to_envDcp, g_from_envDcp, pObject, &sourceEnv, &targetEnv); - void * mapped_object2 = s_mapObject(g_to_envDcp, g_from_envDcp, pObject, NULL, NULL); - sourceEnv.get()->pExtEnv->releaseInterface(sourceEnv.get()->pExtEnv, pObject); - sourceEnv.clear(); - - if (mapped_object2 == mapped_object1) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - - else - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, mapped_object1); - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, mapped_object2); - - result += g_result; - - return result; -} - -static rtl::OUString s_test_mapBackObject(Callee * pCallee) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tobject map back test --> ")); - - void * pObject = createObject(g_to_envDcp, pCallee); - - uno::Environment to_sourceEnv; - uno::Environment to_targetEnv; - void * mapped_object = s_mapObject(g_to_envDcp, - g_from_envDcp, - pObject, - &to_sourceEnv, - &to_targetEnv); - - uno::Environment back_sourceEnv; - uno::Environment back_targetEnv; - void * mapped_back_object = s_mapObject(g_from_envDcp, - g_to_envDcp, - mapped_object, - &back_sourceEnv, - &back_targetEnv); - - if (back_targetEnv.get() != to_sourceEnv.get()) - abort(); - - if (back_sourceEnv.get() != to_targetEnv.get()) - abort(); - - if (pObject == mapped_back_object) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - - else - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - - to_sourceEnv .get()->pExtEnv->releaseInterface(to_sourceEnv .get()->pExtEnv, pObject); - to_targetEnv .get()->pExtEnv->releaseInterface(to_targetEnv .get()->pExtEnv, mapped_object); - back_targetEnv.get()->pExtEnv->releaseInterface(back_targetEnv.get()->pExtEnv, mapped_back_object); - - result += g_result; - - return result; -} - -static rtl::OUString s_test_objectRegistered(Callee * pCallee) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tobject registered test --> ")); - - void * pObject = createObject(g_to_envDcp, pCallee); - - uno::Environment sourceEnv; - uno::Environment targetEnv; - void * mapped_object = s_mapObject(g_to_envDcp, - g_from_envDcp, - pObject, - &sourceEnv, - &targetEnv); - - if (sourceEnv.get() == targetEnv.get()) - { - if (mapped_object != pObject) - abort(); - } - else - { - typelib_TypeDescriptionReference * type_XInterface = - * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); - - typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0; - TYPELIB_DANGER_GET( (typelib_TypeDescription **) &pTXInterfaceDescr, type_XInterface ); - - rtl_uString * pOId = 0; - targetEnv.get()->pExtEnv->getObjectIdentifier(targetEnv.get()->pExtEnv, &pOId, mapped_object); - - void * pOut = NULL; - - targetEnv.get()->pExtEnv->getRegisteredInterface(targetEnv.get()->pExtEnv, - &pOut, - pOId, - pTXInterfaceDescr); - - TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) pTXInterfaceDescr ); - - if (mapped_object == pOut) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OKAY\n")); - - else - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILED\n")); - - - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, pOut); - } - - sourceEnv.get()->pExtEnv->releaseInterface(sourceEnv.get()->pExtEnv, pObject); - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, mapped_object); - - result += g_result; - - return result; -} - - -// static void s_test_mappingNotEqual(char const * source1Name, char const * dest1Name, -// char const * source2Name, char const * dest2Name) -// { -// rtl::OUString source1EnvName(source1Name, rtl_str_getLength(source1Name), RTL_TEXTENCODING_ASCII_US); -// rtl::OUString dest1EnvName (dest1Name, rtl_str_getLength(dest1Name), RTL_TEXTENCODING_ASCII_US); - -// rtl::OUString source2EnvName(source2Name, rtl_str_getLength(source2Name), RTL_TEXTENCODING_ASCII_US); -// rtl::OUString dest2EnvName (dest2Name, rtl_str_getLength(dest2Name), RTL_TEXTENCODING_ASCII_US); - -// uno::Mapping mapping1(s_getMapping(source1EnvName, dest1EnvName, NULL, NULL)); -// uno::Mapping mapping2(s_getMapping(source2EnvName, dest2EnvName, NULL, NULL)); - -// if (mapping2.get() == mapping1.get()) -// { -// // fprintf(stderr, "***************** can not reget mapping\n"); -// abort(); -// } -// } - -static rtl::OUString s_test_call(Callee * pCallee) -{ - g_result = rtl::OUString(); - g_custom = rtl::OUString(); - - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\tobject call test --> ")); - - void * pObject = createObject(g_to_envDcp, pCallee); - - uno::Environment sourceEnv; - uno::Environment targetEnv; - void * mapped_object = s_mapObject(g_to_envDcp, g_from_envDcp, pObject, &sourceEnv, &targetEnv); - sourceEnv.get()->pExtEnv->releaseInterface(sourceEnv.get()->pExtEnv, pObject); - sourceEnv.clear(); - - g_check = 1; - callObject(g_from_envDcp, mapped_object); - g_check = 0; - - targetEnv.get()->pExtEnv->releaseInterface(targetEnv.get()->pExtEnv, mapped_object); - - result += g_result; - - return result; -} - - -static rtl::OString test_mapping_a(char const * pfrom_envDcp, - char const * pto_envDcp, - Callee * pCallee, - char const * pRef) -{ - g_from_envDcp = rtl::OUString(pfrom_envDcp, rtl_str_getLength(pfrom_envDcp), RTL_TEXTENCODING_ASCII_US); - g_to_envDcp = rtl::OUString(pto_envDcp, rtl_str_getLength(pto_envDcp), RTL_TEXTENCODING_ASCII_US); - g_ref = rtl::OUString(pRef, rtl_str_getLength(pRef), RTL_TEXTENCODING_ASCII_US); - - rtl::OUString result; - - g_check = 0; - - result += s_test_regetMapping (); - result += s_test_objectRegistered(pCallee); - result += s_test_remapObject (pCallee); - result += s_test_mapBackObject (pCallee); - result += s_test_mapObject (pCallee); - result += s_test_call (pCallee); - - return rtl::OUStringToOString(result, RTL_TEXTENCODING_ASCII_US); -} - - -static rtl::OString s_replaceCPP(rtl::OString const & str) -{ - rtl::OString result; - - sal_Int32 index_old = 0; - sal_Int32 index = str.indexOf("CPP", index_old); - while (index != -1) - { - result += str.copy(index_old, index - index_old); - result += rtl::OString(CPPU_STRINGIFY(CPPU_ENV)); - - index_old = index + 3; - index = str.indexOf("CPP", index_old); - } - result += str.copy(index_old); - - return result; -} - - -extern "C" { static void s_dummy(rtl_uString * pMethod_name) -{ - rtl::OUString result(RTL_CONSTASCII_USTRINGPARAM("\t\tmethod: ")); - result += rtl::OUString(pMethod_name); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" -dummy-\n")); - - g_result = result; -}} - -static Callee * s_pCustomCallee = s_dummy; - -extern "C" { static void s_callee(rtl_uString * pMethod_name) -{ - if (rtl::OUString(pMethod_name).equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::queryInterface")))) - { - rtl::OUString tmp; - - if (!g_from_envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)))) - { - tmp += g_from_envDcp; - tmp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-->")); - } - - tmp += g_custom; - - if (!g_to_envDcp.match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)))) - { - tmp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-->")); - tmp += g_to_envDcp; - } - - g_custom = tmp; - s_pCustomCallee(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface::queryInterface")).pData); - } - else - s_pCustomCallee(pMethod_name); -}} - - -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) -{ - int ret = 0; - rtl::OString message; - - if (argc == 3 || argc == 6) - { - rtl::OString from_envDcp(argv[1]); - from_envDcp = s_replaceCPP(from_envDcp); - - rtl::OString to_envDcp(argv[2]); - to_envDcp = s_replaceCPP(to_envDcp); - - osl::Module module; - - rtl::OString ref; - if (argc == 6 && rtl::OString(argv[3]).equals(rtl::OString("-s"))) - { - rtl::OUString libName(argv[4], rtl_str_getLength(argv[4]), RTL_TEXTENCODING_ASCII_US); - libName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLEXTENSION)); - module.load(libName); - - s_pCustomCallee = (Callee *)module.getFunctionSymbol(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CALLEE"))); - if (!s_pCustomCallee) - abort(); - - ref = s_replaceCPP(rtl::OString(argv[5])); - } - - message += rtl::OString("TESTING: "); - message += from_envDcp; - message += rtl::OString("-->"); - message += to_envDcp; - message += rtl::OString("\n"); - - message += test_mapping_a(from_envDcp.getStr(), to_envDcp.getStr(), s_callee, ref); - - if (message.indexOf(rtl::OString("FAILED")) == -1) - message += rtl::OString("TESTS PASSED\n"); - - else - { - message += rtl::OString("TESTS _NOT_ PASSED\n"); - ret = -1; - } - } - else - message = "Usage: <source env. dcp> <destination env. dcp> [-s testfun <ref. string>]\n"; - - - std::cout << message.getStr(); - - return ret; -} diff --git a/cppu/test/purpenvhelper/TestEnv.cxx b/cppu/test/purpenvhelper/TestEnv.cxx deleted file mode 100644 index 65a91230dd03..000000000000 --- a/cppu/test/purpenvhelper/TestEnv.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - - -#include "cppu/EnvDcp.hxx" - -#include "cppu/helper/purpenv/Environment.hxx" -#include "cppu/helper/purpenv/Mapping.hxx" - - - -#define LOG_LIFECYCLE_TestEnv -#ifdef LOG_LIFECYCLE_TestEnv -# include <iostream> -# define LOG_LIFECYCLE_TestEnv_emit(x) x - -#else -# define LOG_LIFECYCLE_TestEnv_emit(x) - -#endif - - -class SAL_DLLPRIVATE TestEnv : public cppu::Enterable -{ - int m_inCount; - - virtual ~TestEnv(void); - -public: - explicit TestEnv(void); - -protected: - virtual void v_enter(void); - virtual void v_leave(void); - - virtual void v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam); - virtual void v_callOut_v (uno_EnvCallee * pCallee, va_list * pParam); - - virtual int v_isValid (rtl::OUString * pReason); -}; - -TestEnv::TestEnv(void) - : m_inCount(0) -{ - LOG_LIFECYCLE_TestEnv_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestEnv::TestEnv(...)", this)); -} - -TestEnv::~TestEnv(void) -{ - LOG_LIFECYCLE_TestEnv_emit(fprintf(stderr, "LIFE: %s -> %p\n", "TestEnv::~TestEnv(void)", this)); -} - - -void TestEnv::v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam) -{ - ++ m_inCount; - pCallee(pParam); - -- m_inCount; -} - -void TestEnv::v_callOut_v(uno_EnvCallee * pCallee, va_list * pParam) -{ - -- m_inCount; - pCallee(pParam); - ++ m_inCount; -} - -void TestEnv::v_enter(void) -{ - ++ m_inCount; -} - -void TestEnv::v_leave(void) -{ - -- m_inCount; -} - -int TestEnv::v_isValid(rtl::OUString * pReason) -{ - int result = m_inCount & 1; - - if (result) - *pReason = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OK")); - - else - *pReason = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not entered/invoked")); - - return result; -} - -extern "C" void SAL_CALL uno_initEnvironment(uno_Environment * pEnv) SAL_THROW_EXTERN_C() -{ - cppu::helper::purpenv::Environment_initWithEnterable(pEnv, new TestEnv()); -} - -extern "C" void uno_ext_getMapping(uno_Mapping ** ppMapping, - uno_Environment * pFrom, - uno_Environment * pTo ) -{ - cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo); -} - diff --git a/cppu/test/purpenvhelper/TestEnv.def b/cppu/test/purpenvhelper/TestEnv.def deleted file mode 100644 index 1444d92c13fa..000000000000 --- a/cppu/test/purpenvhelper/TestEnv.def +++ /dev/null @@ -1,8 +0,0 @@ -HEAPSIZE 0 -EXPORTS - uno_initEnvironment - uno_ext_getMapping - - - - diff --git a/cppu/test/purpenvhelper/makefile.mk b/cppu/test/purpenvhelper/makefile.mk deleted file mode 100644 index 3d9b9eaedcbf..000000000000 --- a/cppu/test/purpenvhelper/makefile.mk +++ /dev/null @@ -1,54 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := purpenvhelper.test.pl - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE - - -.INCLUDE : settings.mk -.INCLUDE : ../../source/helper/purpenv/export.mk - - -SHL1TARGET := TestEnv_uno_uno -SHL1IMPLIB := i$(SHL1TARGET) -SHL1OBJS := $(SLO)$/TestEnv.obj -SHL1STDLIBS := $(purpenv_helper_LIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) -SHL1DEF := TestEnv.def - - -.INCLUDE : target.mk - -ALLTAR: $(BIN)$/$(TARGET) - -$(BIN)$/$(TARGET): purpenvhelper.test.pl - @+$(COPY) $^ $@ diff --git a/cppu/test/purpenvhelper/purpenvhelper.test.pl b/cppu/test/purpenvhelper/purpenvhelper.test.pl deleted file mode 100755 index aa5605f71416..000000000000 --- a/cppu/test/purpenvhelper/purpenvhelper.test.pl +++ /dev/null @@ -1,67 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests=( - "env.tester.bin uno:TestEnv" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/purpose_envs/makefile.mk b/cppu/test/purpose_envs/makefile.mk deleted file mode 100644 index 6e9fe8ebb067..000000000000 --- a/cppu/test/purpose_envs/makefile.mk +++ /dev/null @@ -1,44 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := purpose_envs.test.pl - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE - - -.INCLUDE : settings.mk - - -.INCLUDE : target.mk - -ALLTAR: $(BIN)$/$(TARGET) - -$(BIN)$/$(TARGET): purpose_envs.test.pl - @+$(COPY) $^ $@ diff --git a/cppu/test/purpose_envs/purpose_envs.test.pl b/cppu/test/purpose_envs/purpose_envs.test.pl deleted file mode 100755 index 28abe2b72398..000000000000 --- a/cppu/test/purpose_envs/purpose_envs.test.pl +++ /dev/null @@ -1,67 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -my $rc = 0; -my $comment = ""; - - -@tests=( -"env.tester.bin uno" -); - -foreach $test (@tests) { - $output = ""; - - $cmd = $test; - open TESTER, $cmd . "|"; - while (<TESTER>) { - chomp; - - $output = $output . "\t" . $_ . "\n"; - } - close TESTER ; - - if ($? != 0) { - $comment = $comment . "TEST FAILED: " . $cmd . "\n"; - $comment = $comment . $output; - } - $rc = $rc + $?; -} - - -print $comment; - -if ($rc == 0) { - print "*********** SUCCESS\n"; -} -else { - print "*********** FAILURE\n"; -} diff --git a/cppu/test/surrogate.hxx b/cppu/test/surrogate.hxx deleted file mode 100644 index 3f479d3e5009..000000000000 --- a/cppu/test/surrogate.hxx +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <uno/dispatcher.h> -#include <uno/mapping.hxx> -#include <uno/environment.h> -#include <uno/data.h> -#include <osl/diagnose.h> -#include <osl/interlck.h> - -#include <com/sun/star/uno/Reference.hxx> - -/* -//================================================================================================== -struct UnoMediator : public uno_Interface -{ - oslInterlockedCount nRef; - uno_Interface * pDest; - - UnoMediator( uno_Interface * pDest ); - ~UnoMediator(); -}; - -//-------------------------------------------------------------------------------------------------- -inline static void SAL_CALL UnoMediator_acquire( uno_Interface * pUnoI ) -{ - osl_incrementInterlockedCount( &((UnoMediator *)pUnoI)->nRef ); -} -//-------------------------------------------------------------------------------------------------- -inline static void SAL_CALL UnoMediator_release( uno_Interface * pUnoI ) -{ - if (! osl_decrementInterlockedCount( &((UnoMediator *)pUnoI)->nRef )) - delete (UnoMediator *)pUnoI; -} -//-------------------------------------------------------------------------------------------------- -inline static void SAL_CALL UnoMediator_dispatch( - uno_Interface * pUnoI, const typelib_TypeDescription * pMemberType, - void * pReturn, void * pArgs[], uno_Any ** ppException ) -{ - (*((UnoMediator *)pUnoI)->pDest->pDispatcher)( - ((UnoMediator *)pUnoI)->pDest, pMemberType, pReturn, pArgs, ppException ); -} - -//__________________________________________________________________________________________________ -UnoMediator::UnoMediator( uno_Interface * pDest_ ) - : nRef( 0 ) - , pDest( pDest_ ) -{ - (*pDest->acquire)( pDest ); - uno_Interface::acquire = UnoMediator_acquire; - uno_Interface::release = UnoMediator_release; - uno_Interface::pDispatcher = UnoMediator_dispatch; -} -//__________________________________________________________________________________________________ -UnoMediator::~UnoMediator() -{ - (*pDest->release)( pDest ); -} -*/ - -//################################################################################################## - -template< class T > -inline sal_Bool makeSurrogate( com::sun::star::uno::Reference< T > & rOut, - const com::sun::star::uno::Reference< T > & rOriginal ) -{ - rOut.clear(); - - typelib_TypeDescription * pTD = 0; - const com::sun::star::uno::Type & rType = ::getCppuType( &rOriginal ); - TYPELIB_DANGER_GET( &pTD, rType.getTypeLibType() ); - OSL_ENSURE( pTD, "### cannot get typedescription!" ); - if (pTD) - { - uno_Environment * pCppEnv1 = 0; - uno_Environment * pCppEnv2 = 0; - - ::rtl::OUString aCppEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - uno_getEnvironment( &pCppEnv1, aCppEnvTypeName.pData, 0 ); - uno_createEnvironment( &pCppEnv2, aCppEnvTypeName.pData, 0 ); // anonymous - - ::com::sun::star::uno::Mapping aMapping( pCppEnv1, pCppEnv2, ::rtl::OUString::createFromAscii("prot") ); - T * p = (T *)aMapping.mapInterface( rOriginal.get(), (typelib_InterfaceTypeDescription *)pTD ); - if (p) - { - rOut = p; - p->release(); - } - - (*pCppEnv2->release)( pCppEnv2 ); - (*pCppEnv1->release)( pCppEnv1 ); - - TYPELIB_DANGER_RELEASE( pTD ); - } -/* - ::com::sun::star::uno::Mapping aCpp2Uno( CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO ); - ::com::sun::star::uno::Mapping aUno2Cpp( UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME ); - OSL_ENSURE( aCpp2Uno.is() && aUno2Cpp.is(), "### cannot get mappings!" ); - if (aCpp2Uno.is() && aUno2Cpp.is()) - { - typelib_TypeDescription * pTD = 0; - const com::sun::star::uno::Type & rType = ::getCppuType( &rOriginal ); - TYPELIB_DANGER_GET( &pTD, rType.getTypeLibType() ); - OSL_ENSURE( pTD, "### cannot get typedescription!" ); - if (pTD) - { - uno_Interface * pUno = (uno_Interface *)aCpp2Uno.mapInterface( - rOriginal.get(), (typelib_InterfaceTypeDescription *)pTD ); - if (pUno) - { - UnoMediator * pPseudo = new UnoMediator( pUno ); - (*pPseudo->acquire)( pPseudo ); - OSL_ENSURE( uno_equals( &pUno, &pPseudo, pTD, 0 ), "### interfaces don't belong to same object, but they do!?" ); - (*pUno->release)( pUno ); - - T * pCpp = (T *)aUno2Cpp.mapInterface( - pPseudo, (typelib_InterfaceTypeDescription *)pTD ); - (*pPseudo->release)( pPseudo ); - - if (pCpp) - { - rOut = pCpp; - pCpp->release(); - } - } - TYPELIB_DANGER_RELEASE( pTD ); - } - } -*/ - return rOut.is(); -} diff --git a/cppu/test/test_Cincludes.c b/cppu/test/test_Cincludes.c deleted file mode 100644 index bacdbc67209e..000000000000 --- a/cppu/test/test_Cincludes.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <uno/any2.h> -#include <uno/data.h> -#include <uno/dispatcher.h> -#include <uno/environment.h> -#include <uno/mapping.h> -#include <uno/sequence2.h> -#include <uno/threadpool.h> -#include <typelib/typedescription.h> - diff --git a/cppu/test/test_cuno.c b/cppu/test/test_cuno.c deleted file mode 100644 index 5757e0c229bb..000000000000 --- a/cppu/test/test_cuno.c +++ /dev/null @@ -1,784 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <stdio.h> -#include <osl/diagnose.h> -#include <osl/time.h> -#include <osl/interlck.h> -#include <rtl/alloc.h> -// -/* -#include <uno/dispatcher.h> -#include <uno/environment.h> -#include <uno/mapping.hxx> -*/ -#include <uno/data.h> -#include <uno/any2.h> -#include <uno/sequence2.h> - -#include <test/XLanguageBindingTest.h> - - -typedef struct _InstanceData -{ - void const * m_XInterface[2]; - void const * m_XLBTestBase[2]; - void const * m_XLanguageBindingTest[2]; - - sal_Int32 m_refCount; - typelib_TypeDescription* m_pTDXInterface; - typelib_TypeDescription* m_pTDSeqTestElement; - typelib_TypeDescription* m_pTDTestDataElements; - test_TestDataElements m_data, m_structData; -} InstanceData; - -#define GET_THIS( p ) (InstanceData *)((void **)p)[1] - -//================================================================================================== -static void SAL_CALL c_acquire( void * p ) - SAL_THROW_EXTERN_C( ) -{ - CUNO_CALL( ((com_sun_star_uno_XInterface *)p) )->acquire( (com_sun_star_uno_XInterface *)p ); -} -//================================================================================================== -static void SAL_CALL c_release( void * p ) - SAL_THROW_EXTERN_C( ) -{ - CUNO_CALL( ((com_sun_star_uno_XInterface *)p) )->release( (com_sun_star_uno_XInterface *)p ); -} -//================================================================================================== -static void * SAL_CALL c_queryInterface( void * p, typelib_TypeDescriptionReference * pType ) - SAL_THROW_EXTERN_C( ) -{ - uno_Any aExc; - com_sun_star_uno_XInterface * pRet = NULL; - - if (CUNO_EXCEPTION_OCCURED( CUNO_CALL( ((com_sun_star_uno_XInterface *)p) )->queryInterface( (com_sun_star_uno_XInterface *)p, &aExc, &pRet, pType ) )) - { - uno_any_destruct( &aExc, c_release ); - return NULL; - } - else - { - return pRet; - } -} - -void defaultConstructData(test_TestDataElements* pData, typelib_TypeDescriptionReference * pElemType) -{ - pData->_Base._Base.Bool = sal_False; - pData->_Base._Base.Char = 0; - pData->_Base._Base.Byte = 0; - pData->_Base._Base.Short = 0; - pData->_Base._Base.UShort = 0; - pData->_Base._Base.Long = 0; - pData->_Base._Base.ULong = 0; - pData->_Base._Base.Hyper = 0; - pData->_Base._Base.UHyper = 0; - pData->_Base._Base.Float = 0; - pData->_Base._Base.Double = 0; - pData->_Base._Base.Enum = test_TestEnum_TEST; - pData->_Base.String = 0; - rtl_uString_new(&pData->_Base.String); - pData->_Base.Interface = 0; - uno_any_construct(&pData->_Base.Any, 0, 0, 0); -/* pData->Sequence = 0; */ - uno_type_sequence_construct( - &pData->Sequence, pElemType, 0, 0, c_acquire ); -} - -void assign1( test_TestSimple* rData, - sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test_TestEnum eEnum) -{ - rData->Bool = bBool; - rData->Char = cChar; - rData->Byte = nByte; - rData->Short = nShort; - rData->UShort = nUShort; - rData->Long = nLong; - rData->ULong = nULong; - rData->Hyper = nHyper; - rData->UHyper = nUHyper; - rData->Float = fFloat; - rData->Double = fDouble; - rData->Enum = eEnum; -} - -void assign2( test_TestElement* rData, - sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test_TestEnum eEnum, rtl_uString* rStr, - com_sun_star_uno_XInterface* xTest, - uno_Any* rAny, - typelib_TypeDescription* pTDIface) -{ - assign1( (test_TestSimple *)rData, - bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, - eEnum ); - rtl_uString_assign(&rData->String, rStr); -/* uno_assignData(&rData->Interface, pTDIface, &xTest, pTDIface, c_queryInterface, c_acquire, c_release); */ - if ( rData->Interface ) - CUNO_CALL(rData->Interface)->release(rData->Interface); - - if ( xTest ) - { - CUNO_CALL(xTest)->acquire(xTest); - rData->Interface = xTest; - } else - { - rData->Interface = 0; - } - - uno_type_any_assign(&rData->Any, rAny->pData, rAny->pType, c_acquire, c_release); -} - -void assign3( test_TestDataElements* rData, - sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test_TestEnum eEnum, rtl_uString* rStr, - com_sun_star_uno_XInterface* xTest, - uno_Any* rAny, - /* sequence< test_TestElement >*/uno_Sequence* rSequence, - typelib_TypeDescription* pTDIface, - typelib_TypeDescription* pTDSeqElem) -{ - assign2( (test_TestElement *)rData, - bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, - eEnum,rStr, xTest, rAny, pTDIface ); - uno_sequence_assign(&rData->Sequence, rSequence, pTDSeqElem, c_release); -} - -/* XInterface =============================================================================== */ - -/* XInterface::acquire */ -cuno_ErrorCode SAL_CALL XInterface_acquire( com_sun_star_uno_XInterface* pIFace) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - osl_incrementInterlockedCount( &pImpl->m_refCount ); - return CUNO_ERROR_NONE; -} - -/* XInterface::release */ -cuno_ErrorCode SAL_CALL XInterface_release( com_sun_star_uno_XInterface * pIFace ) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - if( osl_decrementInterlockedCount( &pImpl->m_refCount ) == 0) - { - uno_destructData(&pImpl->m_data, pImpl->m_pTDTestDataElements, c_release); - uno_destructData(&pImpl->m_structData, pImpl->m_pTDTestDataElements, c_release); - typelib_typedescription_release(pImpl->m_pTDXInterface); - typelib_typedescription_release(pImpl->m_pTDSeqTestElement); - typelib_typedescription_release(pImpl->m_pTDTestDataElements); - rtl_freeMemory( pImpl ); - } - return CUNO_ERROR_NONE; -} - -/* XInterface::queryInterface */ -cuno_ErrorCode SAL_CALL XInterface_queryInterface( com_sun_star_uno_XInterface * pIFace, uno_Any * pExc, com_sun_star_uno_XInterface ** pRet, typelib_TypeDescriptionReference * pTypeRef) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - com_sun_star_uno_XInterface * pIFaceRet = 0; - if ( pTypeRef ) - { - if( ! rtl_ustr_ascii_compare_WithLength( pTypeRef->pTypeName->buffer, pTypeRef->pTypeName->length, - "com.sun.star.uno.XInterface" ) ) - pIFaceRet = (com_sun_star_uno_XInterface *)&pImpl->m_XInterface; - else if( !rtl_ustr_ascii_compare_WithLength( pTypeRef->pTypeName->buffer, pTypeRef->pTypeName->length, - "test.XLBTestBase" ) ) - pIFaceRet = (com_sun_star_uno_XInterface *)&pImpl->m_XLBTestBase; - else if( !rtl_ustr_ascii_compare_WithLength( pTypeRef->pTypeName->buffer, pTypeRef->pTypeName->length, - "test.XLanguageBindingTest" ) ) - pIFaceRet = (com_sun_star_uno_XInterface *)&pImpl->m_XLanguageBindingTest; - - if( pIFaceRet ) - { - CUNO_CALL(pIFaceRet)->acquire( pIFaceRet ); - *pRet = pIFaceRet; - } else - { - *pRet = 0; - } - } - return CUNO_ERROR_NONE; -} - -/* XLBTestBase =============================================================================== */ - -/* XLBTestBase::getBool */ -cuno_ErrorCode SAL_CALL XLBTestBase_getBool( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Bool *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Bool; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setBool */ -cuno_ErrorCode SAL_CALL XLBTestBase_setBool( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Bool value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Bool = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getByte */ -cuno_ErrorCode SAL_CALL XLBTestBase_getByte( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int8 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Byte; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setByte */ -cuno_ErrorCode SAL_CALL XLBTestBase_setByte( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int8 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Byte = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getChar */ -cuno_ErrorCode SAL_CALL XLBTestBase_getChar( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Unicode *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Char; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setChar */ -cuno_ErrorCode SAL_CALL XLBTestBase_setChar( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Unicode value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Char = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getShort */ -cuno_ErrorCode SAL_CALL XLBTestBase_getShort( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int16 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Short; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setShort */ -cuno_ErrorCode SAL_CALL XLBTestBase_setShort( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int16 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Short = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getUShort */ -cuno_ErrorCode SAL_CALL XLBTestBase_getUShort( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt16 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.UShort; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setUShort */ -cuno_ErrorCode SAL_CALL XLBTestBase_setUShort( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt16 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.UShort = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getLong */ -cuno_ErrorCode SAL_CALL XLBTestBase_getLong( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int32 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Long; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setLong */ -cuno_ErrorCode SAL_CALL XLBTestBase_setLong( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int32 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Long = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getULong */ -cuno_ErrorCode SAL_CALL XLBTestBase_getULong( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt32 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.ULong; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setULong */ -cuno_ErrorCode SAL_CALL XLBTestBase_setULong( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt32 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.ULong = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getHyper */ -cuno_ErrorCode SAL_CALL XLBTestBase_getHyper( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int64 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Hyper; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setHyper */ -cuno_ErrorCode SAL_CALL XLBTestBase_setHyper( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Int64 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Hyper = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getUHyper */ -cuno_ErrorCode SAL_CALL XLBTestBase_getUHyper( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt64 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.UHyper; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setUHyper */ -cuno_ErrorCode SAL_CALL XLBTestBase_setUHyper( test_XLBTestBase * pIFace, uno_Any * pExc, sal_uInt64 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.UHyper = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getFloat */ -cuno_ErrorCode SAL_CALL XLBTestBase_getFloat( test_XLBTestBase * pIFace, uno_Any * pExc, float *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Float; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setFloat */ -cuno_ErrorCode SAL_CALL XLBTestBase_setFloat( test_XLBTestBase * pIFace, uno_Any * pExc, float value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Float = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getDouble */ -cuno_ErrorCode SAL_CALL XLBTestBase_getDouble( test_XLBTestBase * pIFace, uno_Any * pExc, double *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Double; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setDouble */ -cuno_ErrorCode SAL_CALL XLBTestBase_setDouble( test_XLBTestBase * pIFace, uno_Any * pExc, double value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Double = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getEnum */ -cuno_ErrorCode SAL_CALL XLBTestBase_getEnum( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestEnum *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = pImpl->m_data._Base._Base.Enum; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setEnum */ -cuno_ErrorCode SAL_CALL XLBTestBase_setEnum( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestEnum value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - pImpl->m_data._Base._Base.Enum = value; - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getString */ -cuno_ErrorCode SAL_CALL XLBTestBase_getString( test_XLBTestBase * pIFace, uno_Any * pExc, rtl_uString **pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - *pRet = 0; - rtl_uString_newFromString(pRet, pImpl->m_data._Base.String); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setString */ -cuno_ErrorCode SAL_CALL XLBTestBase_setString( test_XLBTestBase * pIFace, uno_Any * pExc, rtl_uString *value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - rtl_uString_assign(&pImpl->m_data._Base.String, value); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getInterface */ -cuno_ErrorCode SAL_CALL XLBTestBase_getInterface( test_XLBTestBase * pIFace, uno_Any * pExc, com_sun_star_uno_XInterface **pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); -/* uno_copyData(pRet, &pImpl->m_data._Base.Interface, pImpl->m_pTDXInterface, c_acquire); */ - if ( pImpl->m_data._Base.Interface ) - { - CUNO_CALL(pImpl->m_data._Base.Interface)->acquire(pImpl->m_data._Base.Interface); - *pRet = pImpl->m_data._Base.Interface; - } else - { - *pRet = 0; - } - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setInterface */ -cuno_ErrorCode SAL_CALL XLBTestBase_setInterface( test_XLBTestBase * pIFace, uno_Any * pExc, com_sun_star_uno_XInterface *value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); -/* uno_assignData(&pImpl->m_data._Base.Interface, pImpl->m_pTDXInterface, &value, pImpl->m_pTDXInterface, c_queryInterface, c_acquire, c_release); */ - if ( pImpl->m_data._Base.Interface ) - CUNO_CALL(pImpl->m_data._Base.Interface)->release(pImpl->m_data._Base.Interface); - - if ( value ) - { - CUNO_CALL(value)->acquire(value); - pImpl->m_data._Base.Interface = value; - } else - { - pImpl->m_data._Base.Interface = 0; - } - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getAny */ -cuno_ErrorCode SAL_CALL XLBTestBase_getAny( test_XLBTestBase * pIFace, uno_Any * pExc, uno_Any *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - typelib_TypeDescription* pTD = 0; - typelib_typedescriptionreference_getDescription(&pTD, pImpl->m_data._Base.Any.pType); - uno_any_construct(pRet, pImpl->m_data._Base.Any.pData, pTD, c_acquire); - typelib_typedescription_release(pTD); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setAny */ -cuno_ErrorCode SAL_CALL XLBTestBase_setAny( test_XLBTestBase * pIFace, uno_Any * pExc, uno_Any *value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - typelib_TypeDescription* pTD = 0; - typelib_typedescriptionreference_getDescription(&pTD, value->pType); - uno_any_assign(&pImpl->m_data._Base.Any, value->pData, pTD, c_acquire, c_release); - typelib_typedescription_release(pTD); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getSequence */ -cuno_ErrorCode SAL_CALL XLBTestBase_getSequence( test_XLBTestBase * pIFace, uno_Any * pExc, /*sequence< test.TestElement >*/uno_Sequence **pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - uno_sequence_construct(pRet, pImpl->m_pTDSeqTestElement, pImpl->m_data.Sequence->elements, pImpl->m_data.Sequence->nElements, c_acquire); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setSequence */ -cuno_ErrorCode SAL_CALL XLBTestBase_setSequence( test_XLBTestBase * pIFace, uno_Any * pExc, /*sequence< test.TestElement >*/uno_Sequence *value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - uno_sequence_assign(&pImpl->m_data.Sequence, value, pImpl->m_pTDSeqTestElement, c_release); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getStruct */ -cuno_ErrorCode SAL_CALL XLBTestBase_getStruct( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestDataElements *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - uno_copyData(pRet, &pImpl->m_structData, pImpl->m_pTDTestDataElements, c_acquire); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setStruct */ -cuno_ErrorCode SAL_CALL XLBTestBase_setStruct( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestDataElements *value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - uno_assignData(&pImpl->m_structData, pImpl->m_pTDTestDataElements, value, pImpl->m_pTDTestDataElements, c_queryInterface, c_acquire, c_release); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setValues */ -cuno_ErrorCode SAL_CALL XLBTestBase_setValues( test_XLBTestBase * pIFace, uno_Any * pExc, sal_Bool aBool, sal_Unicode aChar, sal_Int8 aByte, sal_Int16 aShort, sal_uInt16 aUShort, sal_Int32 aLong, sal_uInt32 aULong, sal_Int64 aHyper, sal_uInt64 aUHyper, float aFloat, double aDouble, test_TestEnum aEnum, rtl_uString* aString, com_sun_star_uno_XInterface *aInterface, uno_Any * aAny, /*sequence< test.TestElement >*/ uno_Sequence * aSequence, test_TestDataElements *aStruct) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - assign3(&pImpl->m_data, aBool, aChar, aByte, aShort, aUShort, aLong, aULong, aHyper, aUHyper, aFloat, aDouble, - aEnum, aString, aInterface, aAny,aSequence, pImpl->m_pTDXInterface, pImpl->m_pTDSeqTestElement); - uno_assignData(&pImpl->m_structData, pImpl->m_pTDTestDataElements, aStruct, pImpl->m_pTDTestDataElements, c_queryInterface, c_acquire, c_release); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::setValues2 */ -cuno_ErrorCode SAL_CALL XLBTestBase_setValues2( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestDataElements* pRet, sal_Bool* aBool, sal_Unicode* aChar, sal_Int8* aByte, sal_Int16* aShort, sal_uInt16* aUShort, sal_Int32* aLong, sal_uInt32* aULong, sal_Int64* aHyper, sal_uInt64* aUHyper, float* aFloat, double* aDouble, test_TestEnum* aEnum, rtl_uString** aString, com_sun_star_uno_XInterface **aInterface, uno_Any * aAny, /*sequence< test.TestElement >*/ uno_Sequence ** aSequence, test_TestDataElements * aStruct) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - assign3(&pImpl->m_data, *aBool, *aChar, *aByte, *aShort, *aUShort, *aLong, *aULong, *aHyper, *aUHyper, *aFloat, *aDouble, - *aEnum, *aString, *aInterface, aAny, *aSequence, pImpl->m_pTDXInterface, pImpl->m_pTDSeqTestElement); - uno_assignData(&pImpl->m_structData, pImpl->m_pTDTestDataElements, aStruct, pImpl->m_pTDTestDataElements, c_queryInterface, c_acquire, c_release); - uno_copyData(pRet, &pImpl->m_structData, pImpl->m_pTDTestDataElements, c_acquire); - return CUNO_ERROR_NONE; -} -/* XLBTestBase::getValues */ -cuno_ErrorCode SAL_CALL XLBTestBase_getValues( test_XLBTestBase * pIFace, uno_Any * pExc, test_TestDataElements* pRet, sal_Bool* aBool, sal_Unicode* aChar, sal_Int8* aByte, sal_Int16* aShort, sal_uInt16* aUShort, sal_Int32* aLong, sal_uInt32* aULong, sal_Int64* aHyper, sal_uInt64* aUHyper, float* aFloat, double* aDouble, test_TestEnum* aEnum, rtl_uString** aString, com_sun_star_uno_XInterface **aInterface, uno_Any * aAny, /*sequence< test.TestElement >*/ uno_Sequence ** aSequence, test_TestDataElements * aStruct) -{ - typelib_TypeDescription* pTD = 0; - InstanceData * pImpl = GET_THIS( pIFace ); - *aBool = pImpl->m_data._Base._Base.Bool; - *aChar = pImpl->m_data._Base._Base.Char; - *aByte = pImpl->m_data._Base._Base.Byte; - *aShort = pImpl->m_data._Base._Base.Short; - *aUShort = pImpl->m_data._Base._Base.UShort; - *aLong = pImpl->m_data._Base._Base.Long; - *aULong = pImpl->m_data._Base._Base.ULong; - *aHyper = pImpl->m_data._Base._Base.Hyper; - *aUHyper = pImpl->m_data._Base._Base.UHyper; - *aFloat = pImpl->m_data._Base._Base.Float; - *aDouble = pImpl->m_data._Base._Base.Double; - *aEnum = pImpl->m_data._Base._Base.Enum; - *aString = 0; - rtl_uString_newFromString(aString, pImpl->m_data._Base.String); -/* uno_copyData(aInterface, &pImpl->m_data._Base.Interface, pImpl->m_pTDXInterface, c_acquire); */ - if ( pImpl->m_data._Base.Interface ) - { - CUNO_CALL(pImpl->m_data._Base.Interface)->acquire(pImpl->m_data._Base.Interface); - *aInterface = pImpl->m_data._Base.Interface; - } else - { - *aInterface = 0; - } - typelib_typedescriptionreference_getDescription(&pTD, pImpl->m_data._Base.Any.pType); - uno_any_construct(aAny, pImpl->m_data._Base.Any.pData, pTD, c_acquire); - typelib_typedescription_release(pTD); - uno_sequence_construct(aSequence, pImpl->m_pTDSeqTestElement, pImpl->m_data.Sequence->elements, pImpl->m_data.Sequence->nElements, c_acquire); - uno_copyData(aStruct, &pImpl->m_structData, pImpl->m_pTDTestDataElements, c_acquire); - uno_copyData(pRet, &pImpl->m_structData, pImpl->m_pTDTestDataElements, c_acquire); - return CUNO_ERROR_NONE; -} - -/* XLanguageBindingTest =============================================================================== */ - -/* XLanguageBindingTest::getRuntimeException */ -cuno_ErrorCode SAL_CALL XLanguageBindingTest_getRuntimeException( test_XLanguageBindingTest * pIFace, uno_Any * pExc, sal_Int32 *pRet) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - com_sun_star_uno_RuntimeException aExc; - typelib_TypeDescription * pTD = 0; - rtl_uString * pTypeName = 0; - uno_Any excp; - - rtl_uString_newFromAscii( &pTypeName, "com.sun.star.uno.RuntimeException"); - typelib_typedescription_getByName(&pTD, pTypeName); - - aExc._Base.Message = 0; - rtl_uString_newFromAscii(&aExc._Base.Message, "dum dum dum ich tanz im kreis herum..."); - aExc._Base.Context = 0; - if (CUNO_EXCEPTION_OCCURED( CUNO_CALL(pIFace)->getInterface( (test_XLBTestBase *)pIFace, &excp, &aExc._Base.Context) )) - { - /* ... */ - uno_any_destruct( &excp, 0 ); - } - - uno_any_construct(pExc, &aExc, pTD, c_acquire); - uno_destructData(&aExc, pTD, c_release); - typelib_typedescription_release(pTD); - rtl_uString_release(pTypeName); - - return CUNO_ERROR_EXCEPTION; -} -/* XLanguageBindingTest::setRuntimeException */ -cuno_ErrorCode SAL_CALL XLanguageBindingTest_setRuntimeException( test_XLanguageBindingTest * pIFace, uno_Any * pExc, sal_Int32 value) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - com_sun_star_uno_RuntimeException aExc; - typelib_TypeDescription * pTD = 0; - rtl_uString * pTypeName = 0; - uno_Any excp; - - rtl_uString_newFromAscii( &pTypeName, "com.sun.star.uno.RuntimeException"); - typelib_typedescription_getByName(&pTD, pTypeName); - - aExc._Base.Message = 0; - rtl_uString_newFromAscii(&aExc._Base.Message, "dum dum dum ich tanz im kreis herum..."); - aExc._Base.Context = 0; - if (CUNO_EXCEPTION_OCCURED( CUNO_CALL(pIFace)->getInterface( (test_XLBTestBase *)pIFace, &excp, &aExc._Base.Context) )) - { - /* ... */ - uno_any_destruct( &excp, 0 ); - } - - uno_any_construct(pExc, &aExc, pTD, c_acquire); - uno_destructData(&aExc, pTD, c_release); - typelib_typedescription_release(pTD); - rtl_uString_release(pTypeName); - - return CUNO_ERROR_EXCEPTION; -} -/* XLanguageBindingTest::raiseException */ -cuno_ErrorCode SAL_CALL XLanguageBindingTest_raiseException( test_XLanguageBindingTest * pIFace, uno_Any * pExc, test_TestDataElements* pRet, sal_Bool* aBool, sal_Unicode* aChar, sal_Int8* aByte, sal_Int16* aShort, sal_uInt16* aUShort, sal_Int32* aLong, sal_uInt32* aULong, sal_Int64* aHyper, sal_uInt64* aUHyper, float* aFloat, double* aDouble, test_TestEnum* aEnum, rtl_uString ** aString, com_sun_star_uno_XInterface ** aInterface, uno_Any* aAny, /*sequence< test.TestElement >*/ uno_Sequence ** aSequence, test_TestDataElements* AStruct) -{ - InstanceData * pImpl = GET_THIS( pIFace ); - com_sun_star_lang_IllegalArgumentException aExc; - typelib_TypeDescription * pTD = 0; - rtl_uString * pTypeName = 0; - uno_Any excp; - - rtl_uString_newFromAscii( &pTypeName, "com.sun.star.lang.IllegalArgumentException"); - typelib_typedescription_getByName(&pTD, pTypeName); - - aExc.ArgumentPosition = 5; - aExc._Base.Message = 0; - rtl_uString_newFromAscii(&aExc._Base.Message, "dum dum dum ich tanz im kreis herum..."); - aExc._Base.Context = 0; - if (CUNO_EXCEPTION_OCCURED( CUNO_CALL(pIFace)->getInterface( (test_XLBTestBase *)pIFace, &excp, &aExc._Base.Context) )) - { - /* ... */ - uno_any_destruct( &excp, 0 ); - } - - uno_any_construct(pExc, &aExc, pTD, c_acquire); - uno_destructData(&aExc, pTD, c_release); - typelib_typedescription_release(pTD); - rtl_uString_release(pTypeName); - - return CUNO_ERROR_EXCEPTION; -} - - -static const com_sun_star_uno_XInterface_ftab s_XInterface_ftab={ - XInterface_queryInterface, - XInterface_acquire, - XInterface_release, - }; -static const test_XLBTestBase_ftab s_XLBTestBase_ftab={ - XInterface_queryInterface, - XInterface_acquire, - XInterface_release, - XLBTestBase_getBool, - XLBTestBase_setBool, - XLBTestBase_getByte, - XLBTestBase_setByte, - XLBTestBase_getChar, - XLBTestBase_setChar, - XLBTestBase_getShort, - XLBTestBase_setShort, - XLBTestBase_getUShort, - XLBTestBase_setUShort, - XLBTestBase_getLong, - XLBTestBase_setLong, - XLBTestBase_getULong, - XLBTestBase_setULong, - XLBTestBase_getHyper, - XLBTestBase_setHyper, - XLBTestBase_getUHyper, - XLBTestBase_setUHyper, - XLBTestBase_getFloat, - XLBTestBase_setFloat, - XLBTestBase_getDouble, - XLBTestBase_setDouble, - XLBTestBase_getEnum, - XLBTestBase_setEnum, - XLBTestBase_getString, - XLBTestBase_setString, - XLBTestBase_getInterface, - XLBTestBase_setInterface, - XLBTestBase_getAny, - XLBTestBase_setAny, - XLBTestBase_getSequence, - XLBTestBase_setSequence, - XLBTestBase_getStruct, - XLBTestBase_setStruct, - XLBTestBase_setValues, - XLBTestBase_setValues2, - XLBTestBase_getValues - }; -static const test_XLanguageBindingTest_ftab s_XLanguageBindingTest_ftab={ - XInterface_queryInterface, - XInterface_acquire, - XInterface_release, - XLBTestBase_getBool, - XLBTestBase_setBool, - XLBTestBase_getByte, - XLBTestBase_setByte, - XLBTestBase_getChar, - XLBTestBase_setChar, - XLBTestBase_getShort, - XLBTestBase_setShort, - XLBTestBase_getUShort, - XLBTestBase_setUShort, - XLBTestBase_getLong, - XLBTestBase_setLong, - XLBTestBase_getULong, - XLBTestBase_setULong, - XLBTestBase_getHyper, - XLBTestBase_setHyper, - XLBTestBase_getUHyper, - XLBTestBase_setUHyper, - XLBTestBase_getFloat, - XLBTestBase_setFloat, - XLBTestBase_getDouble, - XLBTestBase_setDouble, - XLBTestBase_getEnum, - XLBTestBase_setEnum, - XLBTestBase_getString, - XLBTestBase_setString, - XLBTestBase_getInterface, - XLBTestBase_setInterface, - XLBTestBase_getAny, - XLBTestBase_setAny, - XLBTestBase_getSequence, - XLBTestBase_setSequence, - XLBTestBase_getStruct, - XLBTestBase_setStruct, - XLBTestBase_setValues, - XLBTestBase_setValues2, - XLBTestBase_getValues, - XLanguageBindingTest_getRuntimeException, - XLanguageBindingTest_setRuntimeException, - XLanguageBindingTest_raiseException - }; - -com_sun_star_uno_XInterface* SAL_CALL createTestObject() -{ - InstanceData *pObj; - rtl_uString* usXInterface = 0; - rtl_uString* usSeqTestElement = 0; - rtl_uString* usTestDataElements = 0; - - /* Create a data instance of the component */ - pObj= (InstanceData*)rtl_allocateMemory( sizeof( InstanceData) ); - pObj->m_XInterface[0] = &s_XInterface_ftab; - pObj->m_XInterface[1] = pObj; - pObj->m_XLBTestBase[0] = &s_XLBTestBase_ftab; - pObj->m_XLBTestBase[1] = pObj; - pObj->m_XLanguageBindingTest[0] = &s_XLanguageBindingTest_ftab; - pObj->m_XLanguageBindingTest[1] = pObj; - - /* Initalize the reference counter member and other component data */ - pObj->m_refCount= 1; - - pObj->m_pTDXInterface = 0; - rtl_uString_newFromAscii( &usXInterface, "com.sun.star.uno.XInterface"); - typelib_typedescription_getByName(&pObj->m_pTDXInterface, usXInterface); - - pObj->m_pTDSeqTestElement = 0; - rtl_uString_newFromAscii( &usSeqTestElement, "[]test.TestElement"); - typelib_typedescription_getByName(&pObj->m_pTDSeqTestElement, usSeqTestElement); - - pObj->m_pTDTestDataElements = 0; - rtl_uString_newFromAscii( &usTestDataElements, "test.TestDataElements"); - typelib_typedescription_getByName(&pObj->m_pTDTestDataElements, usTestDataElements); - - defaultConstructData(&pObj->m_data, pObj->m_pTDSeqTestElement->pWeakRef); - defaultConstructData(&pObj->m_structData, pObj->m_pTDSeqTestElement->pWeakRef); - - rtl_uString_release(usXInterface); - rtl_uString_release(usSeqTestElement); - rtl_uString_release(usTestDataElements); - return (com_sun_star_uno_XInterface *)&pObj->m_XInterface; -} - diff --git a/cppu/test/test_di.cxx b/cppu/test/test_di.cxx deleted file mode 100644 index 88e8f9ac639d..000000000000 --- a/cppu/test/test_di.cxx +++ /dev/null @@ -1,888 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !defined(OSL_DEBUG_LEVEL) || OSL_DEBUG_LEVEL == 0 -# undef OSL_DEBUG_LEVEL -# define OSL_DEBUG_LEVEL 2 -#endif - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include <stdio.h> -#include <string.h> -#include <rtl/ustring.hxx> -#include <osl/diagnose.h> -#include <osl/time.h> -#include <sal/types.h> -// -#include <uno/dispatcher.h> -#include <uno/environment.h> -#include <uno/mapping.hxx> -#include <uno/data.h> - -// #include <uno/cuno.h> -// #include <test/XLanguageBindingTest.h> - -#include <cppuhelper/weak.hxx> -#include <cppuhelper/queryinterface.hxx> -#include <cppu/macros.hxx> -#include <test/XLanguageBindingTest.hpp> - -#include <cppuhelper/implbase1.hxx> - -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/DisposedException.hpp> - - -using namespace test; -using namespace cppu; -using namespace osl; -using namespace rtl; -using namespace com::sun::star; -using namespace com::sun::star::uno; - - -//================================================================================================== -sal_Bool equals( const test::TestElement & rData1, const test::TestElement & rData2 ) -{ - OSL_ENSURE( rData1.Bool == rData2.Bool, "### bool does not match!" ); - OSL_ENSURE( rData1.Char == rData2.Char, "### char does not match!" ); - OSL_ENSURE( rData1.Byte == rData2.Byte, "### byte does not match!" ); - OSL_ENSURE( rData1.Short == rData2.Short, "### short does not match!" ); - OSL_ENSURE( rData1.UShort == rData2.UShort, "### unsigned short does not match!" ); - OSL_ENSURE( rData1.Long == rData2.Long, "### long does not match!" ); - OSL_ENSURE( rData1.ULong == rData2.ULong, "### unsigned long does not match!" ); - OSL_ENSURE( rData1.Hyper == rData2.Hyper, "### hyper does not match!" ); - OSL_ENSURE( rData1.UHyper == rData2.UHyper, "### unsigned hyper does not match!" ); - OSL_ENSURE( rData1.Float == rData2.Float, "### float does not match!" ); - OSL_ENSURE( rData1.Double == rData2.Double, "### double does not match!" ); - OSL_ENSURE( rData1.Enum == rData2.Enum, "### enum does not match!" ); - OSL_ENSURE( rData1.String == rData2.String, "### string does not match!" ); - OSL_ENSURE( rData1.Interface == rData2.Interface, "### interface does not match!" ); - OSL_ENSURE( rData1.Any == rData2.Any, "### any does not match!" ); - - return (rData1.Bool == rData2.Bool && - rData1.Char == rData2.Char && - rData1.Byte == rData2.Byte && - rData1.Short == rData2.Short && - rData1.UShort == rData2.UShort && - rData1.Long == rData2.Long && - rData1.ULong == rData2.ULong && - rData1.Hyper == rData2.Hyper && - rData1.UHyper == rData2.UHyper && - rData1.Float == rData2.Float && - rData1.Double == rData2.Double && - rData1.Enum == rData2.Enum && - rData1.String == rData2.String && - rData1.Interface == rData2.Interface && - rData1.Any == rData2.Any); -} -//================================================================================================== -sal_Bool equals( const test::TestData & rData1, const test::TestData & rData2 ) -{ - sal_Int32 nLen; - - if ((rData1.Sequence == rData2.Sequence) && - equals( (const test::TestElement &)rData1, (const test::TestElement &)rData2 ) && - (nLen = rData1.Sequence.getLength()) == rData2.Sequence.getLength()) - { - // once again by hand sequence == - const test::TestElement * pElements1 = rData1.Sequence.getConstArray(); - const test::TestElement * pElements2 = rData2.Sequence.getConstArray(); - for ( ; nLen--; ) - { - if (! equals( pElements1[nLen], pElements2[nLen] )) - { - OSL_ENSURE( sal_False, "### sequence element did not match!" ); - return sal_False; - } - } - return sal_True; - } - return sal_False; -} -//================================================================================================== -void assign( test::TestElement & rData, - sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test::TestEnum eEnum, const ::rtl::OUString& rStr, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - const ::com::sun::star::uno::Any& rAny ) -{ - rData.Bool = bBool; - rData.Char = cChar; - rData.Byte = nByte; - rData.Short = nShort; - rData.UShort = nUShort; - rData.Long = nLong; - rData.ULong = nULong; - rData.Hyper = nHyper; - rData.UHyper = nUHyper; - rData.Float = fFloat; - rData.Double = fDouble; - rData.Enum = eEnum; - rData.String = rStr; - rData.Interface = xTest; - rData.Any = rAny; -} -//================================================================================================== -void assign( test::TestData & rData, - sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test::TestEnum eEnum, const ::rtl::OUString& rStr, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - const ::com::sun::star::uno::Any& rAny, - const com::sun::star::uno::Sequence< test::TestElement >& rSequence ) -{ - assign( (test::TestElement &)rData, - bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, - eEnum, rStr, xTest, rAny ); - rData.Sequence = rSequence; -} - -//================================================================================================== -class TestDummy : public OWeakObject -{ -public: - sal_Int32 getRefCount() const - { return m_refCount; } - - virtual ~TestDummy() - { OSL_TRACE( "> scalar TestDummy dtor <\n" ); } -}; -//================================================================================================== -class Test_Impl : public cppu::WeakImplHelper1< XLanguageBindingTest > -{ - test::TestData _aData, _aStructData; - -public: - sal_Int32 getRefCount() const - { return m_refCount; } - - virtual ~Test_Impl() - { OSL_TRACE( "> scalar Test_Impl dtor <\n" ); } - - // XLBTestBase - virtual void SAL_CALL setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test::TestEnum eEnum, const ::rtl::OUString& rStr, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - const ::com::sun::star::uno::Any& rAny, - const ::com::sun::star::uno::Sequence<test::TestElement >& rSequence, - const test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException); - - virtual test::TestData SAL_CALL setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte, - sal_Int16& nShort, sal_uInt16& nUShort, - sal_Int32& nLong, sal_uInt32& nULong, - sal_Int64& nHyper, sal_uInt64& nUHyper, - float& fFloat, double& fDouble, - test::TestEnum& eEnum, rtl::OUString& rStr, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - ::com::sun::star::uno::Any& rAny, - ::com::sun::star::uno::Sequence<test::TestElement >& rSequence, - test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException); - - virtual test::TestData SAL_CALL getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte, - sal_Int16& nShort, sal_uInt16& nUShort, - sal_Int32& nLong, sal_uInt32& nULong, - sal_Int64& nHyper, sal_uInt64& nUHyper, - float& fFloat, double& fDouble, - test::TestEnum& eEnum, rtl::OUString& rStr, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - ::com::sun::star::uno::Any& rAny, - ::com::sun::star::uno::Sequence< test::TestElement >& rSequence, - test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException); - - virtual test::SmallStruct echoSmallStruct(const test::SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException) - { return rStruct; } - virtual test::MediumStruct echoMediumStruct(const test::MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException) - { return rStruct; } - virtual test::BigStruct echoBigStruct(const test::BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException) - { return rStruct; } - virtual test::AllFloats echoAllFloats(const test::AllFloats& rStruct) throw(com::sun::star::uno::RuntimeException) - { return rStruct; } - - virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException) - { return _aData.Bool; } - virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException) - { return _aData.Byte; } - virtual sal_Unicode SAL_CALL getChar() throw(com::sun::star::uno::RuntimeException) - { return _aData.Char; } - virtual sal_Int16 SAL_CALL getShort() throw(com::sun::star::uno::RuntimeException) - { return _aData.Short; } - virtual sal_uInt16 SAL_CALL getUShort() throw(com::sun::star::uno::RuntimeException) - { return _aData.UShort; } - virtual sal_Int32 SAL_CALL getLong() throw(com::sun::star::uno::RuntimeException) - { return _aData.Long; } - virtual sal_uInt32 SAL_CALL getULong() throw(com::sun::star::uno::RuntimeException) - { return _aData.ULong; } - virtual sal_Int64 SAL_CALL getHyper() throw(com::sun::star::uno::RuntimeException) - { return _aData.Hyper; } - virtual sal_uInt64 SAL_CALL getUHyper() throw(com::sun::star::uno::RuntimeException) - { return _aData.UHyper; } - virtual float SAL_CALL getFloat() throw(com::sun::star::uno::RuntimeException) - { return _aData.Float; } - virtual double SAL_CALL getDouble() throw(com::sun::star::uno::RuntimeException) - { return _aData.Double; } - virtual test::TestEnum SAL_CALL getEnum() throw(com::sun::star::uno::RuntimeException) - { return _aData.Enum; } - virtual rtl::OUString SAL_CALL getString() throw(com::sun::star::uno::RuntimeException) - { return _aData.String; } - virtual com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getInterface( ) throw(com::sun::star::uno::RuntimeException) - { return _aData.Interface; } - virtual com::sun::star::uno::Any SAL_CALL getAny() throw(com::sun::star::uno::RuntimeException) - { return _aData.Any; } - virtual com::sun::star::uno::Sequence< test::TestElement > SAL_CALL getSequence() throw(com::sun::star::uno::RuntimeException) - { return _aData.Sequence; } - virtual test::TestData SAL_CALL getStruct() throw(com::sun::star::uno::RuntimeException) - { return _aStructData; } - - virtual void SAL_CALL setBool( sal_Bool _bool ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Bool = _bool; } - virtual void SAL_CALL setByte( sal_Int8 _byte ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Byte = _byte; } - virtual void SAL_CALL setChar( sal_Unicode _char ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Char = _char; } - virtual void SAL_CALL setShort( sal_Int16 _short ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Short = _short; } - virtual void SAL_CALL setUShort( sal_uInt16 _ushort ) throw(::com::sun::star::uno::RuntimeException) - { _aData.UShort = _ushort; } - virtual void SAL_CALL setLong( sal_Int32 _long ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Long = _long; } - virtual void SAL_CALL setULong( sal_uInt32 _ulong ) throw(::com::sun::star::uno::RuntimeException) - { _aData.ULong = _ulong; } - virtual void SAL_CALL setHyper( sal_Int64 _hyper ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Hyper = _hyper; } - virtual void SAL_CALL setUHyper( sal_uInt64 _uhyper ) throw(::com::sun::star::uno::RuntimeException) - { _aData.UHyper = _uhyper; } - virtual void SAL_CALL setFloat( float _float ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Float = _float; } - virtual void SAL_CALL setDouble( double _double ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Double = _double; } - virtual void SAL_CALL setEnum( test::TestEnum _enum ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Enum = _enum; } - virtual void SAL_CALL setString( const ::rtl::OUString& _string ) throw(::com::sun::star::uno::RuntimeException) - { _aData.String = _string; } - virtual void SAL_CALL setInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _interface ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Interface = _interface; } - virtual void SAL_CALL setAny( const ::com::sun::star::uno::Any& _any ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Any = _any; } - virtual void SAL_CALL setSequence( const ::com::sun::star::uno::Sequence<test::TestElement >& _sequence ) throw(::com::sun::star::uno::RuntimeException) - { _aData.Sequence = _sequence; } - virtual void SAL_CALL setStruct( const test::TestData& _struct ) throw(::com::sun::star::uno::RuntimeException) - { _aStructData = _struct; } - - // XLanguageBindingTest - virtual test::TestData SAL_CALL raiseException( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte, sal_Int16& nShort, sal_uInt16& nUShort, sal_Int32& nLong, sal_uInt32& nULong, sal_Int64& nHyper, sal_uInt64& nUHyper, float& fFloat, double& fDouble, test::TestEnum& eEnum, ::rtl::OUString& aString, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInterface, ::com::sun::star::uno::Any& aAny, ::com::sun::star::uno::Sequence<test::TestElement >& aSequence,test::TestData& aStruct ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - virtual sal_Int32 SAL_CALL getRuntimeException() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setRuntimeException( sal_Int32 _runtimeexception ) throw(::com::sun::star::uno::RuntimeException); -}; -//__________________________________________________________________________________________________ -void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte, - sal_Int16 nShort, sal_uInt16 nUShort, - sal_Int32 nLong, sal_uInt32 nULong, - sal_Int64 nHyper, sal_uInt64 nUHyper, - float fFloat, double fDouble, - test::TestEnum eEnum, const ::rtl::OUString& rStr, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - const ::com::sun::star::uno::Any& rAny, - const ::com::sun::star::uno::Sequence<test::TestElement >& rSequence, - const test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException) -{ - assign( _aData, - bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, - eEnum, rStr, xTest, rAny, rSequence ); - _aStructData = rStruct; -} -//__________________________________________________________________________________________________ -test::TestData Test_Impl::setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte, - sal_Int16& nShort, sal_uInt16& nUShort, - sal_Int32& nLong, sal_uInt32& nULong, - sal_Int64& nHyper, sal_uInt64& nUHyper, - float& fFloat, double& fDouble, - test::TestEnum& eEnum, rtl::OUString& rStr, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - ::com::sun::star::uno::Any& rAny, - ::com::sun::star::uno::Sequence<test::TestElement >& rSequence, - test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException) -{ - assign( _aData, - bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, - eEnum, rStr, xTest, rAny, rSequence ); - _aStructData = rStruct; - return _aStructData; -} -//__________________________________________________________________________________________________ -test::TestData Test_Impl::getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte, - sal_Int16& nShort, sal_uInt16& nUShort, - sal_Int32& nLong, sal_uInt32& nULong, - sal_Int64& nHyper, sal_uInt64& nUHyper, - float& fFloat, double& fDouble, - test::TestEnum& eEnum, rtl::OUString& rStr, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest, - ::com::sun::star::uno::Any& rAny, - ::com::sun::star::uno::Sequence<test::TestElement >& rSequence, - test::TestData& rStruct ) - throw(com::sun::star::uno::RuntimeException) -{ - bBool = _aData.Bool; - cChar = _aData.Char; - nByte = _aData.Byte; - nShort = _aData.Short; - nUShort = _aData.UShort; - nLong = _aData.Long; - nULong = _aData.ULong; - nHyper = _aData.Hyper; - nUHyper = _aData.UHyper; - fFloat = _aData.Float; - fDouble = _aData.Double; - eEnum = _aData.Enum; - rStr = _aData.String; - xTest = _aData.Interface; - rAny = _aData.Any; - rSequence = _aData.Sequence; - rStruct = _aStructData; - return _aStructData; -} - -//================================================================================================== -static sal_Bool performTest( - const Reference< XLanguageBindingTest > & xLBT, - const Reference< XInterface > & xDummyInterface ) -{ - OSL_ENSURE( xLBT.is() && xDummyInterface.is(), "### no test interfaces!" ); - if (xLBT.is() && xDummyInterface.is()) - { - // this data is never ever granted access to by calls other than equals(), assign()! - test::TestData aData; // test against this data - - assign( (test::TestElement &)aData, - sal_True, '@', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98, - SAL_CONST_INT64(0x123456789abcdef0), - SAL_CONST_UINT64(0xfedcba9876543210), - (float)17.0815, 3.1415926359, TestEnum_LOLA, - OUString::createFromAscii("dumdidum"), xDummyInterface, - makeAny( xDummyInterface ) ); - aData.Sequence = Sequence<test::TestElement >( (const test::TestElement *)&aData, 1 ); - OSL_ENSURE( aData.Any == xDummyInterface, "### unexpected any!" ); - OSL_ENSURE( !(aData.Any != xDummyInterface), "### unexpected any!" ); - - // aData complete ==> never touched again - //================================================================================ - - // this is a manually copy of aData for first setting... - test::TestData aSetData0( aData ); // copy ctor - // assignment - test::TestData aSetData1 = aSetData0; - - test::TestData aSetData; - assign( (test::TestElement &)aSetData, - aSetData1.Bool, aSetData1.Char, aSetData1.Byte, aSetData1.Short, aSetData1.UShort, - aSetData1.Long, aSetData1.ULong, aSetData1.Hyper, aSetData1.UHyper, - aSetData1.Float, aSetData1.Double, - aSetData1.Enum, aSetData1.String, aSetData1.Interface, aSetData1.Any ); - // switch over to new sequence allocation - aSetData.Sequence = Sequence<test::TestElement >( (const test::TestElement *)&aSetData, 1 ); - - xLBT->setValues( - aSetData.Bool, aSetData.Char, aSetData.Byte, aSetData.Short, aSetData.UShort, - aSetData.Long, aSetData.ULong, aSetData.Hyper, aSetData.UHyper, aSetData.Float, aSetData.Double, - aSetData.Enum, aSetData.String, aSetData.Interface, aSetData.Any, aSetData.Sequence, aSetData ); - - { - test::TestData aRet, aRet2; - xLBT->getValues( - aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort, - aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double, - aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 ); - - OSL_ASSERT( equals( aData, aRet ) && equals( aData, aRet2 ) ); - - // set last retrieved values - test::TestData aSV2ret = xLBT->setValues2( - aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort, - aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double, - aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 ); - - OSL_ASSERT( equals( aData, aSV2ret ) && equals( aData, aRet2 ) ); - } - { - test::TestData aRet, aRet2; - test::TestData aGVret = xLBT->getValues( - aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort, - aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double, - aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 ); - - OSL_ASSERT( equals( aData, aRet ) && equals( aData, aRet2 ) && equals( aData, aGVret ) ); - - // set last retrieved values - xLBT->setBool( aRet.Bool ); - xLBT->setChar( aRet.Char ); - xLBT->setByte( aRet.Byte ); - xLBT->setShort( aRet.Short ); - xLBT->setUShort( aRet.UShort ); - xLBT->setLong( aRet.Long ); - xLBT->setULong( aRet.ULong ); - xLBT->setHyper( aRet.Hyper ); - xLBT->setUHyper( aRet.UHyper ); - xLBT->setFloat( aRet.Float ); - xLBT->setDouble( aRet.Double ); - xLBT->setEnum( aRet.Enum ); - xLBT->setString( aRet.String ); - xLBT->setInterface( aRet.Interface ); - xLBT->setAny( aRet.Any ); - xLBT->setSequence( aRet.Sequence ); - xLBT->setStruct( aRet2 ); - } - { - test::TestData aRet, aRet2; - aRet.Hyper = xLBT->getHyper(); - aRet.UHyper = xLBT->getUHyper(); - aRet.Float = xLBT->getFloat(); - aRet.Double = xLBT->getDouble(); - aRet.Byte = xLBT->getByte(); - aRet.Char = xLBT->getChar(); - aRet.Bool = xLBT->getBool(); - aRet.Short = xLBT->getShort(); - aRet.UShort = xLBT->getUShort(); - aRet.Long = xLBT->getLong(); - aRet.ULong = xLBT->getULong(); - aRet.Enum = xLBT->getEnum(); - aRet.String = xLBT->getString(); - aRet.Interface = xLBT->getInterface(); - aRet.Any = xLBT->getAny(); - aRet.Sequence = xLBT->getSequence(); - aRet2 = xLBT->getStruct(); - - OSL_ASSERT( equals( aData, aRet ) && equals( aData, aRet2 ) ); - } - { - test::SmallStruct aIn(1, 2); - test::SmallStruct aOut = xLBT->echoSmallStruct(aIn); - OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::SmallStruct)) == 0 ); - } - { - test::MediumStruct aIn(1, 2, 3, 4); - test::MediumStruct aOut = xLBT->echoMediumStruct(aIn); - OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::MediumStruct)) == 0 ); - } - { - test::BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8); - test::BigStruct aOut = xLBT->echoBigStruct(aIn); - OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::BigStruct)) == 0 ); - } - { - test::AllFloats aIn(1.1, 2.2, 3.3, 4.4); - test::AllFloats aOut = xLBT->echoAllFloats(aIn); - return( memcmp(&aIn, &aOut, sizeof(test::AllFloats)) == 0 ); - } - } - return sal_False; -} - -//__________________________________________________________________________________________________ -test::TestData Test_Impl::raiseException( sal_Bool& /*bBool*/, sal_Unicode& /*cChar*/, sal_Int8& /*nByte*/, sal_Int16& /*nShort*/, sal_uInt16& /*nUShort*/, sal_Int32& /*nLong*/, sal_uInt32& /*nULong*/, sal_Int64& /*nHyper*/, sal_uInt64& /*nUHyper*/, float& /*fFloat*/, double& /*fDouble*/, test::TestEnum& /*eEnum*/, ::rtl::OUString& /*aString*/, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& /*xInterface*/, ::com::sun::star::uno::Any& /*aAny*/, ::com::sun::star::uno::Sequence< test::TestElement >& /*aSequence*/, test::TestData& /*aStruct*/ ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) -{ - lang::IllegalArgumentException aExc; - aExc.ArgumentPosition = 5; - aExc.Message = OUString::createFromAscii( "dum dum dum ich tanz im kreis herum..." ); - aExc.Context = getInterface(); - throw aExc; -} -//__________________________________________________________________________________________________ -sal_Int32 Test_Impl::getRuntimeException() throw(::com::sun::star::uno::RuntimeException) -{ - lang::DisposedException aExc; - aExc.Message = OUString::createFromAscii( "dum dum dum ich tanz im kreis herum..." ); - aExc.Context = getInterface(); - throw aExc; -} -//__________________________________________________________________________________________________ -void Test_Impl::setRuntimeException( sal_Int32 /*_runtimeexception*/ ) throw(::com::sun::star::uno::RuntimeException) -{ - lang::DisposedException aExc; - aExc.Message = OUString::createFromAscii( "dum dum dum ich tanz im kreis herum..." ); - aExc.Context = getInterface(); - throw aExc; -} - -static void raising1( const Reference< XLanguageBindingTest > & xLBT ) -{ - test::TestData aRet, aRet2; - xLBT->raiseException( - aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort, - aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double, - aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 ); -} -static void raising2( const Reference< XLanguageBindingTest > & xLBT ) -{ - try - { - raising1( xLBT ); - } - catch (RuntimeException &) - { - } - catch (...) - { - throw; - } -} -//================================================================================================== -sal_Bool raiseException( const Reference< XLanguageBindingTest > & xLBT ) -{ - try - { - xLBT->getRuntimeException(); - } - catch (lang::DisposedException & exc) - { - OSL_ENSURE( exc.Context == xLBT->getInterface() && - exc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...") ), - "### unexpected exception content!" ); - } - catch (RuntimeException &) - { - } - catch (Exception &) - { - return sal_False; - } - catch (...) - { - return sal_False; - } - - sal_Int32 nCount = 0; - try - { - try - { - try - { - raising2( xLBT ); - } - catch (RuntimeException &) - { - } - catch (lang::IllegalArgumentException aExc) - { - ++nCount; - OSL_ENSURE( aExc.ArgumentPosition == 5 && - aExc.Context == xLBT->getInterface() && - aExc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...") ), - "### unexpected exception content!" ); - - /** it is certain, that the RuntimeException testing will fail, if no */ - xLBT->getRuntimeException(); - } - } - catch (const RuntimeException & rExc) - { - ++nCount; - OSL_ENSURE( rExc.Context == xLBT->getInterface() && - rExc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...") ), - "### unexpected exception content!" ); - - /** it is certain, that the RuntimeException testing will fail, if no */ - xLBT->setRuntimeException( 0xcafebabe ); - } - catch (lang::IllegalArgumentException &) - { - } - } - catch (Exception & rExc) - { - ++nCount; - OSL_ENSURE( rExc.Context == xLBT->getInterface() && - rExc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...") ), - "### unexpected exception content!" ); - return (nCount == 3 && - rExc.Context == xLBT->getInterface() && - rExc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...") )); - } - return sal_False; -} - -//================================================================================================== -static void checkInvalidInterfaceQuery( - Reference< XInterface > const & xObj ) -{ - try - { - Any aRet( xObj->queryInterface( ::getCppuType( (const lang::IllegalArgumentException *)0 ) ) ); - OSL_ASSERT( ! aRet.hasValue() ); - } - catch (RuntimeException &) - { - } - try - { - Reference< lang::XComponent > xComp( xObj, UNO_QUERY_THROW ); - OSL_ASSERT( 0 ); - } - catch (RuntimeException & /*exc*/) - { -// OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); -// OSL_TRACE( str.getStr() ); - } -} - -//================================================================================================== -static bool perform_test( - Reference< XLanguageBindingTest > const & xObj, - Reference< XInterface > const & xDummy ) -{ - checkInvalidInterfaceQuery( xObj ); - - if (performTest( xObj, xDummy )) - { - ::fprintf( stderr, "> invocation test succeeded!\n" ); - if (raiseException( xObj )) - { - ::fprintf( stderr, "> exception test succeeded!\n" ); - return true; - } - else - { - ::fprintf( stderr, "> exception test failed!\n" ); - } - } - - ::fprintf( stderr, "> dynamic invocation test failed!\n" ); - return false; -} - -//================================================================================================== -void test_CppBridge(void) -{ - // C++-UNO test - { - TestDummy * p = new TestDummy(); - Reference< XInterface > xDummy( *p ); - { - Test_Impl * p2 = new Test_Impl(); - Reference< XLanguageBindingTest > xOriginal( p2 ); - checkInvalidInterfaceQuery( xOriginal ); - { - const char * pExtraMapping = ""; - - Reference< XLanguageBindingTest > xMapped; - { - uno_Interface * pUnoI = 0; - - OUString aCppEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - OUString aUnoEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO) ); - - uno_Environment * pCppEnv = 0; - uno_Environment * pUnoEnv = 0; - ::uno_getEnvironment( &pCppEnv, aCppEnvTypeName.pData, 0 ); - ::uno_getEnvironment( &pUnoEnv, aUnoEnvTypeName.pData, 0 ); - - // C++ -> UNO - Mapping mapping( pCppEnv, pUnoEnv ); - mapping.mapInterface( (void **)&pUnoI, xOriginal.get(), ::getCppuType( &xOriginal ) ); - -#ifdef EXTRA_MAPPING - // UNO -> ano C++a - ::uno_createEnvironment( &pCppEnv, aCppEnvTypeName.pData, 0 ); - mapping = Mapping( pUnoEnv, pCppEnv ); - mapping.mapInterface( (void **)&xMapped, pUnoI, ::getCppuType( &xMapped ) ); - // ano C++a -> ano UNOa - ::uno_createEnvironment( &pUnoEnv, aUnoEnvTypeName.pData, 0 ); - mapping = Mapping( pCppEnv, pUnoEnv ); - mapping.mapInterface( (void **)&pUnoI, xMapped.get(), ::getCppuType( &xMapped ) ); - pExtraMapping = " <-> c++ <-> uno"; -#endif - - // ano UNOa -> ano C++b - ::uno_createEnvironment( &pCppEnv, aCppEnvTypeName.pData, 0 ); - mapping = Mapping( pUnoEnv, pCppEnv ); - mapping.mapInterface( (void **)&xMapped, pUnoI, ::getCppuType( &xMapped ) ); - (*pUnoI->release)( pUnoI ); - (*pCppEnv->release)( pCppEnv ); - (*pUnoEnv->release)( pUnoEnv ); - } - - if (perform_test( xMapped, xDummy )) - { - ::fprintf( stderr, "> C++-UNO test (c++ <-> uno%s <-> c++ [component impl]) succeeded!\n", pExtraMapping ); - } - else - { - ::fprintf( stderr, "> C++-UNO test (c++ <-> uno%s <-> c++ [component impl]) failed!\n", pExtraMapping ); - exit( 1 ); - } - } - OSL_ENSURE( p2->getRefCount() == 1, "### test object ref count > 1 !" ); - } - OSL_ENSURE( p->getRefCount() == 1, "### dummy object ref count > 1 !" ); - } -} - -//================================================================================================== -void test_CBridge(void) -{ - // C-UNO test - { - TestDummy * p = new TestDummy(); - Reference< XInterface > xDummy( *p ); - { - Test_Impl * p2 = new Test_Impl(); - Reference< XLanguageBindingTest > xOriginal( p2 ); - checkInvalidInterfaceQuery( xOriginal ); - { - Reference< XLanguageBindingTest > xMapped; - { - uno_Interface * pUnoI2 = 0; - void * pC = 0; - uno_Interface * pUnoI1 = 0; - - OUString aCppEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - OUString aCEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_C) ); - OUString aUnoEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO) ); - - // C++ -> UNO - uno_Environment * pCppEnv = 0; - uno_Environment * pUnoEnv = 0; - ::uno_getEnvironment( &pCppEnv, aCppEnvTypeName.pData, 0 ); - ::uno_getEnvironment( &pUnoEnv, aUnoEnvTypeName.pData, 0 ); - Mapping aCpp2Uno( pCppEnv, pUnoEnv ); - aCpp2Uno.mapInterface( (void **)&pUnoI1, xOriginal.get(), ::getCppuType( &xOriginal ) ); - (*pCppEnv->release)( pCppEnv ); - - // UNO -> C - uno_Environment * pCEnv = 0; - ::uno_getEnvironment( &pCEnv, aCEnvTypeName.pData, 0 ); - Mapping aUno2C( pUnoEnv, pCEnv ); - aUno2C.mapInterface( &pC, pUnoI1, ::getCppuType( &xOriginal ) ); - (*pUnoI1->release)( pUnoI1 ); - (*pUnoEnv->release)( pUnoEnv ); - - // C -> ano UNO - uno_Environment * pAnoUnoEnv = 0; - ::uno_createEnvironment( &pAnoUnoEnv, aUnoEnvTypeName.pData, 0 ); // anonymous - Mapping aC2Uno( pCEnv, pAnoUnoEnv ); - aC2Uno.mapInterface( (void **)&pUnoI2, pC, ::getCppuType( &xOriginal ) ); - (*pCEnv->pExtEnv->releaseInterface)( pCEnv->pExtEnv, pC ); - (*pCEnv->release)( pCEnv ); - - // ano UNO -> ano C++ - uno_Environment * pAnoCppEnv = 0; - ::uno_createEnvironment( &pAnoCppEnv, aCppEnvTypeName.pData, 0 ); - Mapping aUno2Cpp( pAnoUnoEnv, pAnoCppEnv ); - (*pAnoCppEnv->release)( pAnoCppEnv ); - (*pAnoUnoEnv->release)( pAnoUnoEnv ); - aUno2Cpp.mapInterface( (void **)&xMapped, pUnoI2, ::getCppuType( &xOriginal ) ); - (*pUnoI2->release)( pUnoI2 ); - } - - if (perform_test( xMapped, xDummy )) - { - ::fprintf( stderr, "> C-UNO test (c++ <-> uno <-> c <-> uno <-> c++ [component impl]) succeeded!\n" ); - } - else - { - ::fprintf( stderr, "> C-UNO test (c++ <-> uno <-> c <-> uno <-> c++ [component impl]) failed!\n" ); - exit( 1 ); - } - } - OSL_ENSURE( p->getRefCount() == 1, "### test object ref count > 1 !" ); - } - OSL_ENSURE( p->getRefCount() == 1, "### dummy object ref count > 1 !" ); - } -} -#if 0 -//================================================================================================== -extern "C" com_sun_star_uno_XInterface* SAL_CALL createTestObject(); - -void test_CBridge2(void) -{ - // C-UNO test - { - TestDummy * p = new TestDummy(); - Reference< XInterface > xDummy( *p ); - { - com_sun_star_uno_XInterface* pXIface = createTestObject(); - test_XLanguageBindingTest* pXLBTest = 0; - uno_Any aExc; - Reference< XLanguageBindingTest > xMapped; - - OSL_ENSURE( pXIface != 0, "create test object failed\n"); - - /* Get interface XFoo2 */ - if (CUNO_EXCEPTION_OCCURED( CUNO_CALL(pXIface)->queryInterface( pXIface, &aExc, (com_sun_star_uno_XInterface**)&pXLBTest, ::getCppuType( &xMapped ).getTypeLibType()) )) - { - uno_any_destruct( &aExc, 0 ); - } - OSL_ENSURE( pXLBTest != 0, "query_Interface XLanguageBindingTest failed\n"); - - Mapping aC2Cpp( - OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_C) ), - OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ) ); - aC2Cpp.mapInterface( (void **)&xMapped, pXLBTest, ::getCppuType( &xMapped ) ); - - OSL_ENSURE( xMapped.is(), "mapping interface failed\n"); - - if (perform_test( xMapped, xDummy )) - { - ::fprintf( stderr, "> second C-UNO test (c++ <-> uno <-> c [component impl]) succeeded!\n" ); - } - else - { - ::fprintf( stderr, "> second C-UNO test (c++ <-> uno <-> c [component impl]) failed!\n" ); - exit( 1 ); - } - - - CUNO_CALL(pXIface)->release( pXIface ); - CUNO_CALL(pXLBTest)->release( (com_sun_star_uno_XInterface *)pXLBTest ); - } - OSL_ENSURE( p->getRefCount() == 1, "### dummy object ref count > 1 !" ); - } - -} -#endif - diff --git a/cppu/test/test_sec.cxx b/cppu/test/test_sec.cxx deleted file mode 100644 index 0bc3585e23d0..000000000000 --- a/cppu/test/test_sec.cxx +++ /dev/null @@ -1,211 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include <stdio.h> - - -#include <uno/current_context.hxx> - -#include <cppuhelper/implbase1.hxx> - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/loader/XImplementationLoader.hpp> -#include <com/sun/star/container/XNameContainer.hpp> - -using namespace rtl; -using namespace cppu; -using namespace com::sun::star::uno; -using namespace com::sun::star::security; -using namespace com::sun::star::lang; -using namespace com::sun::star::loader; -using namespace com::sun::star::registry; -using namespace com::sun::star::container; - - -static inline void out( const sal_Char * p ) -{ - ::fprintf( stderr, p ); -} -static inline void out( const OUString & r ) -{ - OString aStr( OUStringToOString( r, RTL_TEXTENCODING_ASCII_US ) ); - out( aStr.getStr() ); -} - - -static Reference< XInterface > load( - const Reference< XMultiServiceFactory > & xMgr, - const char * service, - const char * implName, const char * activator, const char * loc ) throw () -{ - Reference< XInterface > xRet( - xMgr->createInstance( OUString::createFromAscii( service ) ) ); - if (xRet.is()) - return xRet; - - try - { - Reference< XImplementationLoader > xLoader( - xMgr->createInstance( OUString::createFromAscii( activator ) ), UNO_QUERY ); - if (xLoader.is()) - { - Reference< XSingleServiceFactory > xFac( xLoader->activate( - OUString::createFromAscii( implName ), OUString(), - OUString::createFromAscii( loc ), - Reference< XRegistryKey >() ), UNO_QUERY ); - if (xFac.is()) - return xFac->createInstance(); - } - else - { - out( "### cannot activate loader \"" ); - out( activator ); - out( "\"!\n" ); - } - } - catch (Exception &) - { - out( "### cannot activate service \"" ); - out( service ); - out( "\"!\n" ); - } - return Reference< XInterface >(); -} - -static void setEnv( const Reference< XMultiServiceFactory > & xMgr ) throw () -{ - OSL_ASSERT( xMgr.is() ); - Reference< XNameContainer > xContext( getCurrentContext(), UNO_QUERY ); - OSL_ASSERT( xContext.is() ); - - try - { - xContext->insertByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.ServiceManager") ), - makeAny( xMgr ) ); - xContext->insertByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.security.AccessController") ), - makeAny( load( xMgr, - "com.sun.star.security.AccessController", - "com.sun.star.comp.security.AccessController", - "com.sun.star.loader.Java2", - "com.sun.star.comp.security.AccessController" ) ) ); - xContext->insertByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.security.auth.login.LoginContext") ), - makeAny( load( xMgr, - "com.sun.star.security.auth.login.LoginContext", - "com.sun.star.comp.security.auth.login.LoginContext", - "com.sun.star.loader.Java2", - "com.sun.star.comp.security.auth.login.LoginContext" ) ) ); - } - catch (Exception & rExc) - { - out( "### exception occured: " ); - out( rExc.Message ); - out( "\n" ); - } -} - -//################################################################################################## -//################################################################################################## -//################################################################################################## - -struct PrivAction : WeakImplHelper1< XPrivilegedAction > -{ - virtual Any SAL_CALL run() - throw (Exception) - { - throw IllegalArgumentException( - OUString::createFromAscii("testtest"), (OWeakObject *)this, (sal_Int16)5 ); - } -}; - -struct Thread1 : public OThread -{ - Reference< XMultiServiceFactory > _xMgr; - - Thread1( const Reference< XMultiServiceFactory > & xMgr ) - : _xMgr( xMgr ) - {} - - void f() - { - Reference< XNameAccess > xAccess( getCurrentContext(), UNO_QUERY ); - OSL_ASSERT( xAccess->getByName( OUString::createFromAscii("a") ) == (sal_Int16)5 ); - Reference< XNameContainer > xCont( getCurrentContext(), UNO_QUERY ); - xCont->insertByName( OUString::createFromAscii("b"), makeAny( (sal_Int32)6 ) ); - } - virtual void SAL_CALL run() - { - try - { - setEnv( _xMgr ); - Reference< XNameContainer > xCont( getCurrentContext(), UNO_QUERY ); - xCont->insertByName( OUString::createFromAscii("a"), makeAny( (sal_Int32)5 ) ); - f(); - Reference< XNameAccess > xAccess( getCurrentContext(), UNO_QUERY ); - OSL_ASSERT( xAccess->getByName( OUString::createFromAscii("b") ) == (sal_Int16)6 ); - -// checkPermission( -// Permission( OUString::createFromAscii("java.io.FilePermission"), -// OUString::createFromAscii("f:\\userprofiles.dat"), -// OUString::createFromAscii("read") ) ); - -// try -// { -// Reference< XCurrentContext > xContext( getCurrentContext() ); -// Reference< XAccessController > xACC( xContext->getAccessController() ); -// xACC->doPrivileged( new PrivAction(), Reference< XAccessControlContext >() ); -// } -// catch (IllegalArgumentException & r) -// { -// OSL_ASSERT( r.ArgumentPosition == 5 && -// r.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("testtest") )); -// } - } - catch (RuntimeException & rExc) - { - out( rExc.Message ); - } - } -}; - - -void test_security( const Reference< XMultiServiceFactory > & xMgr ) throw () -{ - setEnv( xMgr ); - OSL_ASSERT( getCurrentContext()->getServiceManager().is() ); - - Thread1 thread1( xMgr ); - thread1.create(); - thread1.join(); - out( "> exiting...\n" ); -} diff --git a/cppu/test/testcppu.cxx b/cppu/test/testcppu.cxx deleted file mode 100644 index b132ab0cb281..000000000000 --- a/cppu/test/testcppu.cxx +++ /dev/null @@ -1,1241 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !defined(OSL_DEBUG_LEVEL) || OSL_DEBUG_LEVEL == 0 -# undef OSL_DEBUG_LEVEL -# define OSL_DEBUG_LEVEL 2 -#endif - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" - -#include "sal/main.h" - -#include <stdio.h> - -#include <uno/environment.h> -#include <uno/mapping.hxx> - -#include <uno/dispatcher.h> -#include <rtl/alloc.h> -#include <rtl/unload.h> - -#include <cppuhelper/queryinterface.hxx> -#include <com/sun/star/uno/Exception.hpp> -#include <com/sun/star/uno/XInterface.hpp> -#include <com/sun/star/uno/Uik.hpp> -#include <rtl/ustring.hxx> -#include <osl/diagnose.h> -#include <osl/interlck.h> -#include <sal/types.h> - -#include <test/Test1.hpp> -#include <test/Test2.hpp> -#include <test/TdTest1.hpp> -#include <test/Test3.hpp> -#include <test/Base.hpp> -#include <test/Base1.hpp> -#include <test/Base2.hpp> - -#include <uno/current_context.hxx> -#include <cppuhelper/bootstrap.hxx> -#include <cppuhelper/implbase1.hxx> - -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/container/XHierarchicalNameAccess.hpp> -#include <com/sun/star/uno/XCurrentContext.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <test/XSimpleInterface.hpp> -#include <test/XLanguageBindingTest.hpp> -#include <com/sun/star/registry/XSimpleRegistry.hpp> - -using namespace test; -using namespace rtl; -using namespace osl; - -using namespace com::sun::star; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::registry; -using namespace test; - - -sal_Int32 getSize( const Type & rT ) -{ - sal_Int32 nSize; - typelib_TypeDescription * pTD = 0; - typelib_typedescriptionreference_getDescription( &pTD, rT.getTypeLibType() ); - nSize = pTD->nSize; - typelib_typedescription_release( pTD ); - return nSize; -} - -/* - * main. - */ -void testCppu() -{ - Any a(false); -#if 0 - // the following don't compile, which is ok: - a.get<sal_Unicode>(); - a.get<sal_uInt16>(); - a.has<sal_Unicode>(); - a.has<sal_uInt16>(); - Any a_( static_cast<sal_Unicode>('a') ); -#endif - OSL_ASSERT( a.getValueTypeClass() == TypeClass_BOOLEAN ); - OSL_ASSERT( !a.get<bool>() && !a.get<sal_Bool>() ); - a <<= sal_False; - OSL_ASSERT( a.getValueTypeClass() == TypeClass_BOOLEAN ); - OSL_ASSERT( !a.get<bool>() && !a.get<sal_Bool>() ); - a = Any(sal_False); - OSL_ASSERT( a.getValueTypeClass() == TypeClass_BOOLEAN ); - OSL_ASSERT( !a.get<bool>() && !a.get<sal_Bool>() ); - Any b( static_cast<sal_Int8>(32) ); - OSL_ASSERT( b.getValueTypeClass() == TypeClass_BYTE ); - OSL_ASSERT( b.get<sal_Int64>() == 32 && - b.get<sal_uInt64>() == 32 && - b.get<sal_Int32>() == 32 && - b.get<sal_uInt32>() == 32 && - b.get<sal_Int16>() == 32 && - b.get<sal_Int8>() == 32 ); - OSL_ASSERT( b.has<sal_Int64>() && - b.has<sal_uInt64>() && - b.has<sal_Int32>() && - b.has<sal_uInt32>() && - b.has<sal_Int16>() && - b.has<sal_Int8>() ); - b <<= true; - OSL_ASSERT( b.getValueTypeClass() == TypeClass_BOOLEAN ); - OSL_ASSERT( b.get<bool>() && b.get<sal_Bool>() ); - try { - b.get<sal_Int8>(); - OSL_ASSERT(false); - } - catch (RuntimeException & /*exc*/) { -// exc; - } - try { - const Sequence<beans::PropertyValue> seq( - b.get< Sequence<beans::PropertyValue> >() ); - OSL_ASSERT(false); - } - catch (RuntimeException & /*exc*/) { -// exc; - } - - sal_Int32 big = 0x7fffffff; - try - { - Sequence< Sequence< Any > > seq( big ); - } - catch (::std::bad_alloc &) - { - } - try - { - Sequence< Sequence< Any > > seq( 0, big ); - } - catch (::std::bad_alloc &) - { - } - try - { - Sequence< Sequence< Any > > seq; - seq.realloc( big ); - } - catch (::std::bad_alloc &) - { - } - - { - // test the size of types - OSL_ENSURE( sizeof( Uik ) == getSize( getCppuType( (Uik *)0) ), - "bad sizeof uik" ); - OSL_ENSURE( sizeof( Test1 ) == getSize( getCppuType( (Test1*)0).getTypeLibType() ), - "bad sizeof test1" ); -// OSL_ENSURE( sizeof( TdTest1 ) == getSize( get_test_TdTest1_Type().getTypeLibType() ), -// "bad sizeof TypedefTest1" ); - OSL_ENSURE( sizeof( Test2 ) == getSize( getCppuType( (Test2*)0).getTypeLibType() ), - "bad sizeof test2" ); - -/* find the error -sal_Int32 nPos; -nPos = (sal_Int32)&((Test3 *)0)->nInt8; -nPos = (sal_Int32)&((Test3 *)0)->nFloat; -nPos = (sal_Int32)&((Test3 *)0)->nuInt8; -nPos = (sal_Int32)&((Test3 *)0)->nDouble; -nPos = (sal_Int32)&((Test3 *)0)->nInt16; -nPos = (sal_Int32)&((Test3 *)0)->aString; -nPos = (sal_Int32)&((Test3 *)0)->nuInt16; -nPos = (sal_Int32)&((Test3 *)0)->nInt64; -nPos = (sal_Int32)&((Test3 *)0)->nInt32; -nPos = (sal_Int32)&((Test3 *)0)->nuInt64; -nPos = (sal_Int32)&((Test3 *)0)->nuInt32; -nPos = (sal_Int32)&((Test3 *)0)->eType; -nPos = (sal_Int32)&((Test3 *)0)->wChar; -nPos = (sal_Int32)&((Test3 *)0)->td; -nPos = (sal_Int32)&((Test3 *)0)->bBool; -nPos = (sal_Int32)&((Test3 *)0)->aAny; -*/ - OSL_ENSURE( sizeof( Test3 ) == getSize( getCppuType( (Test3*)0).getTypeLibType() ), - "bad sizeof test3" ); - } - - { - // test the default constructor - Test1 a1; - a1.nInt16 = 4; - a1.dDouble = 3.6; - a1.bBool = sal_True; - uno_type_constructData( &a1, getCppuType( (Test1*)0).getTypeLibType() ); - OSL_ASSERT( a1.nInt16 == 0 && a1.dDouble == 0.0 && a1.bBool == sal_False); - - Test2 a2; - a2.nInt16 = 2; - a2.aTest1.nInt16 = 4; - a2.aTest1.dDouble = 3.6; - a2.aTest1.dDouble = sal_True; - uno_type_constructData( &a2, getCppuType( (Test2*)0).getTypeLibType() ); - OSL_ASSERT( a2.nInt16 == 0 && a2.aTest1.nInt16 == 0 && a2.aTest1.dDouble == 0.0 && a2.aTest1.bBool == sal_False); - - Test3 * pa3 = (Test3 *)new char[ sizeof( Test3 ) ]; - Test3 & a3 = *pa3; - a3.nInt8 = 2; - a3.nFloat = (float)2; - a3.nDouble = 2; - a3.nInt16 = 2; - a3.nuInt16 = 2; - a3.nInt64 = 2; - a3.nInt32 = 2; - a3.nuInt64 = 2; - a3.nuInt32 = 2; - a3.eType = TypeClass_STRUCT; - a3.wChar = L'g'; - a3.td.nInt16 = 2; - a3.td.dDouble = 2; - a3.bBool = sal_True; - uno_type_constructData( &a3, getCppuType( (Test3*)0).getTypeLibType() ); - OSL_ASSERT( a3.nInt8 == 0 && a3.nFloat == (float)0 - && a3.nDouble == 0 && a3.nInt16 == 0 && a3.aString == OUString() - && a3.nuInt16 == 0 && a3.nInt64 == 0 && a3.nInt32 == 0 - && a3.nuInt64 == 0 && a3.nuInt32 == 0 && a3.eType == TypeClass_VOID - && a3.wChar == L'\0' && a3.td.nInt16 == 0 && a3.td.dDouble == 0 - && a3.bBool == sal_False ); - OSL_ASSERT( a3.aAny.getValueType() == getCppuVoidType() ); - delete[] reinterpret_cast< char * >(pa3); - } - - { - // test the destructor - long a1[ sizeof( Test1 ) / sizeof(long) +1 ]; - uno_type_constructData( &a1, getCppuType( (Test1*)0).getTypeLibType() ); - uno_type_destructData( &a1, getCppuType( (Test1*)0).getTypeLibType(), reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - long a2[ sizeof( Test2 ) / sizeof(long) +1 ]; - uno_type_constructData( &a2, getCppuType( (Test2*)0).getTypeLibType() ); - uno_type_destructData( &a2, getCppuType( (Test2*)0).getTypeLibType(), reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - long a3[ sizeof( Test3 ) / sizeof(long) +1 ]; - uno_type_constructData( &a3, getCppuType( (Test3*)0).getTypeLibType() ); - OUString aTestString( RTL_CONSTASCII_USTRINGPARAM("test") ); - ((Test3*)a3)->aString = aTestString; - uno_type_destructData( &a3, getCppuType( (Test3*)0).getTypeLibType(), reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - OSL_ASSERT( aTestString.pData->refCount == 1 ); - } - - { - // test the copy constructor - Test1 a1; - a1.nInt16 = 4; - a1.dDouble = 3.6; - a1.bBool = sal_True; - char sz1[sizeof( Test1 )]; - uno_type_copyData( sz1, &a1, getCppuType( (Test1*)0).getTypeLibType(), reinterpret_cast<uno_AcquireFunc>(cpp_acquire) ); - OSL_ASSERT( ((Test1*)sz1)->nInt16 == 4 && ((Test1*)sz1)->dDouble == 3.6 && ((Test1*)sz1)->bBool == sal_True); - - Test2 a2; - a2.nInt16 = 2; - a2.aTest1.nInt16 = 4; - a2.aTest1.dDouble = 3.6; - a2.aTest1.bBool = sal_True; - char sz2[sizeof( Test2 )]; - uno_type_copyData( sz2, &a2, getCppuType( (Test2*)0).getTypeLibType(), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire) ); - OSL_ASSERT( ((Test2*)sz2)->nInt16 == 2 ); - OSL_ASSERT(((Test2*)sz2)->aTest1.nInt16 == 4 ); - OSL_ASSERT( ((Test2*)sz2)->aTest1.dDouble == 3.6 ); - OSL_ASSERT(((Test2*)sz2)->aTest1.bBool == sal_True); - - Test3 a3; - a3.nInt8 = 2; - a3.nFloat = (float)2; - a3.nDouble = 2; - a3.nInt16 = 2; - a3.aString = OUString::createFromAscii("2"); - a3.nuInt16 = 2; - a3.nInt64 = 2; - a3.nInt32 = 2; - a3.nuInt64 = 2; - a3.nuInt32 = 2; - a3.eType = TypeClass_STRUCT; - a3.wChar = L'2'; - a3.td.nInt16 = 2; - a3.td.dDouble = 2; - a3.bBool = sal_True; - a3.aAny = makeAny( (sal_Int32)2 ); - char sz3[sizeof( Test3 )]; - uno_type_copyData( sz3, &a3, getCppuType( (Test3*)0).getTypeLibType(), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire) ); - OSL_ASSERT( ((Test3*)sz3)->nInt8 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nFloat == (float)2 ); - OSL_ASSERT( ((Test3*)sz3)->nDouble == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nInt16 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->aString == OUString::createFromAscii("2") ); - OSL_ASSERT( ((Test3*)sz3)->nuInt16 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nInt64 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nInt32 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nuInt64 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->nuInt32 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->eType == TypeClass_STRUCT ); - OSL_ASSERT( ((Test3*)sz3)->wChar == L'2' ); - OSL_ASSERT( ((Test3*)sz3)->td.nInt16 == 2 ); - OSL_ASSERT( ((Test3*)sz3)->td.dDouble == 2 ); - OSL_ASSERT( ((Test3*)sz3)->bBool == sal_True ); - OSL_ASSERT( ((Test3*)sz3)->aAny.getValueType() == getCppuType( (sal_Int32 *)0 ) ); - OSL_ASSERT( *(sal_Int32*)((Test3*)sz3)->aAny.getValue() == 2 ); - ((Test3 *)sz3)->~Test3(); - } - - { - sal_Bool bAssignable; - // test assignment - Test1 a1; - a1.nInt16 = 4; - a1.dDouble = 3.6; - a1.bBool = sal_True; - Test1 sz1; - bAssignable = uno_type_assignData( - &sz1, getCppuType( (Test1*)0).getTypeLibType(), - &a1, getCppuType( (Test1*)0).getTypeLibType(), - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - OSL_ASSERT( bAssignable ); - OSL_ASSERT( sz1.nInt16 == 4 && sz1.dDouble == 3.6 && sz1.bBool == sal_True); - - Test2 a2; - a2.nInt16 = 2; - a2.aTest1.nInt16 = 4; - a2.aTest1.dDouble = 3.6; - a2.aTest1.bBool = sal_True; - Test2 sz2; - bAssignable = uno_type_assignData( - &sz2, getCppuType( (Test2*)0).getTypeLibType(), - &a2, getCppuType( (Test2*)0).getTypeLibType(), - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - OSL_ASSERT( bAssignable ); - OSL_ASSERT( sz2.nInt16 == 2 && sz2.aTest1.nInt16 == 4 - && sz2.aTest1.dDouble == 3.6 && sz2.aTest1.bBool == sal_True); - - Test3 a3; - Test3 sz3; - a3.nInt8 = 2; - a3.nFloat = (float)2; - a3.nDouble = 2; - a3.nInt16 = 2; - a3.aString = OUString::createFromAscii("2"); - a3.nuInt16 = 2; - a3.nInt64 = 2; - a3.nInt32 = 2; - a3.nuInt64 = 2; - a3.nuInt32 = 2; - a3.eType = TypeClass_STRUCT; - a3.wChar = L'2'; - a3.td.nInt16 = 2; - a3.td.dDouble = 2; - a3.bBool = sal_True; - a3.aAny = makeAny( (sal_Int32)2 ); - OSL_ASSERT( a3.aAny.isExtractableTo( ::getCppuType( (sal_Int64 const *)0 ) ) ); - OSL_ASSERT( ::getCppuType( (sal_Int64 const *)0 ).isAssignableFrom( a3.aAny.getValueType() ) ); - bAssignable = uno_type_assignData( - &sz3, getCppuType( (Test3*)0).getTypeLibType(), - &a3, getCppuType( (Test3*)0).getTypeLibType(), - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - OSL_ASSERT( bAssignable ); - OSL_ASSERT( sz3.nInt8 == 2 ); - OSL_ASSERT( sz3.nFloat == (float)2 ); - OSL_ASSERT( sz3.nDouble == 2 ); - OSL_ASSERT( sz3.nInt16 == 2 ); - OSL_ASSERT( sz3.aString == OUString::createFromAscii("2") ); - OSL_ASSERT( sz3.nuInt16 == 2 ); - OSL_ASSERT( sz3.nInt64 == 2 ); - OSL_ASSERT( sz3.nInt32 == 2 ); - OSL_ASSERT( sz3.nuInt64 == 2 ); - OSL_ASSERT( sz3.nuInt32 == 2 ); - OSL_ASSERT( sz3.eType == TypeClass_STRUCT ); - OSL_ASSERT( sz3.wChar == L'2' ); - OSL_ASSERT( sz3.td.nInt16 == 2 ); - OSL_ASSERT( sz3.td.dDouble == 2 ); - OSL_ASSERT( sz3.bBool == sal_True ); - OSL_ASSERT( sz3.aAny.getValueType() == getCppuType( (sal_Int32 *)0 ) ); - OSL_ASSERT( *(sal_Int32*)sz3.aAny.getValue() == 2 ); - - // test not assigneable values - bAssignable = uno_type_assignData( - &a1, getCppuType( (Test1*)0).getTypeLibType(), - &a2, getCppuType( (Test2*)0).getTypeLibType(), - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - OSL_ASSERT( !bAssignable ); - } - - { - // test any - Any tb; - tb <<= true; - OSL_ASSERT( tb.getValueType() == ::getCppuBooleanType() ); - OSL_ASSERT( tb == makeAny( true ) ); - Any aAny = makeAny( (sal_Int8)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int8 *)0 ) ); - OSL_ASSERT( *(sal_Int8*)aAny.getValue() == 2 ); - aAny = makeAny( (float)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (float *)0 ) ); - OSL_ASSERT( *(float*)aAny.getValue() == (float)2 ); - aAny = makeAny( (sal_Int8)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int8 *)0 ) ); - OSL_ASSERT( *(sal_Int8*)aAny.getValue() == 2 ); - aAny = makeAny( (double)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (double *)0 ) ); - OSL_ASSERT( *(double*)aAny.getValue() == (double)2 ); - aAny = makeAny( (sal_Int16)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int16 *)0 ) ); - OSL_ASSERT( *(sal_Int16*)aAny.getValue() == 2 ); - aAny = makeAny( OUString( RTL_CONSTASCII_USTRINGPARAM("test") ) ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (OUString *)0 ) ); - OSL_ASSERT( *(OUString*)aAny.getValue() == OUString::createFromAscii("test") ); - aAny = makeAny( (sal_uInt16)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt16 *)0 ) ); - OSL_ASSERT( *(sal_Int16*)aAny.getValue() == 2 ); - sal_Int64 aInt64 = SAL_CONST_INT64(0x200000000); - aAny = makeAny( aInt64 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int64 *)0 ) ); - OSL_ASSERT( *(sal_Int64*)aAny.getValue() == SAL_CONST_INT64(0x200000000) ); - aAny = makeAny( (sal_Int32)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int32 *)0 ) ); - OSL_ASSERT( *(sal_Int32*)aAny.getValue() == 2 ); - sal_uInt64 auInt64 = SAL_CONST_UINT64(0x200000000); - aAny = makeAny( auInt64 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt64 *)0 ) ); - OSL_ASSERT( *(sal_uInt64*)aAny.getValue() == SAL_CONST_UINT64(0x200000000) ); - aAny = makeAny( (sal_uInt32)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt32 *)0 ) ); - OSL_ASSERT( *(sal_uInt32*)aAny.getValue() == 2 ); - aAny = makeAny( TypeClass_STRUCT ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (TypeClass *)0 ) ); - OSL_ASSERT( *(TypeClass*)aAny.getValue() == TypeClass_STRUCT ); - sal_Unicode c = L'2'; - aAny.setValue( &c, getCppuCharType() ); - OSL_ASSERT( aAny.getValueType() == getCppuCharType() ); - OSL_ASSERT( *(sal_Unicode*)aAny.getValue() == L'2' ); - sal_Bool b2 = sal_True; - aAny.setValue( &b2, getCppuBooleanType() ); - OSL_ASSERT( aAny.getValueType() == getCppuBooleanType() ); - OSL_ASSERT( *(sal_Bool*)aAny.getValue() == sal_True ); - } - - { - // test: operator <<=( any, value ) - Any aAny; - aAny <<= (sal_Int8)2; - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int8 *)0 ) ); - OSL_ASSERT( *(sal_Int8*)aAny.getValue() == 2 ); - aAny <<=( (float)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (float *)0 ) ); - OSL_ASSERT( *(float*)aAny.getValue() == (float)2 ); -// aAny <<=( (sal_uInt8)2 ); -// OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt8 *)0 ) ); -// OSL_ASSERT( *(sal_uInt8*)aAny.getValue() == 2 ); - aAny <<=( (double)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (double *)0 ) ); - OSL_ASSERT( *(double*)aAny.getValue() == (double)2 ); - aAny <<=( (sal_Int16)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int16 *)0 ) ); - OSL_ASSERT( *(sal_Int16*)aAny.getValue() == 2 ); - aAny <<=( OUString( RTL_CONSTASCII_USTRINGPARAM("test") ) ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (OUString *)0 ) ); - OSL_ASSERT( *(OUString*)aAny.getValue() == OUString::createFromAscii("test") ); - aAny <<=( (sal_uInt16)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt16 *)0 ) ); - OSL_ASSERT( *(sal_Int16*)aAny.getValue() == 2 ); - sal_Int64 aInt64 = SAL_CONST_INT64(0x200000000); - aAny <<=( aInt64 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int64 *)0 ) ); - OSL_ASSERT( *(sal_Int64*)aAny.getValue() == SAL_CONST_UINT64(0x200000000) ); - aAny <<=( (sal_Int32)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_Int32 *)0 ) ); - OSL_ASSERT( *(sal_Int32*)aAny.getValue() == 2 ); - sal_uInt64 auInt64 = SAL_CONST_UINT64(0x200000000); - aAny <<=( auInt64 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt64 *)0 ) ); - OSL_ASSERT( *(sal_uInt64*)aAny.getValue() == SAL_CONST_UINT64(0x200000000) ); - aAny <<=( (sal_uInt32)2 ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (sal_uInt32 *)0 ) ); - OSL_ASSERT( *(sal_uInt32*)aAny.getValue() == 2 ); - aAny <<=( TypeClass_STRUCT ); - OSL_ASSERT( aAny.getValueType() == getCppuType( (TypeClass *)0 ) ); - OSL_ASSERT( *(TypeClass*)aAny.getValue() == TypeClass_STRUCT ); - } - - { - // test seq< any > - Sequence< Any > seqAny( 1 ); - seqAny[ 0 ] <<= sal_Int32(5); - seqAny.realloc( 200000 ); // hopefully different memory - seqAny[ 1 ] <<= sal_Int32(6); - - uno_Any * pAnys = (uno_Any *)seqAny.getConstArray(); - OSL_ASSERT( pAnys[ 1 ].pData == &pAnys[ 1 ].pReserved ); - OSL_ASSERT( *(sal_Int32 *)pAnys[ 1 ].pData == sal_Int32(6) ); - OSL_ASSERT( pAnys[ 0 ].pData == &pAnys[ 0 ].pReserved ); - OSL_ASSERT( *(sal_Int32 *)pAnys[ 0 ].pData == sal_Int32(5) ); - } - - { - // test: operator >>=( any, value ) - Test3 a3; - makeAny( (sal_Int8)2) >>= a3.nInt8; - OSL_ASSERT( (makeAny( (sal_Int8)2) >>= a3.nInt8) && a3.nInt8 == 2 ); - OSL_ASSERT( (makeAny( (float)2) >>= a3.nFloat) && a3.nFloat ==(float)2 ); - OSL_ASSERT( (makeAny( (double)2) >>= a3.nDouble) && a3.nDouble == 2 ); - OSL_ASSERT( (makeAny( (sal_Int16)2) >>= a3.nInt16) && a3.nInt16 == 2 ); - OSL_ASSERT( (makeAny( OUString( RTL_CONSTASCII_USTRINGPARAM("2") )) >>= a3.aString) && - a3.aString == OUString::createFromAscii("2") ); - OSL_ASSERT( (makeAny( (sal_uInt16)2) >>= a3.nuInt16) && a3.nuInt16 == 2 ); - sal_Int64 aInt64 = SAL_CONST_INT64(0x200000000); - OSL_ASSERT( makeAny( aInt64 ) >>= a3.nInt64 ); - OSL_ASSERT( a3.nInt64 == SAL_CONST_INT64(0x200000000) ); - OSL_ASSERT( (makeAny( (sal_Int32)2) >>= a3.nInt32) && a3.nInt32 == 2 ); - sal_uInt64 auInt64 = SAL_CONST_UINT64(0x200000000); - OSL_ASSERT( makeAny( auInt64 ) >>= a3.nuInt64 ); - OSL_ASSERT( a3.nuInt64 == SAL_CONST_UINT64(0x200000000) ); - OSL_ASSERT( (makeAny( (sal_uInt32)2) >>= a3.nuInt32) && a3.nuInt32 == 2 ); - OSL_ASSERT( (makeAny( TypeClass_STRUCT) >>= a3.eType) && a3.eType == TypeClass_STRUCT ); - //OSL_ASSERT( (makeAny( L'2' ) >>= a3.wChar) && a3.nInt8 ==L'2'; - OSL_ASSERT( (makeAny( (sal_Int16)2) >>= a3.td.nInt16) && a3.nInt16 == 2 ); - OSL_ASSERT( (makeAny( (double)2) >>= a3.td.dDouble) && a3.nDouble == 2 ); - //OSL_ASSERT( (makeAny( (sal_True)2) >>= a3.bBool) && a3.nInt8 ==sal_True; - - // Only one negative test, the implementation has only one if to test this - OSL_ASSERT( (makeAny( (float)2) >>= a3.nFloat) && a3.nFloat ==(float)2 ); - } - - { - // test: Sequence - Sequence< Test1 > aTestSeq; - OSL_ASSERT( aTestSeq.getLength() == 0 ); - sal_Int32 szInt32[2] = { 1, 2 }; - Sequence< sal_Int32 > aInt32Seq( szInt32, 2 ); - OSL_ASSERT( aInt32Seq.getLength() == 2 ); - OSL_ASSERT( aInt32Seq[0] == 1 && aInt32Seq[1] == 2 ); - OSL_ASSERT( aInt32Seq.getArray()[0] == 1 && aInt32Seq.getArray()[1] == 2 ); - Sequence< sal_Int32 > aNextInt32Seq( aInt32Seq ); - OSL_ASSERT( aNextInt32Seq[0] == 1 && aNextInt32Seq[1] == 2 ); - aInt32Seq[0] = 45; - OSL_ASSERT( aInt32Seq[0] == 45 && aInt32Seq[1] == 2 ); - OSL_ASSERT( aNextInt32Seq[0] == 1 && aNextInt32Seq[1] == 2 ); - sal_Int32 * pArray = aNextInt32Seq.getArray(); - OSL_ASSERT( pArray[0] == 1 && pArray[1] == 2 ); - Sequence< double > aDoubleSeq( 5 ); - OSL_ASSERT( aDoubleSeq[4] == 0.0 ); - Sequence< OUString > aStringSeq( 5 ); - OSL_ASSERT( aStringSeq[4] == OUString() ); - } - sal_Int32 szInt32[2] = { 1, 2 }; - Sequence<sal_Int32 > aInt32Seq( szInt32, 2 ); - Sequence<sal_Int32 > aNextInt32Seq( aInt32Seq ); - aNextInt32Seq.realloc( 1 ); // split of sequence - const sal_Int32 * pArray = aNextInt32Seq.getConstArray(); - OSL_ASSERT( pArray[0] == 1 ); - aInt32Seq.realloc( 1 ); // reallocate mem - pArray = aInt32Seq.getConstArray(); - OSL_ASSERT( pArray[0] == 1 ); - - Sequence<sal_Int32 > aInt32Seq2( aInt32Seq ); - aInt32Seq.realloc( 0 ); - aInt32Seq.realloc( 1 ); - aInt32Seq.realloc( 0 ); -} - -class TestInterface : public XInterface -{ -public: - // XInterface - void SAL_CALL acquire() throw () - { osl_incrementInterlockedCount( &nRefCount ); } - void SAL_CALL release() throw () - { if( !osl_decrementInterlockedCount( &nRefCount ) ) delete this; } - Any SAL_CALL queryInterface( const Type & rType ) throw (RuntimeException) - { return cppu::queryInterface( rType, static_cast< XInterface* >( this ) ); } - - TestInterface() : nRefCount( 0 ) {} - - sal_Int32 nRefCount; -}; - -struct SimpleInterface : public TestInterface, public XSimpleInterface -{ - void SAL_CALL acquire() throw () - { TestInterface::acquire(); } - void SAL_CALL release() throw () - { TestInterface::release(); } - Any SAL_CALL queryInterface( const Type & rType ) throw (RuntimeException) - { - Any aRet( cppu::queryInterface( rType, static_cast< XSimpleInterface * >( this ) ) ); - return (aRet.hasValue() ? aRet : TestInterface::queryInterface( rType )); - } - virtual void SAL_CALL method() throw(::com::sun::star::uno::RuntimeException) - {} -}; - -static sal_Bool s_aAssignableFromTab[11][11] = -{ - /* from CH,BO,BY,SH,US,LO,UL,HY,UH,FL,DO */ -/* TypeClass_CHAR */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, -/* TypeClass_BOOLEAN */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, -/* TypeClass_BYTE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, -/* TypeClass_SHORT */ { 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, -/* TypeClass_UNSIGNED_SHORT */ { 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, -/* TypeClass_LONG */ { 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, -/* TypeClass_UNSIGNED_LONG */ { 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, -/* TypeClass_HYPER */ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, -/* TypeClass_UNSIGNED_HYPER */ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, -/* TypeClass_FLOAT */ { 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0 }, -/* TypeClass_DOUBLE */ { 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1 } -}; -template < class T > -void test_assignSimple( const T & rVal, /*const*/ Any /*&*/ rAny ) -{ - typelib_TypeDescription * pTD = 0; - ::getCppuType( &rVal ).getDescription( &pTD ); - sal_Bool bTable = s_aAssignableFromTab[pTD->eTypeClass-1][rAny.getValueTypeClass()-1]; - OSL_ASSERT( - (bTable!=sal_False) == - (typelib_typedescriptionreference_isAssignableFrom( - pTD->pWeakRef, rAny.getValueTypeRef() )!=sal_False) ); - T t; - OSL_ASSERT( (bTable!=sal_False) == ((rAny >>= t)!=sal_False) ); - if (bTable) - OSL_ASSERT( t == rVal ); - typelib_typedescription_release( pTD ); -} -template < class T > -void test_simple_assignment( const T & rVal ) -{ - // bool - sal_Bool tr = sal_True; - typelib_TypeDescription * pBoolTD = 0; - ::getCppuBooleanType().getDescription( &pBoolTD ); - Any a( &tr, pBoolTD ); - test_assignSimple( rVal, a ); - OSL_ASSERT( typelib_typedescriptionreference_isAssignableFrom( pBoolTD->pWeakRef, a.getValueTypeRef() ) ); - typelib_typedescription_release( pBoolTD ); - OSL_ASSERT( *(sal_Bool *)a.getValue() ); - // char - sal_Unicode ch = 'a'; - typelib_TypeDescription * pCharTD = 0; - ::getCppuCharType().getDescription( &pCharTD ); - a.setValue( &ch, pCharTD ); - test_assignSimple( rVal, a ); - OSL_ASSERT( typelib_typedescriptionreference_isAssignableFrom( pCharTD->pWeakRef, a.getValueTypeRef() ) ); - typelib_typedescription_release( pCharTD ); - OSL_ASSERT( *(sal_Unicode *)a.getValue() == 'a' ); - - // rest by template - a <<= (sal_Int8)5; - test_assignSimple( rVal, a ); - a <<= (sal_Int16)5; - test_assignSimple( rVal, a ); - a <<= (sal_uInt16)5; - test_assignSimple( rVal, a ); - a <<= (sal_Int32)5; - test_assignSimple( rVal, a ); - a <<= (sal_uInt32)5; - test_assignSimple( rVal, a ); - a <<= (sal_Int64)5; - test_assignSimple( rVal, a ); - a <<= (sal_uInt64)5; - test_assignSimple( rVal, a ); - a <<= (float)5; - test_assignSimple( rVal, a ); - a <<= (double)5; - test_assignSimple( rVal, a ); -} -static void testAssignment() -{ - // simple types - test_simple_assignment( (sal_Int8)5 ); - test_simple_assignment( (sal_Int16)5 ); - test_simple_assignment( (sal_uInt16)5 ); - test_simple_assignment( (sal_Int32)5 ); - test_simple_assignment( (sal_uInt32)5 ); - test_simple_assignment( (sal_Int64)5 ); - test_simple_assignment( (sal_uInt64)5 ); - test_simple_assignment( (float)5 ); - test_simple_assignment( (double)5 ); - // some complex things - Any a; - TestSimple ts; - TestElement te; // derived from simple - a <<= ts; - OSL_ASSERT( !(a >>= te) ); - OSL_ASSERT( a >>= ts ); - a <<= te; - OSL_ASSERT( (a >>= te) && (a >>= ts) ); - // interface - Reference< XSimpleInterface > xOriginal( new SimpleInterface() ); - a <<= xOriginal; - Reference< XInterface > x; - OSL_ASSERT( (a >>= x) && (a == xOriginal) && (xOriginal == x) && (x == xOriginal) ); - // sequence - Sequence< TestElement > aSeq( 5 ); - Sequence< TestElement > aSeq2( 3 ); - aSeq[1].Byte = 17; - a <<= aSeq; - OSL_ASSERT( a >>= aSeq2 ); - OSL_ASSERT( aSeq2[1].Byte == 17 ); - aSeq2[1].Byte = 20; - OSL_ASSERT( aSeq != aSeq2 ); - OSL_ASSERT( a != aSeq2 ); - a <<= aSeq2; - OSL_ASSERT( a >>= aSeq ); - OSL_ASSERT( a == aSeq ); - OSL_ASSERT( !(a != aSeq) ); - OSL_ASSERT( aSeq == aSeq2 ); - OSL_ASSERT( aSeq[1].Byte == 20 ); - - // equals... - sal_uInt64 n = (sal_uInt64)(sal_Int64)-5; - a.setValue( &n, getCppuType( (sal_uInt64 *)0 ) ); - Any b; - sal_Int8 n2 = -5; - b.setValue( &n2, getCppuType( (sal_Int8 *)0 ) ); - OSL_ASSERT( a != b ); -} - -void test_interface() -{ - { - // test: Interface - Reference< XInterface > xIFace; - OSL_ASSERT( !xIFace.is() ); - xIFace.clear(); // do nothing - } -} - -void test_inheritance() -{ - OSL_ASSERT( sizeof( Base ) == getSize( getCppuType( (Base *)0).getTypeLibType() ) ); - OSL_ASSERT( sizeof( Base1 ) == getSize( getCppuType( (Base1 *)0).getTypeLibType() ) ); - OSL_ASSERT( sizeof( Base2 ) == getSize( getCppuType( (Base2 *)0).getTypeLibType() ) ); -} - -sal_Int32 nCallback_1; -sal_Int32 nCallback; -void SAL_CALL typedescription_Callback_1 -( - void * pContext, - typelib_TypeDescription ** ppRet, - rtl_uString * pTypeName -) -{ - OSL_ENSURE( pContext == (void *)1, "### unexpected context!" ); - if( *ppRet ) - { - typelib_typedescription_release( *ppRet ); - *ppRet = 0; - } - - OUString aTypeName( pTypeName ); - if( -1 != aTypeName.indexOf( OUString::createFromAscii("1_") ) ) - { - nCallback_1++; - OUString aName( RTL_CONSTASCII_USTRINGPARAM("unsigned short") ); - OUString empty; - typelib_CompoundMember_Init aMember = { typelib_TypeClass_UNSIGNED_SHORT, - aName.pData, - empty.pData }; - typelib_typedescription_new( - ppRet, - typelib_TypeClass_STRUCT, pTypeName, 0, - 1, - &aMember - ); - } -} - -void SAL_CALL typedescription_Callback -( - void * pContext, - typelib_TypeDescription ** ppRet, - rtl_uString * pTypeName -) -{ - OSL_ENSURE( pContext == (void *)0, "### unexpected context!" ); - if( *ppRet ) - { - typelib_typedescription_release( *ppRet ); - *ppRet = 0; - } - - OUString aTypeName( pTypeName ); - if( -1 != aTypeName.indexOf( OUString::createFromAscii("cachetest") ) ) - { - nCallback++; - aTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM("1_") ) + aTypeName; - OUString empty; - typelib_CompoundMember_Init aMember = { typelib_TypeClass_STRUCT, - aTypeName.pData, - empty.pData }; - typelib_typedescription_new( - ppRet, - typelib_TypeClass_STRUCT, pTypeName, 0, - 1, - &aMember - ); - } -} - -void test_cache() -{ - typelib_typedescription_registerCallback( - (void *)1, - reinterpret_cast<typelib_typedescription_Callback>(typedescription_Callback_1) ); - typelib_typedescription_registerCallback( - 0, - reinterpret_cast<typelib_typedescription_Callback>(typedescription_Callback) ); - - for( sal_Int32 i = 0; i < 300; i++ ) - { - typelib_TypeDescription * pTD = 0; - OUString aTypeName( RTL_CONSTASCII_USTRINGPARAM("cachetest") ); - aTypeName = aTypeName + OUString::valueOf( i ); - typelib_typedescription_getByName( &pTD, aTypeName.pData ); - typelib_typedescription_release( pTD ); - } - OSL_ASSERT( nCallback_1 == 300 ); - OSL_ASSERT( nCallback == 300 ); - // The cache size is 200 so the description "cachetest200" is in the cache - typelib_TypeDescription * pTD = 0; - OUString aName200( RTL_CONSTASCII_USTRINGPARAM("cachetest200") ); - typelib_typedescription_getByName( &pTD, aName200.pData ); - OSL_ASSERT( nCallback_1 == 300 ); - OSL_ASSERT( nCallback == 300 ); - // The cache size is 200 so the description "cachetest199" is not in the cache - // "1_cachetest199" is loaded too. - OUString aName199( RTL_CONSTASCII_USTRINGPARAM("cachetest199") ); - typelib_typedescription_getByName( &pTD, aName199.pData ); - typelib_typedescription_release( pTD ); - OSL_ASSERT( nCallback_1 == 301 ); - OSL_ASSERT( nCallback == 301 ); - - typelib_typedescription_revokeCallback( - (void *)1, - reinterpret_cast<typelib_typedescription_Callback>(typedescription_Callback_1) ); - typelib_typedescription_revokeCallback( - 0, - reinterpret_cast<typelib_typedescription_Callback>(typedescription_Callback) ); -} - -static OUString s_aAddPurpose; - -static void SAL_CALL getMappingCallback( - uno_Mapping ** /*ppMapping*/, - uno_Environment * /*pFrom*/, uno_Environment * /*pTo*/, rtl_uString * pAddPurpose ) -{ - s_aAddPurpose = pAddPurpose; -} -static void testMappingCallback() -{ - uno_registerMappingCallback( reinterpret_cast<uno_getMappingFunc>(getMappingCallback) ); - OSL_ASSERT( ! s_aAddPurpose.getLength() ); - Mapping aTest( - OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ), - OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ), - OUString( RTL_CONSTASCII_USTRINGPARAM("test") ) ); - uno_revokeMappingCallback( reinterpret_cast<uno_getMappingFunc>(getMappingCallback) ); - OSL_ASSERT( s_aAddPurpose.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("test") ) ); - s_aAddPurpose = OUString(); - Mapping aTest2( - OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ), - OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ), - OUString( RTL_CONSTASCII_USTRINGPARAM("test") ) ); - OSL_ASSERT( ! s_aAddPurpose.getLength() ); -} - -static void testEnvironments(void) -{ - uno_Environment ** ppEnv; - sal_Int32 nLen; - OUString aTypeName; - - ::uno_getRegisteredEnvironments( - &ppEnv, &nLen, ::rtl_allocateMemory, aTypeName.pData ); - - if (nLen) - { - for ( sal_Int32 nPos = 0; nPos < nLen; ++nPos ) - { - uno_Environment * pEnv = ppEnv[ nPos ]; - - // dump out infos - ::uno_dumpEnvironment( stderr, pEnv, 0 ); - - // call some releases - void ** ppInterfaces = 0; - sal_Int32 nInterfaces; - - uno_ExtEnvironment * pExtEnv = pEnv->pExtEnv; - (*pExtEnv->getRegisteredInterfaces)( - pExtEnv, &ppInterfaces, &nInterfaces, ::rtl_allocateMemory ); - if (nInterfaces) - { - while (nInterfaces--) - { - void * p = ppInterfaces[ nInterfaces ]; - (*pExtEnv->releaseInterface)( pExtEnv, p ); - } - ::rtl_freeMemory( ppInterfaces ); - } - - (*pEnv->release)( pEnv ); - } - ::rtl_freeMemory( ppEnv ); - } -} - -inline const ::com::sun::star::uno::Type& SAL_CALL getCppuType( const Sequence< OUString[2][4] >* ) SAL_THROW( () ) -{ - return getCppuSequenceType< OUString[2][4] >( getCppuArrayType2( (const OUString (*)[2][4])0 ) ); -} - -//================================================================================================== -class Test_CContext - : public ::cppu::WeakImplHelper1< XCurrentContext > -{ - Reference< XCurrentContext > m_xDel; - sal_Int32 m_value; - OUString m_name; -public: - inline Test_CContext( sal_Int32 val, OUString const & rName, - Reference< XCurrentContext > const & xDel ) - SAL_THROW( () ) - : m_xDel( xDel ) - , m_value( val ) - , m_name( rName ) - {} - - virtual Any SAL_CALL getValueByName( OUString const & rName ) - throw (RuntimeException); -}; -//__________________________________________________________________________________________________ -Any Test_CContext::getValueByName( OUString const & rName ) - throw (RuntimeException) -{ - if (rName == m_name) - { - return makeAny( m_value ); - } - else if (m_xDel.is()) - { - return m_xDel->getValueByName( rName ); - } - return Any(); -} -//================================================================================================== -static void testCurrentContext() -{ - { - ContextLayer layer( new Test_CContext( - 5, OUString( RTL_CONSTASCII_USTRINGPARAM("Value1") ), - Reference< XCurrentContext >() ) ); - Reference< XCurrentContext > xCC( getCurrentContext() ); - OSL_ASSERT( - xCC.is() && - xCC->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM("Value1") ) ) == (sal_Int16)5 && - !xCC->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM("Value2") ) ).hasValue() ); - OSL_ASSERT( ! layer.getPreviousContext().is() ); - - { - ContextLayer layer2( new Test_CContext( - 7, OUString( RTL_CONSTASCII_USTRINGPARAM("Value2") ), - xCC ) ); - OSL_ASSERT( layer2.getPreviousContext() == xCC ); - xCC = getCurrentContext(); - OSL_ASSERT( - xCC.is() && - xCC->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM("Value1") ) ) == (sal_Int16)5 && - xCC->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM("Value2") ) ) == (sal_Int16)7 && - !xCC->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM("dummy") ) ).hasValue() ); - - uno_Interface * pContext = 0; - OUString aEnvName( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO) ); - OSL_VERIFY( ::uno_getCurrentContext( (void **)&pContext, aEnvName.pData, 0 ) ); - (*pContext->release)( pContext ); - } - OSL_ASSERT( ! layer.getPreviousContext().is() ); - } - OSL_ASSERT( ! getCurrentContext().is() ); -} - -void testArray(void) -{ - long a[5][6]; - getCppuArrayType2( &a ); - - getCppuArrayType1( (const long (*)[5])0 ); - getCppuArrayType2( (const long (*)[6][7])0 ); - getCppuArrayType3( (const long (*)[7][8][9])0 ); - getCppuArrayType4( (const long (*)[8][9][10][11])0 ); - getCppuArrayType5( (const long (*)[9][10][11][12][13])0 ); - getCppuArrayType6( (const long (*)[10][11][12][13][14][15])0 ); - - getCppuArrayType2( (const Reference< XInterface > (*)[6][7])0 ); - - getCppuArrayType1( (const Test1 (*)[5])0 ); - getCppuArrayType2( (const Test1 (*)[6][7])0 ); - getCppuArrayType3( (const Test1 (*)[7][8][9])0 ); - getCppuArrayType4( (const Test1 (*)[8][9][10][11])0 ); - getCppuArrayType5( (const Test1 (*)[9][10][11][12][13])0 ); - getCppuArrayType6( (const Test1 (*)[10][11][12][13][14][15])0 ); - - typelib_TypeDescription* pType = NULL; - typelib_TypeDescriptionReference* pTypeRef = NULL; - sal_Int32 pDim[] = { 2, 4 }; - Type rType = getCppuType((const sal_Int32*)0); - typelib_typedescription_newArray(&pType, rType.getTypeLibType(), 2, pDim); - OSL_ASSERT( pType ); - typelib_typedescriptionreference_new(&pTypeRef, typelib_TypeClass_ARRAY, pType->pTypeName); - OSL_ASSERT( pTypeRef ); - - sal_Int32 a1[2][4]; - sal_Int32 a2[2][4] = { {1,2,3,4}, {5,6,7,8} }; - uno_constructData( &a1, pType ); -// uno_type_constructData( &a1, pTypeRef ); - - sal_Bool bAssignable = uno_assignData(&a1, pType, a2, pType, - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - sal_Int32 i,j; - for ( i=0; i<2; i++ ) - for ( j=0; j<4; j++ ) - OSL_ASSERT( a1[i][j] == a2[i][j] ); - - uno_destructData( a1, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); -// uno_type_destructData( &a1, pTypeRef, cpp_release ); - uno_destructData( a2, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - typelib_typedescription_release(pType); - typelib_typedescriptionreference_release(pTypeRef); - pType = NULL; - pTypeRef = NULL; - - typelib_typedescription_newArray(&pType, getCppuType((const OUString*)0).getTypeLibType(), 2, pDim); - OSL_ASSERT( pType ); - typelib_typedescriptionreference_new(&pTypeRef, typelib_TypeClass_ARRAY, pType->pTypeName); - OSL_ASSERT( pTypeRef ); - - OUString s1(OUString::createFromAscii("Hallo")); - OUString s2(OUString::createFromAscii("jetzt")); - OUString s3(OUString::createFromAscii("teste")); - OUString s4(OUString::createFromAscii("ich")); - OUString s5(OUString::createFromAscii("ein")); - OUString s6(OUString::createFromAscii("Array")); - OUString s7(OUString::createFromAscii("mit")); - OUString s8(OUString::createFromAscii("strings")); - OUString st1,st2,st3,st4,st5,st6,st7,st8; - - void* p = rtl_allocateMemory(8 * sizeof(rtl_uString*)); - void* p2 = rtl_allocateMemory(8 * sizeof(rtl_uString*)); - rtl_uString** ppS = (rtl_uString**)p; - rtl_uString* sa1[2][4] = { {st1.pData,st2.pData,st3.pData,st4.pData}, - {st5.pData,st6.pData,st7.pData,st8.pData} }; - rtl_uString* sa2[2][4] = { {s1.pData,s2.pData,s3.pData,s4.pData}, - {s5.pData,s6.pData,s7.pData,s8.pData} }; - uno_constructData( p, pType ); - - bAssignable = uno_assignData(p, pType, sa2, pType, - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - bAssignable = uno_assignData(sa1, pType, p, pType, - reinterpret_cast<uno_QueryInterfaceFunc>(cpp_queryInterface), - reinterpret_cast<uno_AcquireFunc>(cpp_acquire), - reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - for ( i=0; i<2; i++ ) - for ( j=0; j<4; j++ ) - OSL_ASSERT( sa1[i][j] == sa2[i][j] ); - - OUString sA[2][4]; - sA[0][0] = s1; - sA[1][0] = s5; - sA[0][1] = s2; - sA[1][1] = s6; - sA[0][2] = s3; - sA[1][2] = s7; - sA[0][3] = s4; - sA[1][3] = s8; - - Any aa1, aa2; - Type arrayType; - OUString (*sB)[2][4]; - aa1.setValue(&sA, getCppuArrayType2( (const OUString (*)[2][4])0 )); - aa2 = aa1; - arrayType = aa2.getValueType(); - sB = (OUString(*)[2][4])aa2.getValue(); - for ( i=0; i<2; i++ ) - for ( j=0; j<4; j++ ) - OSL_ASSERT( sA[i][j] == (*sB)[i][j] ); - - // requires a specialized getCppuType function 'getCppuType( const Sequence< OUString[2][4] >* )' -// Sequence< OUString[2][4] > aSeq(2); -// OUString (*pSeq)[2][4] = aSeq.getArray(); -// uno_copyData(pSeq[0], sA, pType, cpp_acquire); -// uno_copyData(pSeq[1], sA, pType, cpp_acquire); - -// OSL_ASSERT( aSeq[0][0][0] == sA[0][0] ); -// OSL_ASSERT( aSeq[0][0][1] == sA[0][1] ); -// OSL_ASSERT( aSeq[0][0][2] == sA[0][2] ); -// OSL_ASSERT( aSeq[0][0][3] == sA[0][3] ); -// OSL_ASSERT( aSeq[0][1][0] == sA[1][0] ); -// OSL_ASSERT( aSeq[0][1][1] == sA[1][1] ); -// OSL_ASSERT( aSeq[0][1][2] == sA[1][2] ); -// OSL_ASSERT( aSeq[0][1][3] == sA[1][3] ); - -// OSL_ASSERT( aSeq[1][0][0] == sA[0][0] ); -// OSL_ASSERT( aSeq[1][0][1] == sA[0][1] ); -// OSL_ASSERT( aSeq[1][0][2] == sA[0][2] ); -// OSL_ASSERT( aSeq[1][0][3] == sA[0][3] ); -// OSL_ASSERT( aSeq[1][1][0] == sA[1][0] ); -// OSL_ASSERT( aSeq[1][1][1] == sA[1][1] ); -// OSL_ASSERT( aSeq[1][1][2] == sA[1][2] ); -// OSL_ASSERT( aSeq[1][1][3] == sA[1][3] ); - - uno_constructData( p2, pType ); - ppS = (rtl_uString**)p2; - uno_copyData(p2, sa1, pType, reinterpret_cast<uno_AcquireFunc>(cpp_acquire)); - uno_copyData(sa2, p2, pType, reinterpret_cast<uno_AcquireFunc>(cpp_acquire)); - - uno_destructData( p, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release)); - uno_destructData( p2, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - uno_destructData( sa1, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - uno_destructData( sa2, pType, reinterpret_cast<uno_ReleaseFunc>(cpp_release) ); - - rtl_freeMemory(p); - rtl_freeMemory(p2); - typelib_typedescription_release(pType); - typelib_typedescriptionreference_release(pTypeRef); - pType = NULL; - pTypeRef = NULL; -} - -/* - * main. - */ -SAL_IMPLEMENT_MAIN() -{ - rtl::OUString const cppName( - RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - uno_Environment * pCppEnv = 0; - uno_getEnvironment( &pCppEnv, cppName.pData, 0 ); - uno_getEnvironment( &pCppEnv, cppName.pData, 0 ); - (*pCppEnv->release)( pCppEnv ); - - try { - typelib_setCacheSize( 200 ); - Reference< registry::XSimpleRegistry > xRegistry( - ::cppu::createSimpleRegistry() ); - xRegistry->open( OUString( RTL_CONSTASCII_USTRINGPARAM("testcppu.rdb") ), sal_True, sal_False ); - Reference< XComponentContext > xContext( - ::cppu::bootstrap_InitialComponentContext( xRegistry ) ); - testEnvironments(); - ::rtl_unloadUnusedModules( 0 ); - testMappingCallback(); - ::rtl_unloadUnusedModules( 0 ); - -// // security test -// void test_security( const Reference< XMultiServiceFactory > & ); -// test_security( xMgr ); - - // C++, C bridges test - void test_CppBridge(void); - test_CppBridge(); - ::rtl_unloadUnusedModules( 0 ); -// void test_CBridge(void); -// void test_CBridge2(void); -// test_CBridge(); -// test_CBridge2(); - - testCurrentContext(); - testAssignment(); - testCppu(); -// testArray(); -#if 0 // cache test not possible if types are loaded dynamically (cppumaker -L) - test_cache(); -#endif - test_interface(); - test_inheritance(); - - // shutdown - Reference< XComponent > xComp( xContext, UNO_QUERY_THROW ); - xComp.set( xContext, UNO_QUERY_THROW ); - Reference< XInterface > x( - xContext->getValueByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theTypeDescriptionManager") ) ), UNO_QUERY_THROW ); - xComp->dispose(); - } - catch (Exception & exc) { - fprintf( stderr, "error: %s\n", rtl::OUStringToOString( - exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); - } - - typelib_setCacheSize( 0 ); - ::rtl_unloadUnusedModules( 0 ); - testEnvironments(); - ::rtl_unloadUnusedModules( 0 ); - - return 0; -} diff --git a/cppu/test/testthreadpool.cxx b/cppu/test/testthreadpool.cxx deleted file mode 100644 index ec404b89793c..000000000000 --- a/cppu/test/testthreadpool.cxx +++ /dev/null @@ -1,193 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cppu.hxx" -#include <osl/diagnose.h> -#include <osl/time.h> - -#include <rtl/uuid.h> - -#include <uno/threadpool.h> - -#include <vos/thread.hxx> - -#define TEST_ENSURE OSL_ENSURE - -using namespace ::vos; - - -class OThread1 : public OThread -{ -public: - OThread1( sal_uInt8 *pCallerUuid ); - virtual void run(); - -public: - sal_uInt8 *m_pCallerUuid; - sal_Int8 *m_pThreadIdentifier; - sal_Int32 m_nThreadIdentifierLength; - - void *m_pThreadData; -}; - -OThread1::OThread1( sal_uInt8 *pCallerUuid ) : - m_pCallerUuid( pCallerUuid ), - m_pThreadData( (void*) 1 ), - m_pThreadIdentifier( 0 ), - m_nThreadIdentifierLength( 0 ) -{ - -} - -void OThread1::run() -{ - - uno_threadpool_Ticket *pTicket = uno_threadpool_createTicket( m_pCallerUuid ); - - uno_threadIdent_retrieve( &m_pThreadIdentifier , &m_nThreadIdentifierLength ); - - uno_threadpool_waitOnTicket( pTicket , &m_pThreadData ); - - uno_threadIdent_revoke(); -} - - -void SAL_CALL doIt( void *pThreadData ) -{ - *( sal_Int32 *) pThreadData = 2; -} - -void testthreadpool() -{ - printf( "Testing threadpool ..." ); - fflush( stdout ); - - sal_uInt8 pCallerUuid1[16]; - sal_uInt8 pCallerUuid2[16]; - rtl_createUuid( pCallerUuid1, 0 , sal_True ); - rtl_createUuid( pCallerUuid2, 0 , sal_True ); - - //------------ - // Test reply - //------------ - { - OThread1 thread1( pCallerUuid1 ); - - thread1.create(); - - // do a busy wait - while( ! thread1.m_pThreadIdentifier && ! thread1.m_nThreadIdentifierLength ); - - void *pThreadData = (void*)0xdeadbabe; - uno_threadpool_reply( thread1.m_pThreadIdentifier , - thread1.m_nThreadIdentifierLength, - pThreadData ); - - // do a busy wait - while( (void*)1 == thread1.m_pThreadData ); - - TEST_ENSURE( pThreadData == thread1.m_pThreadData, "uno_threadpool_reply error" ); - } - - //--------------- - // Test request - //--------------- - { - OThread1 thread1( pCallerUuid1 ); - - thread1.create(); - - // do a busy wait - while( ! thread1.m_pThreadIdentifier && ! thread1.m_nThreadIdentifierLength ); - - // do a request - sal_Int32 i = 1; - uno_threadpool_request( thread1.m_pThreadIdentifier , - thread1.m_nThreadIdentifierLength, - &i, - doIt, - sal_False); - - // do a busy wait - while( 1 == i ); - TEST_ENSURE( 2 == i, "uno_threadpool_request error" ); - - // get it out of the pool - void *pThreadData = (void*)0xdeadbabe; - uno_threadpool_reply( thread1.m_pThreadIdentifier , - thread1.m_nThreadIdentifierLength, - pThreadData ); - - // do a busy wait - while( pThreadData != thread1.m_pThreadData ); - - } - - //--------------- - // Test dispose threads - //--------------- - { - OThread1 thread1( pCallerUuid1 ); - OThread1 thread2( pCallerUuid2 ); - - thread1.create(); - thread2.create(); - - // do a busy wait - while( ! thread1.m_pThreadIdentifier && ! thread1.m_nThreadIdentifierLength && - ! thread2.m_pThreadIdentifier && ! thread2.m_nThreadIdentifierLength ); - - // dispose the first - uno_threadpool_disposeThreads( pCallerUuid1 ); - - while( (void*)1 == thread1.m_pThreadData ); - TEST_ENSURE( (void*)0 == thread1.m_pThreadData, "disposing threads failed" ); - - TimeValue value = {1,0}; - osl_waitThread( &value ); - TEST_ENSURE( (void*)1 == thread2.m_pThreadData, "wrong thread disposed !" ); - - // test, if new threads are directly disposed - OThread1 thread3( pCallerUuid1 ); - thread3.create(); - - while( (void*)1 == thread3.m_pThreadData ); - TEST_ENSURE( (void*)0 == thread3.m_pThreadData , - "new threads entering threadpool are not disposed" ); - - uno_threadpool_reply( thread2.m_pThreadIdentifier , - thread2.m_nThreadIdentifierLength, - (void*)0x2 ); - - while( (void*)1 == thread2.m_pThreadData ); - TEST_ENSURE( (void*)2 == thread2.m_pThreadData , "reply does not work correctly" ); - - uno_threadpool_stopDisposeThreads( pCallerUuid1 ); - } - printf( "Done\n" ); -} diff --git a/cppuhelper/inc/cppuhelper/factory.hxx b/cppuhelper/inc/cppuhelper/factory.hxx index 8ebc6b4467c2..1b733d7a9170 100644 --- a/cppuhelper/inc/cppuhelper/factory.hxx +++ b/cppuhelper/inc/cppuhelper/factory.hxx @@ -149,6 +149,23 @@ SAL_CALL createSingleComponentFactory( rtl_ModuleCount * pModCount = 0 ) SAL_THROW( () ); +/** Creates a single service factory which holds the instance created only once. + + @param fptr function pointer for instanciating the object + @param rImplementationName implementation name of service + @param rServiceNames supported services + @param pModCount for future extension (library unloading concept). + + @see createSingleComponentFactory +*/ +::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > SAL_CALL +createOneInstanceComponentFactory( + ComponentFactoryFunc fptr, + ::rtl::OUString const & rImplementationName, + ::com::sun::star::uno::Sequence< ::rtl::OUString > const & rServiceNames, + rtl_ModuleCount * pModCount = 0 ) + SAL_THROW( () ); + /** Deprecated. The type of the instanciate function used as argument of the create*Fcatory functions. @see createSingleFactory diff --git a/cppuhelper/prj/build.lst b/cppuhelper/prj/build.lst index db8ddcaae6c8..de66b2d61a4b 100644 --- a/cppuhelper/prj/build.lst +++ b/cppuhelper/prj/build.lst @@ -3,3 +3,4 @@ ch cppuhelper usr1 - all ch_mkout NULL ch cppuhelper\inc nmake - all ch_include NULL ch cppuhelper\source nmake - all ch_source ch_unotypes ch_include NULL ch cppuhelper\unotypes nmake - all ch_unotypes NULL +ch cppuhelper\qa\propertysetmixin nmake - all ch_qa_propertysetmixin ch_source NULL diff --git a/cppuhelper/prj/d.lst b/cppuhelper/prj/d.lst index 6660eab8c3cf..0707a7609b56 100644 --- a/cppuhelper/prj/d.lst +++ b/cppuhelper/prj/d.lst @@ -35,7 +35,6 @@ mkdir: %_DEST%\inc%_EXT%\cppuhelper ..\inc\cppuhelper\shlib.hxx %_DEST%\inc%_EXT%\cppuhelper\shlib.hxx ..\inc\cppuhelper\basemutex.hxx %_DEST%\inc%_EXT%\cppuhelper\basemutex.hxx ..\inc\cppuhelper\bootstrap.hxx %_DEST%\inc%_EXT%\cppuhelper\bootstrap.hxx -..\inc\cppuhelper\extract.hxx %_DEST%\inc%_EXT%\cppuhelper\extract.hxx ..\inc\cppuhelper\exc_hlp.hxx %_DEST%\inc%_EXT%\cppuhelper\exc_hlp.hxx ..\inc\cppuhelper\typeprovider.hxx %_DEST%\inc%_EXT%\cppuhelper\typeprovider.hxx ..\inc\cppuhelper\factory.hxx %_DEST%\inc%_EXT%\cppuhelper\factory.hxx @@ -53,7 +52,6 @@ mkdir: %_DEST%\inc%_EXT%\cppuhelper ..\inc\cppuhelper\queryinterface.hxx %_DEST%\inc%_EXT%\cppuhelper\queryinterface.hxx ..\inc\cppuhelper\weakref.hxx %_DEST%\inc%_EXT%\cppuhelper\weakref.hxx ..\inc\cppuhelper\servicefactory.hxx %_DEST%\inc%_EXT%\cppuhelper\servicefactory.hxx -..\inc\cppuhelper\smartservices.hxx %_DEST%\inc%_EXT%\cppuhelper\smartservices.hxx ..\inc\cppuhelper\implementationentry.hxx %_DEST%\inc%_EXT%\cppuhelper\implementationentry.hxx ..\inc\cppuhelper\access_control.hxx %_DEST%\inc%_EXT%\cppuhelper\access_control.hxx ..\inc\cppuhelper\unourl.hxx %_DEST%\inc%_EXT%\cppuhelper\unourl.hxx diff --git a/cppuhelper/qa/ifcontainer/export.map b/cppuhelper/qa/ifcontainer/export.map index 4ca70fa85463..879fa8953788 100644 --- a/cppuhelper/qa/ifcontainer/export.map +++ b/cppuhelper/qa/ifcontainer/export.map @@ -1,4 +1,4 @@ -UDK_3.0 { +UDK_3_0_0 { global: registerAllTestFunction; diff --git a/cppuhelper/qa/ifcontainer/makefile.mk b/cppuhelper/qa/ifcontainer/makefile.mk index 1e93701d3859..3277b4c204ea 100644 --- a/cppuhelper/qa/ifcontainer/makefile.mk +++ b/cppuhelper/qa/ifcontainer/makefile.mk @@ -35,6 +35,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl diff --git a/cppuhelper/qa/propertysetmixin/comp.map b/cppuhelper/qa/propertysetmixin/comp.map deleted file mode 100644 index e4b038369818..000000000000 --- a/cppuhelper/qa/propertysetmixin/comp.map +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - local: - *; -}; diff --git a/cppuhelper/qa/propertysetmixin/makefile.mk b/cppuhelper/qa/propertysetmixin/makefile.mk index 8bf652d33b9b..edd4795fc115 100644 --- a/cppuhelper/qa/propertysetmixin/makefile.mk +++ b/cppuhelper/qa/propertysetmixin/makefile.mk @@ -25,46 +25,44 @@ # #************************************************************************* -PRJ := ..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ := ../.. PRJNAME := cppuhelper TARGET := qa_propertysetmixin -PACKAGE = test$/cppuhelper$/propertysetmixin$/comp +PACKAGE = test/cppuhelper/propertysetmixin/comp ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk -.IF "$(GUI)" == "WNT" -FILEURLPREFIX = file:/// -MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR)))) +.IF "$(OS)" == "WNT" +my_file = file:/// .ELSE -FILEURLPREFIX = file:// -MY_URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR) -.ENDIF - - +my_file = file:// +.END DLLPRE = # no leading "lib" on .so files -INCPRE += -I$(MISC)$/$(TARGET)$/inc +INCPRE += -I$(MISC)/$(TARGET)/inc +CFLAGSCXX += $(CPPUNIT_CFLAGS) SHL1TARGET = $(TARGET) -SHL1OBJS = $(SLO)$/test_propertysetmixin.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) +SHL1OBJS = $(SLO)/test_propertysetmixin.obj +SHL1VERSIONMAP = test.map +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) SHL1IMPLIB = i$(SHL1TARGET) +SHL1RPATH = NONE DEF1NAME = $(SHL1TARGET) -.IF "$(COMNAME)" == "gcc3" -SHL1VERSIONMAP = test.gcc3.map -.ELSE -SHL1VERSIONMAP = test.map -.ENDIF - SHL2TARGET = $(TARGET).uno -SHL2OBJS = $(SLO)$/comp_propertysetmixin.obj -SHL2VERSIONMAP = comp.map +SHL2OBJS = $(SLO)/comp_propertysetmixin.obj +SHL2VERSIONMAP = $(SOLARENV)/src/component.map SHL2STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) SHL2IMPLIB = i$(SHL2TARGET) +SH21RPATH = NONE DEF2NAME = $(SHL2TARGET) SLOFILES = $(SHL1OBJS) $(SHL2OBJS) @@ -76,63 +74,52 @@ JARFILES = java_uno.jar juh.jar jurt.jar ridl.jar ALLTAR: test -$(MISC)$/$(TARGET)$/types.urd: types.idl +$(MISC)/$(TARGET)/types.urd: types.idl - $(MKDIR) $(@:d) $(IDLC) -O$(@:d) -I$(SOLARIDLDIR) -cid -we $< -$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.urd +$(MISC)/$(TARGET)/types.rdb: $(MISC)/$(TARGET)/types.urd - $(RM) $@ $(REGMERGE) $@ /UCR $< -$(MISC)$/$(TARGET)$/uno.rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ - $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST) \ - $(MISC)$/$(TARGET)$/$(TARGET).uno.jar $(MISC)$/$(TARGET)$/bootstrap.rdb +$(MISC)/$(TARGET)/uno.rdb: $(MISC)/$(TARGET)/types.rdb $(SHL2TARGETN) \ + $(MISC)/$(TARGET)/$(TARGET).uno.jar $(MISC)/$(TARGET)/bootstrap.rdb - $(MKDIR) $(@:d) - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - $(REGMERGE) $@ / $(MISC)$/$(TARGET)$/types.rdb - $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \ - -c javavm.uno$(DLLPOST) -c reflection.uno$(DLLPOST) \ - -c stocservices.uno$(DLLPOST) - $(REGCOMP) -register -r $@ \ - -c $(subst,$/,/ $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST)) - $(REGCOMP) -register -br $(MISC)$/$(TARGET)$/bootstrap.rdb -r $@ \ - -c \ - $(subst,$/,/ $(FILEURLPREFIX)$(PWD)$/$(MISC)$/$(TARGET)$/$(TARGET).uno.jar) \ - -classpath $(CLASSPATH) \ - -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) - -$(MISC)$/$(TARGET)$/bootstrap.rdb .ERRREMOVE: + $(COPY) $(SOLARBINDIR)/types.rdb $@ + $(REGMERGE) $@ / $(MISC)/$(TARGET)/types.rdb + $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \ + -c reflection.uno -c stocservices.uno -c $(SHL2TARGETN) + $(REGCOMP) -register -br $(MISC)/$(TARGET)/bootstrap.rdb -r $@ \ + -c $(my_file)$(PWD)/$(MISC)/$(TARGET)/$(TARGET).uno.jar \ + -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR) + +$(MISC)/$(TARGET)/bootstrap.rdb: - $(MKDIR) $(@:d) - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \ - -c javavm.uno$(DLLPOST) -c stocservices.uno$(DLLPOST) + $(COPY) $(SOLARBINDIR)/types.rdb $@ + $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \ + -c stocservices.uno -$(MISC)$/$(TARGET)$/cppumaker.flag: $(MISC)$/$(TARGET)$/types.rdb - $(CPPUMAKER) -O$(MISC)$/$(TARGET)$/inc -BUCR -Gc \ - -X$(SOLARBINDIR)$/types.rdb $< +$(MISC)/$(TARGET)/cppumaker.flag: $(MISC)/$(TARGET)/types.rdb + $(CPPUMAKER) -O$(MISC)/$(TARGET)/inc -BUCR -Gc \ + -X$(SOLARBINDIR)/types.rdb $< $(TOUCH) $@ -$(SLOFILES): $(MISC)$/$(TARGET)$/cppumaker.flag +$(SLOFILES): $(MISC)/$(TARGET)/cppumaker.flag -$(MISC)$/$(TARGET)$/javamaker.flag: $(MISC)$/$(TARGET)$/types.rdb - $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)$/types.rdb $< +$(MISC)/$(TARGET)/javamaker.flag: $(MISC)/$(TARGET)/types.rdb + $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)/types.rdb $< $(TOUCH) $@ -# The following dependency (to execute javac whenever javamaker has run) does -# not work reliably, see #i28827#: -$(JAVAFILES) $(JAVACLASSFILES): $(MISC)$/$(TARGET)$/javamaker.flag +$(JAVATARGET): $(MISC)/$(TARGET)/javamaker.flag -$(MISC)$/$(TARGET)$/$(TARGET).uno.jar: $(JAVACLASSFILES) \ - $(MISC)$/$(TARGET)$/javamaker.flag manifest +$(MISC)/$(TARGET)/$(TARGET).uno.jar: $(JAVATARGET) \ + $(MISC)/$(TARGET)/javamaker.flag manifest jar cfm $@ manifest -C $(CLASSDIR) test/cppuhelper/propertysetmixin -test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET)$/uno.rdb -.IF "$(GUI)" == "WNT" - set CLASSPATH=$(CLASSPATH) && \ - set URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) && \ - testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET)$/uno.rdb#$(SOLARBINDIR)" -.ELSE - setenv CLASSPATH $(CLASSPATH) && \ - setenv URE_INTERNAL_JAVA_DIR $(MY_URE_INTERNAL_JAVA_DIR) && \ - testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET)$/uno.rdb#$(SOLARLIBDIR)" -.ENDIF +test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/uno.rdb + $(CPPUNITTESTER) $(SHL1TARGETN) \ + -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR) \ + -env:URE_INTERNAL_LIB_DIR=$(my_file)$(SOLARSHAREDBIN) \ + -env:arg-reg=$(MISC)/$(TARGET)/uno.rdb -env:arg-path=$(SOLARSHAREDBIN) + +.END diff --git a/cppuhelper/qa/propertysetmixin/test.gcc3.map b/cppuhelper/qa/propertysetmixin/test.gcc3.map deleted file mode 100644 index e7f19d73264e..000000000000 --- a/cppuhelper/qa/propertysetmixin/test.gcc3.map +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - registerAllTestFunction; - - _ZN4_STL7num_put*; # STLport - - local: - *; -}; diff --git a/cppuhelper/qa/propertysetmixin/test.map b/cppuhelper/qa/propertysetmixin/test.map index 7321bbca16ad..3308588ef6f8 100644 --- a/cppuhelper/qa/propertysetmixin/test.map +++ b/cppuhelper/qa/propertysetmixin/test.map @@ -27,7 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx index 395f0b096c7b..06db4cfdad52 100644 --- a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx +++ b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx @@ -61,9 +61,12 @@ #include "com/sun/star/uno/XComponentContext.hpp" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/servicefactory.hxx" -#include "testshl/simpleheader.hxx" +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include "osl/mutex.hxx" -#include "osl/thread.h" +#include "rtl/bootstrap.hxx" #include "rtl/ref.hxx" #include "rtl/string.h" #include "rtl/textenc.h" @@ -95,6 +98,14 @@ std::ostream & operator <<(std::ostream & out, css::uno::Any const & value) { out << "com::sun::star::uno::Any[" << value.getValueType() << ", ...]"; } +rtl::OUString getArgument(rtl::OUString const & name) { + rtl::OUString val; + CPPUNIT_ASSERT( + rtl::Bootstrap::get( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("arg-")) + name, val)); + return val; +} + class BoundListener: public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener > { @@ -219,17 +230,12 @@ void Test::setUp() { // single component context is used for all tests and destroyed in the last // pseudo-test "finish": if (!m_context.is()) { - char const * fw = getForwardString(); - rtl::OUString forward(fw, rtl_str_getLength(fw), - osl_getThreadTextEncoding()); - //TODO: check for string conversion failure - sal_Int32 index = forward.indexOf('#'); - rtl::OUString registry = forward.copy(0, index); - rtl::OUString bootstrappath = forward.copy(index+1); - css::uno::Reference< css::lang::XMultiComponentFactory > factory( cppu::createRegistryServiceFactory( - registry, sal_False, bootstrappath), + getArgument(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("reg"))), + sal_False, + getArgument( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("path")))), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::beans::XPropertySet >( factory, css::uno::UNO_QUERY_THROW)->getPropertyValue( @@ -667,8 +673,8 @@ void Test::testFull( css::uno::Reference< css::uno::XComponentContext > Test::m_context; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/cppuhelper/qa/unourl/export.map b/cppuhelper/qa/unourl/export.map index 4ca70fa85463..879fa8953788 100644 --- a/cppuhelper/qa/unourl/export.map +++ b/cppuhelper/qa/unourl/export.map @@ -1,4 +1,4 @@ -UDK_3.0 { +UDK_3_0_0 { global: registerAllTestFunction; diff --git a/cppuhelper/qa/unourl/makefile.mk b/cppuhelper/qa/unourl/makefile.mk index 9c4e3bc86976..de2c05d40bc1 100644 --- a/cppuhelper/qa/unourl/makefile.mk +++ b/cppuhelper/qa/unourl/makefile.mk @@ -35,6 +35,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl diff --git a/cppuhelper/qa/weak/makefile.mk b/cppuhelper/qa/weak/makefile.mk index 771edb26cfe5..543e87118a75 100644 --- a/cppuhelper/qa/weak/makefile.mk +++ b/cppuhelper/qa/weak/makefile.mk @@ -33,6 +33,7 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index 941465519a08..d43ea690e11a 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -385,4 +385,5 @@ UDK_3.7 { # OOo 3.3 __1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_; __1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_; __1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_; + __1cEcppubHcreateOneInstanceComponentFactory6FpFrknDcomDsunEstarDunoJReference4n0ERXComponentContext____n0EJReference4n0EKXInterface___rknDrtlIOUString_rkn0EISequence4n0K___pnQ_rtl_ModuleCount__n0EJReference4n0DElangXXSingleComponentFactory____; } UDK_3.6; diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index b1d473c061af..96faf2272231 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -1124,6 +1124,17 @@ Reference< lang::XSingleComponentFactory > SAL_CALL createSingleComponentFactory Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, pModCount, sal_False ); } +Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFactory( + ComponentFactoryFunc fptr, + OUString const & rImplementationName, + Sequence< OUString > const & rServiceNames, + rtl_ModuleCount * pModCount) + SAL_THROW( () ) +{ + return new OFactoryComponentHelper( + Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, pModCount, sal_True ); +} + } diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 099373b2e220..59ab83e34e82 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -379,5 +379,6 @@ UDK_3.6 { # OOo 3.3 _ZN4cppu11OWeakObject26disposeWeakConnectionPointEv; _ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE; _ZN3com3sun4star3uno19WeakReferenceHelper5clearEv; + _ZN4cppu33createOneInstanceComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount; } UDK_3.5; diff --git a/cppuhelper/source/gcc3os2.map b/cppuhelper/source/gcc3os2.map index 6aada0273d59..681a076cee79 100644 --- a/cppuhelper/source/gcc3os2.map +++ b/cppuhelper/source/gcc3os2.map @@ -373,4 +373,5 @@ UDK_3.5 { # OOo 3.0 global: _ZN4cppu18OPropertySetHelperC1ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb; _ZN4cppu18OPropertySetHelperC2ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb; + _ZN4cppu28createOneInstanceComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount; } UDK_3.4; diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map index 6bc10cb175c2..6d5a491ab925 100644 --- a/cppuhelper/source/msvc_win32_intel.map +++ b/cppuhelper/source/msvc_win32_intel.map @@ -276,4 +276,5 @@ UDK_3.6 { # OOo 3.3 global: ?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ; ?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ; + ?createOneInstanceComponentFactory@cppu@@YA?AV?$Reference@VXSingleComponentFactory@lang@star@sun@com@@@uno@star@sun@com@@P6A?AV?$Reference@VXInterface@uno@star@sun@com@@@3456@ABV?$Reference@VXComponentContext@uno@star@sun@com@@@3456@@ZABVOUString@rtl@@ABV?$Sequence@VOUString@rtl@@@3456@PAU_rtl_ModuleCount@@@Z; } UDK_3.5; diff --git a/cppuhelper/test/cfg_test.map b/cppuhelper/test/cfg_test.map deleted file mode 100644 index ac2c3750bfe0..000000000000 --- a/cppuhelper/test/cfg_test.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/idlc/source/makefile.mk b/idlc/source/makefile.mk index 37da1509afee..879090d15b54 100644 --- a/idlc/source/makefile.mk +++ b/idlc/source/makefile.mk @@ -120,11 +120,7 @@ YACCFLAGS+=-v .INCLUDE : target.mk $(MISC)$/stripped_scanner.ll : scanner.ll -.IF "$(GUI)"=="UNX" || "$(USE_SHELL)" != "4nt" tr -d "\015" < scanner.ll > $(MISC)$/stripped_scanner.ll -.ELSE - cat scanner.ll > $(MISC)$/stripped_scanner.ll -.ENDIF $(MISC)$/scanner.cxx: $(MISC)$/stripped_scanner.ll flex -o$(MISC)$/scanner.cxx $(MISC)$/stripped_scanner.ll diff --git a/idlc/source/preproc/cpp.h b/idlc/source/preproc/cpp.h index 24d30222b5a1..4b8645b2d34e 100644 --- a/idlc/source/preproc/cpp.h +++ b/idlc/source/preproc/cpp.h @@ -40,11 +40,8 @@ #define NULL 0 #endif -#ifndef __alpha typedef unsigned char uchar; -#endif - enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP, diff --git a/io/source/TextInputStream/makefile.mk b/io/source/TextInputStream/makefile.mk index 6613c392d60a..3c0cd5c5702d 100644 --- a/io/source/TextInputStream/makefile.mk +++ b/io/source/TextInputStream/makefile.mk @@ -40,7 +40,7 @@ SLOFILES= \ $(SLO)$/TextInputStream.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = tinstrm.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/io/source/TextInputStream/tinstrm.map b/io/source/TextInputStream/tinstrm.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/io/source/TextInputStream/tinstrm.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/io/source/TextOutputStream/makefile.mk b/io/source/TextOutputStream/makefile.mk index cf3f09345e17..ad78178f8bfa 100644 --- a/io/source/TextOutputStream/makefile.mk +++ b/io/source/TextOutputStream/makefile.mk @@ -41,7 +41,7 @@ SLOFILES= \ $(SLO)$/TextOutputStream.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = toutstrm.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/io/source/TextOutputStream/toutstrm.map b/io/source/TextOutputStream/toutstrm.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/io/source/TextOutputStream/toutstrm.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/io/source/acceptor/acceptor.map b/io/source/acceptor/acceptor.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/io/source/acceptor/acceptor.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/io/source/acceptor/makefile.mk b/io/source/acceptor/makefile.mk index 5a33ca3f093d..3da3fbe18913 100644 --- a/io/source/acceptor/makefile.mk +++ b/io/source/acceptor/makefile.mk @@ -52,7 +52,7 @@ SLOFILES= \ $(SLO)$/acc_socket.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = acceptor.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1RPATH=URELIB SHL1STDLIBS= \ diff --git a/io/source/connector/connectr.map b/io/source/connector/connectr.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/io/source/connector/connectr.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/io/source/connector/makefile.mk b/io/source/connector/makefile.mk index de3e922846db..7f12b850f1e3 100644 --- a/io/source/connector/makefile.mk +++ b/io/source/connector/makefile.mk @@ -52,7 +52,7 @@ SLOFILES= \ $(SLO)$/ctr_socket.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = connectr.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1RPATH=URELIB SHL1STDLIBS= \ diff --git a/io/source/stm/makefile.mk b/io/source/stm/makefile.mk index ff16516bb4e1..a6a163eca4e2 100644 --- a/io/source/stm/makefile.mk +++ b/io/source/stm/makefile.mk @@ -53,7 +53,7 @@ SLOFILES = $(SLO)$/opipe.obj\ $(SLO)$/opump.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = stm.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/io/source/stm/stm.map b/io/source/stm/stm.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/io/source/stm/stm.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/javaunohelper/source/javaunohelper.map b/javaunohelper/source/javaunohelper.map index a7bf6b0721af..dcbe0506ae77 100644 --- a/javaunohelper/source/javaunohelper.map +++ b/javaunohelper/source/javaunohelper.map @@ -1,4 +1,4 @@ -UDK_3.1 { +UDK_3_0_0 { global: Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo; Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory; diff --git a/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java b/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java index 997b9d1c76ee..455e3aab6502 100644 --- a/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java +++ b/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java @@ -58,30 +58,8 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster { static public final boolean DEBUG = false; static { - // preload shared libraries whichs import lips are linked to jpipe - if ( System.getProperty( "os.name" ).startsWith( "Windows" ) ) - { - try { - NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "msvcr71"); - } catch (Throwable e){} // loading twice would fail - - try { - NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "msvcr70"); - } catch (Throwable e){} // loading twice would fail - - try { - NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "uwinapi"); - } catch (Throwable e){} // loading twice would fail - - try { - NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "sal3"); - } catch (Throwable e){} // loading twice would fail - } - // load shared library for JNI code - try { - NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "jpipe"); - } catch (Throwable e){} // loading twice would fail + NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), "jpipe"); } protected String _aDescription; diff --git a/jurt/prj/build.lst b/jurt/prj/build.lst index f3d498b8cdd6..9b9b722bc3ae 100644 --- a/jurt/prj/build.lst +++ b/jurt/prj/build.lst @@ -15,4 +15,5 @@ ju jurt\com\sun\star\comp\connections nmake - all ju_con ju_co_loader NULL ju jurt\com\sun\star\comp\servicemanager nmake - all ju_servman NULL ju jurt\com\sun\star\comp\urlresolver nmake - all ju_urlres ju_co_loader NULL ju jurt\source\pipe nmake - all ju_src_pipe NULL +ju jurt\source\pipe\wrapper nmake - w ju_src_pipe_wrapper NULL ju jurt\util nmake - all ju_ut ju_brid_jrm ju_co_bfactr ju_con ju_con_sock ju_con_pipe ju_cssl_uno ju_env_java ju_prot_urp ju_servman ju_urlres ju_src_pipe ju_libutil ju_uno NULL diff --git a/jurt/prj/d.lst b/jurt/prj/d.lst index 5223fe2fe5ee..848435f61138 100644 --- a/jurt/prj/d.lst +++ b/jurt/prj/d.lst @@ -1,5 +1,6 @@ ..\%__SRC%\class\jurt.jar %_DEST%\bin%_EXT%\jurt.jar -..\%__SRC%\bin\jpipe*.dll %_DEST%\bin%_EXT%\jpipe*.dll +..\%__SRC%\bin\jpipe.dll %_DEST%\bin%_EXT%\jpipe.dll +..\%__SRC%\bin\jpipx.dll %_DEST%\bin%_EXT%\jpipx.dll ..\%__SRC%\lib\libjpipe*.so %_DEST%\lib%_EXT%\libjpipe*.so ..\%__SRC%\lib\libjpipe*.dylib %_DEST%\lib%_EXT%\libjpipe*.dylib diff --git a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c b/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c index 255da24c2f86..4d0a5b357604 100644 --- a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c +++ b/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c @@ -25,10 +25,20 @@ * ************************************************************************/ +#include "jni.h" #include "osl/security.h" #include <osl/pipe.h> -#include "com_sun_star_lib_connections_pipe_PipeConnection.h" +/* On Windows, jpipe.dll must not have dependencies on any other URE DLLs, as + Java System.LoadLibrary could otherwise not load it. Therefore, on Windows, + this code goes into a jpipx.dll that the jpipe.dll wrapper loads with + LoadLibraryEx(LOAD_WITH_ALTERED_SEARCH_PATH). The function names in this + wrapped code are truncated from the long JNICALL names, as JNICALL causes + some "@N" with different numeric values for N (and probably different across + 32 and 64 bit) to be added to the symbol names, which the calls to + GetProcAddress in wrapper/wrapper.c would otheriwse have to take into + account. +*/ /*****************************************************************************/ /* exception macros */ @@ -100,7 +110,12 @@ static rtl_uString * jstring2ustring(JNIEnv * env, jstring jstr) * Method: connect * Signature: (Lcom/sun/star/beans/NativeService;)V */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_createJNI +SAL_DLLPUBLIC_EXPORT void +#if defined WNT +PipeConnection_create +#else +JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_createJNI +#endif (JNIEnv * env, jobject obj_this, jstring name) { enum { @@ -234,7 +249,12 @@ JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_cre * Method: closeJNI * Signature: ()V */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_closeJNI +SAL_DLLPUBLIC_EXPORT void +#if defined WNT +PipeConnection_close +#else +JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_closeJNI +#endif (JNIEnv * env, jobject obj_this) { enum { @@ -315,7 +335,12 @@ JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_clo * Method: readJNI * Signature: ([[BI)I */ -JNIEXPORT jint JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_readJNI +SAL_DLLPUBLIC_EXPORT jint +#if defined WNT +PipeConnection_read +#else +JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_readJNI +#endif (JNIEnv * env, jobject obj_this, jobjectArray buffer, jint len) { enum { @@ -430,7 +455,12 @@ JNIEXPORT jint JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_rea * Method: writeJNI * Signature: ([B)V */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_writeJNI +SAL_DLLPUBLIC_EXPORT void +#if defined WNT +PipeConnection_write +#else +JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_writeJNI +#endif (JNIEnv * env, jobject obj_this, jbyteArray buffer) { enum { @@ -522,7 +552,12 @@ JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_wri * Method: flushJNI * Signature: ()V */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_flushJNI +SAL_DLLPUBLIC_EXPORT void +#if defined WNT +PipeConnection_flush +#else +JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_flushJNI +#endif (JNIEnv * env, jobject obj_this) { (void) env; /* not used */ diff --git a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.h b/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.h deleted file mode 100644 index a21e8f979348..000000000000 --- a/jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.h +++ /dev/null @@ -1,53 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class com_sun_star_connections_pipe_PipeConnection */ - -#ifndef _Included_com_sun_star_lib_connections_pipe_PipeConnection_h -#define _Included_com_sun_star_lib_connections_pipe_PipeConnection_h -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_sun_star_lib_connections_pipe_PipeConnection - * Method: connect - * Signature: (Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_createJNI - (JNIEnv *, jobject, jstring); - -/* - * Class: com_sun_star_lib_connections_pipe_PipeConnection - * Method: readJNI - * Signature: ([[BI)I - */ -JNIEXPORT jint JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_readJNI - (JNIEnv *, jobject, jobjectArray, jint); - -/* - * Class: com_sun_star_lib_connections_pipe_PipeConnection - * Method: writeJNI - * Signature: ([B)V - */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_writeJNI - (JNIEnv *, jobject, jbyteArray); - -/* - * Class: com_sun_star_lib_connections_pipe_PipeConnection - * Method: flushJNI - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_flushJNI - (JNIEnv *, jobject); - -/* - * Class: com_sun_star_lib_connections_pipe_PipeConnection - * Method: closeJNI - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_sun_star_lib_connections_pipe_PipeConnection_closeJNI - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jurt/source/pipe/jpipe.dxp b/jurt/source/pipe/jpipe.dxp deleted file mode 100644 index e07ea907470f..000000000000 --- a/jurt/source/pipe/jpipe.dxp +++ /dev/null @@ -1,5 +0,0 @@ -Java_com_sun_star_lib_connections_pipe_PipeConnection_createJNI -Java_com_sun_star_lib_connections_pipe_PipeConnection_closeJNI -Java_com_sun_star_lib_connections_pipe_PipeConnection_readJNI -Java_com_sun_star_lib_connections_pipe_PipeConnection_writeJNI -Java_com_sun_star_lib_connections_pipe_PipeConnection_flushJNI diff --git a/jurt/source/pipe/makefile.mk b/jurt/source/pipe/makefile.mk index e56ece77f5c1..5be6f1ebfd10 100644 --- a/jurt/source/pipe/makefile.mk +++ b/jurt/source/pipe/makefile.mk @@ -1,39 +1,57 @@ -PRJ=..$/.. - -PRJNAME=jurt -TARGET=jpipe -ENABLE_EXCEPTIONS=TRUE - -#? -NO_DEFAULT_STL=TRUE -NO_BSYMBOLIC=TRUE -USE_DEFFILE=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -.IF "$(SOLAR_JAVA)"=="" -nojava: - @echo "Not building jurt because Java is disabled" -.ENDIF - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/com_sun_star_lib_connections_pipe_PipeConnection.obj - -SHL1TARGET=$(TARGET) -SHL1LIBS=$(SLB)$/$(TARGET).lib -SHL1STDLIBS=$(SALLIB) -SHL1DEF=$(MISC)$/$(SHL1TARGET).def -SHL1RPATH=URELIB - -DEF1NAME=$(SHL1TARGET) -DEF1EXPORTFILE=$(TARGET).dxp -DEF1DES=jurtpipe - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +PRJ = ../.. +PRJNAME = jurt +TARGET = jpipe + +NO_DEFAULT_STL = TRUE +VISIBILITY_HIDDEN = TRUE + +.INCLUDE: settings.mk + +.IF "$(OS)" == "WNT" +SHL1TARGET = jpipx +.ELSE +SHL1TARGET = jpipe +.END + +SHL1CODETYPE = C +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLO)/com_sun_star_lib_connections_pipe_PipeConnection.obj +SHL1RPATH = URELIB +SHL1STDLIBS = $(SALLIB) +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) + +SLOFILES = $(SHL1OBJS) + +.IF "$(SOLAR_JAVA)" == "" +nothing .PHONY : +.END + +.INCLUDE: target.mk diff --git a/cppu/test/EnvDcp/makefile.mk b/jurt/source/pipe/wrapper/makefile.mk index cc0db62e93fe..88a3b160da2e 100644 --- a/cppu/test/EnvDcp/makefile.mk +++ b/jurt/source/pipe/wrapper/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -23,24 +23,30 @@ # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := EnvDcp.test - +#***********************************************************************/ -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE +PRJ = ../../.. +PRJNAME = jurt +TARGET = wrapper +NO_DEFAULT_STL = TRUE +UWINAPILIB = +VISIBILITY_HIDDEN = TRUE -.INCLUDE : settings.mk +.INCLUDE: settings.mk +SHL1CODETYPE = C +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLO)/wrapper.obj +SHL1RPATH = URELIB +SHL1TARGET = jpipe +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) -APP1TARGET := $(TARGET) -APP1OBJS := $(OBJ)$/EnvDcp.test.obj -APP1STDLIBS := $(ObjectFactory_LIB) $(CPPULIB) $(SALLIB) +SLOFILES = $(SHL1OBJS) +.IF "$(SOLAR_JAVA)" == "" +nothing .PHONY : +.END -.INCLUDE : target.mk +.INCLUDE: target.mk diff --git a/jurt/source/pipe/wrapper/wrapper.c b/jurt/source/pipe/wrapper/wrapper.c new file mode 100644 index 000000000000..5ef40f009191 --- /dev/null +++ b/jurt/source/pipe/wrapper/wrapper.c @@ -0,0 +1,99 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#include "sal/config.h" + +#include <stddef.h> + +#include <Windows.h> + +#include "jni.h" +#include "sal/types.h" + +static HMODULE module; + +static FARPROC getFunction(char const * name) { + return GetProcAddress(module, name); +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + (void) lpvReserved; + if (fdwReason == DLL_PROCESS_ATTACH) { + wchar_t path[32767]; + DWORD size; + size = GetModuleFileNameW(hinstDLL, path, 32767); + if (size == 0) { + return FALSE; + } + path[size - 5] = L'x'; /* ...\jpipe.dll -> ...\jpipx.dll */ + module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (module == NULL) { + return FALSE; + } + } + return TRUE; +} + +SAL_DLLPUBLIC_EXPORT void JNICALL +Java_com_sun_star_lib_connections_pipe_PipeConnection_createJNI( + JNIEnv * env, jobject obj_this, jstring name) +{ + (*(void (*)(JNIEnv *, jobject, jstring)) + getFunction("PipeConnection_create"))(env, obj_this, name); +} + +SAL_DLLPUBLIC_EXPORT void JNICALL +Java_com_sun_star_lib_connections_pipe_PipeConnection_closeJNI( + JNIEnv * env, jobject obj_this) +{ + (*(void (*)(JNIEnv *, jobject)) + getFunction("PipeConnection_close"))(env, obj_this); +} + +SAL_DLLPUBLIC_EXPORT jint JNICALL +Java_com_sun_star_lib_connections_pipe_PipeConnection_readJNI( + JNIEnv * env, jobject obj_this, jobjectArray buffer, jint len) +{ + return (*(jint (*)(JNIEnv *, jobject, jobjectArray, jint)) + getFunction("PipeConnection_read"))(env, obj_this, buffer, len); +} + +SAL_DLLPUBLIC_EXPORT void JNICALL +Java_com_sun_star_lib_connections_pipe_PipeConnection_writeJNI( + JNIEnv * env, jobject obj_this, jbyteArray buffer) +{ + (*(void (*)(JNIEnv *, jobject, jbyteArray)) + getFunction("PipeConnection_write"))(env, obj_this, buffer); +} + +SAL_DLLPUBLIC_EXPORT void JNICALL +Java_com_sun_star_lib_connections_pipe_PipeConnection_flushJNI( + JNIEnv * env, jobject obj_this) +{ + (*(void (*)(JNIEnv *, jobject)) + getFunction("PipeConnection_flush"))(env, obj_this); +} diff --git a/jvmaccess/util/cc5_solaris_sparc.map b/jvmaccess/util/cc5_solaris_sparc.map index e2cb767dc65e..bb59a648f4c5 100644 --- a/jvmaccess/util/cc5_solaris_sparc.map +++ b/jvmaccess/util/cc5_solaris_sparc.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3.1 { +UDK_3_0_0 { global: # jvmaccess/virtualmachine.hxx: __1cJjvmaccessOVirtualMachineLAttachGuardRCreationException2t6M_v_; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -52,7 +52,7 @@ UDK_3.2 { __1cJjvmaccesscQ__RTTI__1CpnJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException * __1cJjvmaccesscR__RTTI__1CpknJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException const * __1cJjvmaccessOVirtualMachine2t5B6MpnHJavaVM__ibpnHJNIEnv___v_; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) #Nvariant 1 -} UDK_3.1; +} UDK_3_0_0; UDK_3.3 { global: diff --git a/jvmaccess/util/gcc3.map b/jvmaccess/util/gcc3.map index 330651a1cf6e..707645d2c829 100644 --- a/jvmaccess/util/gcc3.map +++ b/jvmaccess/util/gcc3.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3.1 { +UDK_3_0_0 { global: # jvmaccess/virtualmachine.hxx: _ZN9jvmaccess14VirtualMachine11AttachGuard17CreationExceptionC1Ev; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -59,7 +59,7 @@ UDK_3.2 { # We put the '*' at the beginning because its unlikely that these symbols will ever be a postfix of another symbol. _*ZN9jvmaccess14VirtualMachineC1EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) _*ZN9jvmaccess14VirtualMachineC2EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) -} UDK_3.1; +} UDK_3_0_0; UDK_3.3 { global: diff --git a/jvmaccess/util/msvc_win32_intel.map b/jvmaccess/util/msvc_win32_intel.map index fd148b1892ba..4620b1caa940 100644 --- a/jvmaccess/util/msvc_win32_intel.map +++ b/jvmaccess/util/msvc_win32_intel.map @@ -1,4 +1,4 @@ -UDK_3.1 { +UDK_3_0_0 { global: # jvmaccess/virtualmachine.hxx: ??0CreationException@AttachGuard@VirtualMachine@jvmaccess@@QAE@XZ; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -15,7 +15,7 @@ UDK_3.1 { UDK_3.2 { global: -} UDK_3.1; +} UDK_3_0_0; UDK_3.3 { global: diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx index 1647a1d9359b..3302fe42e90c 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx @@ -69,9 +69,11 @@ namespace jfw_plugin #define JFW_PLUGIN_ARCH "m68k" #elif defined HPPA #define JFW_PLUGIN_ARCH "parisc" -#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA +#elif defined AXP +#define JFW_PLUGIN_ARCH "alpha" +#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA #error unknown plattform -#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA +#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA class MalformedVersionException diff --git a/offapi/com/sun/star/accessibility/AccessibleRelation.idl b/offapi/com/sun/star/accessibility/AccessibleRelation.idl index 2c4aadd314d4..8df475e9fa0e 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRelation.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRelation.idl @@ -50,7 +50,7 @@ published struct AccessibleRelation the whole relation is regarded as invalid. The content of the targetSet is then undefined.</p> - @see AccessibleRelationType. + @see AccessibleRelationType */ short RelationType; diff --git a/offapi/com/sun/star/accessibility/AccessibleRole.idl b/offapi/com/sun/star/accessibility/AccessibleRole.idl index 7231db672c07..5fe65d04ec42 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRole.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRole.idl @@ -686,6 +686,33 @@ published constants AccessibleRole @since OOo 3.0 */ const short TREE_TABLE = 80; + + /** Comment role + + <p>An object which represents a comment.</p> + + <p>A comment is anchored at a certain content position in the document and + annotates this document content position or a certain text range of the document content. + In the OpenDocument file format a comment is known as an annotation.</p> + + <p>See also <const>COMMENT_END</const>.</p> + + @since OOo 3.2 + */ + const short COMMENT = 81; + + /** Comment end role + + <p>An invisible object which represents the end position of a text range which + is annotated by a comment - see <const>COMMENT</const>.</p> + + <p>This object and the corresponding object representing the comment shall be + in relation of type <const>MEMBER_OF</const>.</p> + + @since OOo 3.2 + */ + const short COMMENT_END = 82; + }; }; }; }; }; diff --git a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl index 56f5305d10f2..db69a6b5d842 100644 --- a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl +++ b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl @@ -38,6 +38,7 @@ //============================================================================= /** If you do not want to implement the <type>XGridColumnModel</type> yourself, use this service. + @since OOo 3.3.0 */ service DefaultGridColumnModel { diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl index e823e451249c..c487afc79b49 100644 --- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl @@ -38,6 +38,8 @@ //============================================================================= /** If you do not want to implement the <type>XGridDataModel</type> yourself, use this service. + + @since OOo 3.3.0 */ service DefaultGridDataModel { diff --git a/offapi/com/sun/star/awt/grid/GridColumn.idl b/offapi/com/sun/star/awt/grid/GridColumn.idl index a38d6cafd903..a87aef84f7d3 100644 --- a/offapi/com/sun/star/awt/grid/GridColumn.idl +++ b/offapi/com/sun/star/awt/grid/GridColumn.idl @@ -38,6 +38,8 @@ //============================================================================= /** Represents a column as used by the <type>DefaultGridColumnModel</type> + + @since OOo 3.3.0 */ service GridColumn { diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl index dfc6905d1148..caab721185a5 100644 --- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl @@ -31,24 +31,14 @@ #include <com/sun/star/lang/EventObject.idl> #endif -#ifndef __com_sun_star_awt_grid_XGridColumn_idl__ -#include <com/sun/star/awt/grid/XGridColumn.idl> -#endif - //============================================================================= module com { module sun { module star { module awt { module grid { //============================================================================= +/** An event used by a <type>XGridColumn</type> to notify changes in the column. -/** An event used by a <type>XGridColumnModel</type> to notify changes in the column - model to the <type>XGridControl</type>. - You usually need to fill this event only if you implement the <type>XGridColumnModel</type> - yourself. - - @see XGridColumnModel - @see XGridControl - @see XGridColumnListener + @since OOo 3.3.0 */ struct GridColumnEvent: com::sun::star::lang::EventObject { @@ -63,9 +53,6 @@ struct GridColumnEvent: com::sun::star::lang::EventObject /** Contains the index of the changed column**/ long index; - - /** Contains the changed column**/ - XGridColumn column; //------------------------------------------------------------------------- }; diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl index 30d87a3f1c46..1e0afb610f16 100644 --- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl @@ -27,10 +27,7 @@ #ifndef __com_sun_star_awt_grid_GridDataEvent_idl__ #define __com_sun_star_awt_grid_GridDataEvent_idl__ -#ifndef __com_sun_star_lang_EventObject_idl__ #include <com/sun/star/lang/EventObject.idl> -#endif - //============================================================================= @@ -46,6 +43,8 @@ module com { module sun { module star { module awt { module grid { @see XGridDataModel @see XGridControl @see XGridDataListener + + @sonce OOo 3.3.0 */ struct GridDataEvent: com::sun::star::lang::EventObject { @@ -67,7 +66,7 @@ struct GridDataEvent: com::sun::star::lang::EventObject string headerName; /** Contains the changed row**/ - sequence<string> rowData; + sequence<any> rowData; }; diff --git a/cppu/test/ObjectFactory/CppObject.hxx b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl index f8f5786daa31..af1f90dfdc8b 100644 --- a/cppu/test/ObjectFactory/CppObject.hxx +++ b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: GridInvalidDataException.idl,v $ + * $Revision: 1.0 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,39 +27,32 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef __com_sun_star_awt_grid_GridInvalidDataException_idl__ +#define __com_sun_star_awt_grid_GridInvalidDataException_idl__ -#ifndef INCLUDED_CppObject_hxx -#define INCLUDED_CppObject_hxx - +#ifndef __com_sun_star_uno_RuntimeException_idl__ +#include <com/sun/star/uno/RuntimeException.idl> +#endif -#include "com/sun/star/uno/XComponentContext.hpp" +//============================================================================= -#include "callee.hxx" +module com { module sun { module star { module awt { module grid { -namespace cssu = ::com::sun::star::uno; +//============================================================================= +/** Exception is thrown to indicate that set data is invalid, e.g. type of data is unknown + or data count doesn't match with column count. -class CppObject: public cssu::XInterface + @since OOo 3.3.0 + */ +exception GridInvalidDataException : com::sun::star::uno::RuntimeException { -public: - static cssu::XInterface * s_create (Callee * pCallee); - static void s_release(cssu::XInterface * pXInterface); - static void s_call (cssu::XInterface * pXInterface); - - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); - virtual cssu::Any SAL_CALL queryInterface(cssu::Type const & rType ) throw (cssu::RuntimeException); - -protected: - oslInterlockedCount m_nRef; - - explicit CppObject(Callee * pCallee) SAL_THROW((cssu::RuntimeException)); - virtual ~CppObject(void) SAL_THROW((cssu::RuntimeException)); - - Callee * m_pCallee; }; +//============================================================================= + +}; }; }; }; }; #endif diff --git a/cppu/test/ObjectFactory/callee.hxx b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl index beb31d4f4dd9..9d96daf624bb 100644 --- a/cppu/test/ObjectFactory/callee.hxx +++ b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: GridInvalidModelException.idl,v $ + * $Revision: 1.0 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,16 +27,31 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef __com_sun_star_awt_grid_GridInvalidModelException_idl__ +#define __com_sun_star_awt_grid_GridInvalidModelException_idl__ + +#ifndef __com_sun_star_uno_RuntimeException_idl__ +#include <com/sun/star/uno/RuntimeException.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module awt { module grid { + +//============================================================================= -#ifndef INCLUDED_callee_hxx -#define INCLUDED_callee_hxx +/** Exception is thrown when data or column model isn't set. + @since OOo 3.3.0 + */ +exception GridInvalidModelException : com::sun::star::uno::RuntimeException +{ -#include <rtl/ustring.hxx> +}; +//============================================================================= -extern "C" { -typedef void Callee(rtl_uString * pMethod_name); -} +}; }; }; }; }; #endif diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl index 2475e59b5b26..e9b87c2fe7ed 100644 --- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl @@ -50,14 +50,17 @@ struct GridSelectionEvent: com::sun::star::lang::EventObject { //------------------------------------------------------------------------- - /** Contains the x coordinate of the selected cell**/ - long x; + /** the selected row*/ + long Row; - /** Contains the y coordinate of the selected cell**/ - long y; + /** the selected column*/ + long Column; + + /**number of selected rows, if multiple rows selected*/ + long Range; /** Contains the action <type>SelectionEventType</types> that was performed **/ - SelectionEventType action; + SelectionEventType Action; }; diff --git a/offapi/com/sun/star/awt/grid/SelectionEventType.idl b/offapi/com/sun/star/awt/grid/SelectionEventType.idl index 8096ceceeb13..c7ee61498cc3 100644 --- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl +++ b/offapi/com/sun/star/awt/grid/SelectionEventType.idl @@ -49,7 +49,13 @@ enum SelectionEventType /** This value indicates that a selection was removed from the grid control */ - REMOVE + REMOVE, + + //------------------------------------------------------------------------- + + /** This value indicates that a selection was changed + */ + CHANGE }; diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl index 7de3eda02231..542c27085dcb 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl @@ -66,6 +66,7 @@ The <type>XGridSelection</type> interface provides a bunch of methods to set and get selection for the grid control. </p> + @since OOo 3.3.0 */ service UnoControlGrid { diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl index bcb28af294b8..7eea49624045 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl @@ -37,6 +37,12 @@ #include <com/sun/star/view/SelectionType.idl> +#include <com/sun/star/awt/FontDescriptor.idl> + +#include <com/sun/star/style/VerticalAlignment.idl> + +#include <com/sun/star/util/Color.idl> + //============================================================================= module com { module sun { module star { module awt { module grid { @@ -44,6 +50,8 @@ module com { module sun { module star { module awt { module grid { //============================================================================= /** specifies the standard model of a <type>UnoControlGridModel</type>. + + @since OOo 3.3.0 */ service UnoControlGridModel { @@ -84,11 +92,68 @@ service UnoControlGridModel */ [property] boolean VScroll; + /** Specifies that the control can be reached with the TAB key. + */ + [property] boolean Tabstop; + /** Specifies the selection mode that is enabled for this grid control. <p>The default value is <member scope="com::sun::star::view">SelectionType::SINGLE</member></p> */ [property] ::com::sun::star::view::SelectionType SelectionModel; + /** Specifies the background color of rows. If color for even rows is set, then specifies + the color of odd rows. Default value is white. + */ + [property] ::com::sun::star::util::Color RowBackgroundColor; + + /** Specifies the background color of even rows. Default value is white. + */ + [property] ::com::sun::star::util::Color EvenRowBackgroundColor; + + /** Specifies the background color of header. Default value is white. + */ + [property] ::com::sun::star::util::Color HeaderBackgroundColor; + + /** Specifies the text color. Default value is black. + */ + [property] ::com::sun::star::util::Color TextColor; + + /** Specifies the line color. Default value is white. + */ + [property] ::com::sun::star::util::Color LineColor; + + /** specifies the vertical alignment of the content in the control. + + <pre> + TOP + MIDDLE + BOTTOM + </pre> + */ + [property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the font attributes of the text in the control. + */ + [property] com::sun::star::awt::FontDescriptor FontDescriptor; + + /** specifies the <type scope="com::sun::star::text">FontEmphasis</type> + value of the text in the control. + */ + [property] short FontEmphasisMark; + + /** specifies the <type scope="com::sun::star::text">FontRelief</type> + value of the text in the control. + */ + [property] short FontRelief; + + /** specifies the help text of the control. + */ + [property] string HelpText; + + /** specifies the help URL of the control. + */ + [property] string HelpURL; + }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridCell.idl b/offapi/com/sun/star/awt/grid/XGridCell.idl index b64c40a3dce4..08f3cfd1b2d5 100644 --- a/offapi/com/sun/star/awt/grid/XGridCell.idl +++ b/offapi/com/sun/star/awt/grid/XGridCell.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -interface XGridCell: com::sun::star::uno::XInterface +interface XGridCell { [attribute] string Value; diff --git a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl index 825acd4af43a..7f9fa28c3307 100644 --- a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl +++ b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl @@ -37,10 +37,9 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -/** gives access to the items of a list box and makes it possible to - register item and action event listeners. +/** renderer for cells */ -interface XGridCellRenderer: com::sun::star::uno::XInterface +interface XGridCellRenderer { //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl index 9c9981959ed3..d217ff5d4ac6 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumn.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl @@ -30,6 +30,9 @@ #ifndef __com_sun_star_uno_XInterface_idl__ #include <com/sun/star/uno/XInterface.idl> #endif +#include <com/sun/star/style/HorizontalAlignment.idl> +#include <com/sun/star/awt/grid/XGridColumnListener.idl> + //============================================================================= @@ -38,28 +41,67 @@ module com { module sun { module star { module awt { module grid { //============================================================================= /** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control + @since OOo 3.3.0 */ -interface XGridColumn: com::sun::star::uno::XInterface +interface XGridColumn { /** Specifies the an idendifier of the colomn.**/ [attribute] any Identifier; /** Specifies the default column witdth. **/ [attribute] long ColumnWidth; - /* + + /** Specifies the preferred column witdth. **/ [attribute] long PreferredWidth; + /** Specifies the min column witdth. **/ [attribute] long MinWidth; + /** Specifies the max column witdth. **/ [attribute] long MaxWidth; - [attribute] boolean Resizable; - */ + /** Specifies whether column has fixed size or not. **/ + [attribute] boolean Resizeable; + + /** Specifies the horizontal alignment of the content in the control. + + <pre> + LEFT + CENTER + RIGHT + </pre> + */ + [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign; /** A title is displayed in the colum header row if <method>UnoControlGridModel::ShowRowHeader</method> is set to <true/>**/ [attribute] string Title; + /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes. + @param Listener + the listener to add. + */ + [oneway] void addColumnListener( [in] XGridColumnListener listener); + //------------------------------------------------------------------------- + + /** Removes a listener previously added with <method>addColumnListener()</method>. + @param Listener + the listener to remove. + */ + [oneway] void removeColumnListener( [in] XGridColumnListener listener); + + /**Updates changed column widths, when column widths are being resized. + @param name + can be PrefWidth or ColWidth, depending on which was changed + @param width + the new column width + */ + void updateColumn( [in] string name, [in] long width); + /**Sets column index + @param index + index, which is the index of the column in the column array of the column model + */ + void setIndex( [in] long index ); }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl index a9a0e50a34ed..8a2d044f33d5 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl @@ -46,18 +46,20 @@ module com { module sun { module star { module awt { module grid { <p>Usually you must not implement this interface yourself, but you must notify it correctly if you implement the <type>XGridColumnModel</type> yourself</p>. + + @since OOo 3.3.0 */ -interface XGridColumnListener: com::sun::star::uno::XInterface +interface XGridColumnListener { - /** - Invoked after a column was added to the column model. - */ - void columnAdded( [in] GridColumnEvent event ); - - /** - Invoked after a column was removed from the column model. - */ - void columnRemoved( [in] GridColumnEvent event ); + // /** + // Invoked after a column was added to the column model. + //*/ + //void columnAdded( [in] GridColumnEvent event ); + // + // /** + // Invoked after a column was removed from the column model. + //*/ + //void columnRemoved( [in] GridColumnEvent event ); /** Invoked after a column was modified. diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl index 51f290fcef0e..86e77680cd95 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl @@ -30,6 +30,7 @@ #include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/awt/grid/XGridColumn.idl> + #include <com/sun/star/awt/grid/XGridColumnListener.idl> //============================================================================= @@ -42,12 +43,18 @@ module com { module sun { module star { module awt { module grid { retrieve the column structure that is displayed in the actual control. If you do not need your own model implementation, you can also use the <type>DefaultGridColumnModel</type>. + + @since OOo 3.3.0 */ -interface XGridColumnModel: com::sun::star::uno::XInterface +interface XGridColumnModel { - /** Specifies whether column selection is allowed + ///** Specifies whether column selection is allowed + //*/ + //[attribute] boolean ColumnSelectionAllowed; + + /**Specifies the height of column header. */ - [attribute] boolean ColumnSelectionAllowed; + [attribute] long ColumnHeaderHeight; /** Returns the number of columns. @returns @@ -81,29 +88,28 @@ interface XGridColumnModel: com::sun::star::uno::XInterface /** Returns a specific column. @param index - the position of the reuquested column. + the position of the requested column. @returns the requested column. */ XGridColumn getColumn( [in] long index); - /* - long getTotalColumnWidth(); + /** Sets default columns to the column model. + @param elements + the number of default columns that should be set. */ + void setDefaultColumns([in] long elements); - /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes. - @param Listener - the listener to add. + /**Creates new XGridColumn with the settings of other column. To be used if the columns which are added to + the column model have the same settings. + @param column + the column, which is already created */ - [oneway] void addColumnListener( [in] XGridColumnListener listener); - - //------------------------------------------------------------------------- + XGridColumn copyColumn( [in] XGridColumn column ); - /** Removes a listener previously added with <method>addColumnListener()</method>. - @param Listener - the listener to remove. + /* + long getTotalColumnWidth(); */ - [oneway] void removeColumnListener( [in] XGridColumnListener listener); }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 05c49aa1669d..5019a571663b 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -41,30 +41,25 @@ module com { module sun { module star { module awt { module grid { /** An interface to a control that displays a tabular data. @see UnoControlGrid + + @since OOo 3.3.0 */ interface XGridControl: XGridSelection { - /** Specifies the <type>XGridColumnModel</type> of the control. - */ - [attribute] XGridColumnModel ColumnModel; - - /** Specifies the <type>XGridDataModel</type> of the control. - */ - [attribute] XGridDataModel DataModel; - - /** Converting */ long getItemIndexAtPoint( [in] long x, [in] long y); - /** registers a listener for mouse events. - */ - //[oneway] void addMouseListener( [in] com::sun::star::awt::XMouseListener listener ); - - /** unregisters a listener for mouse events. - */ - //[oneway] void removeMouseListener( [in] com::sun::star::awt::XMouseListener listener ); + /** Sets tooltip for row + @param textForTooltip + text, which will be shown as tooltip. + If only cell content should be displayed, leave sequence empty. + @param columnsForTooltip + column numbers, which define the cell content that should be shown in the tooltip. + If only text should be shown, leave this sequence empty. + */ + void setToolTip( [in] sequence< string > textForTooltip, [in] sequence< long > columnsForTooltip); }; diff --git a/offapi/com/sun/star/awt/grid/XGridControlListener.idl b/offapi/com/sun/star/awt/grid/XGridControlListener.idl index ac703e8516ee..6f4fdf68ccd4 100644 --- a/offapi/com/sun/star/awt/grid/XGridControlListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridControlListener.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -interface XGridControlListener: com::sun::star::uno::XInterface +interface XGridControlListener { }; diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl index cee808a178f2..d6d0d930b331 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl @@ -46,6 +46,8 @@ module com { module sun { module star { module awt { module grid { <p>Usually you must not implement this interface yourself, but you must notify it correctly if you implement the <type>XGridDataModel</type> yourself</p>. + + @since OOo 3.3.0 */ interface XGridDataListener: com::sun::star::lang::XEventListener { diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl index f41841cf8039..5cc4085807e1 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl @@ -1,5 +1,6 @@ /************************************************************************* * + * $Revision: 1.8 $ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -41,6 +42,8 @@ module com { module sun { module star { module awt { module grid { retrieve the content data that is displayed in the actual control. If you do not need your own model implementation, you can also use the <type>DefaultGridDataModel</type>. + + @since OOo 3.3.0 */ interface XGridDataModel: ::com::sun::star::lang::XComponent { @@ -54,7 +57,11 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent /** Returns the content of each row. */ - [attribute,readonly] sequence< sequence< string > > Data; + [attribute,readonly] sequence< sequence< any > > Data; + + /**Specifies the width of row header. + */ + [attribute] long RowHeaderWidth; /** Returns the number of rows in in the model. @returns @@ -69,7 +76,7 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent @param data the content of the row. */ - void addRow( [in] string headername, [in] sequence< string > data ); + void addRow( [in] string headername, [in] sequence< any > data ); /** Removes a row from the model. @@ -82,6 +89,26 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent */ void removeAll(); + /**Updates the content of a given cell. + @param row + the row index + @param column + the column index + @param value + the new value of the cell. + */ + void updateCell([in] long row, [in] long column, [in] any value ); + + /**Updates the content of a given row. + @param row + the row index + @param columns + column indexes of the cells, which should be updated + @param value + the new values of the cells. + */ + void updateRow([in] long row, [in] sequence< long > columns, [in] sequence< any > values); + //------------------------------------------------------------------------- /** Adds a listener for the <type>GridDataEvent</type> posted after the grid changes. diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl index ecb760cb3277..5049426018b0 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelection.idl +++ b/offapi/com/sun/star/awt/grid/XGridSelection.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { /** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>. */ -interface XGridSelection: com::sun::star::uno::XInterface +interface XGridSelection { /** Returns the lowest index of the selection. @returns @@ -53,21 +53,25 @@ interface XGridSelection: com::sun::star::uno::XInterface */ long getMaxSelectionIndex(); - /** Adds a selection intervall. - @param start - the start row index. - @param length - the number of rows to be selected. + /** Selects all rows. */ - [oneway] void insertIndexIntervall( [in] long start, [in] long length); + [oneway] void selectAllRows(); - /** Removes a selection intervall. - @param start - the start row index. - @param length - the number of rows to be selected. + /** Selects multiple rows. Previous selections will be removed. + @param rangeOfRows + array of rows indexes, which will be selected. */ - [oneway] void removeIndexIntervall( [in] long start, [in] long length); + [oneway] void selectRows( [in] sequence< long > rangeOfRows); + + /** Deselects all selected rows. + */ + [oneway] void deselectAllRows(); + + /** Deselects selected rows. Selected rows, which aren't in the range remain selected. + @param rangeOfRows + array of rows indexes, which will be deselected. + */ + [oneway] void deselectRows( [in] sequence< long > rangeOfRows); /** Returns the indicies of all selected rows. @returns @@ -90,17 +94,17 @@ interface XGridSelection: com::sun::star::uno::XInterface boolean isSelectedIndex( [in] long index); /** Marks a row as selected. - @param + @param index the index of a row. */ - [oneway] void selectRow( [in] long y); + [oneway] void selectRow( [in] long index); /* [oneway] void selectColumn( [in] long x); */ /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes. - @param Listener + @param listener the listener to add. */ [oneway] void addSelectionListener( [in] XGridSelectionListener listener); @@ -108,7 +112,7 @@ interface XGridSelection: com::sun::star::uno::XInterface //------------------------------------------------------------------------- /** Removes a listener previously added with <method>addSelectionListener()</method>. - @param Listener + @param listener the listener to remove. */ [oneway] void removeSelectionListener( [in] XGridSelectionListener listener); diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk index 3cfe6d83b3ba..02c159f8ffec 100644 --- a/offapi/com/sun/star/awt/grid/makefile.mk +++ b/offapi/com/sun/star/awt/grid/makefile.mk @@ -57,7 +57,9 @@ IDLFILES=\ ScrollBarMode.idl\ XGridControl.idl\ UnoControlGrid.idl\ - UnoControlGridModel.idl + UnoControlGridModel.idl\ + GridInvalidDataException.idl\ + GridInvalidModelException.idl # ------------------------------------------------------------------ .INCLUDE : target.mk diff --git a/offapi/com/sun/star/configuration/Update.idl b/offapi/com/sun/star/configuration/Update.idl new file mode 100644 index 000000000000..790a4bb40235 --- /dev/null +++ b/offapi/com/sun/star/configuration/Update.idl @@ -0,0 +1,45 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef __com_sun_star_configuration_Update_idl__ +#define __com_sun_star_configuration_Update_idl__ + +#include "com/sun/star/configuration/XUpdate.idl" + +module com { module sun { module star { module configuration { + +/* Provides access to internal update features of the configuration provider. + + <p>This singleton is unpublished and unstable.</p> + + @since OOo 3.3.0 +*/ +singleton Update: XUpdate; + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/configuration/XUpdate.idl b/offapi/com/sun/star/configuration/XUpdate.idl new file mode 100644 index 000000000000..7514cbcb1b7f --- /dev/null +++ b/offapi/com/sun/star/configuration/XUpdate.idl @@ -0,0 +1,51 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef __com_sun_star_configuration_XUpdate_idl__ +#define __com_sun_star_configuration_XUpdate_idl__ + +#include "com/sun/star/uno/XInterface.idl" + +module com { module sun { module star { module configuration { + +/* Provides access to internal update features of the configuration provider. + + <p>This interface is unpublished and unstable.</p> + + @since OOo 3.3.0 +*/ +interface XUpdate { + void insertExtensionXcsFile([in] boolean shared, [in] string fileUri); + void insertExtensionXcuFile([in] boolean shared, [in] string fileUri); + void insertModificationXcuFile( + [in] string fileUri, [in] sequence< string > includedPaths, + [in] sequence< string > excludedPaths); +}; + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/configuration/makefile.mk b/offapi/com/sun/star/configuration/makefile.mk index 0dc3a42df9ab..00525e9ba355 100644 --- a/offapi/com/sun/star/configuration/makefile.mk +++ b/offapi/com/sun/star/configuration/makefile.mk @@ -65,6 +65,8 @@ IDLFILES=\ PropertyHierarchy.idl\ XTemplateContainer.idl\ XTemplateInstance.idl\ + Update.idl \ + XUpdate.idl # ------------------------------------------------------------------ diff --git a/offapi/com/sun/star/document/DocumentProperties.idl b/offapi/com/sun/star/document/DocumentProperties.idl index c8e0ee9ca493..5b00f6c9a8e2 100755 --- a/offapi/com/sun/star/document/DocumentProperties.idl +++ b/offapi/com/sun/star/document/DocumentProperties.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module document { @see XDocumentProperties @see XDocumentPropertiesSupplier */ -service DocumentProperties : XDocumentProperties +published service DocumentProperties : XDocumentProperties { /** constructs default-initialized instance */ diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl b/offapi/com/sun/star/document/MediaDescriptor.idl index 72690a45eccd..89a3141a443d 100644 --- a/offapi/com/sun/star/document/MediaDescriptor.idl +++ b/offapi/com/sun/star/document/MediaDescriptor.idl @@ -51,6 +51,10 @@ #include <com/sun/star/task/XStatusIndicator.idl> #endif +#ifndef __com_sun_star_frame_XFrame_idl__ +#include <com/sun/star/frame/XFrame.idl> +#endif + //============================================================================= module com { module sun { module star { module document { @@ -594,6 +598,11 @@ published service MediaDescriptor @since OOo 3.0 */ [optional,property] string ViewControllerName; + //------------------------------------------------------------------------- + + /** specifies the frame containing the document. May be empty. + */ + [optional,property] com::sun::star::frame::XFrame Frame; }; //============================================================================= diff --git a/offapi/com/sun/star/document/OfficeDocument.idl b/offapi/com/sun/star/document/OfficeDocument.idl index 98d3b09e39e3..4a3418e4da64 100644 --- a/offapi/com/sun/star/document/OfficeDocument.idl +++ b/offapi/com/sun/star/document/OfficeDocument.idl @@ -71,6 +71,10 @@ #include <com/sun/star/document/XEmbeddedScripts.idl> #endif +#ifndef __com_sun_star_document_XDocumentPropertiesSupplier_idl__ +#include <com/sun/star/document/XDocumentPropertiesSupplier.idl> +#endif + //============================================================================= module com { module sun { module star { module document { @@ -158,6 +162,8 @@ published service OfficeDocument Instead of the <type>StandaloneDocumentInfo</type> service the <type>DocumentInfo</type> will be available on an already opened document only. </p> + + @deprecated Use <type>XDocumentPropertiesSupplier</type> instead. */ [optional] interface XDocumentInfoSupplier; @@ -180,6 +186,13 @@ published service OfficeDocument [optional] interface XEmbeddedScripts; //------------------------------------------------------------------------- + /** access to the <type>DocumentProperties</type>. + + @since OOo 3.0 + */ + [optional] interface XDocumentPropertiesSupplier; + + //------------------------------------------------------------------------- /** controls the focus behaviour of the form controls in the document <p> diff --git a/offapi/com/sun/star/document/XDocumentProperties.idl b/offapi/com/sun/star/document/XDocumentProperties.idl index 943fbd586f8f..8a3b2c1843aa 100755 --- a/offapi/com/sun/star/document/XDocumentProperties.idl +++ b/offapi/com/sun/star/document/XDocumentProperties.idl @@ -88,7 +88,7 @@ module com { module sun { module star { module document { for getting access to an instance from a loaded document @see DocumentProperties for a service that implements this interface */ -interface XDocumentProperties +published interface XDocumentProperties { //------------------------------------------------------------------------- /** contains the initial author of the document. @@ -352,8 +352,6 @@ interface XDocumentProperties if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when trying to open a stream in the given storage - @throws com::sun::star::uno::Exception - in various unspecified circumstances */ void loadFromStorage( [in] com::sun::star::embed::XStorage Storage, @@ -361,15 +359,10 @@ interface XDocumentProperties raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::io::WrongFormatException, com::sun::star::lang::WrappedTargetException, - com::sun::star::io::IOException, - com::sun::star::uno::Exception ); + com::sun::star::io::IOException ); //------------------------------------------------------------------------- /** loads document properties from an ODF package or an OLE container. - <p> - For compatibility reasons this method also supports the import from - former StarOffice binary file formats. - </p> @param URL the URL of the source document @@ -389,16 +382,13 @@ interface XDocumentProperties if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when trying to open a stream in the given storage - @throws com::sun::star::uno::Exception - in various unspecified circumstances */ void loadFromMedium( [in] string URL, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::io::WrongFormatException, com::sun::star::lang::WrappedTargetException, - com::sun::star::io::IOException, - com::sun::star::uno::Exception ); + com::sun::star::io::IOException ); //------------------------------------------------------------------------- /** stores document properties to an ODF package. @@ -428,23 +418,16 @@ interface XDocumentProperties if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when writing to the storage - @throws com::sun::star::uno::Exception - in various unspecified circumstances */ void storeToStorage( [in] com::sun::star::embed::XStorage Storage, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::WrappedTargetException, - com::sun::star::io::IOException, - com::sun::star::uno::Exception ); + com::sun::star::io::IOException ); //------------------------------------------------------------------------- /** stores document properties to an ODF package or an OLE container. - <p> - For compatibility reasons this method also supports the export to former - StarOffice binary file formats. - </p> @param URL the URL of the target document @@ -462,15 +445,12 @@ interface XDocumentProperties if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when writing to the storage - @throws com::sun::star::uno::Exception - in various unspecified circumstances */ void storeToMedium( [in] string URL, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::lang::WrappedTargetException, - com::sun::star::io::IOException, - com::sun::star::uno::Exception ); + com::sun::star::io::IOException ); }; //============================================================================= diff --git a/offapi/com/sun/star/document/XDocumentPropertiesSupplier.idl b/offapi/com/sun/star/document/XDocumentPropertiesSupplier.idl index 52fa61aa5f12..811513d7a026 100644 --- a/offapi/com/sun/star/document/XDocumentPropertiesSupplier.idl +++ b/offapi/com/sun/star/document/XDocumentPropertiesSupplier.idl @@ -52,7 +52,7 @@ module com { module sun { module star { module document { @see XDocumentProperties @see DocumentProperties */ -interface XDocumentPropertiesSupplier +published interface XDocumentPropertiesSupplier { //------------------------------------------------------------------------- /** provides the document properties object. diff --git a/offapi/com/sun/star/drawing/framework/XResourceFactory.idl b/offapi/com/sun/star/drawing/framework/XResourceFactory.idl index 5e0286128999..4bb8b09bc8ad 100644 --- a/offapi/com/sun/star/drawing/framework/XResourceFactory.idl +++ b/offapi/com/sun/star/drawing/framework/XResourceFactory.idl @@ -31,6 +31,12 @@ #ifndef __com_sun_star_uno_XInterface_idl__ #include <com/sun/star/uno/XInterface.idl> #endif +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_lang_WrappedTargetException_idl__ +#include <com/sun/star/lang/WrappedTargetException.idl> +#endif module com { module sun { module star { module drawing { module framework { @@ -65,7 +71,10 @@ interface XResourceFactory when the given URL is not supported by the factory. */ XResource createResource ( - [in] XResourceId xResourceId); + [in] XResourceId xResourceId) + raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException + ); /** Call this method to tell a factory that the given resource is no longer in use. The factory can decide whether to destroy the diff --git a/offapi/com/sun/star/drawing/framework/XView.idl b/offapi/com/sun/star/drawing/framework/XView.idl index 8e07eb27f0f6..c773cd903a00 100644 --- a/offapi/com/sun/star/drawing/framework/XView.idl +++ b/offapi/com/sun/star/drawing/framework/XView.idl @@ -45,8 +45,6 @@ module com { module sun { module star { module drawing { module framework { view is. It just needs to identify view objects and a typesafe way to reference them.</p> <p>The URL prefix of views is <code>private:resource/view</code></p> - @see XViewController - @see XViewFactory */ interface XView { diff --git a/offapi/com/sun/star/embed/Actions.idl b/offapi/com/sun/star/embed/Actions.idl index a65766a4ed79..48ad78eb0ab2 100644 --- a/offapi/com/sun/star/embed/Actions.idl +++ b/offapi/com/sun/star/embed/Actions.idl @@ -35,7 +35,7 @@ module com { module sun { module star { module embed { /** This constant set contains possible actions that could be approved by <type>ActionsApproval</type> implementation. */ -constants Actions +published constants Actions { //------------------------------------------------------------------------ /** "Prevent Close" - throws veto excetion if target object is going to diff --git a/offapi/com/sun/star/embed/Aspects.idl b/offapi/com/sun/star/embed/Aspects.idl index 3b0d13ba50c8..28431b60f87e 100644 --- a/offapi/com/sun/star/embed/Aspects.idl +++ b/offapi/com/sun/star/embed/Aspects.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module embed { @see XEmbeddedObject */ -constants Aspects +published constants Aspects { // MS OLE aspects diff --git a/offapi/com/sun/star/embed/BaseStorage.idl b/offapi/com/sun/star/embed/BaseStorage.idl index 776e9b992cbe..81df39792b75 100644 --- a/offapi/com/sun/star/embed/BaseStorage.idl +++ b/offapi/com/sun/star/embed/BaseStorage.idl @@ -44,7 +44,7 @@ //============================================================================ /** This is a service that allows to get access to a storage hierarchy. */ -service BaseStorage +published service BaseStorage { // ----------------------------------------------------------------------- /** This is a general interface representing storage functionality. diff --git a/offapi/com/sun/star/embed/DocumentCloser.idl b/offapi/com/sun/star/embed/DocumentCloser.idl index 89c020c8caa6..9b0eaf617527 100644 --- a/offapi/com/sun/star/embed/DocumentCloser.idl +++ b/offapi/com/sun/star/embed/DocumentCloser.idl @@ -65,7 +65,7 @@ module com { module sun { module star { module embed { from the container system window. </p> */ -service DocumentCloser : com::sun::star::lang::XComponent +published service DocumentCloser : com::sun::star::lang::XComponent { /** is used to initialize the object on it's creation. diff --git a/offapi/com/sun/star/embed/ElementModes.idl b/offapi/com/sun/star/embed/ElementModes.idl index d579c7f67be3..314036fd45ec 100644 --- a/offapi/com/sun/star/embed/ElementModes.idl +++ b/offapi/com/sun/star/embed/ElementModes.idl @@ -43,7 +43,7 @@ module com { module sun { module star { module embed { @see <type>XStorage</type> */ -constants ElementModes +published constants ElementModes { //------------------------------------------------------------------------ /** specifies opening of an element for reading. diff --git a/offapi/com/sun/star/embed/EmbedMapUnits.idl b/offapi/com/sun/star/embed/EmbedMapUnits.idl index 7888eea876b7..ff8a3cebada5 100644 --- a/offapi/com/sun/star/embed/EmbedMapUnits.idl +++ b/offapi/com/sun/star/embed/EmbedMapUnits.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module embed { @see XVisualObject */ -constants EmbedMapUnits +published constants EmbedMapUnits { // ---------------------------------------------------------------------- /** In this type of map mode one logical point is equal to one-hundredth diff --git a/offapi/com/sun/star/embed/EmbedMisc.idl b/offapi/com/sun/star/embed/EmbedMisc.idl index 1fa8204a44b0..a1e05224b00b 100644 --- a/offapi/com/sun/star/embed/EmbedMisc.idl +++ b/offapi/com/sun/star/embed/EmbedMisc.idl @@ -47,7 +47,7 @@ module com { module sun { module star { module embed { @see XEmbeddedObject */ -constants EmbedMisc +published constants EmbedMisc { // analog of the MS OLEMISC enum diff --git a/offapi/com/sun/star/embed/EmbedStates.idl b/offapi/com/sun/star/embed/EmbedStates.idl index 3f63bec2e607..df94cfa045a5 100644 --- a/offapi/com/sun/star/embed/EmbedStates.idl +++ b/offapi/com/sun/star/embed/EmbedStates.idl @@ -36,7 +36,7 @@ module com { module sun { module star { module embed { /** This constant set contains possible states for <type>EmbeddedObject</type>. */ -constants EmbedStates +published constants EmbedStates { //------------------------------------------------------------------------ /** "Loaded" - the persistent representation of the object is loaded in diff --git a/offapi/com/sun/star/embed/EmbedUpdateModes.idl b/offapi/com/sun/star/embed/EmbedUpdateModes.idl index 17213598d92a..9060aa965909 100644 --- a/offapi/com/sun/star/embed/EmbedUpdateModes.idl +++ b/offapi/com/sun/star/embed/EmbedUpdateModes.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module embed { @see XEmbeddedObject */ -constants EmbedUpdateModes +published constants EmbedUpdateModes { // ----------------------------------------------------------------------- /** An object representation should be updated as often as possible. diff --git a/offapi/com/sun/star/embed/EmbedVerbs.idl b/offapi/com/sun/star/embed/EmbedVerbs.idl index cc92013b83d5..5d34fb1e8153 100644 --- a/offapi/com/sun/star/embed/EmbedVerbs.idl +++ b/offapi/com/sun/star/embed/EmbedVerbs.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module embed { @see XEmbeddedObject */ -constants EmbedVerbs +published constants EmbedVerbs { //------------------------------------------------------------------------ /** lets the object do default activation, as by doubleclick. diff --git a/offapi/com/sun/star/embed/EmbeddedObjectDescriptor.idl b/offapi/com/sun/star/embed/EmbeddedObjectDescriptor.idl index 733db10e61b1..5a47c8f8fafc 100644 --- a/offapi/com/sun/star/embed/EmbeddedObjectDescriptor.idl +++ b/offapi/com/sun/star/embed/EmbeddedObjectDescriptor.idl @@ -71,7 +71,7 @@ module com { module sun { module star { module embed { @see com::sun::star::beans::PropertyValue */ -service EmbeddedObjectDescriptor +published service EmbeddedObjectDescriptor { //------------------------------------------------------------------------ /** lets the graphical representation of embedded document be stored. diff --git a/offapi/com/sun/star/embed/EntryInitModes.idl b/offapi/com/sun/star/embed/EntryInitModes.idl index 2517670dacf9..ae67192d323a 100644 --- a/offapi/com/sun/star/embed/EntryInitModes.idl +++ b/offapi/com/sun/star/embed/EntryInitModes.idl @@ -38,7 +38,7 @@ module com { module sun { module star { module embed { @see XEmbedPersist */ -constants EntryInitModes +published constants EntryInitModes { // ----------------------------------------------------------------------- /** In case object persistance is created based on existing entry, diff --git a/offapi/com/sun/star/embed/FileSystemStorage.idl b/offapi/com/sun/star/embed/FileSystemStorage.idl index 76d07e3f9aeb..2b4d7d456751 100644 --- a/offapi/com/sun/star/embed/FileSystemStorage.idl +++ b/offapi/com/sun/star/embed/FileSystemStorage.idl @@ -40,7 +40,7 @@ /** This is a service that allows to get access to a file system folder using storage hierarchy. */ -service FileSystemStorage +published service FileSystemStorage { // ----------------------------------------------------------------------- /** This service describes the base functionality of storages. diff --git a/offapi/com/sun/star/embed/FileSystemStorageFactory.idl b/offapi/com/sun/star/embed/FileSystemStorageFactory.idl index 30f7f1fa15db..d27541d703ef 100644 --- a/offapi/com/sun/star/embed/FileSystemStorageFactory.idl +++ b/offapi/com/sun/star/embed/FileSystemStorageFactory.idl @@ -42,7 +42,7 @@ create a <type>FileSystemStorage</type> based on URL. The URL must point to a folder. */ -service FileSystemStorageFactory +published service FileSystemStorageFactory { // ---------------------------------------------------------------------- /** A storage can be created through this interface. diff --git a/offapi/com/sun/star/embed/InsertedObjectInfo.idl b/offapi/com/sun/star/embed/InsertedObjectInfo.idl index a07529ee34cc..dedfabb75a8f 100644 --- a/offapi/com/sun/star/embed/InsertedObjectInfo.idl +++ b/offapi/com/sun/star/embed/InsertedObjectInfo.idl @@ -43,7 +43,7 @@ /** is intended to provide result of creation of an embedded object by dialog. */ -struct InsertedObjectInfo +published struct InsertedObjectInfo { //------------------------------------------------------------------------- /** The new created embedded object. diff --git a/offapi/com/sun/star/embed/InstanceLocker.idl b/offapi/com/sun/star/embed/InstanceLocker.idl index 15716cc4fceb..3258dc3b9365 100644 --- a/offapi/com/sun/star/embed/InstanceLocker.idl +++ b/offapi/com/sun/star/embed/InstanceLocker.idl @@ -57,7 +57,7 @@ module com { module sun { module star { module embed { the listener throw related veto exception until the service is disposed. </p> */ -service InstanceLocker : com::sun::star::lang::XComponent +published service InstanceLocker : com::sun::star::lang::XComponent { /** is used to initialize the object on it's creation. diff --git a/offapi/com/sun/star/embed/InvalidStorageException.idl b/offapi/com/sun/star/embed/InvalidStorageException.idl index a8eeb067d237..f4eabfb8908e 100644 --- a/offapi/com/sun/star/embed/InvalidStorageException.idl +++ b/offapi/com/sun/star/embed/InvalidStorageException.idl @@ -44,7 +44,7 @@ For example in case it is broken one. </p> */ -exception InvalidStorageException: com::sun::star::io::IOException +published exception InvalidStorageException: com::sun::star::io::IOException { }; diff --git a/offapi/com/sun/star/embed/LinkageMisuseException.idl b/offapi/com/sun/star/embed/LinkageMisuseException.idl index 769938f9ccba..fec43851a373 100644 --- a/offapi/com/sun/star/embed/LinkageMisuseException.idl +++ b/offapi/com/sun/star/embed/LinkageMisuseException.idl @@ -44,7 +44,7 @@ Or if embedded object is misused as a linked object. </p> */ -exception LinkageMisuseException: com::sun::star::uno::Exception +published exception LinkageMisuseException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/embed/NeedsRunningStateException.idl b/offapi/com/sun/star/embed/NeedsRunningStateException.idl index 4c5149e36454..8853049ab64f 100644 --- a/offapi/com/sun/star/embed/NeedsRunningStateException.idl +++ b/offapi/com/sun/star/embed/NeedsRunningStateException.idl @@ -47,7 +47,7 @@ addition to the loaded state. Other states and possible verbs can be detected only after object is switched to running state. */ -exception NeedsRunningStateException: WrongStateException +published exception NeedsRunningStateException: WrongStateException { }; diff --git a/offapi/com/sun/star/embed/NoVisualAreaSizeException.idl b/offapi/com/sun/star/embed/NoVisualAreaSizeException.idl index 9262e9f0ee31..c5f8e5935b46 100644 --- a/offapi/com/sun/star/embed/NoVisualAreaSizeException.idl +++ b/offapi/com/sun/star/embed/NoVisualAreaSizeException.idl @@ -41,7 +41,7 @@ /** This exception can be thrown in case the object can not provide own visual area currently. */ -exception NoVisualAreaSizeException: com::sun::star::uno::Exception +published exception NoVisualAreaSizeException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/embed/OLESimpleStorage.idl b/offapi/com/sun/star/embed/OLESimpleStorage.idl index d83078dfb315..8aa4630acd6b 100644 --- a/offapi/com/sun/star/embed/OLESimpleStorage.idl +++ b/offapi/com/sun/star/embed/OLESimpleStorage.idl @@ -45,7 +45,7 @@ module com { module sun { module star { module embed { /** This service provides a simple functionality to allow read/write the storages in OLE storage format. */ -service OLESimpleStorage: XOLESimpleStorage +published service OLESimpleStorage: XOLESimpleStorage { // CONSTRUCTORS ---------------------------------------------------------- /** is used to initialize the object on it's creation. diff --git a/offapi/com/sun/star/embed/ObjectSaveVetoException.idl b/offapi/com/sun/star/embed/ObjectSaveVetoException.idl index cd75d9c0eb94..3d0252e912fe 100644 --- a/offapi/com/sun/star/embed/ObjectSaveVetoException.idl +++ b/offapi/com/sun/star/embed/ObjectSaveVetoException.idl @@ -43,7 +43,7 @@ @see XEmbeddedClient */ -exception ObjectSaveVetoException: com::sun::star::uno::Exception +published exception ObjectSaveVetoException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/embed/StateChangeInProgressException.idl b/offapi/com/sun/star/embed/StateChangeInProgressException.idl index fe6e50f221b9..648e839383ba 100644 --- a/offapi/com/sun/star/embed/StateChangeInProgressException.idl +++ b/offapi/com/sun/star/embed/StateChangeInProgressException.idl @@ -42,7 +42,7 @@ to call requested functionality currently because the object is changing state. */ -exception StateChangeInProgressException: com::sun::star::embed::WrongStateException +published exception StateChangeInProgressException: com::sun::star::embed::WrongStateException { //------------------------------------------------------------------------ /** contains the target state the object tries to reach currently. diff --git a/offapi/com/sun/star/embed/Storage.idl b/offapi/com/sun/star/embed/Storage.idl index 93709d335b2b..d34d736cf5cb 100644 --- a/offapi/com/sun/star/embed/Storage.idl +++ b/offapi/com/sun/star/embed/Storage.idl @@ -75,7 +75,7 @@ of a parent storage. </p> */ -service Storage +published service Storage { // ----------------------------------------------------------------------- /** This service describes the base functionality of storages. diff --git a/offapi/com/sun/star/embed/StorageFactory.idl b/offapi/com/sun/star/embed/StorageFactory.idl index 0f653069f07e..4b4b40d01a4c 100644 --- a/offapi/com/sun/star/embed/StorageFactory.idl +++ b/offapi/com/sun/star/embed/StorageFactory.idl @@ -41,7 +41,7 @@ /** The <type>StorageFactory</type> is a service that allows to create a storage based on either stream or URL. */ -service StorageFactory +published service StorageFactory { // ---------------------------------------------------------------------- /** A storage can be created through this interface. @@ -82,13 +82,22 @@ service StorageFactory <dt>parameter 3</dt> <dd> - allowes to provide + this paramenter represents + <type scope="com::sun::star::uno">Any</type> + containing a sequence of + <type scope="com::sun::star::beans">PropertyValue</type>.<br> + The parameter can contain entries from <type scope="com::sun::star::document">MediaDescryptor</type> - to the storage so some parts can be used for + to transport some document info during the storage initialization, it can be for example <type scope="com::sun::star::task">XInteractionHandler</type> implementation, password for the storage and repair - package flag. + package flag.<br> + Additionaly the parameter might contain property with the name + "StorageFormat" that can take values from + <type scope="com::sun::star::embed">StorageFormats</type>. + If the property is not provided a storage of package format + is created. </dd> </dl> diff --git a/cppu/test/EnvStack_tester/EnvStack.tester.hxx b/offapi/com/sun/star/embed/StorageFormats.idl index 1500ffe4723f..128fb1190b15 100644 --- a/cppu/test/EnvStack_tester/EnvStack.tester.hxx +++ b/offapi/com/sun/star/embed/StorageFormats.idl @@ -24,38 +24,42 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef __com_sun_star_embed_StorageFormats_idl__ +#define __com_sun_star_embed_StorageFormats_idl__ -#ifndef INCLUDED_cppu_test_EnvStack_tester_hxx -#define INCLUDED_cppu_test_EnvStack_tester_hxx -#include "uno/environment.hxx" +//============================================================================ +module com { module sun { module star { module embed { -#ifdef CPPU_test_EnvStack_tester_IMPL -# define CPPU_test_EnvStack_tester_EXPORT SAL_DLLPUBLIC_EXPORT +//============================================================================ +/** The constant set contains IDs of formats that are supported by + <type>StorageFactory</type>. -#elif defined(CPPU_test_EnvStack_Test_LIB) -# define CPPU_test_EnvStack_tester_EXPORT extern + @see <type>StorageFactory</type> + @since OOo 3.3 +*/ +published constants StorageFormats +{ + //------------------------------------------------------------------------ + /** specifies package format + */ + const long PACKAGE = 1; -#elif defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE) -# define CPPU_test_EnvStack_tester_EXPORT extern __attribute__ ((weak)) + //------------------------------------------------------------------------ + /** specifies zip format + */ + const long ZIP = 2; -#elif defined(__SUNPRO_CC) -# define CPPU_test_EnvStack_tester_EXPORT extern - extern rtl::OUString g_commentStack; - extern com::sun::star::uno::Environment g_env; + //------------------------------------------------------------------------ + /** specifies Office Open XML format + */ + const long OFOPXML = 3; +}; -# pragma weak g_commentStack -# pragma weak g_env +//============================================================================ -#else -# define CPPU_test_EnvStack_tester_EXPORT SAL_DLLPUBLIC_IMPORT +}; }; }; }; #endif -CPPU_test_EnvStack_tester_EXPORT rtl::OUString g_commentStack; -CPPU_test_EnvStack_tester_EXPORT com::sun::star::uno::Environment g_env; - - - -#endif diff --git a/offapi/com/sun/star/embed/StorageStream.idl b/offapi/com/sun/star/embed/StorageStream.idl index eb08391619dd..1fb6733605f0 100644 --- a/offapi/com/sun/star/embed/StorageStream.idl +++ b/offapi/com/sun/star/embed/StorageStream.idl @@ -64,7 +64,7 @@ of the stream can exist. </p> */ -service StorageStream +published service StorageStream { // ----------------------------------------------------------------------- /** allows to get access to <type scope="com::sun::star::io">XInputStream</type> diff --git a/offapi/com/sun/star/embed/StorageWrappedTargetException.idl b/offapi/com/sun/star/embed/StorageWrappedTargetException.idl index 038d2fb9194f..aed449eb90a1 100644 --- a/offapi/com/sun/star/embed/StorageWrappedTargetException.idl +++ b/offapi/com/sun/star/embed/StorageWrappedTargetException.idl @@ -41,7 +41,7 @@ /** This exception can wrap an exception thrown during <type>XStorage</type> methods execution. */ -exception StorageWrappedTargetException: com::sun::star::lang::WrappedTargetException +published exception StorageWrappedTargetException: com::sun::star::lang::WrappedTargetException { }; diff --git a/offapi/com/sun/star/embed/UnreachableStateException.idl b/offapi/com/sun/star/embed/UnreachableStateException.idl index e0347b7894e5..be53beda3bc3 100644 --- a/offapi/com/sun/star/embed/UnreachableStateException.idl +++ b/offapi/com/sun/star/embed/UnreachableStateException.idl @@ -40,7 +40,7 @@ /** This exception can be thrown in case specified state can not be reached. */ -exception UnreachableStateException: com::sun::star::uno::Exception +published exception UnreachableStateException: com::sun::star::uno::Exception { // ----------------------------------------------------------------------- /** The current state of the object. diff --git a/offapi/com/sun/star/embed/UseBackupException.idl b/offapi/com/sun/star/embed/UseBackupException.idl index 34c19b6b59ec..e7d74d30f52c 100644 --- a/offapi/com/sun/star/embed/UseBackupException.idl +++ b/offapi/com/sun/star/embed/UseBackupException.idl @@ -51,7 +51,7 @@ internally, and can be used as a temporary storage usually used. </p> */ -exception UseBackupException: com::sun::star::io::IOException +published exception UseBackupException: com::sun::star::io::IOException { /** The URL of the temporary file the storage is based on now. */ diff --git a/offapi/com/sun/star/embed/VerbAttributes.idl b/offapi/com/sun/star/embed/VerbAttributes.idl index f8ee208831c5..742e782eb5c9 100644 --- a/offapi/com/sun/star/embed/VerbAttributes.idl +++ b/offapi/com/sun/star/embed/VerbAttributes.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module embed { @see VerbDescriptor */ -constants VerbAttributes +published constants VerbAttributes { // ----------------------------------------------------------------------- /** Execution of the verb with this attribute must not modify the diff --git a/offapi/com/sun/star/embed/VerbDescriptor.idl b/offapi/com/sun/star/embed/VerbDescriptor.idl index c286e1ef23d0..f213c5969952 100644 --- a/offapi/com/sun/star/embed/VerbDescriptor.idl +++ b/offapi/com/sun/star/embed/VerbDescriptor.idl @@ -36,7 +36,7 @@ /** describes a verb. */ -struct VerbDescriptor +published struct VerbDescriptor { //------------------------------------------------------------------------ /** specifies the id of the verb. diff --git a/offapi/com/sun/star/embed/VisualRepresentation.idl b/offapi/com/sun/star/embed/VisualRepresentation.idl index d41c9acfbe3f..8d07575008bb 100644 --- a/offapi/com/sun/star/embed/VisualRepresentation.idl +++ b/offapi/com/sun/star/embed/VisualRepresentation.idl @@ -39,7 +39,7 @@ /** can contain a graphical representation in an arbitrary format. */ -struct VisualRepresentation +published struct VisualRepresentation { //------------------------------------------------------------------------- /** The format of the visual representation. diff --git a/offapi/com/sun/star/embed/WrongStateException.idl b/offapi/com/sun/star/embed/WrongStateException.idl index f7a2a31d9058..809389c3a1fa 100644 --- a/offapi/com/sun/star/embed/WrongStateException.idl +++ b/offapi/com/sun/star/embed/WrongStateException.idl @@ -41,7 +41,7 @@ /** This exception can be thrown in case the object's state does not allow to call requested functionality. */ -exception WrongStateException: com::sun::star::uno::Exception +published exception WrongStateException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/embed/XActionsApproval.idl b/offapi/com/sun/star/embed/XActionsApproval.idl index 904ae103101a..d3b64367a97b 100644 --- a/offapi/com/sun/star/embed/XActionsApproval.idl +++ b/offapi/com/sun/star/embed/XActionsApproval.idl @@ -44,7 +44,7 @@ possible actions must be documented in documentation of the object. </p> */ -interface XActionsApproval: com::sun::star::uno::XInterface +published interface XActionsApproval: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** requests an approval for the specified action. diff --git a/offapi/com/sun/star/embed/XClassifiedObject.idl b/offapi/com/sun/star/embed/XClassifiedObject.idl index 37ca9249cb30..2cde70fa8566 100644 --- a/offapi/com/sun/star/embed/XClassifiedObject.idl +++ b/offapi/com/sun/star/embed/XClassifiedObject.idl @@ -43,7 +43,7 @@ //============================================================================ /** represents common functionality for embedded objects */ -interface XClassifiedObject: com::sun::star::uno::XInterface +published interface XClassifiedObject: com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** retrieves class ID of the object. diff --git a/offapi/com/sun/star/embed/XCommonEmbedPersist.idl b/offapi/com/sun/star/embed/XCommonEmbedPersist.idl index 2f07ce1e3015..8b82c44965e0 100644 --- a/offapi/com/sun/star/embed/XCommonEmbedPersist.idl +++ b/offapi/com/sun/star/embed/XCommonEmbedPersist.idl @@ -59,7 +59,7 @@ /** specifies common implementation for embedded objects and links persistence. */ -interface XCommonEmbedPersist: com::sun::star::uno::XInterface +published interface XCommonEmbedPersist: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** lets the object or the link store itself. diff --git a/offapi/com/sun/star/embed/XComponentSupplier.idl b/offapi/com/sun/star/embed/XComponentSupplier.idl index de1044bd2901..548b5aa24510 100644 --- a/offapi/com/sun/star/embed/XComponentSupplier.idl +++ b/offapi/com/sun/star/embed/XComponentSupplier.idl @@ -38,7 +38,7 @@ //============================================================================= /** provides access to a component. */ -interface XComponentSupplier: com::sun::star::uno::XInterface +published interface XComponentSupplier: com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** allows to get access to a component. diff --git a/offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl b/offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl index b0e3c68b512c..45f3aef06cd6 100644 --- a/offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl +++ b/offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl @@ -67,7 +67,7 @@ an embedded object based on system clipboard. </p> */ -interface XEmbedObjectClipboardCreator: com::sun::star::uno::XInterface +published interface XEmbedObjectClipboardCreator: com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** creates a new object and initializes it from the system clipboard. diff --git a/offapi/com/sun/star/embed/XEmbedObjectCreator.idl b/offapi/com/sun/star/embed/XEmbedObjectCreator.idl index 09227bd26aa0..a214851922ad 100644 --- a/offapi/com/sun/star/embed/XEmbedObjectCreator.idl +++ b/offapi/com/sun/star/embed/XEmbedObjectCreator.idl @@ -63,7 +63,7 @@ an embedded object. </p> */ -interface XEmbedObjectCreator: com::sun::star::uno::XInterface +published interface XEmbedObjectCreator: com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** creates a new object and initializes it as a new one. diff --git a/offapi/com/sun/star/embed/XEmbedObjectFactory.idl b/offapi/com/sun/star/embed/XEmbedObjectFactory.idl index f5b73f1d3dc3..67a355054c48 100644 --- a/offapi/com/sun/star/embed/XEmbedObjectFactory.idl +++ b/offapi/com/sun/star/embed/XEmbedObjectFactory.idl @@ -61,7 +61,7 @@ This interface provides user with full control over object creation. </p> */ -interface XEmbedObjectFactory: com::sun::star::uno::XInterface +published interface XEmbedObjectFactory: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** creates a new object and transport parameters for persistent diff --git a/offapi/com/sun/star/embed/XEmbedPersist.idl b/offapi/com/sun/star/embed/XEmbedPersist.idl index 6eaf57c21a18..73f807188ba6 100644 --- a/offapi/com/sun/star/embed/XEmbedPersist.idl +++ b/offapi/com/sun/star/embed/XEmbedPersist.idl @@ -67,7 +67,7 @@ representation. </p> */ -interface XEmbedPersist: XCommonEmbedPersist +published interface XEmbedPersist: XCommonEmbedPersist { //------------------------------------------------------------------------ /** provides object with a parent storage and a name for object's entry. diff --git a/offapi/com/sun/star/embed/XEmbeddedClient.idl b/offapi/com/sun/star/embed/XEmbeddedClient.idl index 1704f719287a..f361ea2d8653 100644 --- a/offapi/com/sun/star/embed/XEmbeddedClient.idl +++ b/offapi/com/sun/star/embed/XEmbeddedClient.idl @@ -52,7 +52,7 @@ //============================================================================ /** represents common functionality for embedded clients. */ -interface XEmbeddedClient: XComponentSupplier +published interface XEmbeddedClient: XComponentSupplier { //------------------------------------------------------------------------ /** asks client to let the object store itself. diff --git a/offapi/com/sun/star/embed/XEmbeddedObject.idl b/offapi/com/sun/star/embed/XEmbeddedObject.idl index 37de00b0221f..e0368736279f 100644 --- a/offapi/com/sun/star/embed/XEmbeddedObject.idl +++ b/offapi/com/sun/star/embed/XEmbeddedObject.idl @@ -92,7 +92,7 @@ //============================================================================ /** represents common functionality for embedded objects. */ -interface XEmbeddedObject +published interface XEmbeddedObject { // INTERFACES // diff --git a/offapi/com/sun/star/embed/XEncryptionProtectedSource.idl b/offapi/com/sun/star/embed/XEncryptionProtectedSource.idl index 1bcb03110a3b..9a71b99e871b 100644 --- a/offapi/com/sun/star/embed/XEncryptionProtectedSource.idl +++ b/offapi/com/sun/star/embed/XEncryptionProtectedSource.idl @@ -42,7 +42,7 @@ //============================================================================ /** This interface allows to set a password for an object. */ -interface XEncryptionProtectedSource: com::sun::star::uno::XInterface +published interface XEncryptionProtectedSource: com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** sets a password for the object. diff --git a/offapi/com/sun/star/embed/XExtendedStorageStream.idl b/offapi/com/sun/star/embed/XExtendedStorageStream.idl index e061c74c7337..397358db57ec 100644 --- a/offapi/com/sun/star/embed/XExtendedStorageStream.idl +++ b/offapi/com/sun/star/embed/XExtendedStorageStream.idl @@ -63,7 +63,7 @@ /** This interface allows access to an extended storage stream that might be transacted. */ -interface XExtendedStorageStream +published interface XExtendedStorageStream { // INTERFACES // diff --git a/offapi/com/sun/star/embed/XHatchWindow.idl b/offapi/com/sun/star/embed/XHatchWindow.idl index 735a556ab0f5..33733958f6cd 100644 --- a/offapi/com/sun/star/embed/XHatchWindow.idl +++ b/offapi/com/sun/star/embed/XHatchWindow.idl @@ -56,7 +56,7 @@ Thus the window can not resize/move itself. </p> */ -interface XHatchWindow: com::sun::star::lang::XComponent +published interface XHatchWindow: com::sun::star::lang::XComponent { //------------------------------------------------------------------------ /** sets the object that will control resizing/moving, if the object is diff --git a/offapi/com/sun/star/embed/XHatchWindowController.idl b/offapi/com/sun/star/embed/XHatchWindowController.idl index d4158db605fc..7ec2e0c5a5bb 100644 --- a/offapi/com/sun/star/embed/XHatchWindowController.idl +++ b/offapi/com/sun/star/embed/XHatchWindowController.idl @@ -49,7 +49,7 @@ rectangle size. </p> */ -interface XHatchWindowController: com::sun::star::uno::XInterface +published interface XHatchWindowController: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** requests window owner to resize/move the window. diff --git a/offapi/com/sun/star/embed/XHatchWindowFactory.idl b/offapi/com/sun/star/embed/XHatchWindowFactory.idl index 5f6ebf5d5998..79d8db04832d 100644 --- a/offapi/com/sun/star/embed/XHatchWindowFactory.idl +++ b/offapi/com/sun/star/embed/XHatchWindowFactory.idl @@ -55,7 +55,7 @@ /** creates a hatch window implementation. */ -interface XHatchWindowFactory: com::sun::star::uno::XInterface +published interface XHatchWindowFactory: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** creates a new hatch window instance. diff --git a/offapi/com/sun/star/embed/XHierarchicalStorageAccess.idl b/offapi/com/sun/star/embed/XHierarchicalStorageAccess.idl index d3a05b0b9de5..1f2cdcf132f9 100644 --- a/offapi/com/sun/star/embed/XHierarchicalStorageAccess.idl +++ b/offapi/com/sun/star/embed/XHierarchicalStorageAccess.idl @@ -95,7 +95,7 @@ opened ( it is locked by hierarchical access ). </p> */ -interface XHierarchicalStorageAccess +published interface XHierarchicalStorageAccess { // METHODS // diff --git a/offapi/com/sun/star/embed/XInplaceObject.idl b/offapi/com/sun/star/embed/XInplaceObject.idl index 53462a78fe88..3ca6bdf359fb 100644 --- a/offapi/com/sun/star/embed/XInplaceObject.idl +++ b/offapi/com/sun/star/embed/XInplaceObject.idl @@ -52,7 +52,7 @@ //============================================================================ /** represents common functionality for inplace embedded objects. */ -interface XInplaceObject: com::sun::star::uno::XInterface +published interface XInplaceObject: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** sets the visible part of the inplace object. diff --git a/offapi/com/sun/star/embed/XInsertObjectDialog.idl b/offapi/com/sun/star/embed/XInsertObjectDialog.idl index 84ee0816ea8d..7b98a1c767a2 100644 --- a/offapi/com/sun/star/embed/XInsertObjectDialog.idl +++ b/offapi/com/sun/star/embed/XInsertObjectDialog.idl @@ -62,7 +62,7 @@ //============================================================================= /** allows to create and initialize a new embedded object using GUI dialog. */ -interface XInsertObjectDialog: com::sun::star::uno::XInterface +published interface XInsertObjectDialog: com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** creates a new object using GUI dialog. diff --git a/offapi/com/sun/star/embed/XLinkCreator.idl b/offapi/com/sun/star/embed/XLinkCreator.idl index 676d112848c9..be4bbe613288 100644 --- a/offapi/com/sun/star/embed/XLinkCreator.idl +++ b/offapi/com/sun/star/embed/XLinkCreator.idl @@ -62,7 +62,7 @@ it will be detected. </p> */ -interface XLinkCreator: com::sun::star::uno::XInterface +published interface XLinkCreator: com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** creates a new object based on diff --git a/offapi/com/sun/star/embed/XLinkFactory.idl b/offapi/com/sun/star/embed/XLinkFactory.idl index 73cd218d35ca..cd77fbfe0dbb 100644 --- a/offapi/com/sun/star/embed/XLinkFactory.idl +++ b/offapi/com/sun/star/embed/XLinkFactory.idl @@ -58,7 +58,7 @@ //============================================================================ /** allows to create and initialize a new link of specified type. */ -interface XLinkFactory: com::sun::star::uno::XInterface +published interface XLinkFactory: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** creates a new link and transport parameters for persistent diff --git a/offapi/com/sun/star/embed/XLinkageSupport.idl b/offapi/com/sun/star/embed/XLinkageSupport.idl index eb321989d182..a4a53c36e7a8 100644 --- a/offapi/com/sun/star/embed/XLinkageSupport.idl +++ b/offapi/com/sun/star/embed/XLinkageSupport.idl @@ -54,7 +54,7 @@ //============================================================================ /** specifies an additional implementation for linked embedded object support. */ -interface XLinkageSupport: XCommonEmbedPersist +published interface XLinkageSupport: XCommonEmbedPersist { //------------------------------------------------------------------------ /** breaks the link and provides the object with a parent storage and a diff --git a/offapi/com/sun/star/embed/XOLESimpleStorage.idl b/offapi/com/sun/star/embed/XOLESimpleStorage.idl index 9f8b19573953..ac39370e8a8f 100644 --- a/offapi/com/sun/star/embed/XOLESimpleStorage.idl +++ b/offapi/com/sun/star/embed/XOLESimpleStorage.idl @@ -58,7 +58,7 @@ module com { module sun { module star { module embed { subcomponents are either OLE storages themself or streams. </p> */ -interface XOLESimpleStorage +published interface XOLESimpleStorage { //INTERFACES // diff --git a/offapi/com/sun/star/embed/XOptimizedStorage.idl b/offapi/com/sun/star/embed/XOptimizedStorage.idl index e43a63bb6586..d51371fadfbb 100644 --- a/offapi/com/sun/star/embed/XOptimizedStorage.idl +++ b/offapi/com/sun/star/embed/XOptimizedStorage.idl @@ -97,7 +97,7 @@ time and will be depricated soon! Another solution will be introduced as final one. */ -interface XOptimizedStorage +published interface XOptimizedStorage { // ----------------------------------------------------------------------- /** allows to insert a raw stream representing nonencrypted stream with diff --git a/offapi/com/sun/star/embed/XPackageStructureCreator.idl b/offapi/com/sun/star/embed/XPackageStructureCreator.idl index 193232cdfdc1..c76d4c787cc7 100644 --- a/offapi/com/sun/star/embed/XPackageStructureCreator.idl +++ b/offapi/com/sun/star/embed/XPackageStructureCreator.idl @@ -42,7 +42,7 @@ //============================================================================= /** allows to convert file system folder tree in to a package. */ -interface XPackageStructureCreator: com::sun::star::uno::XInterface +published interface XPackageStructureCreator: com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** converts file system folder tree in to a package. diff --git a/offapi/com/sun/star/embed/XPersistanceHolder.idl b/offapi/com/sun/star/embed/XPersistanceHolder.idl index f6d171218549..5528fe62e143 100644 --- a/offapi/com/sun/star/embed/XPersistanceHolder.idl +++ b/offapi/com/sun/star/embed/XPersistanceHolder.idl @@ -46,7 +46,7 @@ //============================================================================= /** allows to disconnect an object from its persistence. */ -interface XPersistanceHolder: com::sun::star::uno::XInterface +published interface XPersistanceHolder: com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** disconnects the object from the persistance. diff --git a/offapi/com/sun/star/embed/XRelationshipAccess.idl b/offapi/com/sun/star/embed/XRelationshipAccess.idl index 8a527df38a4d..3c934caf1f33 100644 --- a/offapi/com/sun/star/embed/XRelationshipAccess.idl +++ b/offapi/com/sun/star/embed/XRelationshipAccess.idl @@ -62,7 +62,7 @@ this tag is used as a uniqued identified of an entry. </p> */ -interface XRelationshipAccess : ::com::sun::star::uno::XInterface +published interface XRelationshipAccess : ::com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** allows to detect whether there is an entry with specified value of diff --git a/offapi/com/sun/star/embed/XStateChangeBroadcaster.idl b/offapi/com/sun/star/embed/XStateChangeBroadcaster.idl index e50c54c182ff..91a47e8f6288 100644 --- a/offapi/com/sun/star/embed/XStateChangeBroadcaster.idl +++ b/offapi/com/sun/star/embed/XStateChangeBroadcaster.idl @@ -44,7 +44,7 @@ module com { module sun { module star { module embed { /** broadcasts message in case embedded object object changes it's state. */ -interface XStateChangeBroadcaster: com::sun::star::uno::XInterface +published interface XStateChangeBroadcaster: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** adds the specified listener to receive events about states change diff --git a/offapi/com/sun/star/embed/XStateChangeListener.idl b/offapi/com/sun/star/embed/XStateChangeListener.idl index 13bde974ceaf..3c552de33222 100644 --- a/offapi/com/sun/star/embed/XStateChangeListener.idl +++ b/offapi/com/sun/star/embed/XStateChangeListener.idl @@ -48,7 +48,7 @@ module com { module sun { module star { module embed { /** makes it possible to receive events when an embedded object changes it's state. */ -interface XStateChangeListener: com::sun::star::lang::XEventListener +published interface XStateChangeListener: com::sun::star::lang::XEventListener { //------------------------------------------------------------------------ /** is called just before the object changes state. diff --git a/offapi/com/sun/star/embed/XStorage.idl b/offapi/com/sun/star/embed/XStorage.idl index a03190caddab..0a98cfa3e8eb 100644 --- a/offapi/com/sun/star/embed/XStorage.idl +++ b/offapi/com/sun/star/embed/XStorage.idl @@ -91,7 +91,7 @@ //============================================================================ /** This interface represents main storage functionality. */ -interface XStorage +published interface XStorage { // INTERFACES // diff --git a/offapi/com/sun/star/embed/XStorageRawAccess.idl b/offapi/com/sun/star/embed/XStorageRawAccess.idl index 64031325f628..b70b2e3c1235 100644 --- a/offapi/com/sun/star/embed/XStorageRawAccess.idl +++ b/offapi/com/sun/star/embed/XStorageRawAccess.idl @@ -79,7 +79,7 @@ //============================================================================ /** This interface represents main storage functionality. */ -interface XStorageRawAccess +published interface XStorageRawAccess { // ----------------------------------------------------------------------- /** allows to get a plain raw stream representing a package stream. diff --git a/offapi/com/sun/star/embed/XTransactedObject.idl b/offapi/com/sun/star/embed/XTransactedObject.idl index afefd0f2d2c5..80f86187a7c6 100644 --- a/offapi/com/sun/star/embed/XTransactedObject.idl +++ b/offapi/com/sun/star/embed/XTransactedObject.idl @@ -46,7 +46,7 @@ //============================================================================ /** allows transacted access to an object. */ -interface XTransactedObject: com::sun::star::uno::XInterface +published interface XTransactedObject: com::sun::star::uno::XInterface { // ----------------------------------------------------------------------- /** commits the changes made for object. diff --git a/offapi/com/sun/star/embed/XTransactionBroadcaster.idl b/offapi/com/sun/star/embed/XTransactionBroadcaster.idl index 66e62538f083..fb5b7d2acc06 100644 --- a/offapi/com/sun/star/embed/XTransactionBroadcaster.idl +++ b/offapi/com/sun/star/embed/XTransactionBroadcaster.idl @@ -44,7 +44,7 @@ module com { module sun { module star { module embed { /** broadcasts messege in case transacted object is commited or reverted. */ -interface XTransactionBroadcaster: com::sun::star::uno::XInterface +published interface XTransactionBroadcaster: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** adds the specified listener to receive events about commits and diff --git a/offapi/com/sun/star/embed/XTransactionListener.idl b/offapi/com/sun/star/embed/XTransactionListener.idl index acfa889386ca..89e80956cf11 100644 --- a/offapi/com/sun/star/embed/XTransactionListener.idl +++ b/offapi/com/sun/star/embed/XTransactionListener.idl @@ -48,7 +48,7 @@ module com { module sun { module star { module embed { /** makes it possible to receive events when a transacted object is commited or reverted. */ -interface XTransactionListener: com::sun::star::lang::XEventListener +published interface XTransactionListener: com::sun::star::lang::XEventListener { //------------------------------------------------------------------------ /** is called just before the object is commited. diff --git a/offapi/com/sun/star/embed/XTransferableSupplier.idl b/offapi/com/sun/star/embed/XTransferableSupplier.idl index 76034df05231..d22c6fb27769 100644 --- a/offapi/com/sun/star/embed/XTransferableSupplier.idl +++ b/offapi/com/sun/star/embed/XTransferableSupplier.idl @@ -40,7 +40,7 @@ <type scope="com::sun::star::datatransfer">XTransferable</type> implementation from the object. */ -interface XTransferableSupplier: com::sun::star::uno::XInterface +published interface XTransferableSupplier: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** allows to get access to diff --git a/offapi/com/sun/star/embed/XVisualObject.idl b/offapi/com/sun/star/embed/XVisualObject.idl index 62430e41778a..bed94da4fa7d 100644 --- a/offapi/com/sun/star/embed/XVisualObject.idl +++ b/offapi/com/sun/star/embed/XVisualObject.idl @@ -55,7 +55,7 @@ //============================================================================= /** represents common visualisation functionality for embedded objects. */ -interface XVisualObject: ::com::sun::star::uno::XInterface +published interface XVisualObject: ::com::sun::star::uno::XInterface { //------------------------------------------------------------------------- /** sets the size of object's visual area. diff --git a/offapi/com/sun/star/embed/XWindowSupplier.idl b/offapi/com/sun/star/embed/XWindowSupplier.idl index 3ff344ab60d9..e878a65d21d2 100644 --- a/offapi/com/sun/star/embed/XWindowSupplier.idl +++ b/offapi/com/sun/star/embed/XWindowSupplier.idl @@ -38,7 +38,7 @@ //============================================================================ /** provides access to a vcl window implementation. */ -interface XWindowSupplier: com::sun::star::uno::XInterface +published interface XWindowSupplier: com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** allows to get access to a vcl window implementation. diff --git a/offapi/com/sun/star/embed/makefile.mk b/offapi/com/sun/star/embed/makefile.mk index 404f14ceab1c..349017452ef3 100644 --- a/offapi/com/sun/star/embed/makefile.mk +++ b/offapi/com/sun/star/embed/makefile.mk @@ -57,6 +57,7 @@ IDLFILES=\ Storage.idl\ StorageStream.idl\ StorageFactory.idl\ + StorageFormats.idl\ VerbAttributes.idl\ VisualRepresentation.idl\ VerbDescriptor.idl\ diff --git a/offapi/com/sun/star/packages/NoEncryptionException.idl b/offapi/com/sun/star/packages/NoEncryptionException.idl index 5d057c91cc8f..cffecf7bd637 100644 --- a/offapi/com/sun/star/packages/NoEncryptionException.idl +++ b/offapi/com/sun/star/packages/NoEncryptionException.idl @@ -41,7 +41,7 @@ // DocMerge from xml: exception com::sun::star::packages::NoEncryptionException /** This exception can be thrown in case object is not encrypted one as expected. */ -exception NoEncryptionException: com::sun::star::uno::Exception +published exception NoEncryptionException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/packages/NoRawFormatException.idl b/offapi/com/sun/star/packages/NoRawFormatException.idl index 111b8fdcc90c..a2730b41da62 100644 --- a/offapi/com/sun/star/packages/NoRawFormatException.idl +++ b/offapi/com/sun/star/packages/NoRawFormatException.idl @@ -42,7 +42,7 @@ /** This exception can be thrown in case provided stream is not a raw stream representing encrypted package stream. */ -exception NoRawFormatException: com::sun::star::io::IOException +published exception NoRawFormatException: com::sun::star::io::IOException { }; diff --git a/offapi/com/sun/star/packages/WrongPasswordException.idl b/offapi/com/sun/star/packages/WrongPasswordException.idl index 2e014e310dfb..954e0bd68afc 100644 --- a/offapi/com/sun/star/packages/WrongPasswordException.idl +++ b/offapi/com/sun/star/packages/WrongPasswordException.idl @@ -41,7 +41,7 @@ // DocMerge from xml: exception com::sun::star::packages::WrongPasswordException /** This exception can be thrown in case wrong password was provided. */ -exception WrongPasswordException: com::sun::star::uno::Exception +published exception WrongPasswordException: com::sun::star::uno::Exception { }; diff --git a/offapi/com/sun/star/rdf/XDocumentRepository.idl b/offapi/com/sun/star/rdf/XDocumentRepository.idl index ee42faf0c51c..215fd89fa954 100644 --- a/offapi/com/sun/star/rdf/XDocumentRepository.idl +++ b/offapi/com/sun/star/rdf/XDocumentRepository.idl @@ -28,6 +28,10 @@ #ifndef __com_sun_star_rdf_XDocumentRepository_idl__ #define __com_sun_star_rdf_XDocumentRepository_idl__ +#ifndef __com_sun_star_beans_Pair_idl__ +#include <com/sun/star/beans/Pair.idl> +#endif + #ifndef __com_sun_star_rdf_XMetadatable_idl__ #include <com/sun/star/rdf/XMetadatable.idl> #endif @@ -84,13 +88,6 @@ interface XDocumentRepository : XRepository <code>Subject Predicate XLiteral(RDFaContent^^RDFaDatatype)</code> </li> </ul> - Further, add the following RDF statement to the same unspecified - named graph: - <ul> - <li> - <code>Subject rdfs:label XLiteral(Object->getText())</code> - </li> - </ul> </li> </ol> </p> @@ -172,13 +169,13 @@ interface XDocumentRepository : XRepository <li>if the element has no RDFa meta-data attributes: the empty sequence.</li> <li>if the element has RDFa meta-data attributes: - and no <code>rdfa:content</code> attached: - a sequence with the RDFa-statements corresponding to the - attributes</li> - <li>if the element has RDFa meta-data attributes, - and also <code>rdfa:content</code> attached: - a sequence with the RDFa-statements corresponding to the - attributes, including the RDFa-labels-statement</li> + <ul> + <li>a sequence with the RDFa-statements corresponding to the + attributes.</li> + <li>a flag indicating whether there is a xhtml:content + attribute.</li> + </ul> + </li> </ul> @throws com::sun::star::lang::IllegalArgumentException @@ -190,7 +187,8 @@ interface XDocumentRepository : XRepository @see Statement */ - sequence<Statement> getStatementRDFa([in] XMetadatable Element) + com::sun::star::beans::Pair< sequence<Statement>, boolean > + getStatementRDFa([in] XMetadatable Element) raises( com::sun::star::lang::IllegalArgumentException, RepositoryException ); diff --git a/offapi/com/sun/star/rendering/TexturingMode.idl b/offapi/com/sun/star/rendering/TexturingMode.idl index 9d54940b9dcf..b44a78eae6ce 100644 --- a/offapi/com/sun/star/rendering/TexturingMode.idl +++ b/offapi/com/sun/star/rendering/TexturingMode.idl @@ -36,13 +36,24 @@ module com { module sun { module star { module rendering { */ constants TexturingMode { + /** Pixel outside the texture area are fully transparent.<p> + + This completely switches off pixel generation outside the + texture coordinate range [0,1]. This results in only one + instance of the texture generated per textured primitive.<p> + */ + const byte NONE=0; + + //------------------------------------------------------------------------- + /** Clamp texture coordinate.<p> - This value clamps the texture coordinate to the range + This value clamps the texture coordinates to the range [0,1]. This results in only one instance of the texture - generated per textured primitive.<p> + generated per textured primitive, with the remaining area + filled with the color of the outermost texels<p> */ - const byte CLAMP=0; + const byte CLAMP=1; //------------------------------------------------------------------------- @@ -51,7 +62,7 @@ constants TexturingMode This value repeats the texture over the textured primitive, for the given texture coordinate.<p> */ - const byte REPEAT=1; + const byte REPEAT=2; }; }; }; }; }; diff --git a/offapi/com/sun/star/rendering/XGraphicDevice.idl b/offapi/com/sun/star/rendering/XGraphicDevice.idl index c48f7e3e184d..a9caaefede7e 100644 --- a/offapi/com/sun/star/rendering/XGraphicDevice.idl +++ b/offapi/com/sun/star/rendering/XGraphicDevice.idl @@ -45,12 +45,12 @@ #ifndef __com_sun_star_rendering_XBezierPolyPolygon2D_idl__ #include <com/sun/star/rendering/XBezierPolyPolygon2D.idl> #endif -#ifndef __com_sun_star_rendering_XParametricPolyPolygon2DFactory_idl__ -#include <com/sun/star/rendering/XParametricPolyPolygon2DFactory.idl> -#endif #ifndef __com_sun_star_rendering_XColorSpace_idl__ #include <com/sun/star/rendering/XColorSpace.idl> #endif +#ifndef __com_sun_star_lang_XMultiServiceFactory_idl__ +#include <com/sun/star/lang/XMultiServiceFactory.idl> +#endif module com { module sun { module star { module rendering { @@ -217,8 +217,67 @@ interface XGraphicDevice : ::com::sun::star::uno::XInterface this is not advisable: each canvas implementation is free to internally generate optimized parametric polygons, which can be used more directly for e.g. texturing operations. + + <pre> + Available services (all canvas implementations should provide + this minimal set, though are free to add more; just check the + getAvailableServiceNames() on the returned interface): + + - Gradients - all gradients need to support two construction + parameters, "Colors" being a <type>sequence<Color></type> + and "Stops" being a <type>sequence<double></type>. Both must + have the same length, and at least two elements. See + http://www.w3.org/TR/SVG11/pservers.html#GradientStops for + the semantics of gradient stops and colors. + Required gradient services: + + * "LinearGradient" - the gradient varies linearly between + the given colors. without coordinate system + transformation, the color interpolation happens in + increasing x direction, and is constant in y + direction. Equivalent to svg linear gradient + http://www.w3.org/TR/SVG11/pservers.html#LinearGradients + + * "EllipticalGradient" - this gradient has zeroth color + index in the middle, and varies linearly between center + and final color. The services takes an additional + parameter named "AspectRatio" of <type>double</type> + (width divided by height), if this aspect ratio is 1, the + gradient is circular. If it's not 1, the gradient is + elliptical, with the special twist that the aspect ratio + is maintained also for the center color: the gradient will + not collapse into a single point, but become a line of + center color. If "AspectRatio" is missing, or equal to 1, + this gradient yields similar results as the svg radial + gradient + http://www.w3.org/TR/SVG11/pservers.html#RadialGradients + + * "RectangularGradient" - this gradient has zeroth color + index in the middle, and varies linearly between center + and final color via rectangular boxes + around the center point. The services takes an additional + parameter named "AspectRatio" of <type>double</type> + (width divided by height), if this aspect ratio is 1, the + gradient is quadratic. If it's not 1, the gradient is + rectangular, with the special twist that the aspect ratio + is maintained also for the center color: the gradient will + not collapse into a single point, but become a line of + center color. + + - Hatch patterns - Required hatch services: + + * "VerticalLineHatch" - this hatching consists of vertical lines + * "OrthogonalLinesHatch" - this hatching consists of + crossing vertical and horizontal lines + * "ThreeCrossingLinesHatch" - this hatching consists of + vertical and horizontal lines plus diagonal lines from + left, top to bottom, right. + * "FourCrossingLinesHatch" - this hatching consists of + vertical and horizontal lines plus diagonal lines in both + directions. + </pre> */ - XParametricPolyPolygon2DFactory getParametricPolyPolygonFactory(); + com::sun::star::lang::XMultiServiceFactory getParametricPolyPolygonFactory(); //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/rendering/XParametricPolyPolygon2DFactory.idl b/offapi/com/sun/star/rendering/XParametricPolyPolygon2DFactory.idl deleted file mode 100644 index 2471849864a1..000000000000 --- a/offapi/com/sun/star/rendering/XParametricPolyPolygon2DFactory.idl +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __com_sun_star_rendering_XParametricPolyPolygon2DFactory_idl__ -#define __com_sun_star_rendering_XParametricPolyPolygon2DFactory_idl__ - -#ifndef __com_sun_star_uno_XInterface_idl__ -#include <com/sun/star/uno/XInterface.idl> -#endif -#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ -#include <com/sun/star/lang/IllegalArgumentException.idl> -#endif -#ifndef __com_sun_star_geometry_RealRectangle2D_idl__ -#include <com/sun/star/geometry/RealRectangle2D.idl> -#endif -#ifndef __com_sun_star_rendering_XColorSpace_idl__ -#include <com/sun/star/rendering/XColorSpace.idl> -#endif - - -module com { module sun { module star { module rendering { - -interface XParametricPolyPolygon2D; - -/** This interface provides factory methods to generate various - ready-made XParametricPolyPolygon2Ds - */ -interface XParametricPolyPolygon2DFactory : ::com::sun::star::uno::XInterface -{ - /** Create a linear gradient. - - The gradient varies linearly between colors. the color positions on <0, 1> interval are given by stops values - in the x direction, and has constant color for fixed x - coordinate value in y direction - */ - XParametricPolyPolygon2D createLinearHorizontalGradient( [in] sequence<Color> colors, [in] sequence<double> stops ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create an axial gradient. - - The gradient has middleColor in the middle, and varies - linearly between middleColor and endColor to both sides in the - x direction. For fixed x coordinate, the gradient has constant - color value in y direction. - */ - XParametricPolyPolygon2D createAxialHorizontalGradient( [in] sequence<Color> colors, [in] sequence<double> stops ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create an elliptical gradient. - - The gradient has centerColor in the middle, and varies - linearly between center and endColor via concentric ellipses - around the center point. Note that the absolute size of the - rectangle given at this method does not matter, only it's - aspect ratio: if this aspect ratio is 1, the gradient is - circular. If it's not 1, the gradient is elliptical, with the - special twist that the aspect ratio is maintained also for the - center color: the gradient will not collapse into a single - point, but become a line of center color. - */ - XParametricPolyPolygon2D createEllipticalGradient( [in] sequence<Color> colors, [in] sequence<double> stops, [in] ::com::sun::star::geometry::RealRectangle2D boundRect ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create a rectangular gradient. - - The gradient has centerColor in the middle, and varies - linearly between center and endColor via rectangular boxes - around the center point. Note that the absolute size of the - rectangle given at this method does not matter, only it's - aspect ratio: if this aspect ratio is 1, the gradient is - quadratic. If it's not 1, the gradient is rectangular, with - the special twist that the aspect ratio is maintained also for - the center color: the gradient will not collapse into a single - point, but become a line of center color. - */ - XParametricPolyPolygon2D createRectangularGradient( [in] sequence<Color> colors, [in] sequence<double> stops, [in] ::com::sun::star::geometry::RealRectangle2D boundRect ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create a line hash of vertical lines. - - The hashing consists of vertical lines, with colors varying - linearly between leftColor and rightColor, when going from - left to right - */ - XParametricPolyPolygon2D createVerticalLinesHatch( [in] sequence<ColorComponent> leftColor, [in] sequence<ColorComponent> rightColor ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create a line hash of orthogonally crossing lines. - - The hashing consists of vertical and horizontal lines, with - colors varying linearly between leftTopColor and - rightBottomColor, when going from left to right (for the - vertical lines) and from top tzo bottom (for the horizontal - lines). - */ - XParametricPolyPolygon2D createOrthogonalLinesHatch( [in] sequence<ColorComponent> leftTopColor, [in] sequence<ColorComponent> rightBottomColor ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create a repeating line hash pattern of three crossing lines. - - The hashing consists of vertical and horizontal lines plus - diagonal lines from left, top to bottom, right. Each of the - three groups of lines varies the line color of distinct lines - linearly from startColor to endColor, starting at the leftmost - or topmost position. - */ - XParametricPolyPolygon2D createThreeCrossingLinesHatch( [in] sequence<ColorComponent> startColor, [in] sequence<ColorComponent> endColor ) - raises (com::sun::star::lang::IllegalArgumentException); - - /** Create a repeating line hash pattern of four crossing lines. - - The hashing consists of vertical and horizontal lines plus - diagonal lines in both directions. Each of the four groups of - lines varies the line color of distinct lines linearly from - startColor to endColor, starting at the leftmost or topmost - position. - */ - XParametricPolyPolygon2D createFourCrossingLinesHatch( [in] sequence<ColorComponent> startColor, [in] sequence<ColorComponent> endColor ) - raises (com::sun::star::lang::IllegalArgumentException); -}; - -//============================================================================= - -/// Service providing a <type>XParametricPolyPolygon2DFactory</type> service -service ParametricPolyPolygon2DFactory: XParametricPolyPolygon2DFactory; - -}; }; }; }; - -#endif diff --git a/offapi/com/sun/star/rendering/makefile.mk b/offapi/com/sun/star/rendering/makefile.mk index 3ed9cf9c27e7..6b59d156d35e 100644 --- a/offapi/com/sun/star/rendering/makefile.mk +++ b/offapi/com/sun/star/rendering/makefile.mk @@ -104,7 +104,6 @@ IDLFILES=\ XIntegerReadOnlyBitmap.idl \ XLinePolyPolygon2D.idl \ XParametricPolyPolygon2D.idl \ - XParametricPolyPolygon2DFactory.idl \ XPolyPolygon2D.idl \ XSimpleCanvas.idl \ XSprite.idl \ diff --git a/offapi/com/sun/star/script/ModuleInfo.idl b/offapi/com/sun/star/script/ModuleInfo.idl new file mode 100644 index 000000000000..158ba387be6b --- /dev/null +++ b/offapi/com/sun/star/script/ModuleInfo.idl @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ModuleInfo.idl,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __com_sun_star_script_ModuleInfo_idl__ +#define __com_sun_star_script_ModuleInfo_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= +module com { module sun { module star { module script { +struct ModuleInfo +{ + com::sun::star::uno::XInterface ModuleObject; + long ModuleType; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/script/ModuleType.idl b/offapi/com/sun/star/script/ModuleType.idl new file mode 100644 index 000000000000..a9bde042fa5a --- /dev/null +++ b/offapi/com/sun/star/script/ModuleType.idl @@ -0,0 +1,72 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ModuleType.idl,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __com_sun_star_script_ModuleType_idl__ +#define __com_sun_star_script_ModuleType_idl__ + +//============================================================================= + +module com { module sun { module star { module script { + +published constants ModuleType +{ + // ------------------------------------------------------------------------ + + const long UNKNOWN = 0; + + // ------------------------------------------------------------------------ + + const long NORMAL = 1; + + // ------------------------------------------------------------------------ + + const long CLASS = 2; + + // ------------------------------------------------------------------------ + + const long FORM = 3; + + // ------------------------------------------------------------------------ + + const long DOCUMENT = 4; + + // ------------------------------------------------------------------------ +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/cppu/test/ObjectFactory/ObjectFactory.hxx b/offapi/com/sun/star/script/XVBACompat.idl index 768c4c430f9c..09da54eb27cd 100644 --- a/cppu/test/ObjectFactory/ObjectFactory.hxx +++ b/offapi/com/sun/star/script/XVBACompat.idl @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: XLibraryContainer.idl,v $ + * $Revision: 1.4 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,25 +27,23 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef __com_sun_star_script_XVBACompat_idl__ +#define __com_sun_star_script_XVBACompat_idl__ -#ifndef INCLUDED_ObjectFactory_hxx -#define INCLUDED_ObjectFactory_hxx - - -#include "callee.hxx" - - -#ifdef CPPU_test_ObjectFactory_IMPL -# define CPPU_test_ObjectFactory_EXPORT SAL_DLLPUBLIC_EXPORT - -#else -# define CPPU_test_ObjectFactory_EXPORT SAL_DLLPUBLIC_IMPORT - +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> #endif +//============================================================================= + +module com { module sun { module star { module script { -CPPU_test_ObjectFactory_EXPORT void * createObject(rtl::OUString const & envDcp, Callee * pCallee); -CPPU_test_ObjectFactory_EXPORT void callObject (rtl::OUString const & envDcp, void *); +interface XVBACompat: com::sun::star::uno::XInterface +{ +//============================================================================= + [attribute ] boolean VBACompatModeOn; +}; }; }; }; +}; #endif diff --git a/offapi/com/sun/star/script/XVBAModuleInfo.idl b/offapi/com/sun/star/script/XVBAModuleInfo.idl new file mode 100644 index 000000000000..f9c4e64223c3 --- /dev/null +++ b/offapi/com/sun/star/script/XVBAModuleInfo.idl @@ -0,0 +1,73 @@ +/************************************************************************* + * + * 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 + * + * $RCSfile: XLibraryContainer.idl,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_script_XVBACompat_idl__ +#define __com_sun_star_script_XVBACompat_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif +#ifndef __com_sun_star_script_ModuleInfo_idl__ +#include <com/sun/star/script/ModuleInfo.idl> +#endif +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_container_ElementExistException_idl__ +#include <com/sun/star/container/ElementExistException.idl> +#endif +#ifndef __com_sun_star_lang_WrappedTargetException_idl__ +#include <com/sun/star/lang/WrappedTargetException.idl> +#endif +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include <com/sun/star/container/NoSuchElementException.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module script { + +interface XVBAModuleInfo: com::sun::star::uno::XInterface +{ + + com::sun::star::script::ModuleInfo getModuleInfo( [in] string ModuleName ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::WrappedTargetException ); + boolean hasModuleInfo( [in] string ModuleName ); + void insertModuleInfo( [in] string ModuleName, + [in] com::sun::star::script::ModuleInfo ModuleInfo ) + raises( com::sun::star::lang::IllegalArgumentException, + com::sun::star::container::ElementExistException, + com::sun::star::lang::WrappedTargetException ); + void removeModuleInfo( [in] string ModuleName ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::WrappedTargetException ); +}; }; }; }; +}; +#endif diff --git a/offapi/com/sun/star/script/makefile.mk b/offapi/com/sun/star/script/makefile.mk index 579174390ec4..b694a753f7d7 100644 --- a/offapi/com/sun/star/script/makefile.mk +++ b/offapi/com/sun/star/script/makefile.mk @@ -48,6 +48,10 @@ IDLFILES=\ XPersistentLibraryContainer.idl\ XStorageBasedLibraryContainer.idl\ ModuleSizeExceededRequest.idl\ + XVBACompat.idl\ + XVBAModuleInfo.idl\ + ModuleInfo.idl\ + ModuleType.idl\ # ------------------------------------------------------------------ diff --git a/offapi/com/sun/star/sdb/DataAccessDescriptor.idl b/offapi/com/sun/star/sdb/DataAccessDescriptor.idl index 955962578837..10f9432b498b 100644 --- a/offapi/com/sun/star/sdb/DataAccessDescriptor.idl +++ b/offapi/com/sun/star/sdb/DataAccessDescriptor.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module sdb { /** descriptor for accessing basic data access objects. <p>Various components interacting with the database access world require to specify (or provide themself) an object - such as a query, a table, a result set, a connection to a data source, a column within a table, and so on.</br> + such as a query, a table, a result set, a connection to a data source, a column within a table, and so on.<br/> All of these objects are usually not specified with a single property, but with a set of properties, and for various objects, various (but not always different) properties are needed.<br/> The <code>DataAccessDescriptor</code> describes the super set of the properties for the most common @@ -199,7 +199,7 @@ published service DataAccessDescriptor has access to an already existent result set, it can pass it along for reusage. This is encouraged to increase performance.</p> - <p>The object will at least support the <type scope="com::sun::star::sdbc">ResultSet</type>.</p> + <p>The object will at least support the <type scope="com::sun::star::sdbc">ResultSet</type> service.</p> <p>Note that any superservices of <type scope="com::sun::star::sdbc">ResultSet</type> are also allowed. Especially, this member can denote an instance of the diff --git a/offapi/com/sun/star/sdb/RowSet.idl b/offapi/com/sun/star/sdb/RowSet.idl index 8292523cc4e2..d52b6cf0cc39 100644 --- a/offapi/com/sun/star/sdb/RowSet.idl +++ b/offapi/com/sun/star/sdb/RowSet.idl @@ -70,6 +70,7 @@ published interface XParametersSupplier; to approve the actions and to react on them. @see com::sun::star::sdb::RowChangeAction @see com::sun::star::sdb::RowChangeEvent + @see com::sun::star::sdb::RowsChangeEvent </p> <h3>Notifications</h3> @@ -97,7 +98,8 @@ published interface XParametersSupplier; <tr><td valign="top"><em>operation done</em></td> <td valign="top">When the operation is done, you get a notification about this. It may be a <member scope="com::sun::star::sdbc">XRowSetListener::cursorMoved</member> or a - <member scope="com::sun::star::sdbc">XRowSetListener::rowChanged</member> call. + <member scope="com::sun::star::sdbc">XRowSetListener::rowChanged</member> call or a + <member>XRowsChangeListener::rowsChanged</member> call. </td> </tr> <tr><td valign="top"><em>row state</em></td> @@ -121,39 +123,40 @@ published interface XParametersSupplier; <tr><td/><td><strong>approveCursorMove</strong></td><td><strong>approveRowChange</strong></td> <td><strong>column values</strong></td> <td><strong>cursorMoved</strong></td><td><strong>rowChanged</strong></td> + <td><strong>rowsChanged</strong></td> <td><strong>IsModified</strong></td><td><strong>IsNew</strong></td> <td><strong>RowCount</strong></td><td><strong>IsRowCountFinal</strong></td> </tr> <tr><td><type scope="com::sun::star::sdbc">XResultSet</type></td><td/><td/><td/><td/><td/><td/><td/><td/></tr> - <tr><td align="right"><em>next</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td> - <tr><td align="right"><em>beforeFirst</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> - <tr><td align="right"><em>afterLast</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>first</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>last</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>absolute</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>relative</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>previous</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>refreshRow</em></td><td/><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> - <tr><td align="right"><em>cancelRowUpdates</em></td><td/><td/><td align="center">X</td><td/><td/><td align="center">X</td><td/><td/><td/></tr> + <tr><td align="right"><em>next</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td> + <tr><td align="right"><em>beforeFirst</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> + <tr><td align="right"><em>afterLast</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>first</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>last</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>absolute</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>relative</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>previous</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>refreshRow</em></td><td/><td/><td align="center">X</td><td/><td/><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> + <tr><td align="right"><em>cancelRowUpdates</em></td><td/><td/><td align="center">X</td><td/><td/><td/><td align="center">X</td><td/><td/><td/></tr> <tr><td><type scope="com::sun::star::sdbc">XResultSetUpdate</type></td><td/><td/><td/><td/><td/><td/><td/><td/></tr> - <tr><td align="right"><em>insertRow</em></td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>updateRow</em></td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td/></tr> - <tr><td align="right"><em>deleteRow</em></td><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>moveToInsertRow</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td></tr> - <tr><td align="right"><em>moveToCurrentRow</em></td><td align="center">X</td><td/><td/><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> + <tr><td align="right"><em>insertRow</em></td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>updateRow</em></td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td/><td/><td/></tr> + <tr><td align="right"><em>deleteRow</em></td><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>moveToInsertRow</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td/><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>moveToCurrentRow</em></td><td align="center">X</td><td/><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> <tr><td><type scope="com::sun::star::sdbcx">XDeleteRows</type></td><td/><td/><td/><td/><td/><td/><td/><td/></tr> - <tr><td align="right"><em>deleteRows</em></td><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>deleteRows</em></td><td/><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> <tr><td><type scope="com::sun::star::sdbcx">XRowLocate</type></td><td/><td/><td/><td/><td/><td/><td/><td/></tr> - <tr><td align="right"><em>moveToBookmark</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> - <tr><td align="right"><em>moveRelativeToBookmark</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> + <tr><td align="right"><em>moveToBookmark</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td/><td/></tr> + <tr><td align="right"><em>moveRelativeToBookmark</em></td><td align="center">X</td><td/><td align="center">X</td><td align="center">X</td><td/><td/><td align="center">X</td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr> </tr> </table> diff --git a/cppu/test/ObjectFactory/UnoObject.hxx b/offapi/com/sun/star/sdb/RowsChangeEvent.idl index e2d9fba5aa6b..90bb50f4bf84 100644 --- a/cppu/test/ObjectFactory/UnoObject.hxx +++ b/offapi/com/sun/star/sdb/RowsChangeEvent.idl @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: RowsChangeEvent.idl,v $ + * $Revision: 1.9 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,20 +27,26 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef __com_sun_star_sdb_RowsChangeEvent_idl__ +#define __com_sun_star_sdb_RowsChangeEvent_idl__ -#ifndef INCLUDED_UnoObject_hxx -#define INCLUDED_UnoObject_hxx +#include <com/sun/star/sdb/RowChangeEvent.idl> + module com { module sun { module star { module sdb { -#include "rtl/ustring.hxx" -#include "uno/dispatcher.h" -#include "callee.hxx" +/** indicates which rows have changed and the type of change action on the row set. + */ +struct RowsChangeEvent: com::sun::star::sdb::RowChangeEvent +{ + sequence< any > Bookmarks; +}; -uno_Interface * UnoObject_create (Callee * pCallee); -void UnoObject_release(uno_Interface * pUnoI); -void UnoObject_call (uno_Interface * pUnoI); +//============================================================================= +}; }; }; }; +/*=========================================================================== +===========================================================================*/ #endif diff --git a/offapi/com/sun/star/sdb/XRowsChangeBroadcaster.idl b/offapi/com/sun/star/sdb/XRowsChangeBroadcaster.idl new file mode 100644 index 000000000000..feb8191c44d9 --- /dev/null +++ b/offapi/com/sun/star/sdb/XRowsChangeBroadcaster.idl @@ -0,0 +1,66 @@ +/************************************************************************* +* 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 +* +* $RCSfile: code,v $ +* +* $Revision: 1.3 $ +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef __com_sun_star_sdb_XRowsChangeBroadcaster_idl__ +#define __com_sun_star_sdb_XRowsChangeBroadcaster_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +//============================================================================= + +module com { module sun { module star { module sdb { + +interface XRowsChangeListener; + +//============================================================================= + +/** broadcasts changes in the <code>RowSet</code> supplied by a component + + @see XRowSetSupplier + @see XRowsChangeListener + @since OOo 3.3 + */ +interface XRowsChangeBroadcaster +{ + /** adds a listener to be notified when the <code>RowSet</code> supplied by the component changes. + */ + void addRowsChangeListener( [in] XRowsChangeListener listener ); + + /** removes a previously added listener. + */ + void removeRowsChangeListener( [in] XRowsChangeListener listener ); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/sdb/XRowsChangeListener.idl b/offapi/com/sun/star/sdb/XRowsChangeListener.idl new file mode 100644 index 000000000000..995636e95e3f --- /dev/null +++ b/offapi/com/sun/star/sdb/XRowsChangeListener.idl @@ -0,0 +1,60 @@ +/************************************************************************* + * + * 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 + * + * $RCSfile: XRowsChangeListener.idl,v $ + * $Revision: 1.11 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_sdb_XRowsChangeListener_idl__ +#define __com_sun_star_sdb_XRowsChangeListener_idl__ + +#ifndef __com_sun_star_lang_XEventListener_idl__ +#include <com/sun/star/lang/XEventListener.idl> +#endif +#include <com/sun/star/sdb/RowsChangeEvent.idl> + + module com { module sun { module star { module sdb { + + +/** is used for receiving "rowsChanged" events + posted by, for example, a rowset. + */ +interface XRowsChangeListener: com::sun::star::lang::XEventListener +{ + + /** is called when rows are inserted, updated, or deleted. + @param event + contains information about the event + */ + [oneway] void rowsChanged([in]com::sun::star::sdb::RowsChangeEvent event); +}; + +//============================================================================= + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif diff --git a/offapi/com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl b/offapi/com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl index c0abad38710e..96041b71e86b 100644 --- a/offapi/com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl +++ b/offapi/com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl @@ -219,6 +219,36 @@ interface XSingleSelectQueryAnalyzer : com::sun::star::uno::XInterface */ string getQueryWithSubstitution() raises (com::sun::star::sdbc::SQLException); + + /** sets a new query for the composer, which may be expanded by filters, group by, having + and sort criteria. + @param Command + is the command which should be executed, the type of command depends + on the CommandType. + + <p>In case of a <member>CommandType</member> of <member>CommandType::COMMAND</member>, + means in case the <member>Command</member> specifies an SQL statement, the inherited + <member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member> + becomes relevant:<br/> + It then can be to used to specify whether the SQL statement should be analyzed on the + client side before sending it to the database server.<br/> + The default value for <member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member> + is <TRUE/>. By switching it to <FALSE/>, you can pass backend-specific SQL statements, + which are not standard SQL, to your database.</p> + + @see com::sun::star::sdb::CommandType + @see com::sun::star::sdbc::RowSet::EscapeProcessing + @param CommandType + is the type of the command. + @see com::sun::star::sdb::CommandType + @throws com::sun::star::sdbc::SQLException + if a database access error occurs + or the statement isn't a single select statement + or the statement isn't valid + or the statement can not be parsed. + */ + void setCommand([in] string Command ,[in] long CommandType) + raises (com::sun::star::sdbc::SQLException); }; //============================================================================= diff --git a/offapi/com/sun/star/sdb/XSingleSelectQueryComposer.idl b/offapi/com/sun/star/sdb/XSingleSelectQueryComposer.idl index b659b367320f..ad609262ecbe 100644 --- a/offapi/com/sun/star/sdb/XSingleSelectQueryComposer.idl +++ b/offapi/com/sun/star/sdb/XSingleSelectQueryComposer.idl @@ -96,14 +96,16 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer The value property must be supported by the <type scope="com::sun::star::sdb">DataColumn</type>. @param column the column which is used to create a filter - @paran andCriteria + @param andCriteria If <TRUE/> the filter condition will be appended as an AND condition, otherwise the new filter condition will be appended as OR criteria. E.g. (xx AND bb AND cc) OR newCriteria + @param filterOperator + The operator used, is defined by <type scope="com::sun::star::sdb">SQLFilterOperator</type>. @throws com::sun::star::sdbc::SQLException if a database access error occurs. */ - void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria) + void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator) raises (com::sun::star::sdbc::SQLException); //------------------------------------------------------------------------- @@ -170,14 +172,16 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer providing the name and the value for the filter. @param column the column which is used to create a filter - @paran andCriteria + @param andCriteria If <TRUE/> the filter condition will be appended as an AND condition, otherwise the new filter condition will be appended as OR criteria. E.g. (xx AND bb AND cc) OR newCriteria + @param filterOperator + The operator used, is defined by <type scope="com::sun::star::sdb">SQLFilterOperator</type>. @throws com::sun::star::sdbc::SQLException if a database access error occurs. */ - void appendHavingClauseByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria) + void appendHavingClauseByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator) raises (com::sun::star::sdbc::SQLException); //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/sdb/makefile.mk b/offapi/com/sun/star/sdb/makefile.mk index 975bf03e7712..f095f338bcd4 100644 --- a/offapi/com/sun/star/sdb/makefile.mk +++ b/offapi/com/sun/star/sdb/makefile.mk @@ -90,6 +90,7 @@ IDLFILES=\ ResultSet.idl \ RowChangeAction.idl \ RowChangeEvent.idl \ + RowsChangeEvent.idl \ RowSet.idl \ RowSetVetoException.idl \ SingleSelectQueryAnalyzer.idl \ @@ -128,6 +129,8 @@ IDLFILES=\ XRowSetApproveListener.idl \ XRowSetChangeBroadcaster.idl \ XRowSetChangeListener.idl \ + XRowsChangeBroadcaster.idl \ + XRowsChangeListener.idl \ XRowSetSupplier.idl \ XSingleSelectQueryAnalyzer.idl \ XSingleSelectQueryComposer.idl \ diff --git a/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl b/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl index 194eb6ffeec4..edc6e4ab7c81 100644 --- a/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl +++ b/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl @@ -41,9 +41,9 @@ /** provides a result set which gives access to automatically generated values after a new row was inserted. - The relative order of columns in the result set returned by getGeneratedValues must be the same as the relative order - of the same columns as returned when executing a "SELECT * FROM table". This ensures that clients of this interface - can reliably fetch the column values. + <p>The relative order of columns in the result set returned by <member>getGeneratedValues</member> must be the same + as the relative order of the same columns as returned when executing a "SELECT * FROM table". This ensures that + clients of this interface can reliably fetch the column values.</p> @see com::sun::star::sdbc::Statement @see com::sun::star::sdbc::PreparedStatement diff --git a/offapi/com/sun/star/sdbc/XRowSetListener.idl b/offapi/com/sun/star/sdbc/XRowSetListener.idl index 0bb778e458dc..d4aba4ab71ac 100644 --- a/offapi/com/sun/star/sdbc/XRowSetListener.idl +++ b/offapi/com/sun/star/sdbc/XRowSetListener.idl @@ -50,6 +50,8 @@ published interface XRowSetListener: com::sun::star::lang::XEventListener /** is called when a row is inserted, updated, or deleted. @param event contains information about the event + @deprecated + @see com.sun.star.sdb.XRowsChangeListener */ [oneway] void rowChanged([in]com::sun::star::lang::EventObject event); //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/text/InContentMetadata.idl b/offapi/com/sun/star/text/InContentMetadata.idl index f6aec7bbee63..5eac10714576 100755 --- a/offapi/com/sun/star/text/InContentMetadata.idl +++ b/offapi/com/sun/star/text/InContentMetadata.idl @@ -32,6 +32,10 @@ #include <com/sun/star/container/XEnumerationAccess.idl> #endif +#ifndef __com_sun_star_container_XChild_idl__ +#include <com/sun/star/container/XChild.idl> +#endif + #ifndef __com_sun_star_text_TextContent_idl__ #include <com/sun/star/text/TextContent.idl> #endif @@ -68,6 +72,12 @@ service InContentMetadata annotated range of text can be enumerated. */ interface com::sun::star::container::XEnumerationAccess; + //------------------------------------------------------------------------- + /** The <type>TextContent</type> that is the parent of this text range. + @since OOo 3.3 + */ + interface com::sun::star::container::XChild; + }; diff --git a/offapi/com/sun/star/text/TextMarkupType.idl b/offapi/com/sun/star/text/TextMarkupType.idl index d99942e0d12f..5137d47d217f 100644 --- a/offapi/com/sun/star/text/TextMarkupType.idl +++ b/offapi/com/sun/star/text/TextMarkupType.idl @@ -58,6 +58,12 @@ constants TextMarkupType /// An inivisible markup used to identify sentence boundaries. /// @since OOo 3.0.1 const long SENTENCE = 4; + + /// Markups originates from change tracking. + /// @since OOo 3.3 + const long TRACK_CHANGE_INSERTION = 5; + const long TRACK_CHANGE_DELETION = 6; + const long TRACK_CHANGE_FORMATCHANGE = 7; }; }; }; }; }; diff --git a/offapi/com/sun/star/text/TextRangeContentProperties.idl b/offapi/com/sun/star/text/TextRangeContentProperties.idl new file mode 100644 index 000000000000..74acb67cf9ed --- /dev/null +++ b/offapi/com/sun/star/text/TextRangeContentProperties.idl @@ -0,0 +1,133 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_text_TextRangeContentProperties_idl__ +#define __com_sun_star_text_TextRangeContentProperties_idl__ + +#ifndef __com_sun_star_table_XCell_idl__ +#include <com/sun/star/table/XCell.idl> +#endif + +#ifndef __com_sun_star_text_XTextContent_idl__ +#include <com/sun/star/text/XTextContent.idl> +#endif + +#ifndef __com_sun_star_text_XDocumentIndex_idl__ +#include <com/sun/star/text/XDocumentIndex.idl> +#endif + +#ifndef __com_sun_star_text_XTextTable_idl__ +#include <com/sun/star/text/XTextTable.idl> +#endif + +#ifndef __com_sun_star_text_XTextFrame_idl__ +#include <com/sun/star/text/XTextFrame.idl> +#endif + +#ifndef __com_sun_star_text_XTextSection_idl__ +#include <com/sun/star/text/XTextSection.idl> +#endif + +#ifndef __com_sun_star_text_XDocumentIndexMark_idl__ +#include <com/sun/star/text/XDocumentIndexMark.idl> +#endif + +#ifndef __com_sun_star_text_XFootnote_idl__ +#include <com/sun/star/text/XFootnote.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module text { + +//============================================================================= + +/** describes the structural properties to retrieve text contents. + + @since OOo 3.3 + */ +service TextRangeContentProperties +{ + //------------------------------------------------------------------------- + /** may contain a document index. */ + [optional, readonly, property] com::sun::star::text::XDocumentIndex + DocumentIndex; + + //------------------------------------------------------------------------- + /** may contain a text table. */ + [optional, readonly, property] com::sun::star::text::XTextTable + TextTable; + + //------------------------------------------------------------------------- + /** may contain a table cell. */ + [optional, readonly, property] com::sun::star::table::XCell Cell; + + //------------------------------------------------------------------------- + /** may contain a text frame. */ + [optional, readonly, property] com::sun::star::text::XTextFrame + TextFrame; + + //------------------------------------------------------------------------- + /** may contain a text section. */ + [optional, readonly, property] com::sun::star::text::XTextSection + TextSection; + + //------------------------------------------------------------------------- + /** may contain a document index mark. */ + [optional, readonly, property] com::sun::star::text::XDocumentIndexMark + DocumentIndexMark; + + //------------------------------------------------------------------------- + /** may contain a reference mark. */ + [optional, readonly, property] com::sun::star::text::XTextContent + ReferenceMark; + + //------------------------------------------------------------------------- + /** may contain a footnote. */ + [optional, readonly, property] com::sun::star::text::XFootnote Footnote; + + //------------------------------------------------------------------------- + /** may contain a endnote. */ + [optional, readonly, property] com::sun::star::text::XFootnote Endnote; + + //------------------------------------------------------------------------- + /** may contain a nested text content. + + For example, may contain an <type>InContentMetadata</type> or a + <type scope="com::sun::star::text::textfield">MetadataField</type>. + */ + [optional, readonly, property] com::sun::star::text::XTextContent + NestedTextContent; + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/text/makefile.mk b/offapi/com/sun/star/text/makefile.mk index 28c3d1eaece3..4e6d24746af8 100644 --- a/offapi/com/sun/star/text/makefile.mk +++ b/offapi/com/sun/star/text/makefile.mk @@ -173,6 +173,7 @@ IDLFILES=\ TextPortionEnumeration.idl\ TextRange.idl\ TextRanges.idl\ + TextRangeContentProperties.idl\ TextSection.idl\ TextSections.idl\ TextSortable.idl\ diff --git a/offapi/com/sun/star/text/textfield/MetadataField.idl b/offapi/com/sun/star/text/textfield/MetadataField.idl index 85541457aef7..d98c4be39e96 100755 --- a/offapi/com/sun/star/text/textfield/MetadataField.idl +++ b/offapi/com/sun/star/text/textfield/MetadataField.idl @@ -32,6 +32,10 @@ #include <com/sun/star/container/XEnumerationAccess.idl> #endif +#ifndef __com_sun_star_container_XChild_idl__ +#include <com/sun/star/container/XChild.idl> +#endif + #ifndef __com_sun_star_text_TextField_idl__ #include <com/sun/star/text/TextField.idl> #endif @@ -79,6 +83,13 @@ service MetadataField interface com::sun::star::container::XEnumerationAccess; //------------------------------------------------------------------------- + /** The <type scope="com::sun::star::text">TextContent</type> + that is the parent of this <type>MetadataField</type>. + @since OOo 3.3 + */ + interface com::sun::star::container::XChild; + + //------------------------------------------------------------------------- /** this is the number format for this field. @see com::sun::star::util::NumberFormatter */ diff --git a/offapi/com/sun/star/ui/UIElement.idl b/offapi/com/sun/star/ui/UIElement.idl index 890074fe24b5..580a660f734e 100644 --- a/offapi/com/sun/star/ui/UIElement.idl +++ b/offapi/com/sun/star/ui/UIElement.idl @@ -28,10 +28,6 @@ #ifndef __com_sun_star_ui_UIElement_idl__ #define __com_sun_star_ui_UIElement_idl__ -#ifndef __com_sun_star_frame_XFrame_idl__ -#include <com/sun/star/frame/XFrame.idl> -#endif - #ifndef __com_sun_star_ui_XUIElement_idl__ #include <com/sun/star/ui/XUIElement.idl> #endif @@ -40,10 +36,6 @@ #include <com/sun/star/beans/XPropertySet.idl> #endif -#ifndef __com_sun_star_ui_UIElementType_idl__ -#include <com/sun/star/ui/UIElementType.idl> -#endif - #ifndef __com_sun_star_lang_XInitialization_idl__ #include <com/sun/star/lang/XInitialization.idl> #endif @@ -97,7 +89,7 @@ service UIElement @see com::sun::star::ui::UIElementFactoryManager; @see com::sun::star::ui::UIElementFactory */ - interface ::com::sun::star::lang::XInitialization; + [optional] interface ::com::sun::star::lang::XInitialization; /** used to notify an implementation that it needs to update its visual representation. @@ -106,31 +98,11 @@ service UIElement representation. It is up to the implementation if it ignores notifications. </p> */ - interface com::sun::star::util::XUpdatable; + [optional] interface com::sun::star::util::XUpdatable; /** controls the life-time of the object. */ interface ::com::sun::star::lang::XComponent; - - /** determines the frame to which this element is bound to. - - <p> - The life time of a user interface element does not explicitly depend on the - frame itself but on the visible component attached to the frame. It is possible - to exchange the visible component of a frame and that will lead to the end of - life of all user interface elements. - */ - [readonly, property] com::sun::star::frame::XFrame Frame; - - /** a resource URL which is a unique identifier of a user interface element. - */ - [readonly, property] string ResourceURL; - - /** determines the real type of the user interface element. - - @see UIElementType - */ - [readonly, property] short Type; }; }; }; }; }; diff --git a/offapi/com/sun/star/ui/UIElementType.idl b/offapi/com/sun/star/ui/UIElementType.idl index d9cca7ed8fc5..f87d91ca6243 100644 --- a/offapi/com/sun/star/ui/UIElementType.idl +++ b/offapi/com/sun/star/ui/UIElementType.idl @@ -73,9 +73,14 @@ constants UIElementType const short PROGRESSBAR = 6; //------------------------------------------------------------------------- + /** specifies a tool panel + */ + const short TOOLPANEL = 7; + + //------------------------------------------------------------------------- /** specifies the number of constants. */ - const short COUNT = 7; + const short COUNT = 8; }; }; }; }; }; diff --git a/offapi/com/sun/star/ui/XToolPanel.idl b/offapi/com/sun/star/ui/XToolPanel.idl new file mode 100644 index 000000000000..261f4c20413d --- /dev/null +++ b/offapi/com/sun/star/ui/XToolPanel.idl @@ -0,0 +1,64 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +#ifndef __com_sun_star_ui_XToolPanel_idl__ +#define __com_sun_star_ui_XToolPanel_idl__ + +#include <com/sun/star/awt/XWindow.idl> +#include <com/sun/star/accessibility/XAccessible.idl> + +//============================================================================= + +module com { module sun { module star { module ui { + +//============================================================================= + +/** describes the basic interface to be implemented by a tool panel + */ +interface XToolPanel +{ + /** provides access to the tool panel's main window. + + <p>It is allowed for an implementation to return <NULL/> here, but in this case some functionality, for instance + automatic positioning of the tool panel, might not be available, and must be implemented by the tool panel itself.</p> + */ + [attribute, readonly] ::com::sun::star::awt::XWindow Window; + + /** creates the root of the Accessibility object tree for the tool panel + @param ParentAccessible + the parent object in the Accessibility object tree + */ + ::com::sun::star::accessibility::XAccessible + createAccessible( [in] ::com::sun::star::accessibility::XAccessible ParentAccessible ); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/ui/XUIElement.idl b/offapi/com/sun/star/ui/XUIElement.idl index 1ec3dc579cab..26536a85f29f 100644 --- a/offapi/com/sun/star/ui/XUIElement.idl +++ b/offapi/com/sun/star/ui/XUIElement.idl @@ -36,6 +36,10 @@ #include <com/sun/star/beans/XPropertySet.idl> #endif +#ifndef __com_sun_star_frame_XFrame_idl__ +#include <com/sun/star/frame/XFrame.idl> +#endif + //============================================================================= module com { module sun { module star { module ui { @@ -64,7 +68,26 @@ interface XUIElement : com::sun::star::uno::XInterface a special purpose interface which depends on the type of the user interface element. */ - com::sun::star::uno::XInterface getRealInterface(); + ::com::sun::star::uno::XInterface getRealInterface(); + + /** determines the document frame to which this element is bound to. + + <p>The life time of a user interface element does not explicitly depend on the + frame itself but on the visible component attached to the frame. It is possible + to exchange the visible component of a frame and that will lead to the end of + life of all user interface elements.</p> + */ + [readonly, attribute] ::com::sun::star::frame::XFrame Frame; + + /** a resource URL which is a unique identifier of a user interface element. + */ + [readonly, attribute] string ResourceURL; + + /** determines the type of the user interface element. + + @see UIElementType + */ + [readonly, attribute] short Type; }; }; }; }; }; diff --git a/offapi/com/sun/star/ui/XUIElementFactory.idl b/offapi/com/sun/star/ui/XUIElementFactory.idl index b1522c298752..7a86842508ac 100644 --- a/offapi/com/sun/star/ui/XUIElementFactory.idl +++ b/offapi/com/sun/star/ui/XUIElementFactory.idl @@ -97,6 +97,11 @@ interface XUIElementFactory : ::com::sun::star::uno::XInterface configuration manager. This argument is <b>mandatory</b> to have a working configurable user interface element instance. </li> + <li><b>ParentWindow</b><br/> + specifies a parent window to use for the window(s) representing + the UI element. Depending on the concrete UI element type, this parameter + might be required or ignored by an implementation. + </li> <li><b>Persistent</b><br>specifies if changes to a configurable user interface element should be persistent. This is an optional argument. The default value is <TRUE/>.</li> diff --git a/offapi/com/sun/star/ui/makefile.mk b/offapi/com/sun/star/ui/makefile.mk index 944c8ee689c8..313d74dcd9e8 100644 --- a/offapi/com/sun/star/ui/makefile.mk +++ b/offapi/com/sun/star/ui/makefile.mk @@ -84,7 +84,8 @@ IDLFILES=\ XUIElementFactory.idl \ XUIElementFactoryRegistration.idl \ XUIElementSettings.idl \ - XUIFunctionListener.idl + XUIFunctionListener.idl \ + XToolPanel.idl # ------------------------------------------------------------------ diff --git a/pyuno/zipcore/makefile.mk b/pyuno/zipcore/makefile.mk index 9e546e7d4018..06241da2bfdb 100755 --- a/pyuno/zipcore/makefile.mk +++ b/pyuno/zipcore/makefile.mk @@ -55,7 +55,7 @@ PYTHONBINARY=$(DESTROOT)$/bin$/python$(EXECPOST) .ENDIF FINDLIBFILES_TMP:=$(subst,/,$/ \ - $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v .pyc |$(GREP) -v .py\~ |$(GREP) -v .orig )) + $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v "\.pyc" |$(GREP) -v "\.py~" |$(GREP) -v .orig | $(GREP) -v _failed)) FINDLIBFILES=$(subst,$(SOLARLIBDIR)$/python, $(FINDLIBFILES_TMP)) FILES=\ diff --git a/remotebridges/source/bridge/makefile.mk b/remotebridges/source/bridge/makefile.mk index 6c217b273372..1b712bef1913 100644 --- a/remotebridges/source/bridge/makefile.mk +++ b/remotebridges/source/bridge/makefile.mk @@ -43,7 +43,7 @@ SLOFILES= \ $(SLO)$/bridge_connection.obj\ $(SLO)$/bridge_provider.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = remotebridge.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/remotebridges/source/bridge/remotebridge.map b/remotebridges/source/bridge/remotebridge.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/remotebridges/source/bridge/remotebridge.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/remotebridges/source/factory/brdgfctr.map b/remotebridges/source/factory/brdgfctr.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/remotebridges/source/factory/brdgfctr.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/remotebridges/source/factory/makefile.mk b/remotebridges/source/factory/makefile.mk index 4f0a6d04437b..7cd3875bcfb3 100644 --- a/remotebridges/source/factory/makefile.mk +++ b/remotebridges/source/factory/makefile.mk @@ -43,7 +43,7 @@ SLOFILES= \ $(SLO)$/bridgeimpl.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = brdgfctr.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/remotebridges/source/unourl_resolver/makefile.mk b/remotebridges/source/unourl_resolver/makefile.mk index 7eea4e7cf239..a3e4af7f0d91 100644 --- a/remotebridges/source/unourl_resolver/makefile.mk +++ b/remotebridges/source/unourl_resolver/makefile.mk @@ -43,7 +43,7 @@ SLOFILES= \ $(SLO)$/unourl_resolver.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = uuresolver.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(SALLIB) \ diff --git a/remotebridges/source/unourl_resolver/uuresolver.map b/remotebridges/source/unourl_resolver/uuresolver.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/remotebridges/source/unourl_resolver/uuresolver.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx new file mode 100644 index 000000000000..1082e6ff9844 --- /dev/null +++ b/sal/cppunittester/cppunittester.cxx @@ -0,0 +1,65 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#include "precompiled_sal.hxx" +#include "sal/config.h" + +#include <cstdlib> +#include <iostream> + +#include "cppunit/CompilerOutputter.h" +#include "cppunit/TestResult.h" +#include "cppunit/TestResultCollector.h" +#include "cppunit/TestRunner.h" +#include "cppunit/extensions/TestFactoryRegistry.h" +#include "cppunit/plugin/PlugInManager.h" +#include "cppunit/portability/Stream.h" +#include "osl/thread.h" +#include "rtl/process.h" +#include "rtl/string.hxx" +#include "rtl/ustring.hxx" +#include "sal/main.h" + +SAL_IMPLEMENT_MAIN() { + if (rtl_getAppCommandArgCount() != 1) { + std::cerr << "Usage: cppunittester <shared-library-path>" << std::endl; + return EXIT_FAILURE; + } + rtl::OUString path; + rtl_getAppCommandArg(0, &path.pData); + CppUnit::PlugInManager manager; + manager.load( + rtl::OUStringToOString(path, osl_getThreadTextEncoding()).getStr()); + CppUnit::TestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + CppUnit::TestResult result; + CppUnit::TestResultCollector collector; + result.addListener(&collector); + runner.run(result); + CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write(); + return collector.wasSuccessful() ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/cppu/test/EnvStack/makefile.mk b/sal/cppunittester/makefile.mk index 6e6990b97716..938b63d90ae9 100644 --- a/cppu/test/EnvStack/makefile.mk +++ b/sal/cppunittester/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -23,25 +23,23 @@ # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # -#************************************************************************* - -PRJ := ..$/.. -PRJNAME := cppu -TARGET := EnvStack.test.pl - - -ENABLE_EXCEPTIONS := TRUE -NO_BSYMBOLIC := TRUE -USE_DEFFILE := TRUE +#***********************************************************************/ +PRJ = .. +PRJNAME = sal +TARGET = cppunittester -.INCLUDE : settings.mk +ENABLE_EXCEPTIONS = TRUE +.INCLUDE: settings.mk -.INCLUDE : target.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) +OBJFILES = $(APP1OBJS) -ALLTAR: $(BIN)$/$(TARGET) +APP1OBJS = $(OBJ)/cppunittester.obj +APP1RPATH = NONE +APP1STDLIBS = $(CPPUNITLIB) $(SALLIB) +APP1TARGET = cppunittester -$(BIN)$/$(TARGET): EnvStack.test.pl - @+$(COPY) $^ $@ +.INCLUDE: target.mk diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h index 2986ae4bec6c..c0c74515404a 100644 --- a/sal/inc/osl/semaphor.h +++ b/sal/inc/osl/semaphor.h @@ -37,6 +37,10 @@ extern "C" { typedef void* oslSemaphore; /** Creates a semaphore.<BR> + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @param InitialCount denotes the starting value the semaphore. If you set it to zero, the first acquire() blocks. Otherwise InitialCount acquire()s are immedeatly successfull. @@ -45,12 +49,20 @@ typedef void* oslSemaphore; oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount); /** Release the OS-structures and free semaphore data-structure + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return fbbb */ void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore); /** acquire() decreases the count. It will block if it tries to decrease below zero. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return False if the system-call failed. */ sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore); @@ -59,10 +71,17 @@ sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore); return with False if it would decrease the count below zero. (When acquire() would block.) If it could successfully decrease the count, it will return True. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. */ sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore); /** release() increases the count. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return False if the system-call failed. */ sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore); diff --git a/sal/inc/osl/semaphor.hxx b/sal/inc/osl/semaphor.hxx index 6209aa9970a8..a45737d27524 100644 --- a/sal/inc/osl/semaphor.hxx +++ b/sal/inc/osl/semaphor.hxx @@ -35,7 +35,11 @@ namespace osl { + /** C++ wrapper class around C semaphore functions. + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + */ class Semaphore { public: diff --git a/sal/osl/os2/process_impl.cxx b/sal/osl/os2/process_impl.cxx index d27bd72190e5..27b12bbe0f6a 100644 --- a/sal/osl/os2/process_impl.cxx +++ b/sal/osl/os2/process_impl.cxx @@ -141,6 +141,7 @@ oslProcessError SAL_CALL osl_getExecutableFile (rtl_uString ** ppustrFile) oslProcessError result = osl_Process_E_NotFound; osl_acquireMutex(g_command_args.m_mutex); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) { /* CommandArgs set. Obtain argv[0]. */ @@ -160,6 +161,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void) sal_uInt32 result = 0; osl_acquireMutex(g_command_args.m_mutex); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) result = g_command_args.m_nCount - 1; osl_releaseMutex(g_command_args.m_mutex); @@ -175,6 +177,7 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 nArg, rtl_uString ** strC oslProcessError result = osl_Process_E_NotFound; osl_acquireMutex(g_command_args.m_mutex); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > (nArg + 1)) { rtl_uString_assign (strCommandArg, g_command_args.m_ppArgs[nArg + 1]); @@ -190,7 +193,7 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 nArg, rtl_uString ** strC **************************************/ void SAL_CALL osl_setCommandArgs (int argc, char ** argv) { - + OSL_ASSERT(argc > 0); osl_acquireMutex(g_command_args.m_mutex); OSL_ENSURE (g_command_args.m_nCount == 0, "osl_setCommandArgs(): CommandArgs already set."); if (g_command_args.m_nCount == 0) diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index 5262fef5cd38..300a1446e81a 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -489,7 +489,16 @@ static void ChildStatusProc(void *pData) { int i; for (i = 0; data.m_pszEnv[i] != NULL; i++) - putenv(data.m_pszEnv[i]); + { + if (strchr(data.m_pszEnv[i], '=') == NULL) + { + unsetenv(data.m_pszEnv[i]); /*TODO: check error return*/ + } + else + { + putenv(data.m_pszEnv[i]); /*TODO: check error return*/ + } + } OSL_TRACE("ChildStatusProc : starting '%s'",data.m_pszArgs[0]); diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index adfc59e9c8af..e712b6748e7f 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -184,6 +184,7 @@ oslProcessError SAL_CALL osl_getExecutableFile (rtl_uString ** ppustrFile) oslProcessError result = osl_Process_E_NotFound; pthread_mutex_lock (&(g_command_args.m_mutex)); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) { /* CommandArgs set. Obtain argv[0]. */ @@ -203,6 +204,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void) sal_uInt32 result = 0; pthread_mutex_lock (&(g_command_args.m_mutex)); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) result = g_command_args.m_nCount - 1; pthread_mutex_unlock (&(g_command_args.m_mutex)); @@ -218,6 +220,7 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 nArg, rtl_uString ** strC oslProcessError result = osl_Process_E_NotFound; pthread_mutex_lock (&(g_command_args.m_mutex)); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > (nArg + 1)) { rtl_uString_assign (strCommandArg, g_command_args.m_ppArgs[nArg + 1]); @@ -233,6 +236,7 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 nArg, rtl_uString ** strC **************************************/ void SAL_CALL osl_setCommandArgs (int argc, char ** argv) { + OSL_ASSERT(argc > 0); pthread_mutex_lock (&(g_command_args.m_mutex)); OSL_ENSURE (g_command_args.m_nCount == 0, "osl_setCommandArgs(): CommandArgs already set."); if (g_command_args.m_nCount == 0) diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index c5141fa02260..5563375d9567 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -74,10 +74,14 @@ #include "file_path_helper.h" #define ACT_IGNORE 1 -#define ACT_ABORT 2 -#define ACT_EXIT 3 -#define ACT_SYSTEM 4 -#define ACT_HIDE 5 +#define ACT_EXIT 2 +#define ACT_SYSTEM 3 +#define ACT_HIDE 4 +#ifdef SAL_ENABLE_CRASH_REPORT +# define ACT_ABORT 5 +#else +# define ACT_ABORT ACT_SYSTEM +#endif #define MAX_PATH_LEN 2048 @@ -556,7 +560,7 @@ static int ReportCrash( int Signal ) if (Signals[i].Signal == Signal && Signals[i].Action == ACT_ABORT ) { int ret; - char szShellCmd[512]; + char szShellCmd[512] = { '\0' }; char *pXMLTempName = NULL; char *pStackTempName = NULL; char *pChecksumTempName = NULL; @@ -728,68 +732,57 @@ static int ReportCrash( int Signal ) if ( checksumout ) fclose( checksumout ); -#if defined( LINUX ) - if ( pXMLTempName && pChecksumTempName && pStackTempName ) - snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d -xml %s -chksum %s -stack %s%s", - getpid(), - Signal, - pXMLTempName, - pChecksumTempName, - pStackTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); -#elif defined( MACOSX ) if ( pXMLTempName && pChecksumTempName && pStackTempName ) +#endif /* INCLUDE_BACKTRACE */ { - rtl_uString *crashrep_url = NULL; - rtl_uString *crashrep_path = NULL; - rtl_String *crashrep_path_system = NULL; - - rtl_string2UString( &crashrep_url, RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/crash_report.bin"), OSTRING_TO_OUSTRING_CVTFLAGS ); - rtl_bootstrap_expandMacros( &crashrep_url ); - osl_getSystemPathFromFileURL( crashrep_url, &crashrep_path ); + rtl_uString * crashrep_url = NULL; + rtl_uString * crashrep_path = NULL; + rtl_String * crashrep_path_system = NULL; + rtl_string2UString( + &crashrep_url, + RTL_CONSTASCII_USTRINGPARAM( + "$BRAND_BASE_DIR/program/crashrep"), + OSTRING_TO_OUSTRING_CVTFLAGS); + rtl_bootstrap_expandMacros(&crashrep_url); + osl_getSystemPathFromFileURL(crashrep_url, &crashrep_path); rtl_uString2String( &crashrep_path_system, - rtl_uString_getStr( crashrep_path ), - rtl_uString_getLength( crashrep_path ), + rtl_uString_getStr(crashrep_path), + rtl_uString_getLength(crashrep_path), osl_getThreadTextEncoding(), - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ); - - rtl_uString_release( crashrep_url ); - rtl_uString_release( crashrep_path ); - + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR + | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)); + rtl_uString_release(crashrep_url); + rtl_uString_release(crashrep_path); +#if defined INCLUDE_BACKTRACE && (defined LINUX || defined MACOSX) snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "%s -p %d -s %d -xml %s -chksum %s -stack %s%s", - rtl_string_getStr( crashrep_path_system ), + "%s -p %d -s %d -xml %s -chksum %s -stack %s -noui%s", + rtl_string_getStr(crashrep_path_system), getpid(), Signal, pXMLTempName, pChecksumTempName, pStackTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); - - rtl_string_release( crashrep_path_system ); - - printf( "%s\n", szShellCmd ); - } -#elif defined ( SOLARIS ) - if ( pXMLTempName && pChecksumTempName ) + bAutoCrashReport ? " -send" : "" ); +#elif defined INCLUDE_BACKTRACE && defined SOLARIS snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d -xml %s -chksum %s%s", + "%s -p %d -s %d -xml %s -chksum %s -noui%s", + rtl_string_getStr(crashrep_path_system), getpid(), Signal, pXMLTempName, pChecksumTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); + bAutoCrashReport ? " -send" : "" ); +#else + snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), + "%s -p %d -s %d -noui%s", + rtl_string_getStr(crashrep_path_system), + getpid(), Signal, bAutoCrashReport ? " -send" : "" ); #endif + rtl_string_release(crashrep_path_system); + } -#else /* defined INCLUDE BACKTRACE */ - snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d%s", getpid(), Signal, bAutoCrashReport ? " -noui -send" : " -noui" ); -#endif /* defined INCLUDE BACKTRACE */ - - - ret = system( szShellCmd ); + ret = szShellCmd[0] == '\0' ? -1 : system( szShellCmd ); if ( pXMLTempName ) unlink( pXMLTempName ); diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c index 8f9da54dd52d..bd5185a2ba2b 100644 --- a/sal/osl/w32/pipe.c +++ b/sal/osl/w32/pipe.c @@ -629,7 +629,7 @@ oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe) pPipe->m_Error = osl_Pipe_E_None; } else - Error = osl_Pipe_E_None; + Error = osl_Pipe_E_NotFound; return (Error); } diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index b8b2d3893345..96187be7e203 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -322,6 +322,7 @@ oslProcessError SAL_CALL osl_getExecutableFile( rtl_uString **ppustrFile ) oslProcessError result = osl_Process_E_NotFound; osl_acquireMutex (*osl_getGlobalMutex()); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) { /* CommandArgs set. Obtain arv[0]. */ @@ -340,6 +341,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount(void) sal_uInt32 result = 0; osl_acquireMutex (*osl_getGlobalMutex()); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > 0) { /* We're not counting argv[0] here. */ @@ -357,6 +359,7 @@ oslProcessError SAL_CALL osl_getCommandArg( sal_uInt32 nArg, rtl_uString **strCo oslProcessError result = osl_Process_E_NotFound; osl_acquireMutex (*osl_getGlobalMutex()); + OSL_ASSERT(g_command_args.m_nCount > 0); if (g_command_args.m_nCount > (nArg + 1)) { /* We're not counting argv[0] here. */ @@ -372,6 +375,7 @@ oslProcessError SAL_CALL osl_getCommandArg( sal_uInt32 nArg, rtl_uString **strCo void SAL_CALL osl_setCommandArgs (int argc, char ** argv) { + OSL_ASSERT(argc > 0); osl_acquireMutex (*osl_getGlobalMutex()); if (g_command_args.m_nCount == 0) { diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index f46c233ee932..fc04d5b84a8f 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -169,8 +169,7 @@ namespace /* private */ { rtl::OUString env_var = rtl::OUString(env_vars[i]); - if ((env_var.getLength() == 0) || - (env_var.indexOf(NAME_VALUE_SEPARATOR) == -1)) + if (env_var.getLength() == 0) return false; iterator_pair_t iter_pair = std::equal_range( @@ -179,10 +178,17 @@ namespace /* private */ env_var, less_environment_variable()); - if (iter_pair.first != iter_pair.second) // found - *iter_pair.first = env_var; - else // not found - merged_env->insert(iter_pair.first, env_var); + if (env_var.indexOf(NAME_VALUE_SEPARATOR) == -1) + { + merged_env->erase(iter_pair.first, iter_pair.second); + } + else + { + if (iter_pair.first != iter_pair.second) // found + *iter_pair.first = env_var; + else // not found + merged_env->insert(iter_pair.first, env_var); + } } return true; } @@ -198,9 +204,9 @@ namespace /* private */ if (!create_merged_environment(environment_vars, n_environment_vars, &merged_env)) return false; - // reserve enough space for the '\0'-separated environment strings and + // allocate enough space for the '\0'-separated environment strings and // a final '\0' - environment.reserve(calc_sum_of_string_lengths(merged_env) + 1); + environment.resize(calc_sum_of_string_lengths(merged_env) + 1); string_container_const_iterator_t iter = merged_env.begin(); string_container_const_iterator_t iter_end = merged_env.end(); diff --git a/sal/prj/build.lst b/sal/prj/build.lst index 5622d80edeef..638252ad4ee8 100644 --- a/sal/prj/build.lst +++ b/sal/prj/build.lst @@ -1,4 +1,4 @@ -sa sal : xml2cmp stlport external BOOST:boost NULL +sa sal : xml2cmp stlport external BOOST:boost CPPUNIT:cppunit NULL sa sal usr1 - all sa_mkout NULL sa sal\inc nmake - all sa_inc NULL sa sal\typesconfig nmake - u sa_tc sa_inc NULL @@ -14,3 +14,8 @@ sa sal\qa nmake - all sa_qa sa_util NULL sa sal\osl\unx nmake - u sa_oslu sa_tc.u sa_inc NULL sa sal\osl\all nmake - all sa_oslall sa_tc.u sa_inc NULL sa sal\util nmake - all sa_util sa_tc.u sa_oslall sa_uwinapi.n sa_kill.n sa_onlineupdate.n sa_osln.n sa_oslp.p sa_oslu.u sa_rtl sa_textenc NULL +sa sal\cppunittester nmake - all sa_cppunittester sa_cpprt.u sa_util NULL +sa sal\qa\ByteSequence nmake - all sa_qa_ByteSequence sa_cppunittester sa_util NULL +sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util NULL +sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL +sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL diff --git a/sal/prj/d.lst b/sal/prj/d.lst index bcd9c0e2c95a..3ce270bbbfc4 100644 --- a/sal/prj/d.lst +++ b/sal/prj/d.lst @@ -34,3 +34,5 @@ symlink: %_DEST%\lib%_EXT%\libuno_sal.dylib.3 %_DEST%\lib%_EXT%\libuno_sal.dylib ..\%__SRC%\inc\udkversion.h %_DEST%\inc%_EXT%\sal\udkversion.h +..\%__SRC%\bin\cppunittester %_DEST%\bin%_EXT%\cppunittester +..\%__SRC%\bin\cppunittester.exe %_DEST%\bin%_EXT%\cppunittester.exe diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx index 8c1bebf934c7..7c9ff2eaef94 100644 --- a/sal/qa/ByteSequence/ByteSequence.cxx +++ b/sal/qa/ByteSequence/ByteSequence.cxx @@ -1,607 +1,194 @@ /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sal.hxx" -#include <Byte_Const.h> -#include <rtl/byteseq.h> - -#include <rtl/byteseq.hxx> - -#include <testshl/simpleheader.hxx> - -using namespace rtl; - -namespace rtl_ByteSequence -{ - -//------------------------------------------------------------------------ -// testing constructors -//------------------------------------------------------------------------ - -class ctor : public CppUnit::TestFixture - { - public: - - void ctor_001() - { - ::rtl::ByteSequence aByteSeq1; - ::rtl::ByteSequence aByteSeq2( &kTestEmptyByteSeq ); - CPPUNIT_ASSERT_MESSAGE - ( - "Creates an empty sequence", - aByteSeq1.getLength() == 0 && - aByteSeq1 == aByteSeq2 - ); - } - - void ctor_002() - { - ::rtl::ByteSequence aByteSeq; - ::rtl::ByteSequence aByteSeqtmp( aByteSeq ); - CPPUNIT_ASSERT_MESSAGE - ( - "Creates a copy of given sequence", - aByteSeq == aByteSeqtmp - ); - - } - - void ctor_003() - { - ::rtl::ByteSequence aByteSeq( &kTestByteSeq1 ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Copy constructor Creates a copy from the C-Handle ", - nNewLen == kTestSeqLen1 - ); - } - - void ctor_003_1() - { - ::rtl::ByteSequence aByteSeq( &kTestByteSeq2 ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Copy constructor Creates a copy from the C-Handle: reference count > 1 ", - nNewLen == kTestSeqLen2 - ); - } - - void ctor_004() - { - sal_Int8 * pElements = &kTestByte4; - sal_Int32 len = kTestByteCount1; - ::rtl::ByteSequence aByteSeq( pElements, len); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Creates a copy of given data bytes", - aByteSeq[1] == pElements[1] && - len == nNewLen - - ); - } - - void ctor_005() - { - sal_Int32 len = 50; - ::rtl::ByteSequence aByteSeq( len ); - sal_Int32 nNewLen = aByteSeq.getLength(); - sal_Bool res = sal_True; - for (sal_Int32 i=0; i<len; i++) - { - if (aByteSeq[i] != 0) - res = sal_False; - } - CPPUNIT_ASSERT_MESSAGE - ( - "Creates sequence of given length and initializes all bytes to 0", - nNewLen == len && res - - ); - } - - void ctor_006() - { - sal_Int32 len = 39; - ::rtl::ByteSequence aByteSeq( len , BYTESEQ_NODEFAULT ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Creates sequence of given length and does NOT initialize data", - nNewLen == len - - ); - } - - void ctor_007() - { - ::rtl::ByteSequence aByteSeq( &kTestByteSeq3, BYTESEQ_NOACQUIRE ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Creates a sequence from a C-Handle without acquiring the handle, thus taking over ownership", - nNewLen == kTestSeqLen3 - ); - } - - CPPUNIT_TEST_SUITE(ctor); - CPPUNIT_TEST(ctor_001); - CPPUNIT_TEST(ctor_002); - CPPUNIT_TEST(ctor_003); - CPPUNIT_TEST(ctor_003_1); - CPPUNIT_TEST(ctor_004); - CPPUNIT_TEST(ctor_005); - CPPUNIT_TEST(ctor_006); - CPPUNIT_TEST(ctor_007); - CPPUNIT_TEST_SUITE_END(); - }; - -class assign : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { - } - - // insert your test code here. - void assign_001() - { - sal_Int32 len = kTestByteCount1; - sal_Int32 len2 = len - 1; - sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( kTestByte5, len); - ::rtl::ByteSequence aByteSeq2( pElements, len2); - aByteSeq2 = aByteSeq1; - sal_Int32 nNewLen = aByteSeq2.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Assignment operator: assign longer sequence to another", - aByteSeq1 == aByteSeq2 && - nNewLen == len - ); - } - - void assign_002() - { - sal_Int32 len = kTestByteCount1 - 1 ; - ::rtl::ByteSequence aByteSeq1( len ); - sal_Int8 * pElements = &kTestByte1; - ::rtl::ByteSequence aByteSeq2( pElements, len + 1); - aByteSeq2 = aByteSeq1; - sal_Int32 nNewLen = aByteSeq2.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Assignment operator: assign shorter sequence to another", - aByteSeq1 == aByteSeq2 && - nNewLen == len - ); - } - - void assign_003() - { - sal_Int32 len = kTestByteCount1 - 1 ; - const sal_Int8 * pElements = &kTestByte2; - ::rtl::ByteSequence aByteSeq1( pElements, len + 1 ); - ::rtl::ByteSequence aByteSeq2( len, BYTESEQ_NODEFAULT ); - aByteSeq2 = aByteSeq1; - sal_Int32 nNewLen = aByteSeq2.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Assignment operator: assign sequence to another sequence having no data initialized", - aByteSeq1 == aByteSeq2 && - nNewLen == kTestByteCount1 - ); - } - - void assign_004() - { - ::rtl::ByteSequence aByteSeq1; - sal_Int32 len = kTestByteCount1 ; - const sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq2( pElements, len); - aByteSeq2 = aByteSeq1; - sal_Int32 nNewLen = aByteSeq2.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Assignment operator: assign empty sequence to another not empty sequence", - aByteSeq1 == aByteSeq2 && - nNewLen == 0 - ); - } - - CPPUNIT_TEST_SUITE(assign); - CPPUNIT_TEST(assign_001); - CPPUNIT_TEST(assign_002); - CPPUNIT_TEST(assign_003); - CPPUNIT_TEST(assign_004); - CPPUNIT_TEST_SUITE_END(); -}; // class operator= - - -class equal : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { - } - - // insert your test code here. - void equal_001() - { - sal_Int32 len = kTestByteCount1 ; - sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( pElements, len-1); - ::rtl::ByteSequence aByteSeq2( pElements, len); - sal_Bool res = aByteSeq1 == aByteSeq2; - CPPUNIT_ASSERT_MESSAGE - ( - "Equality operator: compare two sequences 1", - !res - ); - } - - void equal_002() - { - sal_Int32 len = kTestByteCount1 ; - const sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( pElements, len); - ::rtl::ByteSequence aByteSeq2( pElements, len); - sal_Bool res = aByteSeq1 == aByteSeq2; - CPPUNIT_ASSERT_MESSAGE - ( - "Equality operator: compare two sequences 2", - res - ); - } - - void equal_003() - { - sal_Int32 len = kTestByteCount1 ; - const sal_Int8 * pElements = kTestByte5; - ::rtl::ByteSequence aByteSeq1( pElements, len); - pElements = kTestByte6; - ::rtl::ByteSequence aByteSeq2( pElements, len); - sal_Bool res = aByteSeq1 == aByteSeq2; - CPPUNIT_ASSERT_MESSAGE - ( - "Equality operator: compare two sequences 2", - !res - ); - } - CPPUNIT_TEST_SUITE(equal); - CPPUNIT_TEST(equal_001); - CPPUNIT_TEST(equal_002); - CPPUNIT_TEST(equal_003); - CPPUNIT_TEST_SUITE_END(); -}; // class equal - - -class notequal : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } +#include "sal/config.h" - void tearDown() - { - } - - // insert your test code here. - void notequal_001() - { - sal_Int32 len = kTestByteCount1 ; - const sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( pElements, len-1); - ::rtl::ByteSequence aByteSeq2( pElements, len); - sal_Bool res = aByteSeq1 != aByteSeq2; - CPPUNIT_ASSERT_MESSAGE - ( - "Equality operator: compare two sequences 1", - res - ); - } - - void notequal_002() - { - sal_Int32 len = kTestByteCount1 ; - const sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( pElements, len); - ::rtl::ByteSequence aByteSeq2( pElements, len); - sal_Bool res = aByteSeq1 != aByteSeq2; - CPPUNIT_ASSERT_MESSAGE - ( - "Equality operator: compare two sequences 2", - !res - ); - } - - CPPUNIT_TEST_SUITE(notequal); - CPPUNIT_TEST(notequal_001); - CPPUNIT_TEST(notequal_002); - CPPUNIT_TEST_SUITE_END(); -}; // class notequal +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" +#include "rtl/byteseq.hxx" +#include "sal/types.h" +namespace { -class getArray : public CppUnit::TestFixture -{ +class Test: public CppUnit::TestFixture { public: - // initialise your test code values here. - void setUp() - { + void test_default() { + rtl::ByteSequence s; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), s.getLength()); } - void tearDown() - { + void test_size0() { + rtl::ByteSequence s(sal_Int32(0)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), s.getLength()); } - // insert your test code here. - void getArray_001() - { - sal_Int32 len = kTestByteCount1 ; - sal_Int8 * pElements = &kTestByte; - ::rtl::ByteSequence aByteSeq1( pElements, len); - sal_Int8 * pArray = aByteSeq1.getArray(); - sal_Bool res = sal_True; - for (sal_Int32 i = 0; i < len; i++) - { - if (pElements[i] != pArray[i]) - res = sal_False; - } - CPPUNIT_ASSERT_MESSAGE - ( - "Gets the pointer to byte array: one element sequence", - res == sal_True - ); + void test_size5() { + rtl::ByteSequence s(5); + sal_Int8 const * p = s.getConstArray(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), s.getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[0]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[1]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[2]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[3]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[4]); } - void getArray_002() - { - sal_Int8 * pElements = kTestByte6; - ::rtl::ByteSequence aByteSeq(pElements, 5); - sal_Int8 * pArray = aByteSeq.getArray(); - sal_Bool res = sal_True; - for (sal_Int32 i = 0; i < 5; i++) - { - if (pElements[i] != pArray[i]) - res = sal_False; - } - CPPUNIT_ASSERT_MESSAGE - ( - "Gets the pointer to byte array: more elements sequence", - res == sal_True - ); + void test_noinit0() { + rtl::ByteSequence s(0, rtl::BYTESEQ_NODEFAULT); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), s.getLength()); } - CPPUNIT_TEST_SUITE(getArray); - CPPUNIT_TEST(getArray_001); - CPPUNIT_TEST(getArray_002); - CPPUNIT_TEST_SUITE_END(); -}; // class getArray - - -class realloc : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { + void test_noinit5() { + rtl::ByteSequence s(5, rtl::BYTESEQ_NODEFAULT); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), s.getLength()); } - void tearDown() - { + void test_elem0() { + rtl::ByteSequence s(0, 0); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), s.getLength()); } - // insert your test code here. - void realloc_001() - { - ::rtl::ByteSequence aByteSeq; - sal_Int32 nSize = 20; - aByteSeq.realloc( nSize ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Reallocates sequence to new length: empty sequence", - nNewLen == nSize - ); + void test_elem5() { + sal_Int8 const a[5] = { 0, 1, 2, 3, 4 }; + rtl::ByteSequence s(a, 5); + sal_Int8 const * p = s.getConstArray(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), s.getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int8(0), p[0]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(1), p[1]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(2), p[2]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(3), p[3]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(4), p[4]); } - void realloc_002() - { - //reference count > 1 - ::rtl::ByteSequence aByteSeq( &kTestByteSeq2 ); //34 - sal_Int32 nSize = 20; - aByteSeq.realloc( nSize ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Reallocates sequence: reference count > 1 && nSize < nElements", - nNewLen == nSize - ); - } - - void realloc_003() - { - //reference count > 1 - ::rtl::ByteSequence aByteSeq( &kTestByteSeq2 ); //34 - sal_Int32 nSize = kTestSeqLen2 + 5; - sal_Int32 nElements = kTestSeqLen2; - aByteSeq.realloc( nSize ); - sal_Int32 nNewLen = aByteSeq.getLength(); - sal_Bool res = sal_True; - for (int i = nSize; i < nElements; i++) - { - sal_Int8 nValue = aByteSeq[i]; - if (nValue != 0) - res = sal_False; + void test_copy() { + rtl::ByteSequence s1(5); + { + rtl::ByteSequence s2(s1); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), s2.getLength()); + CPPUNIT_ASSERT_EQUAL(s1.getConstArray(), s2.getConstArray()); + CPPUNIT_ASSERT_EQUAL(s1.getHandle(), s2.getHandle()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), s1.getHandle()->nRefCount); } - CPPUNIT_ASSERT_MESSAGE - ( - "Reallocates sequence: reference count > 1 && nSize > nElements", - nNewLen == nSize - && res == sal_True - ); - } - - void realloc_004() - { - sal_Int8 * pElements = &kTestByte3; - sal_Int32 len = kTestByteCount3; - ::rtl::ByteSequence aByteSeq( pElements, len); - sal_Int32 nSize = kTestByteCount3 - 10 ; - aByteSeq.realloc( nSize ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Reallocates sequence: nSize < nElements", - nNewLen == nSize - ); - } - - void realloc_005() - { - sal_Int8 * pElements = kTestByte6; - sal_Int32 len = 4; - ::rtl::ByteSequence aByteSeq( pElements, len); - sal_Int32 nSize = len + 10 ; - aByteSeq.realloc( nSize ); - sal_Int32 nNewLen = aByteSeq.getLength(); - CPPUNIT_ASSERT_MESSAGE - ( - "Reallocates sequence: nSize > nElements", - nNewLen == nSize - ); - } - - CPPUNIT_TEST_SUITE(realloc); - CPPUNIT_TEST(realloc_001); - CPPUNIT_TEST(realloc_002); - CPPUNIT_TEST(realloc_003); - CPPUNIT_TEST(realloc_004); - CPPUNIT_TEST(realloc_005); - //CPPUNIT_TEST(realloc_006); - CPPUNIT_TEST_SUITE_END(); -}; // class realloc - - -class getData : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getHandle()->nRefCount); } - // insert your test code here. - void getData_001() - { - sal_Int8 * pElements = kTestByte5; - ::rtl::ByteSequence aByteSeq(pElements, 4); - sal_Bool res = sal_True; - if (aByteSeq[0] != kTestByte) - res = sal_False; - - if (aByteSeq[1] != kTestByte1) - res = sal_False; - - if (aByteSeq[2] != kTestByte2) - res = sal_False; - - if (aByteSeq[3] != kTestByte3) - res = sal_False; - - CPPUNIT_ASSERT_MESSAGE - ( - "Obtains a reference to byte indexed at given position: empty sequence", - res == sal_True - ); - } - - void getData_002() - { - ::rtl::ByteSequence aByteSeq( &kTestByteSeq2 ); - sal_Int8 nValue = aByteSeq[0]; - CPPUNIT_ASSERT_MESSAGE - ( - "Obtains a reference to byte indexed at given position: reference count > 1", - nValue == kTestChar2 //not sure what is right,hehe - ); - } - - void getData_003() - { - ::rtl::ByteSequence aByteSeq( &kTestByteSeq3 ); - sal_Int8 nValue = aByteSeq[0]; - CPPUNIT_ASSERT_MESSAGE - ( - "Obtains a reference to byte indexed at given position: reference count = 1", - nValue == kTestChar3 //not sure what is right,hehe - ); + void test_fromC() { + sal_Sequence c = { 1, 1, { 0 } }; + { + rtl::ByteSequence s(&c); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s.getLength()); + CPPUNIT_ASSERT_EQUAL( + static_cast< void const * >(c.elements), + static_cast< void const * >(s.getConstArray())); + CPPUNIT_ASSERT_EQUAL(&c, s.getHandle()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), c.nRefCount); + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), c.nRefCount); } - CPPUNIT_TEST_SUITE(getData); - CPPUNIT_TEST(getData_001); - CPPUNIT_TEST(getData_002); - CPPUNIT_TEST(getData_003); + void test_noacquire() { + sal_Sequence c = { 2, 1, { 0 } }; + { + rtl::ByteSequence s(&c, rtl::BYTESEQ_NOACQUIRE); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s.getLength()); + CPPUNIT_ASSERT_EQUAL( + static_cast< void const * >(c.elements), + static_cast< void const * >(s.getConstArray())); + CPPUNIT_ASSERT_EQUAL(&c, s.getHandle()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), c.nRefCount); + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), c.nRefCount); + } + + void test_getArray() { + sal_Int8 const a[5] = { 0, 1, 2, 3, 4 }; + rtl::ByteSequence s1(a, 5); + rtl::ByteSequence s2(s1); + sal_Int8 * p = s2.getArray(); + p[2] = 10; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getHandle()->nRefCount); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s2.getHandle()->nRefCount); + CPPUNIT_ASSERT_EQUAL(sal_Int8(2), s1.getConstArray()[2]); + CPPUNIT_ASSERT_EQUAL(sal_Int8(10), s2.getConstArray()[2]); + } + + void test_same0() { + rtl::ByteSequence s1; + rtl::ByteSequence s2; + CPPUNIT_ASSERT_EQUAL(sal_True, s1 == s2); + CPPUNIT_ASSERT_EQUAL(sal_True, s2 == s1); + CPPUNIT_ASSERT_EQUAL(sal_False, s1 != s2); + CPPUNIT_ASSERT_EQUAL(sal_False, s2 != s1); + } + + void test_diffLen() { + sal_Int8 const a[5] = { 0, 1, 2, 3, 4 }; + rtl::ByteSequence s1(a, 5); + rtl::ByteSequence s2(a, 4); + CPPUNIT_ASSERT_EQUAL(sal_False, s1 == s2); + CPPUNIT_ASSERT_EQUAL(sal_False, s2 == s1); + CPPUNIT_ASSERT_EQUAL(sal_True, s1 != s2); + CPPUNIT_ASSERT_EQUAL(sal_True, s2 != s1); + } + + void test_diffElem() { + sal_Int8 const a1[5] = { 0, 1, 2, 3, 4 }; + rtl::ByteSequence s1(a1, 5); + sal_Int8 const a2[5] = { 0, 1, 10, 3, 4 }; + rtl::ByteSequence s2(a2, 5); + CPPUNIT_ASSERT_EQUAL(sal_False, s1 == s2); + CPPUNIT_ASSERT_EQUAL(sal_False, s2 == s1); + CPPUNIT_ASSERT_EQUAL(sal_True, s1 != s2); + CPPUNIT_ASSERT_EQUAL(sal_True, s2 != s1); + } + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(test_default); + CPPUNIT_TEST(test_size0); + CPPUNIT_TEST(test_size5); + CPPUNIT_TEST(test_noinit0); + CPPUNIT_TEST(test_noinit5); + CPPUNIT_TEST(test_elem0); + CPPUNIT_TEST(test_elem5); + CPPUNIT_TEST(test_copy); + CPPUNIT_TEST(test_fromC); + CPPUNIT_TEST(test_noacquire); + CPPUNIT_TEST(test_getArray); + CPPUNIT_TEST(test_same0); + CPPUNIT_TEST(test_diffLen); + CPPUNIT_TEST(test_diffElem); CPPUNIT_TEST_SUITE_END(); -}; // class getData - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::ctor, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::assign, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::equal, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::notequal, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::getArray, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::realloc, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::getData, "rtl_ByteSequence"); -} // namespace ByteSequence +}; +CPPUNIT_TEST_SUITE_REGISTRATION(Test); -// ----------------------------------------------------------------------------- +} -// 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; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/ByteSequence/Byte_Const.h b/sal/qa/ByteSequence/Byte_Const.h deleted file mode 100644 index 2d167b7d673c..000000000000 --- a/sal/qa/ByteSequence/Byte_Const.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _BYTE_CONST_H_ -#define _BYTE_CONST_H_ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -#include <sal/types.h> - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifdef __cplusplus -extern "C" -{ -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -const sal_Int32 kTestByteCount1 = 7; -const sal_Int32 kTestByteCount2 = 0; -const sal_Int32 kTestByteCount3 = 45; -const sal_Int32 kTestByteCount4 = 100; -const sal_Int32 kTestByteCount5 = 23; -const sal_Int32 kTestByteCount6 = 90; - - -sal_Int8 kTestByte = 100; -sal_Int8 kTestByte1 = 0; -sal_Int8 kTestByte2 = 1; -sal_Int8 kTestByte3 = 2; -sal_Int8 kTestByte4 = -98; - -sal_Int8 kTestByte5[] = {kTestByte, kTestByte1, kTestByte2, kTestByte3, kTestByte4}; - -sal_Int8 kTestByte60 = 56; -sal_Int8 kTestByte61 = -1; -sal_Int8 kTestByte62 = -23; -sal_Int8 kTestByte63 = 21; -sal_Int8 kTestByte64 = -128; -sal_Int8 kTestByte65 = 127; -sal_Int8 kTestByte6[] = {kTestByte60, kTestByte61, kTestByte62, kTestByte63, kTestByte64, kTestByte65}; - -//------------------------------------------------------------------------ - -char kTestChar = 45; -char kTestChar0 = 0; - char kTestChar1 = (char)((500 & 0xff) - 256); -char kTestChar2 = 78; - char kTestChar3 = (char)(-155 & 0xff); - -sal_Int32 kTestSeqLen0 = 0; -sal_Int32 kTestSeqLen1 = 5; -sal_Int32 kTestSeqLen2 = 34; -sal_Int32 kTestSeqLen3 = 270; - -sal_Sequence kTestEmptyByteSeq = -{ - 1, /* sal_Int32 refCount; */ - kTestSeqLen0, /* sal_Int32 length; */ - { kTestChar0 } /* sal_Unicode buffer[1]; */ -}; - -sal_Sequence kTestByteSeq1 = -{ - 1, /* sal_Int32 refCount; */ - kTestSeqLen1, /* sal_Int32 length; */ - { kTestChar1 } /* sal_Unicode buffer[1]; */ -}; - -sal_Sequence kTestByteSeq2 = -{ - 3, /* sal_Int32 refCount; */ - kTestSeqLen2, /* sal_Int32 length; */ - { kTestChar2 } /* sal_Unicode buffer[1]; */ -}; - -sal_Sequence kTestByteSeq3 = -{ - 2, /* sal_Int32 refCount; */ - kTestSeqLen3, /* sal_Int32 length; */ - { kTestChar3 } /* sal_Unicode buffer[1]; */ -}; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifdef __cplusplus -} -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#endif /* _BYTE_CONST_H_ */ - - diff --git a/sal/qa/ByteSequence/export.exp b/sal/qa/ByteSequence/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/ByteSequence/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/qa/ByteSequence/makefile.mk index 4727a0cc51b1..9f7bfcfd25ce 100644 --- a/sal/qa/ByteSequence/makefile.mk +++ b/sal/qa/ByteSequence/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -23,56 +23,33 @@ # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # -#************************************************************************* -PRJ=..$/.. - -PRJNAME=sal -TARGET=qa_bytesequence -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -CFLAGS+= $(LFS_CFLAGS) -CXXFLAGS+= $(LFS_CFLAGS) - -#----------------------------------- OStringBuffer ----------------------------------- - -SHL1OBJS= \ - $(SLO)$/ByteSequence.obj - -SHL1TARGET= rtl_ByteSequence -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +#***********************************************************************/ -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF= $(MISC)$/$(SHL1TARGET).def +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +PRJ = ../.. +PRJNAME = sal +TARGET = qa_ByteSequence -# --- BEGIN -------------------------------------------------------- -SHL2OBJS= \ - $(SLO)$/rtl_old_testbyteseq.obj -SHL2TARGET= rtl_old_testbyteseq -SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +ENABLE_EXCEPTIONS = TRUE -SHL2IMPLIB= i$(SHL2TARGET) +.INCLUDE: settings.mk -DEF2NAME =$(SHL2TARGET) -SHL2VERSIONMAP = $(PRJ)$/qa$/export.map -# END -------------------------------------------------------------- +CFLAGSCXX += $(CPPUNIT_CFLAGS) -#------------------------------- All object files ------------------------------- -# do this here, so we get right dependencies -SLOFILES=$(SHL1OBJS) +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLO)/ByteSequence.obj +SHL1RPATH = NONE +SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) +SHL1TARGET = rtl_ByteSequence +SHL1VERSIONMAP = $(PRJ)/qa/export.map +DEF1NAME = $(SHL1TARGET) -# --- Targets ------------------------------------------------------ +SLOFILES = $(SHL1OBJS) -.INCLUDE : target.mk -.INCLUDE : _cppunit.mk +.INCLUDE: target.mk +.INCLUDE: _cppunit.mk +.END diff --git a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx deleted file mode 100644 index 0c5e7126ce2e..000000000000 --- a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" -// LLA: -// this file is converted to use with testshl2 -// original was placed in sal/test/textenc.cxx -// ----------------------------------------------------------------------------- - -#include <stdio.h> - -// #include <osl/diagnose.h> -#include <rtl/byteseq.hxx> - -using namespace ::rtl; - -#include <testshl/simpleheader.hxx> - - -namespace rtl_testbyteseq -{ - -// ----------------------------------------------------------------------------- - -class oldbyteseq : public CppUnit::TestFixture -{ -public: - void test_bytesequence_001(); - - CPPUNIT_TEST_SUITE( oldbyteseq ); - CPPUNIT_TEST( test_bytesequence_001 ); - CPPUNIT_TEST_SUITE_END( ); -}; - -// ----------------------------------------------------------------------------- - -void oldbyteseq::test_bytesequence_001() -{ - signed char a[5] = { 1 , 2 , 3 , 4 , 5 }; - - // test the c++ wrapper - { - ByteSequence seq; - OSL_ENSURE( ! seq.getLength() , "" ); - - ByteSequence seq2( a , 5 ); - - OSL_ENSURE( !( seq == seq2) , "" ); - - seq = seq2; - OSL_ENSURE( seq == seq2 , "" ); - - seq[0] = 2; - OSL_ENSURE( !(seq == seq2) , "" ); - - seq = ByteSequence( a , 5 ); - OSL_ENSURE( seq == seq2 , "" ); - - seq = ByteSequence( 5 ); // default value is 0 for each byte - OSL_ENSURE( !( seq == seq2 ) , "" ); - } - - { - sal_Sequence *pSeq = 0; - rtl_byte_sequence_construct( &pSeq , 0 ); - - // implementation dependent test. - OSL_ENSURE( pSeq->nRefCount == 2 , "invalid refcount for empty sequence" ); - - sal_Sequence *pSeq2 = 0; - rtl_byte_sequence_constructFromArray( &pSeq2 , a , 5 ); - - OSL_ENSURE( ! rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" ); - - rtl_byte_sequence_assign( &pSeq , pSeq2 ); - OSL_ENSURE( pSeq == pSeq2 , "" ); - OSL_ENSURE( rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" ); - - rtl_byte_sequence_reference2One( &pSeq ); - (( sal_Int8*) rtl_byte_sequence_getConstArray( pSeq ) )[0] = 2; - - OSL_ENSURE( ! rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" ); - - rtl_byte_sequence_constructFromArray( &pSeq , a , 5 ); - OSL_ENSURE( rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" ); - - rtl_byte_sequence_construct( &pSeq , 5 ); - OSL_ENSURE( ! rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" ); - - - - rtl_byte_sequence_release( pSeq2 ); - rtl_byte_sequence_release( pSeq ); - } - - - printf( "test bytesequence OK\n" ); - -} - -} // namespace osl_test_file - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_testbyteseq::oldbyteseq, "rtl_ByteSequence" ); - -// ----------------------------------------------------------------------------- -NOADDITIONAL; diff --git a/sal/qa/OStringBuffer/export.exp b/sal/qa/OStringBuffer/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/OStringBuffer/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk index c7e3a2a37657..d46168dc4d0e 100644 --- a/sal/qa/OStringBuffer/makefile.mk +++ b/sal/qa/OStringBuffer/makefile.mk @@ -24,6 +24,11 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/.. PRJNAME=sal @@ -40,6 +45,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + #------------------------------- All object files ------------------------------- # do this here, so we get right dependencies # SLOFILES= \ @@ -52,15 +59,14 @@ SHL1OBJS= \ $(SLO)$/rtl_String_Utils.obj SHL1TARGET= rtl_OStringBuffer -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp SHL1VERSIONMAP = $(PRJ)$/qa$/export.map - +SHL1RPATH = NONE #------------------------------- All object files ------------------------------- # do this here, so we get right dependencies @@ -71,3 +77,4 @@ SLOFILES=$(SHL1OBJS) .INCLUDE : target.mk .INCLUDE : _cppunit.mk +.END diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index c2221aa68682..01a620e8a238 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -35,7 +35,12 @@ #include <rtl/strbuf.hxx> -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" + +#include <string.h> using namespace rtl; @@ -18404,67 +18409,34 @@ t_print("\n"); // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ctors, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::makeStringAndClear, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getLength, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getCapacity, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ensureCapacity, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setLength, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::charAt, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::csuc, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getStr, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setCharAt, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_001, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_002, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_003, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_004, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_005, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_float, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_double, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative, - "rtl_OStringBuffer"); - -// ----------------------------------------------------------------------------- - -// 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; +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::ctors); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::makeStringAndClear); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getLength); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getCapacity); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::ensureCapacity); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::setLength); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::charAt); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::csuc); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getStr); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::setCharAt); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_001); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_002); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_003); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_004); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_005); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_float); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_double); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative); + +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/OStringBuffer/rtl_String_Const.h b/sal/qa/OStringBuffer/rtl_String_Const.h index 8e5a2977b27a..fb0f9409dded 100644 --- a/sal/qa/OStringBuffer/rtl_String_Const.h +++ b/sal/qa/OStringBuffer/rtl_String_Const.h @@ -542,7 +542,6 @@ static const sal_Int32 expValStrLastNormal[nStrLastNormalCount] = 0,-1,0,4,-1,-1,-1,-1,-1,3,15,11 }; //------------------------------------------------------------------------ -static const sal_Int32 kNonSInt64Max = LONG_MIN; static const sal_Int32 kNonSInt32Max = INT_MIN; static const sal_Int32 kNonSInt16Max = SHRT_MIN; //------------------------------------------------------------------------ diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.cxx b/sal/qa/OStringBuffer/rtl_String_Utils.cxx index 0dc2caaf83be..74b3e80e47c1 100644 --- a/sal/qa/OStringBuffer/rtl_String_Utils.cxx +++ b/sal/qa/OStringBuffer/rtl_String_Utils.cxx @@ -88,7 +88,7 @@ sal_Char* cpystr( sal_Char* dst, const sal_Char* src ) const sal_Char* psrc = src; sal_Char* pdst = dst; - while( *pdst++ = *psrc++ ); + while( (*pdst++ = *psrc++) ); return ( dst ); } diff --git a/sal/qa/export.map b/sal/qa/export.map index 0e4fe0c88ff2..3308588ef6f8 100755 --- a/sal/qa/export.map +++ b/sal/qa/export.map @@ -25,9 +25,9 @@ # #************************************************************************* -UDK_3.0 { +UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/sal/qa/osl/module/export_dll.map b/sal/qa/osl/module/export_dll.map index 9527d66debdc..87c701f21d91 100644 --- a/sal/qa/osl/module/export_dll.map +++ b/sal/qa/osl/module/export_dll.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3.0 { +UDK_3_0_0 { global: firstfunc; diff --git a/sal/qa/osl/mutex/makefile.mk b/sal/qa/osl/mutex/makefile.mk index 4ec1e56c8a17..de4121e3a0b9 100755 --- a/sal/qa/osl/mutex/makefile.mk +++ b/sal/qa/osl/mutex/makefile.mk @@ -25,6 +25,10 @@ # #************************************************************************* +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -39,25 +43,24 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:Socket by codegen.pl SHL1OBJS= \ $(SLO)$/osl_Mutex.obj SHL1TARGET= osl_Mutex -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) .IF "$(GUI)" == "WNT" SHL1STDLIBS += $(WS2_32LIB) .ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS += -ldl -lnsl -.ENDIF - SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1RPATH = NONE # auto generated Target:Socket # END ------------------------------------------------------------------ @@ -66,3 +69,5 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map .INCLUDE : target.mk .INCLUDE : _cppunit.mk + +.END diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx index 45292da9718a..4b1b078785d3 100755 --- a/sal/qa/osl/mutex/osl_Mutex.cxx +++ b/sal/qa/osl/mutex/osl_Mutex.cxx @@ -31,6 +31,10 @@ //------------------------------------------------------------------------ // include files //------------------------------------------------------------------------ +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include <osl_Mutex_Const.h> using namespace osl; @@ -46,17 +50,17 @@ inline void printUString( const ::rtl::OUString & str ) { rtl::OString aString; - t_print("#printUString_u# " ); + printf("#printUString_u# " ); aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); + printf("%s\n", aString.getStr( ) ); } /** print Boolean value. */ inline void printBool( sal_Bool bOk ) { - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); + printf("#printBool# " ); + ( sal_True == bOk ) ? printf("YES!\n" ): printf("NO!\n" ); } /** pause nSec seconds helper function. @@ -75,7 +79,7 @@ namespace ThreadHelper #if ( defined UNX ) || ( defined OS2 ) //Unix sleep( _nSec ); #endif - // t_print("# done\n" ); + // printf("# done\n" ); } void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) { @@ -227,7 +231,7 @@ protected: { // block here if the mutex has been acquired pMyMutex->acquire( ); - t_print("# Mutex acquired. \n" ); + printf("# Mutex acquired. \n" ); pMyMutex->release( ); } }; @@ -273,7 +277,7 @@ protected: Mutex* pGlobalMutex; pGlobalMutex = pGlobalMutex->getGlobalMutex( ); pGlobalMutex->acquire( ); - t_print("# Global Mutex acquired. \n" ); + printf("# Global Mutex acquired. \n" ); pGlobalMutex->release( ); } }; @@ -338,7 +342,7 @@ namespace osl_Mutex bRes = sal_True; /*for (sal_Int8 i=0; i<BUFFER_SIZE; i++) - t_print("#data in buffer is %d\n", m_Data.buffer[i]); + printf("#data in buffer is %d\n", m_Data.buffer[i]); */ CPPUNIT_ASSERT_MESSAGE("Mutex ctor", bRes == sal_True); @@ -692,7 +696,7 @@ protected: void SAL_CALL run( ) { // acquire the mutex - // t_print("# ClearGuardThread" ); + // printf("# ClearGuardThread" ); ClearableMutexGuard aGuard( pMyMutex ); ThreadHelper::thread_sleep( 5 ); @@ -768,7 +772,7 @@ namespace osl_ClearableGuard TimeValue aTimeVal_after; osl_getSystemTime( &aTimeVal_after ); sal_Int32 nSec = aTimeVal_after.Seconds - aTimeVal_befor.Seconds; - t_print("nSec is %d\n", nSec); + printf("nSec is %"SAL_PRIdINT32"\n", nSec); myThread.join(); @@ -834,7 +838,7 @@ protected: void SAL_CALL run( ) { // acquire the mutex - t_print("# ResettableGuard" ); + printf("# ResettableGuard\n" ); ResettableMutexGuard aGuard( pMyMutex ); // release the mutex aGuard.clear( ); @@ -890,13 +894,13 @@ namespace osl_ResettableGuard { Mutex aMutex; ResetGuardThread myThread( &aMutex ); - myThread.create( ); ResettableMutexGuard myMutexGuard( aMutex ); + myThread.create( ); /// is it running? and clear done? + sal_Bool bRes = myThread.isRunning( ); myMutexGuard.clear( ); ThreadHelper::thread_sleep_tenth_sec( 1 ); - sal_Bool bRes = myThread.isRunning( ); /// if reset is not success, the release will return sal_False myMutexGuard.reset( ); @@ -933,13 +937,11 @@ namespace osl_ResettableGuard }; // class reset // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ResettableGuard::ctor, "osl_ResettableGuard"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ResettableGuard::reset, "osl_ResettableGuard"); +CPPUNIT_TEST_SUITE_REGISTRATION(osl_ResettableGuard::ctor); +CPPUNIT_TEST_SUITE_REGISTRATION(osl_ResettableGuard::reset); } // namespace osl_ResettableGuard -// 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; +CPPUNIT_PLUGIN_IMPLEMENT(); // The following sets variables for GNU EMACS // Local Variables: diff --git a/sal/qa/osl/mutex/osl_Mutex_Const.h b/sal/qa/osl/mutex/osl_Mutex_Const.h index 7ae2de6fba63..30d321775f01 100755 --- a/sal/qa/osl/mutex/osl_Mutex_Const.h +++ b/sal/qa/osl/mutex/osl_Mutex_Const.h @@ -1,5 +1,5 @@ /************************************************************************* -* + * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -46,8 +46,6 @@ #endif #include <osl/time.h> -#include <testshl/simpleheader.hxx> - #ifdef UNX #include <unistd.h> #endif diff --git a/sal/qa/osl/pipe/export.exp b/sal/qa/osl/pipe/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/osl/pipe/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/osl/pipe/makefile.mk b/sal/qa/osl/pipe/makefile.mk index 23ae77d2bbcc..6350cdba0233 100644 --- a/sal/qa/osl/pipe/makefile.mk +++ b/sal/qa/osl/pipe/makefile.mk @@ -25,6 +25,10 @@ # #************************************************************************* +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -39,20 +43,22 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:Pipe by codegen.pl SHL1OBJS= \ $(SLO)$/osl_Pipe.obj SHL1TARGET= osl_Pipe -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map -# DEF1EXPORTFILE= export.exp +SHL1RPATH = NONE # auto generated Target:Pipe # END ------------------------------------------------------------------ @@ -60,3 +66,5 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map .INCLUDE : target.mk .INCLUDE : _cppunit.mk + +.END diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index 89c6ac4927f5..6371ad3b5250 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -32,7 +32,10 @@ // include files //------------------------------------------------------------------------ -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include <sal/types.h> #include <rtl/ustring.hxx> @@ -52,6 +55,7 @@ #ifdef UNX #include <unistd.h> #endif +#include <string.h> using namespace osl; using namespace rtl; @@ -64,8 +68,8 @@ using namespace rtl; */ inline void printBool( sal_Bool bOk ) { - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); + printf("#printBool# " ); + ( sal_True == bOk ) ? printf("YES!\n" ): printf("NO!\n" ); } /** print a UNI_CODE String. @@ -74,9 +78,9 @@ inline void printUString( const ::rtl::OUString & str ) { rtl::OString aString; - t_print("#printUString_u# " ); + printf("#printUString_u# " ); aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); + printf("%s\n", aString.getStr( ) ); } /** print last error of pipe system. @@ -84,43 +88,43 @@ inline void printUString( const ::rtl::OUString & str ) inline void printPipeError( ::osl::Pipe aPipe ) { oslPipeError nError = aPipe.getError( ); - t_print("#printPipeError# " ); + printf("#printPipeError# " ); switch ( nError ) { case osl_Pipe_E_None: - t_print("Success!\n" ); + printf("Success!\n" ); break; case osl_Pipe_E_NotFound: - t_print("The returned error is: Not found!\n" ); + printf("The returned error is: Not found!\n" ); break; case osl_Pipe_E_AlreadyExists: - t_print("The returned error is: Already exist!\n" ); + printf("The returned error is: Already exist!\n" ); break; case osl_Pipe_E_NoProtocol: - t_print("The returned error is: No protocol!\n" ); + printf("The returned error is: No protocol!\n" ); break; case osl_Pipe_E_NetworkReset: - t_print("The returned error is: Network reset!\n" ); + printf("The returned error is: Network reset!\n" ); break; case osl_Pipe_E_ConnectionAbort: - t_print("The returned error is: Connection aborted!\n" ); + printf("The returned error is: Connection aborted!\n" ); break; case osl_Pipe_E_ConnectionReset: - t_print("The returned error is: Connection reset!\n" ); + printf("The returned error is: Connection reset!\n" ); break; case osl_Pipe_E_NoBufferSpace: - t_print("The returned error is: No buffer space!\n" ); + printf("The returned error is: No buffer space!\n" ); break; case osl_Pipe_E_TimedOut: - t_print("The returned error is: Timeout!\n" ); + printf("The returned error is: Timeout!\n" ); break; case osl_Pipe_E_ConnectionRefused: - t_print("The returned error is: Connection refused!\n" ); + printf("The returned error is: Connection refused!\n" ); break; case osl_Pipe_E_invalidError: - t_print("The returned error is: Invalid error!\n" ); + printf("The returned error is: Invalid error!\n" ); break; default: - t_print("The returned error is: Number %d, Unknown Error\n", nError ); + printf("The returned error is: Number %d, Unknown Error\n", nError ); break; } } @@ -625,8 +629,8 @@ namespace osl_Pipe printPipeError( aPipe ); aPipe.clear( ); - CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe. not passed in (W32)(LINUX)(UNX).", - osl_Pipe_E_invalidError == nError ); + CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe.", + nError != osl_Pipe_E_None ); } void getError_002( ) @@ -638,8 +642,8 @@ namespace osl_Pipe aPipe.clear( ); aPipe1.clear( ); - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.not passed in (W32)(LINUX)(UNX).", - osl_Pipe_E_invalidError == nError ); + CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.", + nError != osl_Pipe_E_None ); } CPPUNIT_TEST_SUITE( getError ); @@ -687,17 +691,17 @@ namespace osl_Pipe // ----------------------------------------------------------------------------- - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::ctors, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::is, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::create, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::clear, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::assign, "osl_Pipe"); -//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::isValid, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::isEqual, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::close, "osl_Pipe"); - //CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::accept, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getError, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getHandle, "osl_Pipe"); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::ctors); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::is); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::create); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::clear); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::assign); +//CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isValid); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isEqual); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::close); + //CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::accept); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getError); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getHandle); // ----------------------------------------------------------------------------- } // namespace osl_Pipe @@ -881,7 +885,7 @@ namespace osl_StreamPipe void thread_sleep( sal_Int32 _nSec ) { /// print statement in thread process must use fflush() to force display. - // t_print("wait %d seconds. ", _nSec ); + // printf("wait %d seconds. ", _nSec ); fflush(stdout); #ifdef WNT //Windows @@ -890,7 +894,7 @@ namespace osl_StreamPipe #if ( defined UNX ) || ( defined OS2 ) //Unix sleep( _nSec ); #endif - // t_print("done\n" ); + // printf("done\n" ); } // test read/write & send/recv data to pipe // ----------------------------------------------------------------------------- @@ -909,27 +913,27 @@ namespace osl_StreamPipe { sal_Int32 nChars = 0; - t_print("open pipe\n"); + printf("open pipe\n"); ::osl::StreamPipe aSenderPipe( aTestPipeName, osl_Pipe_OPEN ); // aTestPipeName is a string = "TestPipe" if ( aSenderPipe.is() == sal_False ) { - t_print("pipe open failed! \n"); + printf("pipe open failed! \n"); } else { - t_print("read\n"); + printf("read\n"); nChars = aSenderPipe.read( buf, m_pTestString1.getLength() + 1 ); if ( nChars < 0 ) { - t_print("read failed! \n"); + printf("read failed! \n"); return; } - t_print("buffer is %s \n", buf); - t_print("send\n"); + printf("buffer is %s \n", buf); + printf("send\n"); nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 ); if ( nChars < 0 ) { - t_print("client send failed! \n"); + printf("client send failed! \n"); return; } } @@ -948,7 +952,7 @@ namespace osl_StreamPipe ::osl::StreamPipe aConnectionPipe; Pipe_DataSource_Thread( ) { - t_print("create pipe\n"); + printf("create pipe\n"); aListenPipe.create( aTestPipeName, osl_Pipe_CREATE ); } ~Pipe_DataSource_Thread( ) @@ -961,40 +965,40 @@ namespace osl_StreamPipe //create pipe. sal_Int32 nChars; //::osl::StreamPipe aListenPipe( aTestPipeName, osl_Pipe_CREATE ); - t_print("listen\n"); + printf("listen\n"); if ( aListenPipe.is() == sal_False ) { - t_print("pipe create failed! \n"); + printf("pipe create failed! \n"); } else { //::osl::StreamPipe aConnectionPipe; //start server and wait for connection. - t_print("accept\n"); + printf("accept\n"); if ( osl_Pipe_E_None != aListenPipe.accept( aConnectionPipe ) ) { - t_print("pipe accept failed!"); + printf("pipe accept failed!"); return; } - t_print("write\n"); + printf("write\n"); // write to pipe nChars = aConnectionPipe.write( m_pTestString1.getStr(), m_pTestString1.getLength() + 1 ); if ( nChars < 0) { - t_print("server write failed! \n"); + printf("server write failed! \n"); return; } - t_print("recv\n"); + printf("recv\n"); nChars = aConnectionPipe.recv( buf, 256 ); if ( nChars < 0) { - t_print("server receive failed! \n"); + printf("server receive failed! \n"); return; } //thread_sleep( 2 ); - t_print("received message is: %s\n", buf ); + printf("received message is: %s\n", buf ); //aConnectionPipe.close(); } } @@ -1045,16 +1049,11 @@ namespace osl_StreamPipe }; // class recv // ----------------------------------------------------------------------------- - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::ctors, "osl_StreamPipe"); -//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::assign, "osl_StreamPipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::recv, "osl_StreamPipe"); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::ctors); +//CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::assign); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::recv); // ----------------------------------------------------------------------------- } // namespace osl_StreamPipe - -// ----------------------------------------------------------------------------- - -// 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; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/osl/pipe/osl_Pipe.xsce b/sal/qa/osl/pipe/osl_Pipe.xsce deleted file mode 100644 index d96a915d8ab9..000000000000 --- a/sal/qa/osl/pipe/osl_Pipe.xsce +++ /dev/null @@ -1,9 +0,0 @@ -#i23307# -osl_Pipe.getError.getError_001 wntmsci -osl_Pipe.getError.getError_002 wntmsci - -osl_StreamPipe.recv.recv_002 wntmsci unxsols -# osl_Pipe.ctors.ctors_acquire wntmsci - -#i27889# -osl_Pipe.ctors.ctors_no_acquire wntmsci diff --git a/sal/qa/osl/pipe/osl_Pipe_Const.h b/sal/qa/osl/pipe/osl_Pipe_Const.h deleted file mode 100644 index 0b70655eabc0..000000000000 --- a/sal/qa/osl/pipe/osl_Pipe_Const.h +++ /dev/null @@ -1 +0,0 @@ -// no longer used diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk index aa99e25f7c3b..a95db211c2a6 100644 --- a/sal/qa/osl/profile/makefile.mk +++ b/sal/qa/osl/profile/makefile.mk @@ -24,6 +24,11 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -39,16 +44,19 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- SHL1OBJS= \ $(SLO)$/osl_old_testprofile.obj SHL1TARGET= osl_old_testprofile -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1RPATH = NONE # END ------------------------------------------------------------------ @@ -62,4 +70,4 @@ SLOFILES=\ .INCLUDE : target.mk .INCLUDE : _cppunit.mk - +.END diff --git a/sal/qa/osl/profile/osl_old_testprofile.cxx b/sal/qa/osl/profile/osl_old_testprofile.cxx index d85e80203cb3..966a453dc79f 100644 --- a/sal/qa/osl/profile/osl_old_testprofile.cxx +++ b/sal/qa/osl/profile/osl_old_testprofile.cxx @@ -37,7 +37,10 @@ #include <stdio.h> #include <osl/profile.h> -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" //================================================================================================== // ----------------------------------------------------------------------------- @@ -64,7 +67,8 @@ void oldtests::test_profile(void) // successful write - if (hProfile = osl_openProfile( ustrProfileName, 0 )) + hProfile = osl_openProfile( ustrProfileName, 0 ); + if (hProfile != 0) { if (! osl_writeProfileBool( hProfile, "testsection", "testbool", 1 )) printf( "### cannot write into init file!\n" ); @@ -73,7 +77,8 @@ void oldtests::test_profile(void) } // unsuccessful write - if (hProfile = osl_openProfile( ustrProfileName2, 0 )) + hProfile = osl_openProfile( ustrProfileName2, 0 ); + if (hProfile != 0) { if (osl_writeProfileBool( hProfile, "testsection", "testbool", 1 )) printf( "### unexpected success writing into test2.ini!\n" ); @@ -88,7 +93,7 @@ void oldtests::test_profile(void) } // namespace osl_Profile // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Profile::oldtests, "osl_Profile" ); +CPPUNIT_TEST_SUITE_REGISTRATION( osl_Profile::oldtests ); // ----------------------------------------------------------------------------- -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/osl/semaphore/osl_Semaphore.cxx b/sal/qa/osl/semaphore/osl_Semaphore.cxx deleted file mode 100644 index 4a02e284a89b..000000000000 --- a/sal/qa/osl/semaphore/osl_Semaphore.cxx +++ /dev/null @@ -1,525 +0,0 @@ - /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" - -//------------------------------------------------------------------------ -// include files -//------------------------------------------------------------------------ -#include <osl_Semaphore_Const.h> - -using namespace osl; -using namespace rtl; - - -//------------------------------------------------------------------------ -// helper functions and classes -//------------------------------------------------------------------------ - -/** print Boolean value. -*/ -inline void printBool( sal_Bool bOk ) -{ - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); -} - -/** print a UNI_CODE String. -*/ -inline void printUString( const ::rtl::OUString & str ) -{ - rtl::OString aString; - - t_print("#printUString_u# " ); - aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); -} - -/** wait _nSec seconds. -*/ -void thread_sleep( sal_Int32 _nSec ) -{ - /// print statement in thread process must use fflush() to force display. - // t_print("wait %d seconds. ", _nSec ); - // fflush( stdout ); - -#ifdef WNT //Windows - Sleep( _nSec * 1000 ); -#endif -#if ( defined UNX ) || ( defined OS2 ) //Unix - sleep( _nSec ); -#endif -} - - void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) - { -#ifdef WNT //Windows - Sleep(_nTenthSec * 100 ); -#endif -#if ( defined UNX ) || ( defined OS2 ) //Unix - TimeValue nTV; - nTV.Seconds = static_cast<sal_uInt32>( _nTenthSec/10 ); - nTV.Nanosec = ( (_nTenthSec%10 ) * 100000000 ); - osl_waitThread(&nTV); -#endif -} - -/** thread for testing Semaphore acquire. - */ -class HoldThread : public Thread -{ -public: - //get the Semaphores to operate - HoldThread( ::osl::Semaphore& Sem ): MySem( Sem ) { } - - ~HoldThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "#HoldThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - ::osl::Semaphore& MySem; - - void SAL_CALL run() - { - // block here if it tries to decrease below zero. - MySem.acquire( ); - t_print("Semaphore acquired. \n" ); - MySem.release( ); - } -}; - -/** thread for testing Semaphore release and tryToAcquire. - */ -class WaitThread : public Thread -{ -public: - //get the Semaphore pointer to operate - WaitThread( ::osl::Semaphore& Sem ): MySem( Sem ) { } - - ~WaitThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "WaitThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - Semaphore& MySem; - - void SAL_CALL run( ) - { - // block here if the semaphore has been acquired - MySem.acquire( ); - thread_sleep_tenth_sec( 2 ); - MySem.release( ); - } -}; - -/** thread for producer-consumer model. - */ -#define BSIZE 50 -class SemBuffer -{ -public: - sal_Int32 Buf[BSIZE]; - ::osl::Semaphore& aSemOccupied; - ::osl::Semaphore& aSemEmpty; - ::osl::Mutex& aMutex; - - SemBuffer( ::osl::Semaphore& Sem, ::osl::Semaphore& Sem1, ::osl::Mutex& Mut ) - :aSemOccupied( Sem ), aSemEmpty( Sem1 ), aMutex( Mut ) - { - for ( sal_Int8 iCount=0; iCount < BSIZE; iCount++ ) - Buf[iCount] = 0; - } -}; - -class WriterThread : public Thread -{ -public: - //get the Semaphores to operate - WriterThread( SemBuffer& aSemBuffer ): MySemBuffer( aSemBuffer ){ } - - ~WriterThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "WriterThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - SemBuffer& MySemBuffer; - - void SAL_CALL run( ) - { - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - { - MySemBuffer.aSemEmpty.acquire( ) ; - MySemBuffer.aMutex.acquire( ) ; - MySemBuffer.Buf[iCount] = iCount; - MySemBuffer.aMutex.release( ) ; - MySemBuffer.aSemOccupied.release( ) ; - } - } -}; - -class ReaderThread : public Thread -{ -public: - //get the Semaphores to operate - ReaderThread( SemBuffer& aSemBuffer ): MySemBuffer( aSemBuffer ){ } - - ~ReaderThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "ReaderThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } - -protected: - SemBuffer& MySemBuffer; - - void SAL_CALL run( ) - { - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - { - MySemBuffer.aSemOccupied.acquire( ) ; - MySemBuffer.aMutex.acquire( ) ; - MySemBuffer.Buf[iCount] *= MySemBuffer.Buf[iCount]; - MySemBuffer.aMutex.release( ) ; - MySemBuffer.aSemEmpty.release( ) ; - } - } -}; - - - -//------------------------------------------------------------------------ -// test code start here -//------------------------------------------------------------------------ - -namespace osl_Semaphore -{ - - /** testing the method: - Semaphore(sal_uInt32 initialCount); - */ - class ctors : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1; - - void ctors_001( ) - { - ::osl::Semaphore aSem(sal_uInt32(0)); - bRes = aSem.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 0. the first acquire will block.", - sal_False == bRes ); - } - - void ctors_002( ) - { - ::osl::Semaphore aSem(sal_uInt32(1)); - bRes = aSem.tryToAcquire( ); - if ( sal_True == bRes ) - aSem.release( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 1. the first acquire will not block.", - sal_True == bRes ); - } - - void ctors_003( ) - { - ::osl::Semaphore aSem(sal_uInt32(1)); - bRes = aSem.tryToAcquire( ); - bRes1 = aSem.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 1. acquire twice will cause block.", - sal_True == bRes && sal_False == bRes1); - } - - void ctors_004( ) - { - oslSemaphore hSem = new ::osl::Semaphore(sal_uInt32(1)); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test return value of the constructor, it should not be NULL.", - NULL != hSem ); - } - - void ctors_005( ) - { - ::osl::Semaphore aSemaphore(sal_uInt32(2)); - bRes = aSemaphore.tryToAcquire( )&& - aSemaphore.tryToAcquire( )&& - !aSemaphore.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 2. guess what behaviour will the semaphore act like.", - sal_True == bRes ); - } - - CPPUNIT_TEST_SUITE( ctors ); - CPPUNIT_TEST( ctors_001 ); - CPPUNIT_TEST( ctors_002 ); - CPPUNIT_TEST( ctors_003 ); - CPPUNIT_TEST( ctors_004 ); - CPPUNIT_TEST( ctors_005 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class ctors - - - /** testing the method: - sal_Bool acquire(); - */ - class acquire : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2; - - /** tester comment: - acquire semaphore in main thread, and then call acquire again in myThread, - the child thread should block, wait 2 secs, it still block. Then release - semaphore in main thread, the child thread could return from acquire, and - go to exec next statement, so could terminate quickly. - */ - - void acquire_001( ) - { - // launch the child thread - ::osl::Semaphore aSemaphore(1); - bRes = aSemaphore.acquire( ); - HoldThread myThread( aSemaphore ); - myThread.create( ); - - // if acquire in myThread does not work, 2 secs is long enough, - // myThread should terminate now, and bRes1 should be sal_False - thread_sleep_tenth_sec( 2 ); - bRes1 = myThread.isRunning( ); - - // after release semaphore, myThread stops blocking and will terminate immediately - aSemaphore.release( ); - thread_sleep_tenth_sec( 1 ); - bRes2 = myThread.isRunning( ); - myThread.join( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore.", - bRes == sal_True && bRes1 == sal_True && bRes2 == sal_False ); - } - - /** tester comment: - launch 3 thread for testing acquirement inter-process. - */ - - void acquire_002( ) - { - // launch three child threads - ::osl::Semaphore aSemaphore(1); - bRes = aSemaphore.acquire( ); - HoldThread myThread1( aSemaphore ); - myThread1.create( ); - HoldThread myThread2( aSemaphore ); - myThread2.create( ); - HoldThread myThread3( aSemaphore ); - myThread3.create( ); - - // if acquire in myThread does not work, 2 secs is long enough, - thread_sleep_tenth_sec( 2 ); - bRes1 = myThread1.isRunning( ) && myThread2.isRunning( ) && myThread3.isRunning( ); - - // after release semaphore, myThread stops blocking and will terminate immediately - aSemaphore.release( ); - thread_sleep_tenth_sec( 1 ); - bRes2 = myThread1.isRunning( ) || myThread2.isRunning( ) || myThread3.isRunning( ); - myThread1.join( ); - myThread2.join( ); - myThread3.join( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore in multithreaded environment.", - bRes == sal_True && bRes1 == sal_True && bRes2 == sal_False ); - } - - - - /** tester comment: - launch 3 thread for testing acquirement inter-process. in this test, - we use two threads as producer and consumer, operate together on an - array which is initialized to 0 for every item. producer takes action - as follow: - p(A), p(M), Buf[i]=i, v(M), v(B). - consumer's action is like: - p(B), p(M), Buf[i]=Buf[i]*Buf[i], v(M), v(A). - consumer must operate on the array after producer does sequetially, - otherwise, the array will contain items remain zero after all threads - terminate. array will be filled with index^2 in the end. - */ - - void acquire_003( ) - { - // initialization. - ::osl::Semaphore aSemOccupied( sal_uInt32(0) ); - ::osl::Semaphore aSemEmpty( BSIZE ); - ::osl::Mutex aMutex; - - // launch two threads. - SemBuffer aBuffer( aSemOccupied, aSemEmpty, aMutex ); - WriterThread myThread1( aBuffer ); - ReaderThread myThread2( aBuffer ); - myThread1.create( ); - myThread2.create( ); - - myThread1.join( ); - myThread2.join( ); - - bRes = sal_True; - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - bRes = bRes && ( aBuffer.Buf[iCount] == iCount*iCount ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore using Producer-Consumer model.", - sal_True == bRes ); - } - - CPPUNIT_TEST_SUITE( acquire ); - CPPUNIT_TEST( acquire_001 ); - CPPUNIT_TEST( acquire_002 ); - CPPUNIT_TEST( acquire_003 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class acquire - - - /** testing the method: - sal_Bool tryToAcquire(); - */ - class tryToAcquire : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2; - /** tester comment: - First let child thread acquire the semaphore, and wait 2 secs, during the 2 secs, - in main thread, tryToAcquire semaphore should return False, then after the - child thread terminated, tryToAcquire should return True - */ - void tryToAcquire_001() - { - ::osl::Semaphore aSemaphore(1); - WaitThread myThread( aSemaphore ); - myThread.create(); - - // ensure the child thread acquire the semaphore - thread_sleep_tenth_sec(1); - bRes1 = aSemaphore.tryToAcquire(); - - if (bRes1 == sal_True) - aSemaphore.release(); - // wait the child thread terminate - myThread.join(); - - bRes2 = aSemaphore.tryToAcquire(); - if (bRes2 == sal_True) - aSemaphore.release(); - - CPPUNIT_ASSERT_MESSAGE("#test comment#: Try to acquire Semaphore", - bRes1 == sal_False && bRes2 == sal_True); - } - - void tryToAcquire_002() - { - ::osl::Semaphore aSem(1); - bRes = aSem.tryToAcquire( ); - bRes1 = aSem.tryToAcquire( ); - - - CPPUNIT_ASSERT_MESSAGE("#test comment#: Try to acquire Semaphore twice should block.", - sal_True == bRes && sal_False == bRes1); - } - - CPPUNIT_TEST_SUITE( tryToAcquire ); - CPPUNIT_TEST( tryToAcquire_001 ); - CPPUNIT_TEST( tryToAcquire_002 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class tryToAcquire - - - /** testing the method: - sal_Bool release(); - */ - class release : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2, bRunning; - sal_Int32 nCount; - /** acquire/release are not used in pairs: after child thread acquired semaphore, - the main thread release it, then any thread could acquire it. - */ - void release_001() - { - Semaphore aSemaphore(1); - WaitThread myThread( aSemaphore ); - myThread.create( ); - - // ensure the child thread acquire the mutex - thread_sleep_tenth_sec( 1 ); - - bRunning = myThread.isRunning( ); - bRes1 = aSemaphore.tryToAcquire( ); - // wait the child thread terminate - myThread.join( ); - - bRes2 = aSemaphore.tryToAcquire( ); - if ( bRes2 == sal_True ) - aSemaphore.release( ); - - CPPUNIT_ASSERT_MESSAGE( "release Semaphore: try to aquire before and after the semaphore has been released", - bRes1 == sal_False && bRes2 == sal_True && bRunning == sal_True ); - - } - - void release_002() - { - Semaphore aSemaphore(sal_uInt32(0)); - bRes1 = sal_True; - for ( nCount = 0; nCount < 10; nCount++, aSemaphore.release( ) ) { } - for ( nCount = 0; nCount < 10; nCount++, bRes1 = bRes1 && aSemaphore.tryToAcquire( ) ) { } - bRes = aSemaphore.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "release Semaphore: release ten times and acquire eleven times.", - sal_False == bRes && sal_True == bRes1); - } - - CPPUNIT_TEST_SUITE( release ); - CPPUNIT_TEST( release_001 ); - CPPUNIT_TEST( release_002 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class release - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::ctors, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::acquire, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::tryToAcquire, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::release, "osl_Semaphore"); -// ----------------------------------------------------------------------------- - -} // namespace osl_Semaphore - - -// ----------------------------------------------------------------------------- - -// 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; diff --git a/sal/qa/osl/semaphore/osl_Semaphore_Const.h b/sal/qa/osl/semaphore/osl_Semaphore_Const.h deleted file mode 100644 index 457d27e42865..000000000000 --- a/sal/qa/osl/semaphore/osl_Semaphore_Const.h +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _OSL_SEMAPHORE_CONST_H_ -#define _OSL_SEMAPHORE_CONST_H_ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#include <sal/types.h> -#include <rtl/ustring.hxx> - -#ifndef _OSL_THREAD_HXX_ -#include <osl/thread.hxx> -#endif -#include <osl/mutex.hxx> -#include <osl/pipe.hxx> - -#ifndef _OSL_SEMAPHOR_HXX_ -#include <osl/semaphor.hxx> -#endif -#include <osl/time.h> - -#include <testshl/simpleheader.hxx> - -#ifdef UNX -#include <unistd.h> -#endif - -//------------------------------------------------------------------------ -// most return value -1 denote a fail of operation. -//------------------------------------------------------------------------ -#define OSL_PIPE_FAIL -1 - -#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \ - ::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value ) - -//------------------------------------------------------------------------ -// semaphre names -//------------------------------------------------------------------------ -OSLTEST_DECLARE_USTRING( TestSem, "testsem" ); - -const char pTestString[17] = "Sun Microsystems"; - - -#endif /* _OSL_SEMAPHORE_CONST_H_ */ diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk index ea22fbc2720a..37ae3718b40d 100755 --- a/sal/qa/rtl/alloc/makefile.mk +++ b/sal/qa/rtl/alloc/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:jobfile by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/bootstrap/makefile.mk b/sal/qa/rtl/bootstrap/makefile.mk index e17f3c410e94..d32f9db35383 100644 --- a/sal/qa/rtl/bootstrap/makefile.mk +++ b/sal/qa/rtl/bootstrap/makefile.mk @@ -50,6 +50,8 @@ MY_SCRIPTCAT=tr -d "\015" < CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/cipher/makefile.mk b/sal/qa/rtl/cipher/makefile.mk index 73bf673f6c3d..b89e392d71d6 100644 --- a/sal/qa/rtl/cipher/makefile.mk +++ b/sal/qa/rtl/cipher/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk index c936b51a32d3..6bd3bd89d5a6 100755 --- a/sal/qa/rtl/crc32/makefile.mk +++ b/sal/qa/rtl/crc32/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:jobfile by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/digest/makefile.mk b/sal/qa/rtl/digest/makefile.mk index fceb9eac8de8..415183b7e9a0 100644 --- a/sal/qa/rtl/digest/makefile.mk +++ b/sal/qa/rtl/digest/makefile.mk @@ -41,6 +41,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + #----------------------------------- OStringBuffer ----------------------------------- SHL1OBJS= \ diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk index a914dfa86f22..b13ccf420c06 100644 --- a/sal/qa/rtl/doublelock/makefile.mk +++ b/sal/qa/rtl/doublelock/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk index 490ee7b22364..329769b5d3ec 100644 --- a/sal/qa/rtl/locale/makefile.mk +++ b/sal/qa/rtl/locale/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:locale by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/logfile/makefile.mk b/sal/qa/rtl/logfile/makefile.mk index 92e3d30dd7a5..9b52e0a45b37 100644 --- a/sal/qa/rtl/logfile/makefile.mk +++ b/sal/qa/rtl/logfile/makefile.mk @@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # --- BEGIN -------------------------------------------------------- SHL1OBJS= \ $(SLO)$/rtl_logfile.obj diff --git a/sal/qa/rtl/math/makefile.mk b/sal/qa/rtl/math/makefile.mk index a5cd21da67ce..3b35e52ab1f4 100644 --- a/sal/qa/rtl/math/makefile.mk +++ b/sal/qa/rtl/math/makefile.mk @@ -41,6 +41,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + #----------------------------------- OStringBuffer ----------------------------------- SHL1OBJS= \ diff --git a/sal/qa/rtl/ostring/makefile.mk b/sal/qa/rtl/ostring/makefile.mk index bfb6c74c3482..06469b38a407 100644 --- a/sal/qa/rtl/ostring/makefile.mk +++ b/sal/qa/rtl/ostring/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/oustring/makefile.mk b/sal/qa/rtl/oustring/makefile.mk index e65611410003..6f15637651c6 100644 --- a/sal/qa/rtl/oustring/makefile.mk +++ b/sal/qa/rtl/oustring/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/oustringbuffer/makefile.mk b/sal/qa/rtl/oustringbuffer/makefile.mk index 7ba01bcebd72..544f7b7df170 100644 --- a/sal/qa/rtl/oustringbuffer/makefile.mk +++ b/sal/qa/rtl/oustringbuffer/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/process/makefile.mk b/sal/qa/rtl/process/makefile.mk index ef79fc46ca3a..5df9dc01504e 100644 --- a/sal/qa/rtl/process/makefile.mk +++ b/sal/qa/rtl/process/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/random/makefile.mk b/sal/qa/rtl/random/makefile.mk index b97599240a37..cd57ec9bcc13 100644 --- a/sal/qa/rtl/random/makefile.mk +++ b/sal/qa/rtl/random/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:job by codegen.pl SHL1OBJS= \ diff --git a/sal/qa/rtl/strings/makefile.mk b/sal/qa/rtl/strings/makefile.mk index e1a5dd3af99a..3c1b9219642f 100644 --- a/sal/qa/rtl/strings/makefile.mk +++ b/sal/qa/rtl/strings/makefile.mk @@ -37,6 +37,8 @@ ENABLE_EXCEPTIONS := TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + SHL1TARGET := $(TARGET) SHL1OBJS := \ $(SLO)$/test_oustringbuffer_utf32.obj \ diff --git a/sal/qa/rtl/textenc/gcc3_export.map b/sal/qa/rtl/textenc/gcc3_export.map deleted file mode 100644 index e7f19d73264e..000000000000 --- a/sal/qa/rtl/textenc/gcc3_export.map +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - registerAllTestFunction; - - _ZN4_STL7num_put*; # STLport - - local: - *; -}; diff --git a/sal/qa/rtl/textenc/makefile.mk b/sal/qa/rtl/textenc/makefile.mk index 1126c0facaba..597309d9bfe6 100644 --- a/sal/qa/rtl/textenc/makefile.mk +++ b/sal/qa/rtl/textenc/makefile.mk @@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # --- BEGIN -------------------------------------------------------- SHL1OBJS= \ $(SLO)$/rtl_textcvt.obj @@ -47,11 +49,7 @@ SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) -.IF "$(COMNAME)" == "gcc3" -SHL1VERSIONMAP = gcc3_export.map -.ELSE SHL1VERSIONMAP = $(PRJ)$/qa$/export.map -.ENDIF # END -------------------------------------------------------------- @@ -63,11 +61,7 @@ SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) SHL2IMPLIB= i$(SHL2TARGET) DEF2NAME =$(SHL2TARGET) -.IF "$(COMNAME)" == "gcc3" -SHL2VERSIONMAP = gcc3_export.map -.ELSE SHL2VERSIONMAP = $(PRJ)$/qa$/export.map -.ENDIF # END -------------------------------------------------------------- diff --git a/sal/qa/rtl/uri/makefile.mk b/sal/qa/rtl/uri/makefile.mk index 1858f586401a..d4a8814cc649 100644 --- a/sal/qa/rtl/uri/makefile.mk +++ b/sal/qa/rtl/uri/makefile.mk @@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # --- BEGIN -------------------------------------------------------- SHL1OBJS= \ $(SLO)$/rtl_Uri.obj diff --git a/sal/qa/rtl/uuid/makefile.mk b/sal/qa/rtl/uuid/makefile.mk index 93890f0da819..40e583f8b019 100644 --- a/sal/qa/rtl/uuid/makefile.mk +++ b/sal/qa/rtl/uuid/makefile.mk @@ -40,6 +40,8 @@ ENABLE_EXCEPTIONS=TRUE CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) +CFLAGSCXX += $(CPPUNIT_CFLAGS) + # BEGIN ---------------------------------------------------------------- # auto generated Target:joblist by codegen.pl SHL1OBJS= \ diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 2ac61e9aaef5..cc7d3336c2d2 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -281,10 +281,6 @@ static OUString & getIniFileName_Impl() fileName += OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE(""))); } - OUString workDir; - osl_getProcessWorkingDir(&workDir.pData); - osl::FileBase::getAbsoluteFileURL(workDir, fileName, fileName); - static OUString theFileName; if(fileName.getLength()) theFileName = fileName; @@ -653,12 +649,8 @@ rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open ( rtl_uString * pIniName ) SAL_THROW_EXTERN_C() { - OUString workDir; OUString iniName( pIniName ); - osl_getProcessWorkingDir( &workDir.pData ); - osl::FileBase::getAbsoluteFileURL( workDir, iniName, iniName ); - // normalize path FileStatus status( FileStatusMask_FileURL ); DirectoryItem dirItem; diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx index a48918668f83..50f0d7de924e 100644 --- a/sal/rtl/source/macro.hxx +++ b/sal/rtl/source/macro.hxx @@ -89,6 +89,8 @@ this is inserted for the case that the preprocessor ignores error # define THIS_ARCH "M68K" #elif defined HPPA # define THIS_ARCH "HPPA" +#elif defined AXP +# define THIS_ARCH "ALPHA" #endif #if ! defined THIS_ARCH diff --git a/sal/typesconfig/typesconfig.c b/sal/typesconfig/typesconfig.c index 8223c80a5856..708837be926b 100644 --- a/sal/typesconfig/typesconfig.c +++ b/sal/typesconfig/typesconfig.c @@ -160,7 +160,7 @@ int check( TestFunc func, Type eT, void* p ) |* Letzte Aenderung |* *************************************************************************/ -#if defined(IA64) || defined(ARM32) || defined(HPPA) +#if defined(IA64) || defined(ARM32) || defined(HPPA) || defined(AXP) int forceerror() { diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index 6de6cc25c7ce..82ebbc811c8d 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -230,8 +230,6 @@ SHL1STDLIBS+=-lgcc $(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h .ENDIF # "$(SHL1TARGETN)" != "" -.IF "$(GUI)"=="UNX" || "$(USE_SHELL)"!="4nt" - $(OUT)$/inc$/udkversion.h: echo '#ifndef _SAL_UDKVERSION_H_' > $@ echo '#define _SAL_UDKVERSION_H_' >> $@ @@ -241,17 +239,3 @@ $(OUT)$/inc$/udkversion.h: echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@ echo '' >> $@ echo '#endif' >> $@ - -.ELSE - -$(OUT)$/inc$/udkversion.h: - echo #ifndef _SAL_UDKVERSION_H_ > $@ - echo #define _SAL_UDKVERSION_H_ >> $@ - echo. >> $@ - echo #define SAL_UDK_MAJOR "$(UDK_MAJOR)" >> $@ - echo #define SAL_UDK_MINOR "$(UDK_MINOR)" >> $@ - echo #define SAL_UDK_MICRO "$(UDK_MICRO)" >> $@ - echo. >> $@ - echo #endif >> $@ - -.ENDIF diff --git a/salhelper/inc/salhelper/queue.hxx b/salhelper/inc/salhelper/queue.hxx index f0daa8e9a904..445cc5f32da1 100644 --- a/salhelper/inc/salhelper/queue.hxx +++ b/salhelper/inc/salhelper/queue.hxx @@ -93,6 +93,12 @@ public: //---------------------------------------------------------------------------- +/** Queue. + + @deprecated + Must not be used, as it internally uses unnamed semaphores, which are not + supported on Mac OS X. +*/ template<class element_type> class Queue : protected QueueBase<element_type> { @@ -130,6 +136,12 @@ public: //---------------------------------------------------------------------------- +/** Bounded queue. + + @deprecated + Must not be used, as it internally uses unnamed semaphores, which are not + supported on Mac OS X. +*/ template<class element_type> class BoundedQueue : protected Queue<element_type> { diff --git a/salhelper/qa/makefile.mk b/salhelper/qa/makefile.mk index 1ce9ccb6f4ca..fe2aff7453be 100644 --- a/salhelper/qa/makefile.mk +++ b/salhelper/qa/makefile.mk @@ -33,6 +33,8 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) + SHL1TARGET = $(TARGET) SHL1OBJS = $(SLO)$/test_api.obj SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) $(SALHELPERLIB) $(TESTSHL2LIB) diff --git a/salhelper/source/makefile.mk b/salhelper/source/makefile.mk index 4eb278f42fbd..a6b83cb5e090 100644 --- a/salhelper/source/makefile.mk +++ b/salhelper/source/makefile.mk @@ -48,11 +48,6 @@ SLOFILES= \ $(SLO)$/dynload.obj \ $(SLO)$/simplereferenceobject.obj -# SCO: the linker does know about weak symbols, but we can't ignore multiple defined symbols -.IF "$(OS)"=="SCO" -SLOFILES+=$(SLO)$/staticmb.obj -.ENDIF - .IF "$(GUI)" == "WNT" SHL1TARGET= $(TARGET)$(UDK_MAJOR)$(COMID) .ELIF "$(GUI)" == "OS2" diff --git a/salhelper/source/staticmb.cxx b/salhelper/source/staticmb.cxx deleted file mode 100644 index 274b720b1e2d..000000000000 --- a/salhelper/source/staticmb.cxx +++ /dev/null @@ -1,26 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ diff --git a/salhelper/test/rtti/sols.map b/salhelper/test/rtti/sols.map index 962d648475f4..babf2c901585 100644 --- a/salhelper/test/rtti/sols.map +++ b/salhelper/test/rtti/sols.map @@ -1,4 +1,4 @@ -SAMPLELIB { +UDK_3_0_0 { global: GetVersionInfo; _fini; diff --git a/stoc/prj/build.lst b/stoc/prj/build.lst index 2550563c8c34..1fb7d34eeb32 100644 --- a/stoc/prj/build.lst +++ b/stoc/prj/build.lst @@ -22,3 +22,4 @@ tc stoc\source\javavm nmake - all tc_jvm tc_inc NULL tc stoc\source\javaloader nmake - all tc_jvload tc_inc NULL tc stoc\source\uriproc nmake - all tc_uriproc tc_stserv tc_inc NULL tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng tc_sec NULL +tc stoc\test\uriproc nmake - all tc_test_uriproc tc_util NULL diff --git a/stoc/source/corereflection/corefl.map b/stoc/source/corereflection/corefl.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/source/corereflection/corefl.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx index ec325ce11db1..95d9990257f5 100644 --- a/stoc/source/corereflection/criface.cxx +++ b/stoc/source/corereflection/criface.cxx @@ -877,7 +877,8 @@ sal_Bool InterfaceIdlClassImpl::isAssignableFrom( const Reference< XIdlClass > & Uik InterfaceIdlClassImpl::getUik() throw(::com::sun::star::uno::RuntimeException) { - return *(Uik *)&getTypeDescr()->aUik; + return Uik(0, 0, 0, 0, 0); + // Uiks are deprecated and this function must not be called } //__________________________________________________________________________________________________ Sequence< Reference< XIdlMethod > > InterfaceIdlClassImpl::getMethods() diff --git a/stoc/source/corereflection/makefile.mk b/stoc/source/corereflection/makefile.mk index 1a37f93b4bb4..b61eb13aa9ee 100644 --- a/stoc/source/corereflection/makefile.mk +++ b/stoc/source/corereflection/makefile.mk @@ -55,7 +55,7 @@ NOOPTFILES += $(SLO)$/criface.obj .ENDIF SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = corefl.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ diff --git a/stoc/source/inspect/introspection.map b/stoc/source/inspect/introspection.map deleted file mode 100644 index c2806d230702..000000000000 --- a/stoc/source/inspect/introspection.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3.1 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/stoc/source/inspect/makefile.mk b/stoc/source/inspect/makefile.mk index 3a5630d13995..80e87dbf7cab 100644 --- a/stoc/source/inspect/makefile.mk +++ b/stoc/source/inspect/makefile.mk @@ -50,7 +50,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(SALLIB) -SHL1VERSIONMAP = introspection.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1RPATH=URELIB SHL1DEPN= diff --git a/stoc/source/invocation/inv.map b/stoc/source/invocation/inv.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/source/invocation/inv.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/source/invocation/makefile.mk b/stoc/source/invocation/makefile.mk index 8e50bfba1285..c170bf6b614e 100644 --- a/stoc/source/invocation/makefile.mk +++ b/stoc/source/invocation/makefile.mk @@ -50,7 +50,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(SALLIB) -SHL1VERSIONMAP = inv.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1DEPN= SHL1IMPLIB= i$(TARGET) SHL1LIBS= $(SLB)$/$(TARGET).lib diff --git a/stoc/source/invocation_adapterfactory/invadp.map b/stoc/source/invocation_adapterfactory/invadp.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/source/invocation_adapterfactory/invadp.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/source/invocation_adapterfactory/makefile.mk b/stoc/source/invocation_adapterfactory/makefile.mk index 2edb30ea5eb0..66568af039e7 100644 --- a/stoc/source/invocation_adapterfactory/makefile.mk +++ b/stoc/source/invocation_adapterfactory/makefile.mk @@ -50,7 +50,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(SALLIB) -SHL1VERSIONMAP = invadp.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1RPATH=URELIB SHL1DEPN= diff --git a/stoc/source/javaloader/javaloader.map b/stoc/source/javaloader/javaloader.map deleted file mode 100644 index ac2c3750bfe0..000000000000 --- a/stoc/source/javaloader/javaloader.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/stoc/source/javaloader/makefile.mk b/stoc/source/javaloader/makefile.mk index ef35b6921964..60eea6a23457 100644 --- a/stoc/source/javaloader/makefile.mk +++ b/stoc/source/javaloader/makefile.mk @@ -52,7 +52,7 @@ SHL1STDLIBS=\ $(SALLIB) \ $(JVMACCESSLIB) -SHL1VERSIONMAP = javaloader.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1DEPN= SHL1IMPLIB= i$(TARGET) SHL1LIBS= $(SLB)$/$(TARGET).lib diff --git a/stoc/source/javavm/jen.map b/stoc/source/javavm/jen.map deleted file mode 100644 index ac2c3750bfe0..000000000000 --- a/stoc/source/javavm/jen.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/stoc/source/javavm/makefile.mk b/stoc/source/javavm/makefile.mk index 4be9d87f46be..96908d10d1a1 100644 --- a/stoc/source/javavm/makefile.mk +++ b/stoc/source/javavm/makefile.mk @@ -54,7 +54,7 @@ SLOFILES= \ $(SLO)$/interact.obj SHL1TARGET= $(TARGET) -SHL1VERSIONMAP = jen.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(CPPULIB) \ diff --git a/stoc/source/namingservice/makefile.mk b/stoc/source/namingservice/makefile.mk index 00015b35e1f5..424180e114a1 100644 --- a/stoc/source/namingservice/makefile.mk +++ b/stoc/source/namingservice/makefile.mk @@ -50,7 +50,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(SALLIB) -SHL1VERSIONMAP = namingservice.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1DEPN= SHL1IMPLIB= i$(TARGET) diff --git a/stoc/source/namingservice/namingservice.map b/stoc/source/namingservice/namingservice.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/source/namingservice/namingservice.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/source/proxy_factory/makefile.mk b/stoc/source/proxy_factory/makefile.mk index bcb630cb0073..b38dac146ae1 100644 --- a/stoc/source/proxy_factory/makefile.mk +++ b/stoc/source/proxy_factory/makefile.mk @@ -45,7 +45,7 @@ SLOFILES= \ $(SLO)$/proxyfac.obj SHL1TARGET=$(TARGET) -SHL1VERSIONMAP = proxyfac.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(CPPULIB) \ diff --git a/stoc/source/proxy_factory/proxyfac.map b/stoc/source/proxy_factory/proxyfac.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/source/proxy_factory/proxyfac.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/test/registry_tdprovider/makefile.mk b/stoc/test/registry_tdprovider/makefile.mk index 0b86669218b5..f258963f9299 100644 --- a/stoc/test/registry_tdprovider/makefile.mk +++ b/stoc/test/registry_tdprovider/makefile.mk @@ -40,16 +40,11 @@ SLOFILES = $(SLO)$/testregistrytdprovider.obj SHL1TARGET = testregistrytdprovider.uno SHL1OBJS = $(SLOFILES) +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) SHL1IMPLIB = itestregistrytdprovider DEF1NAME = $(SHL1TARGET) -.IF "$(COMNAME)" == "gcc3" -SHL1VERSIONMAP = testregistrytdprovider.gcc3.map -.ELSE -SHL1VERSIONMAP = testregistrytdprovider.map -.ENDIF - .INCLUDE: target.mk ALLTAR: test diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.gcc3.map b/stoc/test/registry_tdprovider/testregistrytdprovider.gcc3.map deleted file mode 100644 index 609b64e1e0ca..000000000000 --- a/stoc/test/registry_tdprovider/testregistrytdprovider.gcc3.map +++ /dev/null @@ -1,38 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - _ZN4_STL7num_put*; # STLport - - local: - *; -}; diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.map b/stoc/test/registry_tdprovider/testregistrytdprovider.map deleted file mode 100644 index e4b038369818..000000000000 --- a/stoc/test/registry_tdprovider/testregistrytdprovider.map +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - local: - *; -}; diff --git a/stoc/test/tdmanager/makefile.mk b/stoc/test/tdmanager/makefile.mk index e3276b19eede..8f39ac552038 100644 --- a/stoc/test/tdmanager/makefile.mk +++ b/stoc/test/tdmanager/makefile.mk @@ -40,16 +40,11 @@ SLOFILES = $(SLO)$/testtdmanager.obj SHL1TARGET = testtdmanager.uno SHL1OBJS = $(SLOFILES) +SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) SHL1IMPLIB = itesttdmanager DEF1NAME = $(SHL1TARGET) -.IF "$(COMNAME)" == "gcc3" -SHL1VERSIONMAP = testtdmanager.gcc3.map -.ELSE -SHL1VERSIONMAP = testtdmanager.map -.ENDIF - .INCLUDE: target.mk ALLTAR: test diff --git a/stoc/test/tdmanager/testtdmanager.gcc3.map b/stoc/test/tdmanager/testtdmanager.gcc3.map deleted file mode 100644 index 609b64e1e0ca..000000000000 --- a/stoc/test/tdmanager/testtdmanager.gcc3.map +++ /dev/null @@ -1,38 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - _ZN4_STL7num_put*; # STLport - - local: - *; -}; diff --git a/stoc/test/tdmanager/testtdmanager.map b/stoc/test/tdmanager/testtdmanager.map deleted file mode 100644 index e4b038369818..000000000000 --- a/stoc/test/tdmanager/testtdmanager.map +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - local: - *; -}; diff --git a/stoc/test/testsmgr_cpnt.map b/stoc/test/testsmgr_cpnt.map index d8c4047c5603..ab5ed357b461 100644 --- a/stoc/test/testsmgr_cpnt.map +++ b/stoc/test/testsmgr_cpnt.map @@ -1,4 +1,4 @@ -UDK_3.1 { +UDK_3_0_0 { global: component_getImplementationEnvironment; component_writeInfo; diff --git a/stoc/test/uriproc/makefile.mk b/stoc/test/uriproc/makefile.mk index d529f8623075..cfdc33e7586b 100644 --- a/stoc/test/uriproc/makefile.mk +++ b/stoc/test/uriproc/makefile.mk @@ -25,7 +25,11 @@ # #************************************************************************* -PRJ := ..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ := ../.. PRJNAME := stoc TARGET := test_uriproc @@ -33,27 +37,14 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files -UNOTYPES = \ - com.sun.star.beans.XPropertySet \ - com.sun.star.lang.XComponent \ - com.sun.star.lang.XMultiComponentFactory \ - com.sun.star.uno.XComponentContext \ - com.sun.star.uri.ExternalUriReferenceTranslator \ - com.sun.star.uri.UriReferenceFactory \ - com.sun.star.uri.VndSunStarPkgUrlReferenceFactory \ - com.sun.star.uri.XExternalUriReferenceTranslator \ - com.sun.star.uri.XUriReference \ - com.sun.star.uri.XUriReferenceFactory \ - com.sun.star.uri.XVndSunStarPkgUrlReferenceFactory \ - com.sun.star.uri.XVndSunStarScriptUrlReference \ - com.sun.star.util.XMacroExpander - SHL1TARGET = $(TARGET) -SHL1OBJS = $(SLO)$/test_uriproc.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) +SHL1OBJS = $(SLO)/test_uriproc.obj +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) SHL1VERSIONMAP = version.map +SHL1RPATH = NONE SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) @@ -61,11 +52,24 @@ SLOFILES = $(SHL1OBJS) .INCLUDE: target.mk +.IF "$(OS)" == "WNT" +my_file = file:/// +.ELSE +my_file = file:// +.END + ALLTAR: test -$(BIN)$/$(TARGET).rdb .ERRREMOVE: - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - regcomp -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/stocservices.uno$(DLLPOST)) +test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb + $(CPPUNITTESTER) $(SHL1TARGETN) \ + -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \ + -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb \ + -env:OOO_TEST_PREFIX=$(my_file)$(PWD)/$(DLLDEST)/ + +$(MISC)/$(TARGET)/services.rdb: + $(MKDIRHIER) $(@:d) + $(RM) $@ + $(REGCOMP) -register -r $@ -wop=vnd.sun.star.expand:\$${{OOO_TEST_PREFIX}} \ + -c $(DLLDEST)/stocservices.uno$(DLLPOST) -test .PHONY: $(SHL1TARGETN) $(BIN)$/$(TARGET).rdb - testshl2 $(SHL1TARGETN) -forward $(BIN)$/$(TARGET).rdb +.END diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx index 4e46d29644f0..a7ad8d9abf94 100644 --- a/stoc/test/uriproc/test_uriproc.cxx +++ b/stoc/test/uriproc/test_uriproc.cxx @@ -28,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_stoc.hxx" -#include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/uno/Reference.hxx" @@ -43,10 +42,12 @@ #include "com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp" #include "com/sun/star/uri/XVndSunStarScriptUrlReference.hpp" #include "com/sun/star/util/XMacroExpander.hpp" -#include "cppuhelper/servicefactory.hxx" -#include "testshl/simpleheader.hxx" +#include "cppuhelper/bootstrap.hxx" +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include "osl/diagnose.h" -#include "osl/thread.h" #include "rtl/string.h" #include "rtl/string.hxx" #include "rtl/textenc.h" @@ -148,20 +149,12 @@ private: }; void Test::setUp() { - char const * registry = getForwardString(); - css::uno::Reference< css::lang::XMultiServiceFactory > factory( - cppu::createRegistryServiceFactory( - rtl::OUString( - registry, rtl_str_getLength(registry), - osl_getThreadTextEncoding()))); - //TODO: check for string conversion failure - css::uno::Reference< css::beans::XPropertySet >( - factory, css::uno::UNO_QUERY_THROW)->getPropertyValue( - rtl::OUString::createFromAscii("DefaultContext")) >>= m_context; + m_context = cppu::defaultBootstrap_InitialComponentContext(); m_uriFactory = css::uri::UriReferenceFactory::create(m_context); } void Test::tearDown() { + m_uriFactory.clear(); css::uno::Reference< css::lang::XComponent >( m_context, css::uno::UNO_QUERY_THROW)->dispose(); } @@ -1004,8 +997,8 @@ void Test::testPkgUrlFactory() { } } -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/stoc/test/uriproc/version.map b/stoc/test/uriproc/version.map index 7321bbca16ad..3308588ef6f8 100644 --- a/stoc/test/uriproc/version.map +++ b/stoc/test/uriproc/version.map @@ -27,7 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/stoc/util/bootstrap.map b/stoc/util/bootstrap.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/util/bootstrap.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/stoc/util/makefile.mk b/stoc/util/makefile.mk index af2ed92edccb..4243d45511fe 100644 --- a/stoc/util/makefile.mk +++ b/stoc/util/makefile.mk @@ -50,7 +50,7 @@ LIB1FILES= $(SLB)$/bootstrap.lib \ $(SLB)$/regtypeprov.lib \ $(SLB)$/typemgr.lib -SHL1VERSIONMAP = bootstrap.map +SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL1STDLIBS= \ $(CPPULIB) \ @@ -75,7 +75,7 @@ LIB2FILES= \ $(SLB)$/typeconverter.lib \ $(SLB)$/uriproc.lib -SHL2VERSIONMAP = stocservices.map +SHL2VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map SHL2STDLIBS= \ $(CPPULIB) \ diff --git a/stoc/util/stocservices.map b/stoc/util/stocservices.map deleted file mode 100644 index 30c5bb729ac7..000000000000 --- a/stoc/util/stocservices.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - component_canUnload; - local: - *; -}; diff --git a/ure/source/README b/ure/source/README index d2b4024e1e15..6e5162d8f058 100644 --- a/ure/source/README +++ b/ure/source/README @@ -141,6 +141,7 @@ Program Files\URE\bin\unsafe_uno_uno.dll [private] Program Files\URE\bin\affine_uno_uno.dll [private] Program Files\URE\bin\log_uno_uno.dll [private] Program Files\URE\bin\jpipe.dll [private] +Program Files\URE\bin\jpipx.dll [private] Program Files\URE\bin\juh.dll [private] Program Files\URE\bin\juhx.dll [private] Program Files\URE\bin\acceptor.uno.dll [private] diff --git a/ure/source/uretest/version.map b/ure/source/uretest/version.map index a93667d9da82..82a89b6b28fc 100644 --- a/ure/source/uretest/version.map +++ b/ure/source/uretest/version.map @@ -34,6 +34,8 @@ UDK_3_0_0 { _ZTI*; _ZTS*; + _ZN4_STL7num_put*; # for STLport + local: *; }; |