diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 15:47:28 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 15:47:28 +0000 |
commit | e6611cc2ef5960e9f32c56da44fafd02446f53e6 (patch) | |
tree | 6358ced419ac9412ae39cbb7032f602ff0e7de7c /sal | |
parent | 243a97038bdab8f2ec448df19c88ac2638035531 (diff) |
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'sal')
102 files changed, 4579 insertions, 23086 deletions
diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/cpprt/makefile.mk index a878d3b0b6cb..510f98df2619 100644 --- a/sal/qa/ByteSequence/makefile.mk +++ b/sal/cpprt/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: mindyliu $ $Date: 2003-03-03 07:47:05 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:45:32 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -59,46 +59,29 @@ # # #************************************************************************* -PRJ=..$/.. +PRJ=.. -PRJNAME=sal -TARGET=qa -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE +PRJNAME=SAL +TARGET=salcpprt ENABLE_EXCEPTIONS=TRUE +LIBTARGET=NO # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk -#------------------------------- All object files ------------------------------- -# do this here, so we get right dependencies -# SLOFILES= \ -# $(SLO)$/ByteSequence.obj +# --- Files -------------------------------------------------------- -#----------------------------------- OStringBuffer ----------------------------------- - -SHL1OBJS= \ - $(SLO)$/ByteSequence.obj - -SHL1TARGET= ByteSequence -SHL1STDLIBS=\ - $(SALLIB) -.IF "$(GUI)" == "WNT" -SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib -.ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a -.ENDIF - -SHL1IMPLIB= i$(SHL1TARGET) -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -DEF1EXPORTFILE= export.exp +CXXFILES = \ + operators_new_delete.cxx +SLOFILES = \ + $(SLO)$/operators_new_delete.obj +LIB1TARGET=$(LB)$/$(TARGET).lib +LIB1ARCHIV=$(LB)$/lib$(TARGET).a +LIB1OBJFILES=$(SLOFILES) # --- Targets ------------------------------------------------------ diff --git a/sal/cpprt/operators_new_delete.cxx b/sal/cpprt/operators_new_delete.cxx new file mode 100644 index 000000000000..d283c00b9d8d --- /dev/null +++ b/sal/cpprt/operators_new_delete.cxx @@ -0,0 +1,288 @@ +/************************************************************************* + * + * $RCSfile: operators_new_delete.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifdef WNT /* avoid 'std::bad_alloc' unresolved externals */ +#define _CRTIMP +#define _NTSDK +#endif /* WNT */ + +#ifndef INCLUDED_ALGORITHM +#include <algorithm> +#define INCLUDED_ALGORITHM +#endif + +#ifndef INCLUDED_NEW +#include <new> +#define INCLUDED_NEW +#endif + +#ifndef INCLUDED_STRING_H +#include <string.h> +#define INCLUDED_STRING_H +#endif + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif + +#ifndef _RTL_ALLOC_H_ +#include <rtl/alloc.h> +#endif + +using std::nothrow_t; + +// ======================================================================= +// AllocatorTraits +// ======================================================================= + +namespace +{ + +struct AllocatorTraits +{ + typedef char const signature_type[8]; + const signature_type & m_signature; + + explicit AllocatorTraits (signature_type const & s) SAL_THROW(()) + : m_signature (s) + {} + + std::size_t size (std::size_t n) const SAL_THROW(()) + { + n = std::max(n, std::size_t(1)); +#if defined(DEBUG) || defined(_DEBUG) + n += sizeof(signature_type); +#endif /* DEBUG */ + return n; + } + + void* init (void * p) const SAL_THROW(()) + { +#if defined(DEBUG) || defined(_DEBUG) + memcpy (p, m_signature, sizeof(signature_type)); + p = static_cast<char*>(p) + sizeof(signature_type); +#endif /* DEBUG */ + return p; + } + + void* fini (void * p) const SAL_THROW(()) + { +#if defined(DEBUG) || defined(_DEBUG) + p = static_cast<char*>(p) - sizeof(signature_type); + if (memcmp (p, m_signature, sizeof(signature_type)) != 0) + { + OSL_ENSURE(0, "operator delete mismatch"); + } +#endif /* DEBUG */ + return p; + } +}; + +// ======================================================================= + +struct VectorTraits : public AllocatorTraits +{ + static const signature_type g_signature; + + VectorTraits() SAL_THROW(()) + : AllocatorTraits (g_signature) + {} +}; + +struct ScalarTraits : public AllocatorTraits +{ + static const signature_type g_signature; + + ScalarTraits() SAL_THROW(()) + : AllocatorTraits (g_signature) + {} +}; + +const AllocatorTraits::signature_type VectorTraits::g_signature = "new[]()"; +const AllocatorTraits::signature_type ScalarTraits::g_signature = "new() "; + +} // anonymous namespace + +// ======================================================================= +// Allocator +// ======================================================================= + +static void default_handler (void) +{ + // Multithreading race in 'std::set_new_handler()' call sequence below. + throw std::bad_alloc(); +} + +// ======================================================================= + +static void* allocate ( + std::size_t n, AllocatorTraits const & rTraits) + SAL_THROW((std::bad_alloc)) +{ + n = rTraits.size (n); + for (;;) + { + void * p = rtl_allocateMemory (sal_uInt32(n)); + if (p != 0) + return rTraits.init (p); + + std::new_handler d = default_handler, f = std::set_new_handler (d); + if (f != d) + std::set_new_handler (f); + + if (f == 0) + throw std::bad_alloc(); + (*f)(); + } +} + +// ======================================================================= + +static void* allocate ( + std::size_t n, AllocatorTraits const & rTraits, std::nothrow_t const &) + SAL_THROW(()) +{ + try + { + return allocate (n, rTraits); + } + catch (std::bad_alloc const &) + { + return (0); + } +} + +// ======================================================================= + +static void deallocate (void * p, AllocatorTraits const & rTraits) + SAL_THROW(()) +{ + if (p) + { + rtl_freeMemory (rTraits.fini(p)); + } +} + +// ======================================================================= +// T * p = new T; delete p; +// ======================================================================= + +void* SAL_CALL operator new (std::size_t n) throw (std::bad_alloc) +{ + return allocate (n, ScalarTraits()); +} + +// ======================================================================= + +void SAL_CALL operator delete (void * p) throw () +{ + deallocate (p, ScalarTraits()); +} + +// ======================================================================= +// T * p = new(nothrow) T; delete(nothrow) p; +// ======================================================================= + +void* SAL_CALL operator new (std::size_t n, std::nothrow_t const &) throw () +{ + return allocate (n, ScalarTraits(), nothrow_t()); +} + +// ======================================================================= + +void SAL_CALL operator delete (void * p, std::nothrow_t const &) throw () +{ + deallocate (p, ScalarTraits()); +} + +// ======================================================================= +// T * p = new T[n]; delete[] p; +// ======================================================================= + +void* SAL_CALL operator new[] (std::size_t n) throw (std::bad_alloc) +{ + return allocate (n, VectorTraits()); +} + +// ======================================================================= + +void SAL_CALL operator delete[] (void * p) throw () +{ + deallocate (p, VectorTraits()); +} + +// ======================================================================= +// T * p = new(nothrow) T[n]; delete(nothrow)[] p; +// ======================================================================= + +void* SAL_CALL operator new[] (std::size_t n, std::nothrow_t const &) throw () +{ + return allocate (n, VectorTraits(), nothrow_t()); +} + +// ======================================================================= + +void SAL_CALL operator delete[] (void * p, std::nothrow_t const &) throw () +{ + deallocate (p, VectorTraits()); +} + +// ======================================================================= diff --git a/sal/inc/osl/conditn.h b/sal/inc/osl/conditn.h index dcb8e67e0c70..b258e98def74 100644 --- a/sal/inc/osl/conditn.h +++ b/sal/inc/osl/conditn.h @@ -2,9 +2,9 @@ * * $RCSfile: conditn.h,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,28 +71,18 @@ extern "C" { #endif -/** condition synchronization object handle - @seealso osl_createCondition() -*/ typedef void* oslCondition; -/** enumeration of possible error values for conditions - @seealso osl_waitCondition() -*/ typedef enum { - /** successful completion */ - osl_cond_result_ok, - /** an unspecified error occured */ - osl_cond_result_error, - /** blocking operation timed out */ - osl_cond_result_timeout, + osl_cond_result_ok, /* successful completion */ + osl_cond_result_error, /* error occured, check osl_getLastSocketError() for details */ + osl_cond_result_timeout, /* blocking operation timed out */ osl_cond_result_FORCE_EQUAL_SIZE = SAL_MAX_ENUM } oslConditionResult; /** Creates a condition. The condition is in the reset-state. - @return a pointer to the created condition object or - NULL if the condition could not be created. + @returns 0 if condition could not be created. */ oslCondition SAL_CALL osl_createCondition(void); @@ -101,41 +91,32 @@ oslCondition SAL_CALL osl_createCondition(void); */ void SAL_CALL osl_destroyCondition(oslCondition Condition); -/** Sets the condition state to set - Any call to osl_waitCondition() will not block, osl_checkCondition() - returns sal_True. +/** Sets condition to True => wait() will not block, check() returns True. NOTE: ALL threads waiting on this condition are unblocked! - @param Condition handle to a created condition. - @return sal_True if the condition has been set or - sal_False if the system-call failed. + @return False if system-call failed. */ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition); -/** Resets condition to unset state - Any call to osl_waitCondition() will block, osl_checkCondition() - will return sal_False. - +/** Sets condition to False => wait() will block, check() returns False @param Condition handle to a created condition. - @return sal_True if the condition has been unset or - sal_False if the system-call failed. + @return False if system-call failed. */ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition); -/** Blocks if condition is not set. - If condition has been destroyed prematurely, osl_waitCondition() - will return sal_False. +/** Blocks if condition is not set<BR> + If condition has been destroyed prematurely, wait() will + return with False. @param Condition handle to a created condition. @param pTimeout Tiemout value or NULL for infinite waiting - @return on of the following result values: osl_cond_result_ok, - osl_cond_result_error, osl_cond_result_timeout. - + @return False if system-call failed. */ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout); /** Queries the state of the condition without blocking. @param Condition handle to a created condition. - @return sal_True if condition is in set state or sal_False otherwise. + @return True: condition is set. <BR> + False: condition is not set. <BR> */ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition); diff --git a/sal/inc/osl/conditn.hxx b/sal/inc/osl/conditn.hxx index 65859e30e80c..fe10706c1255 100644 --- a/sal/inc/osl/conditn.hxx +++ b/sal/inc/osl/conditn.hxx @@ -2,9 +2,9 @@ * * $RCSfile: conditn.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,12 +73,7 @@ namespace osl { - /** Thread synchronization object - A condition is a thread synchronization method with two different states: - set (sal_True) and unset (sal_False). When in unset state, any thread - calling the wait() method will be blocked until the state changes to set. - */ class Condition { public: @@ -90,55 +85,41 @@ namespace osl result_timeout = osl_cond_result_timeout }; - /** Constructs a condition object. - - The initial state of the condition is false/unset. - - @seealso ::osl_createCondition() + /* Create a condition. */ Condition() { condition = osl_createCondition(); } - /** Release the OS-structures and free condition data-structure. - - @seealso ::osl_destroyCondition() - */ + /* Release the OS-structures and free condition data-structure. + */ ~Condition() { osl_destroyCondition(condition); } - /** Release all waiting threads, check() returns sal_True. - - @seealso ::osl_setCondition() - */ + /* Release all waiting threads, check returns sal_True. + */ void set() { osl_setCondition(condition); } - /** Reset condition to false: wait() will block, check() returns sal_False. - - @seealso ::osl_resetCondition() - */ + /* Reset condition to false: wait() will block, check() returns sal_False. + */ void reset() { osl_resetCondition(condition); } /** Blocks the calling thread until condition is set. - - @seealso ::osl_waitCondition() - */ + */ Result wait(const TimeValue *pTimeout = 0) { return (Result) osl_waitCondition(condition, pTimeout); } /** Checks if the condition is set without blocking. - - @seealso ::osl_checkCondition() */ sal_Bool check() { diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h index 909dea9a5d59..f81412fdcab3 100644 --- a/sal/inc/osl/endian.h +++ b/sal/inc/osl/endian.h @@ -2,9 +2,9 @@ * * $RCSfile: endian.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: svesik $ $Date: 2001-04-26 15:27:19 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -158,10 +158,6 @@ extern "C" { # endif #endif -#ifdef S390 -# define _BIG_ENDIAN -#endif - #ifdef _WIN16 # define _LITTLE_ENDIAN #endif @@ -202,7 +198,7 @@ extern "C" { */ #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(SCO) && \ - !defined(AIX) && !defined(HPUX) && !defined(S390) && \ + !defined(AIX) && !defined(HPUX) && \ !defined(SOLARIS) && !defined(IRIX) && !defined(MACOS) && \ !defined(MACOSX) && !defined(FREEBSD) # error "Target plattform not specified !" diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h index 121840b5f6a7..1fa43222dc99 100644 --- a/sal/inc/osl/file.h +++ b/sal/inc/osl/file.h @@ -2,9 +2,9 @@ * * $RCSfile: file.h,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: tra $ $Date: 2002-11-29 09:01:36 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1406,7 +1406,6 @@ oslFileError SAL_CALL osl_createTempFile( oslFileHandle* pHandle, rtl_uString** ppustrTempFileURL); - #ifdef __cplusplus } #endif diff --git a/sal/inc/osl/interlck.h b/sal/inc/osl/interlck.h index de21c98287a3..db518e9125db 100644 --- a/sal/inc/osl/interlck.h +++ b/sal/inc/osl/interlck.h @@ -2,9 +2,9 @@ * * $RCSfile: interlck.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obr $ $Date: 2001-11-12 14:40:49 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,8 +70,6 @@ extern "C" { #endif -/** Counter with atomic in-/decrease operations -*/ typedef sal_Int32 oslInterlockedCount; /** Increments the count variable addressed by pCount. diff --git a/sal/inc/osl/module.hxx b/sal/inc/osl/module.hxx index b936da2a010d..fbfb75719a95 100644 --- a/sal/inc/osl/module.hxx +++ b/sal/inc/osl/module.hxx @@ -2,9 +2,9 @@ * * $RCSfile: module.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,51 +73,29 @@ namespace osl { -/** A class representing a share library module -*/ class Module { Module( const Module&); Module& operator = ( const Module&); public: - /** Lookup URL of module which is mapped at the specified address. - @param addr specifies an address in the process memory space - @param pustrURL receives the URL of the module that is mapped at pv - @return sal_True on success, sal_False if no module can be found at the specified address - */ static sal_Bool getUrlFromAddress(void * addr, ::rtl::OUString & libraryUrl) { return osl_getModuleURLFromAddress(addr, &libraryUrl.pData); } - /** Constructs an uninitialized module object. - */ Module(): m_Module(0){} - /** Contructs the module object and loads the shared library or module. - @param strModuleName the module to load - @seealso ::osl_loadModule() - */ Module( const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT) { load( strModuleName, nRtldMode); } - /** Unloads the module and destructs the object - @seealso ::osl_unloadModule() - */ ~Module() { osl_unloadModule(m_Module); } - /** Loads the shared library or module. - - A previously loaded module will be unloaded before the new one gets loaded. - @param strModuleName the module to load - @seealso ::osl_loadModule() - */ sal_Bool SAL_CALL load( const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT) { @@ -126,9 +104,6 @@ public: return is(); } - /** Unloads the module. - @seealso ::osl_unloadModule() - */ void SAL_CALL unload() { if (m_Module) @@ -138,27 +113,16 @@ public: } } - /** Checks if a module is loaded. - @return sal_True if the module is loaded, sal_False if not - */ sal_Bool SAL_CALL is() const { return m_Module != NULL; } - /** Extract a symbol from the module. - @param strSymbolName the symbol to extract. - @return the address of the symbol - @seealso ::osl_getSymbol() - */ void* SAL_CALL getSymbol( const ::rtl::OUString& strSymbolName) { return ( osl_getSymbol( m_Module, strSymbolName.pData ) ); } - /** Cast operator to oslModule. - @return the oslModule handle - */ operator oslModule() const { return m_Module; diff --git a/sal/inc/osl/mutex.h b/sal/inc/osl/mutex.h index 93ad68c9099f..329d3b168011 100644 --- a/sal/inc/osl/mutex.h +++ b/sal/inc/osl/mutex.h @@ -2,9 +2,9 @@ * * $RCSfile: mutex.h,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,9 +71,6 @@ extern "C" { #endif struct _oslMutexImpl; - -/** a handle to a mutex synchronization object -*/ typedef struct _oslMutexImpl * oslMutex; /** Create a thread-local mutex. diff --git a/sal/inc/osl/nlsupport.h b/sal/inc/osl/nlsupport.h index fa75f9a2c87d..0bbeb26b5401 100644 --- a/sal/inc/osl/nlsupport.h +++ b/sal/inc/osl/nlsupport.h @@ -2,9 +2,9 @@ * * $RCSfile: nlsupport.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,14 +75,15 @@ extern "C" { #endif -/** Determines the text encoding used by the underlying platform for the +/** + Determines the text encoding used by the underlying platform for the specified locale. @param pLocale the locale to return the text encoding for. If this parameter is NULL, the default locale of the current process is used. - @return the rtl_TextEncoding that matches the platform specific encoding + @returns the rtl_TextEncoding that matches the platform specific encoding description or RTL_TEXTENCODING_DONTKNOW if no mapping is available. */ diff --git a/sal/inc/osl/process.h b/sal/inc/osl/process.h index c3237f893632..a9cc417ad41a 100644 --- a/sal/inc/osl/process.h +++ b/sal/inc/osl/process.h @@ -2,9 +2,9 @@ * * $RCSfile: process.h,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: tra $ $Date: 2002-11-28 13:35:38 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -162,317 +162,208 @@ typedef struct { # pragma pack() #endif -/** Process handle. - - @see osl_executeProcess() - @see osl_terminateProcess() - @see osl_freeProcessHandle() - @see osl_getProcessInfo() - @see osl_joinProcess() +/** Process handle + @see osl_executeProcess + @see osl_terminateProcess + @see osl_freeProcessHandle + @see osl_getProcessInfo + @see osl_joinProcess */ typedef void* oslProcess; /** Execute a process. - - @param pustrImageName [in] - Denotes the file URL of the executable image to be started. - - @param pustrArguments [in] - Is an array of argument strings. - - @param nArgument [in] - The number of arguments provided. - - @param Options [in] - Is a combination of int-constants to describe the mode of execution. - - @param Security [in] - Describes a the user and his rights for wich the process is started. - - @param pustrWorkDir [in] - Denotes the file URL of the working directory of the new process. - - @param strEnviroments [in] - Is an array of strings wich describes the enviroment to set. + @param strImageName [in] denotes the name of the executable to be started. + @param strArguments [in] is an array of argument strings. + @param nArgument [in] the number of arguments provided. + @param Options [in] is a combination of int-constants to describe the mode of execution. + @param Security [in] describes a the user and his rights for wich the process is started. + @param strDirectory [in] denotes the name of the startup directory. + @param strEnviroments [in] is an array of strings wich describes the enviroment to set. Each string has the form "variable=value". - - @param nEnvironmentVars [in] - The number of environment vars to set. - - @param pProcess [out] - Points to a oslProcess variable, in wich the processhandle is returned. - - @return - osl_Process_E_None if the executable could be started, otherwise an error-code. - - @see osl_executeProcess_WithRedirectedIO() - @see osl_freeProcessHandle() - @see osl_loginUser() + @param nEnvironmentVars [in] the number of environment vars to set. + @param pProcess [out] points to a oslProcess variable, in wich the processhandle is returned. + @return osl_Process_E_None if the executable could be started, otherwise an error-code. + @see osl_executeProcess_WithRedirectedIO + @see osl_freeProcessHandle + @see osl_loginUser */ - -oslProcessError SAL_CALL osl_executeProcess(rtl_uString *pustrImageName, - rtl_uString *pustrArguments[], +oslProcessError SAL_CALL osl_executeProcess(rtl_uString *strImageName, + rtl_uString *strArguments[], sal_uInt32 nArguments, oslProcessOption Options, oslSecurity Security, - rtl_uString *pustrWorkDir, - rtl_uString *pustrEnvironment[], + rtl_uString *strWorkDir, + rtl_uString *strEnvironment[], sal_uInt32 nEnvironmentVars, oslProcess *pProcess); -/** Execute a process and redirected child process standard IO. - - @param pustrImageName [in] - Denotes the file URL of the executable image to be started. - - @param pustrArguments [in] - Is an array of argument strings. - - @param nArgument [in] - The number of arguments provided. - - @param Options [in] - Is a combination of int-constants to describe the mode of execution. - - @param Security [in] - Describes a the user and his rights for wich the process is started. - - @param pustrWorkDir [in] - Denotes the file URL of the working directory of the new process. - - @param pustrEnviroment [in] - Is an array of strings wich describes the enviroment to set. +/** Execute a process and redirected child process standard IO + @param strImageName [in] denotes the name of the executable to be started. + @param strArguments [in] is an array of argument strings. + @param nArgument [in] the number of arguments provided. + @param Options [in] is a combination of int-constants to describe the mode of execution. + @param Security [in] describes a the user and his rights for wich the process is started. + @param strDirectory [in] denotes the name of the startup directory. + @param strEnviroments [in] is an array of strings wich describes the enviroment to set. Each string has the form "variable=value". - - @param nEnvironmentVars [in] - The number of environment vars to set. - - @param pResource [in] - Is a NULL terminated array of resources to transmit to the client process. - - @param pProcess [out] - Points to a oslProcess variable, in wich the processhandle is returned. - - @param pChildInputWrite [out] - Points to a oslFileHandle variable that receives the handle which can + @param nEnvironmentVars [in] the number of environment vars to set. + @param pResource [in] is a NULL terminated array of resources to transmit to the client process. + @param pProcess [out] points to a oslProcess variable, in wich the processhandle is returned. + @param pChildInputWrite [out] points to a oslFileHandle variable that receives the handle which can be used to write to child process standard input device. Handle has to be closed with osl_closeFile if no longer used. - - @param pChildOutputRead [out] - Points to a oslFileHandle variable that receives the handle which can be used to read from - child process standard output device. Handle has to be closed with osl_closeFile if no longer used. - - @param pChildErrorRead [out] - Points to a oslFileHandle variable that receives the handle which can be used to read from child - process standard error device. Handle has to be closed with osl_closeFile if no longer used. - - @return - osl_Process_E_None if the executable could be started, otherwise an error-code. - - @see osl_executeProcess() - @see osl_freeProcessHandle() - @see osl_loginUser() - @see osl_closeFile() + @param pChildOutputRead [out] points to a oslFileHandle variable that receives the handle which can + be used to read from child process standard output device. Handle has to be closed with osl_closeFile + if no longer used. + @param pChildErrorRead [out] points to a oslFileHandle variable that receives the handle which can + be used to read from child process standard error device. Handle has to be closed with osl_closeFile + if no longer used. + @return osl_Process_E_None if the executable could be started, otherwise an error-code. + @see osl_executeProcess + @see osl_freeProcessHandle + @see osl_loginUser + @see osl_closeFile */ - -oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(rtl_uString *pustrImageName, - rtl_uString *pustrArguments[], +oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(rtl_uString *strImageName, + rtl_uString *strArguments[], sal_uInt32 nArguments, oslProcessOption Options, oslSecurity Security, - rtl_uString *pustrWorkDir, - rtl_uString *pustrEnvironment[], + rtl_uString *strWorkDir, + rtl_uString *strEnvironment[], sal_uInt32 nEnvironmentVars, oslProcess *pProcess, oslFileHandle *pChildInputWrite, oslFileHandle *pChildOutputRead, oslFileHandle *pChildErrorRead); +/** Terminate a process + @param Process [in] the handle of the process to be terminated -/** Terminate a process. - - @param Process [in] - The handle of the process to be terminated. - - @see osl_executeProcess() - @see osl_getProcess() - @see osl_joinProcess() -*/ - + @see osl_executeProcess + @see osl_getProcess + @see osl_joinProcess + */ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process); -/** Retrieve the process handle of a process identifier +/** @deprecated + Retrieve the process handle of a process identifier + @param Ident [in] a process identifier - @deprecated - - @param Ident [in] - A process identifier. - - @return - The process handle on success, NULL in all other cases. + @return the process handle on success, NULL in all other cases */ - oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident); /** Free the specified proces-handle. - @param Process [in] - The handle of the process. - - @see osl_executeProcess() - @see osl_executeProcess_WithRedirectedIO() */ - void SAL_CALL osl_freeProcessHandle(oslProcess Process); -/** Wait for completation of the specified child-process. - +/** Wait for completation of the specified childprocess. @param Process [in] - The handle of the process. - - @return - ols_Process_E_None on success, otherwise an error code. - - @see osl_executeProcess() - @see osl_executeProcess_WithRedirectedIO() + @return ols_Process_E_None + @see osl_executeProcess */ - oslProcessError SAL_CALL osl_joinProcess(oslProcess Process); - -/** Retrieves information about a Process. +/** Wait with a timeout for the completion of the specified child + process. @param Process [in] - The handle of the process. - - @param Fields [in] - The information which is to be retrieved this can be one or more of - osl_Process_IDENTIFIER - osl_Process_EXITCODE - osl_Process_CPUTIMES - osl_Process_HEAPUSAGE + A process identifier. - @param pInfo [out] - A pointer to a vaid oslProcessInfo structure. The Size field has to be initialized with the size - of the oslProcessInfo structure. On success the the Field member holds the (or'ed) retrieved - valid information fields. + @param pTimeout [in] + A timeout value or NULL for infinite waiting. + The unit of resolution is second. @return osl_Process_E_None on success - osl_Process_E_Unknown on failure. + osl_Process_E_TimedOut waiting for the child process timed out + osl_Process_E_Unknown an error occured or the parameter are invalid - @see osl_executeProcess() - @see osl_executeProcess_WithRedirectedIO() + @see osl_executeProcess +*/ +oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout); + +/** Retrieves information about a Process + @param Process [in] the process handle of the process + @param Field [in] the information which is to be retrieved + this can be one or more of + osl_Process_IDENTIFIER + osl_Process_EXITCODE + osl_Process_CPUTIMES + osl_Process_HEAPUSAGE + @param pInfo [out] a pointer to a vaid oslProcessInfo structure. + the Size field has to be initialized with the size + of the oslProcessInfo structure. + on success the the Field member holds the (or'ed) + retrieved valid information fields. + @return osl_Process_E_None on success, osl_Process_E_Unknown on failure. */ +oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData Fields, + oslProcessInfo* pInfo); -oslProcessError SAL_CALL osl_getProcessInfo( - oslProcess Process, - oslProcessData Fields, - oslProcessInfo* pInfo); - - -/** Get the file name of the executable. - - @param ppustrFile [out] - Receives the file URL of the executable image. - - @return - osl_Process_E_None or does not return. - - @see osl_executeProcess() - @see osl_executeProcess_WithRedirectedIO() +/** Get the filename of the executable. + @param strFile [out] the string that receives the executable file path. + @return osl_Process_E_None or does not return. + @see osl_executeProcess */ +oslProcessError SAL_CALL osl_getExecutableFile(rtl_uString **strFile); -oslProcessError SAL_CALL osl_getExecutableFile(rtl_uString **ppustrFile); - - -/** Get the number of command line arguments. - - @return - The number of commandline arguments passed to the main function of - this process. - - @see osl_getCommandArg() +/** @return the number of commandline arguments passed to the main-function of + this process + @see osl_getCommandArg */ - sal_uInt32 SAL_CALL osl_getCommandArgCount(); - -/** Get the nArg-th command line argument passed to the main function of this process. - - @param nArg [in] - The number of the argument to return. - - @param pustrCommandArg [out] - The string receives the nArg-th command-line argument. - - @return - osl_Process_E_None or does not return. - - @see osl_getCommandArgCount() +/** Get the nArg-th command-line argument passed to the main-function of this process. + @param nArg [in] The number of the argument to return. + @param strCommandArg [out] The string receives the nArg-th command-line argument. + @return osl_Process_E_None or does not return. + @see osl_executeProcess */ - -oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **pustrCommandArg); +oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **strCommandArg); /** Get the value of one enviroment variable. - - @param pustrVar [in] - Denotes the name of the variable to get. - - @param ppustrValue [out] - String that receives the value of environment variable. + @param strVar [in] denotes the name of the variable to get. + @param strValue [out] string that receives the value of environment variable. */ - -oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *pustrVar, rtl_uString **ppustrValue); - +oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *strVar, rtl_uString **strValue); /** Get the working directory of the current process as a file URL. The file URL is encoded as common for the OSL file API. - - @param ppustrWorkingDir [out] - String that receives the working directory URL. + @param pustrWorkingDir [out] string that receives the working directory file URL. */ -oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **ppustrWorkingDir ); - +oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir ); /** Get the locale the process is currently running in. The unix implementation caches the value it returns, so if you have to change the locale your are running in, you will have to use osl_setProcessLocale therefor. - @param ppLocale [out] - A pointer that receives the currently selected locale structure. - - @see osl_setProcessLocale() + @param ppLocale [out] a pointer that receives the currently selected locale structure + @see osl_setProcessLocale */ oslProcessError SAL_CALL osl_getProcessLocale( rtl_Locale ** ppLocale ); - /** Change the locale of the process. - @param pLocale [in] - A pointer to the locale to be set. - - @see osl_getProcessLocale() + @param pLocale [in] a pointer to the locale to be set + @see osl_getProcessLocale */ oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale ); -/** @internal -*/ sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket); -/** @internal -*/ - oslSocket SAL_CALL osl_receiveResourcePipe(oslPipe Pipe); #ifdef __cplusplus diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h index 40d75d4af0b9..320d283eebb4 100644 --- a/sal/inc/osl/semaphor.h +++ b/sal/inc/osl/semaphor.h @@ -2,9 +2,9 @@ * * $RCSfile: semaphor.h,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,36 +72,34 @@ extern "C" { typedef void* oslSemaphore; -/** Creates a semaphore. +/** Creates a semaphore.<BR> @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. - @return NULL if the semaphore could not be created, otherwise a handle - to the created semaphore object. + @return 0 if the semaphore could not be created, otherwise a handle to the sem. */ oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount); -/** Release the OS-structures and free semaphore data-structure. +/** Release the OS-structures and free semaphore data-structure + @return fbbb */ void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore); -/** Decrease the count of a semaphore. - - It will block if it tries to decrease below zero. - @return sal_False if the system-call failed. +/** acquire() decreases the count. It will block if it tries to + decrease below zero. + @return False if the system-call failed. */ sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore); -/** tries to decreases the count of a semaphore. - - @return sal_False if it would decrease the count below zero. - (acquire() would block). If it could successfully - decrease the count, it will return sal_True. +/** tryToAcquire() tries to decreases the count. It will + 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. */ sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore); -/** Increases the count of a semaphore. - @return sal_False if the system-call failed. +/** release() increases the count. + @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 8e0b14e47957..a37b997ade76 100644 --- a/sal/inc/osl/semaphor.hxx +++ b/sal/inc/osl/semaphor.hxx @@ -2,9 +2,9 @@ * * $RCSfile: semaphor.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,11 +75,11 @@ namespace osl public: - /** Creates a semaphore. + /** Creates a semaphore.<BR> @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. - @seealso ::osl_createSemaphore() + @return 0 if the semaphore could not be created, otherwise a handle to the sem. */ Semaphore(sal_uInt32 initialCount) @@ -88,39 +88,34 @@ namespace osl } /** Release the OS-structures and free semaphore data-structure - @seealso ::osl_destroySemaphore() + @return fbbb */ ~Semaphore() { osl_destroySemaphore(semaphore); } - /** Decreases the count of the semaphore object. - - It will block if it tries to decrease below zero. - @return sal_False if the system-call failed - @seealso ::osl_acquireSemaphore() + /** acquire() decreases the count. It will block if it tries to + decrease below zero. + @return False if the system-call failed. */ sal_Bool acquire() { return osl_acquireSemaphore(semaphore); } - /** Tries to decreases the count of the semaphore. - - @return sal_False if it would decrease the count below zero - (acquire() would block). If it could successfully - decrease the count, it will return sal_True. - @seealso ::osl_tryToAcquireSemaphore() + /** tryToAcquire() tries to decreases the count. It will + 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. */ sal_Bool tryToAcquire() { return osl_tryToAcquireSemaphore(semaphore); } - /** Increases the count. - @return sal_False if the system-call failed. - @seealso ::osl_releaseSemaphore() + /** release() increases the count. + @return False if the system-call failed. */ sal_Bool release() { diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx index 862ad19eb188..b38dc685ef7b 100644 --- a/sal/inc/osl/thread.hxx +++ b/sal/inc/osl/thread.hxx @@ -2,9 +2,9 @@ * * $RCSfile: thread.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: jl $ $Date: 2001-10-23 08:48:16 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,6 @@ namespace osl */ extern "C" inline void SAL_CALL threadFunc( void* param); -/** The Thread class is a c++ wrapper for the C thread API. - */ class Thread { Thread( const Thread& ); @@ -107,24 +105,11 @@ public: Thread(): m_hThread(0){} - /** Destroyes the thread. - - @see osl_destroyThread - */ virtual ~Thread() { osl_destroyThread( m_hThread); } - /** Creates a thread. - - In order to create a thread one has to supply a class that inherits this Thread class - and one has to provide an implementations for the run function. When create is called - then the run function is executed. - @see osl_createThread - @see osl_createSuspendedThread - - */ sal_Bool SAL_CALL create() { OSL_ASSERT(m_hThread == 0); // only one running thread per instance @@ -138,12 +123,6 @@ public: return m_hThread != 0; } - /** Creates a thread that is suspended. - - To run the thread one has to call resume. - - @see osl_createSuspendedThread - */ sal_Bool SAL_CALL createSuspended() { OSL_ASSERT(m_hThread == 0); // only one running thread per instance @@ -154,117 +133,67 @@ public: return m_hThread != 0; } - /** Suspends the thread. - - @see osl_suspendThread - */ virtual void SAL_CALL suspend() { osl_suspendThread(m_hThread); } - /** Puts the thread in a running state if it is currently suspended. - - @see osl_resumeThread - */ virtual void SAL_CALL resume() { osl_resumeThread(m_hThread); } - /** Terminates the thread. - - @see osl_terminateThread - */ virtual void SAL_CALL terminate() { osl_terminateThread(m_hThread); } - /** - - @see osl_joinWithThread - */ virtual void SAL_CALL join() { osl_joinWithThread(m_hThread); } - /** Determines if this thread is running or not. - @return true, if thread is running, false otherwise. - @see osl_isThreadRunning - */ sal_Bool SAL_CALL isRunning() { return m_hThread != 0 && osl_isThreadRunning(m_hThread); } - /** Sets the priority of this thread. - - @see osl_setThreadPriority - */ void SAL_CALL setPriority( oslThreadPriority Priority) { osl_setThreadPriority(m_hThread, Priority); } - /** Returns the priority of this thread. - - @see osl_getThreadPriority - */ oslThreadPriority SAL_CALL getPriority() { return osl_getThreadPriority(m_hThread); } - /** Returns the identifier this thread. - @see osl_getThreadIdentifier - */ oslThreadIdentifier SAL_CALL getIdentifier() const { return osl_getThreadIdentifier(m_hThread); } - /** Returns the identifier of the current thread. - - @see osl_getThreadIdentifier - */ static oslThreadIdentifier SAL_CALL getCurrentIdentifier() { return osl_getThreadIdentifier(0); } - /** Blocks the current thread for the specified amount of time. - - @see osl_waitThread - */ static void SAL_CALL wait(const TimeValue& Delay) { osl_waitThread(&Delay); } - /** Has the operating system to run another thread and put this thread into - suspended state until it is being scheduled again. - - @see osl_yieldThread - */ static void SAL_CALL yield() { osl_yieldThread(); } - /** - @see osl_scheduleThread - */ virtual sal_Bool SAL_CALL schedule() { return osl_scheduleThread(m_hThread); } - /** Extractor (or cast operator) for the thread handle. - - */ SAL_CALL operator oslThread() const { return m_hThread; @@ -277,20 +206,8 @@ protected: */ friend void SAL_CALL threadFunc( void* param); - /** The run function is run automatically after create has been called. - - run has to be provided by the class that inherits the Thread class. - Put all code that has to be performed by the thread into this function. - - */ virtual void SAL_CALL run() = 0; - /** Notifies the instance of this class that the termination of this - thread is imminent. - - In order to process this notification one has to override this - function. - */ virtual void SAL_CALL onTerminated() { } @@ -311,19 +228,13 @@ class ThreadData ThreadData( const ThreadData& ); ThreadData& operator= (const ThreadData& ); public: - /** Create a thread specific local data key. - - @see osl_createThreadKey - */ + /// Create a thread specific local data key ThreadData( oslThreadKeyCallbackFunction pCallback= 0 ) { m_hKey = osl_createThreadKey( pCallback ); } - /** Destroy a thread specific local data key. - - @see osl_destroyThreadKey - */ + /// Destroy a thread specific local data key ~ThreadData() { osl_destroyThreadKey(m_hKey); @@ -331,7 +242,6 @@ public: /** Set the data associated with the data key. @returns True if operation was successfull - @see osl_setThreadKeyData */ sal_Bool SAL_CALL setData(void *pData) { @@ -340,16 +250,13 @@ public: /** Get the data associated with the data key. @returns The data asscoitaed with the data key or - NULL if no data was set. - @see osl_getThreadKeyData + NULL if no data was set */ void* SAL_CALL getData() { return osl_getThreadKeyData(m_hKey); } - /** Extractor (or cast operator) for the key handle. - */ operator oslThreadKey() const { return m_hKey; diff --git a/sal/inc/osl/time.h b/sal/inc/osl/time.h index 22e10ef6fbf6..3be6fb4127d7 100644 --- a/sal/inc/osl/time.h +++ b/sal/inc/osl/time.h @@ -2,9 +2,9 @@ * * $RCSfile: time.h,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: obr $ $Date: 2001-11-08 15:48:05 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,8 +80,8 @@ extern "C" { # pragma pack(1) #endif -/** Time since Jan-01-1970 -*/ +/* Time since Jan-01-1970 */ + typedef struct { sal_uInt32 Seconds; sal_uInt32 Nanosec; @@ -98,10 +98,9 @@ typedef struct { /* oslDateTime */ /****************************************************************************/ -/** Contains all elements of a timestamp as an own member -*/ typedef struct _oslDateTime { + /*----------------------------------------------------------------------*/ /** contains the nanoseconds . */ sal_uInt32 NanoSeconds; @@ -110,26 +109,32 @@ typedef struct _oslDateTime */ sal_uInt16 Seconds; + /*----------------------------------------------------------------------*/ /** contains the minutes (0-59). */ sal_uInt16 Minutes; + /*----------------------------------------------------------------------*/ /** contains the hour (0-23). */ sal_uInt16 Hours; + /*----------------------------------------------------------------------*/ /** is the day of month (1-31). */ sal_uInt16 Day; + /*----------------------------------------------------------------------*/ /** is the day of week (0-6 , 0 : Sunday). */ sal_uInt16 DayOfWeek; + /*----------------------------------------------------------------------*/ /** is the month of year (1-12). */ sal_uInt16 Month; + /*----------------------------------------------------------------------*/ /** is the year. */ sal_uInt16 Year; diff --git a/sal/inc/osl/util.h b/sal/inc/osl/util.h index 2f56fd6e6f4d..feb961ce552e 100644 --- a/sal/inc/osl/util.h +++ b/sal/inc/osl/util.h @@ -2,9 +2,9 @@ * * $RCSfile: util.h,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obr $ $Date: 2001-11-12 15:51:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,8 +69,9 @@ extern "C" { #endif -/** Retrieves an ethernet address of the machine. +/** @param pEthernetAddr 6 bytes of memory + @return sal_True if the ethernetaddress could be retrieved. <br> sal_False if no address could be found. This may be either because there is no ethernet card or there is no appropriate algorithm diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h index 12f528a36e6d..6a2bf9127c2f 100644 --- a/sal/inc/rtl/math.h +++ b/sal/inc/rtl/math.h @@ -2,9 +2,9 @@ * * $RCSfile: math.h,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: sb $ $Date: 2002-11-04 15:21:35 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,7 +69,8 @@ extern "C" { #endif /* __cplusplus */ -/** Formatting modes for rtl_math_doubleToString and rtl_math_doubleToUString. +/** Formatting modes for rtl_math_doubleToString and rtl_math_doubleToUString + and rtl_math_doubleToUStringBuffer. */ enum rtl_math_StringFormat { @@ -154,6 +155,23 @@ enum rtl_math_RoundingMode rtl_math_RoundingMode_FORCE_EQUAL_SIZE = SAL_MAX_ENUM }; +/** Special decimal places constants for rtl_math_doubleToString and + rtl_math_doubleToUString and rtl_math_doubleToUStringBuffer. + */ +enum rtl_math_DecimalPlaces +{ + /** Value to be used with rtl_math_StringFormat_Automatic. + */ + rtl_math_DecimalPlaces_Max = 0x7ffffff, + + /** Value to be used with rtl_math_StringFormat_G. + In fact the same value as rtl_math_DecimalPlaces_Max, just an alias for + better understanding. + */ + rtl_math_DecimalPlaces_DefaultSignificance = 0x7ffffff +}; + + /** Conversions analogous to sprintf() using internal rounding. +/-HUGE_VAL are converted to "1.#INF" and "-1.#INF", NAN values are @@ -170,10 +188,10 @@ enum rtl_math_RoundingMode If non-null, it points to the current capacity of pResult, which is considered to point to a string buffer (pResult must not itself be null in this case, and must point to a string that has room for the given capacity). - The string representation of the given double value is appended to pResult. - If pResult's current capacity is too small, a new string buffer will be - allocated in pResult as necessary, and pResultCapacity will contain the new - capacity on return. + The string representation of the given double value is inserted into pResult + at position nResultOffset. If pResult's current capacity is too small, a + new string buffer will be allocated in pResult as necessary, and + pResultCapacity will contain the new capacity on return. @param nResultOffset If pResult is used as a string buffer (i.e., pResultCapacity is non-null), @@ -184,14 +202,24 @@ enum rtl_math_RoundingMode The value to convert. @param eFormat - The format to use. If eFormat == rtl_math_StringFormat_G and - nDecPlaces < 0, the default number (currently 6) of decimals is generated. - If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces < 0, the - highest number of significant decimals possible is generated. + The format to use, one of rtl_math_StringFormat. @param nDecPlaces - The number of decimals to be generated. Must be non-negative, expect as - described for the eFormat parameter. + The number of decimals to be generated. Effectively fValue is rounded at + this position, specifying nDecPlaces <= 0 accordingly rounds the value + before the decimal point and fills with zeros. + If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces == + rtl_math_DecimalPlaces_Max, the highest number of significant decimals + possible is generated. + If eFormat == rtl_math_StringFormat_G, nDecPlaces specifies the number of + significant digits instead. If nDecPlaces == + rtl_math_DecimalPlaces_DefaultSignificance, the default number (currently 6 + as implemented by most libraries) of significant digits is generated. + According to the ANSI C90 standard the E style will be used only if the + exponent resulting from the conversion is less than -4 or greater than or + equal to the precision. However, as opposed to the ANSI standard, trailing + zeros are not necessarily removed from the fractional portion of the result + unless bEraseTrailingDecZeros == true was specified. @param cDecSeparator The decimal separator. @@ -200,7 +228,8 @@ enum rtl_math_RoundingMode Either null (no grouping is used), or a null-terminated list of group lengths. Each group length must be strictly positive. If the number of digits in a conversion exceeds the specified range, the last (highest) group - length is repeated as needed. + length is repeated as needed. Values are applied from right to left, for a + grouping of 1,00,00,000 you'd have to specify pGroups={3,2,0}. @param cGroupSeparator The group separator. Ignored if pGroups is null. @@ -235,10 +264,10 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult, If non-null, it points to the current capacity of pResult, which is considered to point to a string buffer (pResult must not itself be null in this case, and must point to a string that has room for the given capacity). - The string representation of the given double value is appended to pResult. - If pResult's current capacity is too small, a new string buffer will be - allocated in pResult as necessary, and pResultCapacity will contain the new - capacity on return. + The string representation of the given double value is inserted into pResult + at position nResultOffset. If pResult's current capacity is too small, a + new string buffer will be allocated in pResult as necessary, and + pResultCapacity will contain the new capacity on return. @param nResultOffset If pResult is used as a string buffer (i.e., pResultCapacity is non-null), @@ -249,14 +278,24 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult, The value to convert. @param eFormat - The format to use. If eFormat == rtl_math_StringFormat_G and - nDecPlaces < 0, the default number (currently 6) of decimals is generated. - If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces < 0, the - highest number of significant decimals possible is generated. + The format to use, one of rtl_math_StringFormat. @param nDecPlaces - The number of decimals to be generated. Must be non-negative, expect as - described for the eFormat parameter. + The number of decimals to be generated. Effectively fValue is rounded at + this position, specifying nDecPlaces <= 0 accordingly rounds the value + before the decimal point and fills with zeros. + If eFormat == rtl_math_StringFormat_Automatic and nDecPlaces == + rtl_math_DecimalPlaces_Max, the highest number of significant decimals + possible is generated. + If eFormat == rtl_math_StringFormat_G, nDecPlaces specifies the number of + significant digits instead. If nDecPlaces == + rtl_math_DecimalPlaces_DefaultSignificance, the default number (currently 6 + as implemented by most libraries) of significant digits is generated. + According to the ANSI C90 standard the E style will be used only if the + exponent resulting from the conversion is less than -4 or greater than or + equal to the precision. However, as opposed to the ANSI standard, trailing + zeros are not necessarily removed from the fractional portion of the result + unless bEraseTrailingDecZeros == true was specified. @param cDecSeparator The decimal separator. @@ -265,7 +304,8 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult, Either null (no grouping is used), or a null-terminated list of group lengths. Each group length must be strictly positive. If the number of digits in a conversion exceeds the specified range, the last (highest) group - length is repeated as needed. + length is repeated as needed. Values are applied from right to left, for a + grouping of 1,00,00,000 you'd have to specify pGroups={3,2,0}. @param cGroupSeparator The group separator. Ignored if pGroups is null. diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx index 9347464fe6e6..d2b262813df3 100644 --- a/sal/inc/rtl/math.hxx +++ b/sal/inc/rtl/math.hxx @@ -2,9 +2,9 @@ * * $RCSfile: math.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: sb $ $Date: 2002-11-06 15:49:29 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,6 +65,7 @@ #include "rtl/math.h" #include "rtl/string.hxx" #include "rtl/ustring.hxx" +#include "rtl/ustrbuf.hxx" #include "sal/mathconf.h" #include "sal/types.h" @@ -134,6 +135,42 @@ inline rtl::OUString doubleToUString(double fValue, return aResult; } +/** A wrapper around rtl_math_doubleToUString that appends to an + rtl::OUStringBuffer. + */ +inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue, + rtl_math_StringFormat eFormat, + sal_Int32 nDecPlaces, + sal_Unicode cDecSeparator, + sal_Int32 const * pGroups, + sal_Unicode cGroupSeparator, + bool bEraseTrailingDecZeros = false) +{ + rtl_uString ** pData; + sal_Int32 * pCapacity; + rBuffer.accessInternals( &pData, &pCapacity ); + rtl_math_doubleToUString( pData, pCapacity, rBuffer.getLength(), fValue, + eFormat, nDecPlaces, cDecSeparator, pGroups, + cGroupSeparator, bEraseTrailingDecZeros); +} + +/** A wrapper around rtl_math_doubleToUString that appends to an + rtl::OUStringBuffer, with no grouping. + */ +inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue, + rtl_math_StringFormat eFormat, + sal_Int32 nDecPlaces, + sal_Unicode cDecSeparator, + bool bEraseTrailingDecZeros = false) +{ + rtl_uString ** pData; + sal_Int32 * pCapacity; + rBuffer.accessInternals( &pData, &pCapacity ); + rtl_math_doubleToUString( pData, pCapacity, rBuffer.getLength(), fValue, + eFormat, nDecPlaces, cDecSeparator, 0, 0, + bEraseTrailingDecZeros); +} + /** A wrapper around rtl_math_stringToDouble. */ inline double stringToDouble(rtl::OString const & rString, @@ -174,7 +211,7 @@ inline double stringToDouble(rtl::OUString const & rString, /** A wrapper around rtl_math_round. */ inline double round( - double fValue, int nDecPlaces, + double fValue, int nDecPlaces = 0, rtl_math_RoundingMode eMode = rtl_math_RoundingMode_Corrected) { return rtl_math_round(fValue, nDecPlaces, eMode); diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h index 9023d2ba32f5..17ca68080ac0 100644 --- a/sal/inc/rtl/string.h +++ b/sal/inc/rtl/string.h @@ -2,9 +2,9 @@ * * $RCSfile: string.h,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: sb $ $Date: 2001-10-30 13:41:07 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1159,6 +1159,43 @@ sal_Int32 SAL_CALL rtl_string_getToken( rtl_String ** newStr , rtl_String * str, */ void SAL_CALL rtl_uString2String( rtl_String ** newStr, const sal_Unicode * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C(); +/** + Converts a Unicode string to a byte string, signalling failure. + + @param pTarget + An out parameter receiving the converted string. Must not be null itself, and + must contain either null or a pointer to a valid rtl_String; the contents are + not modified if conversion fails (rtl_convertUStringToString returns false). + + @param pSource + The Unicode string. May only be null if nLength is zero. + + @param nLength + The length of the Unicode string. Must be non-negative. + + @param nEncoding + The text encoding to convert into. Must be an octet encoding (i.e., + rtl_isOctetTextEncoding(nEncoding) must return true). + + @param nFlags + A combination of RTL_UNICODETOTEXT_FLAGS that detail how to do the conversion + (see rtl_convertUnicodeToText). RTL_UNICODETOTEXT_FLAGS_FLUSH need not be + included, it is implicitly assumed. Typical uses are either + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR (fail if a Unicode character cannot be + converted to the target nEncoding) or OUSTRING_TO_OSTRING_CVTFLAGS (make a + best efforts conversion). + + @return + True if the conversion succeeded, false otherwise. + */ +sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget, + sal_Unicode const * pSource, + sal_Int32 nLength, + rtl_TextEncoding nEncoding, + sal_uInt32 nFlags) + SAL_THROW_EXTERN_C(); + #ifdef __cplusplus } #endif diff --git a/sal/inc/rtl/textcvt.h b/sal/inc/rtl/textcvt.h index 5f07c432ea1c..1049af3469b0 100644 --- a/sal/inc/rtl/textcvt.h +++ b/sal/inc/rtl/textcvt.h @@ -2,9 +2,9 @@ * * $RCSfile: textcvt.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sb $ $Date: 2001-10-29 15:14:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -115,6 +115,9 @@ void SAL_CALL rtl_resetTextToUnicodeContext( rtl_TextToUni #define RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ((sal_uInt32)0x0200) #define RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT ((sal_uInt32)0x0300) #define RTL_TEXTTOUNICODE_FLAGS_FLUSH ((sal_uInt32)0x8000) +#define RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE 0x10000 + /* Accept any global document signatures (for example, in UTF-8, a leading + EF BB BF encoding the Byte Order Mark U+FEFF) */ #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F) #define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK ((sal_uInt32)0x00F0) @@ -184,6 +187,9 @@ void SAL_CALL rtl_resetUnicodeToTextContext( rtl_UnicodeTo #define RTL_UNICODETOTEXT_FLAGS_PRIVATE_IGNORE ((sal_uInt32)0x2000) #define RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE ((sal_uInt32)0x4000) #define RTL_UNICODETOTEXT_FLAGS_FLUSH ((sal_uInt32)0x8000) +#define RTL_UNICODETOTEXT_FLAGS_GLOBAL_SIGNATURE 0x10000 + /* Write any global document signatures (for example, in UTF-8, a leading + EF BB BF encoding the Byte Order Mark U+FEFF) */ #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F) #define RTL_UNICODETOTEXT_FLAGS_INVALID_MASK ((sal_uInt32)0x00F0) diff --git a/sal/inc/rtl/textenc.h b/sal/inc/rtl/textenc.h index 68f04a4ca2b0..019abdd8ad3b 100644 --- a/sal/inc/rtl/textenc.h +++ b/sal/inc/rtl/textenc.h @@ -2,9 +2,9 @@ * * $RCSfile: textenc.h,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-03-19 15:08:29 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -174,6 +174,7 @@ typedef sal_uInt16 rtl_TextEncoding; #define RTL_TEXTENCODING_GB_18030 (RTL_TEXTENC_CAST( 85 )) #define RTL_TEXTENCODING_BIG5_HKSCS (RTL_TEXTENC_CAST( 86 )) #define RTL_TEXTENCODING_TIS_620 (RTL_TEXTENC_CAST( 87 )) +#define RTL_TEXTENCODING_KOI8_U (RTL_TEXTENC_CAST( 88 )) /* ATTENTION! Whenever some encoding is added here, make sure to update * rtl_isOctetEncoding in tencinfo.c. */ @@ -225,6 +226,7 @@ Cyrillic (DOS/OS2-855) RTL_TEXTENCODING_IBM_855 Cyrillic (DOS/OS2-866/Russian) RTL_TEXTENCODING_IBM_866 Cyrillic (ISO-8859-5) RTL_TEXTENCODING_ISO_8859_5 Cyrillic (KOI8-R) RTL_TEXTENCODING_KOI8_R +Cyrillic (KOI8-U) RTL_TEXTENCODING_KOI8_U Cyrillic (Windows-1251) RTL_TEXTENCODING_MS_1251 Greek (Apple Macintosh) RTL_TEXTENCODING_APPLE_GREEK diff --git a/sal/inc/rtl/tres.h b/sal/inc/rtl/tres.h index 9ecbb00e6714..0555f741bd67 100644 --- a/sal/inc/rtl/tres.h +++ b/sal/inc/rtl/tres.h @@ -5,6 +5,14 @@ #include <osl/diagnose.h> #endif +#ifndef _RTL_STRING_H_ +#include <rtl/string.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + /* comandline flags */ #define rtl_tres_Flag_BOOM 0x00000001 #define rtl_tres_Flag_VERBOSE 0x00000002 @@ -19,30 +27,84 @@ #define rtl_tres_Flag_PASSED 0x10000000 #define rtl_tres_Flag_OK 0x20000000 -#ifdef __cplusplus -extern "C" { -#endif -typedef void* rtlTestResult; -rtlTestResult SAL_CALL rtl_tres_create - ( - const sal_Char* meth, - sal_uInt32 flags - ); + /* forward declaration and type definition */ +struct _rtl_TestResult; +typedef struct _rtl_TestResult rtl_TestResult; + -sal_Bool SAL_CALL rtl_tres_state - ( - rtlTestResult res, - sal_Bool bSuccess, - sal_Char* pTestMsg, - sal_Char* pFuncName - ); +typedef void* rtl_funcstate; +typedef void* rtl_cmpstate; -sal_Bool SAL_CALL rtl_tres_destroy( rtlTestResult res ); + /* type definitions of function pointers wich can be overloaded */ +typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)( + rtl_TestResult*, + sal_Bool, + const sal_Char*, + const sal_Char*, + sal_Bool + ); + +typedef void (SAL_CALL *rtl_tres_end_ptr)( rtl_TestResult*, const sal_Char* ); +typedef sal_Bool (SAL_CALL *rtl_tres_ispassed_ptr)( rtl_TestResult* ); +typedef sal_Bool (SAL_CALL *rtl_tres_isok_ptr)( rtl_TestResult* ); +typedef rtl_funcstate (SAL_CALL *rtl_tres_funcstate_ptr)( rtl_TestResult* ); +typedef sal_Bool (SAL_CALL *rtl_tres_isbit_ptr)( rtl_TestResult*, + sal_uInt32 ); + +typedef rtl_funcstate (SAL_CALL *rtl_tres_getnextfuncstate_ptr) + ( rtl_funcstate ); +typedef rtl_funcstate (SAL_CALL *rtl_tres_getprevfuncstate_ptr) + ( rtl_funcstate ); +typedef sal_uInt32 (SAL_CALL *rtl_tres_getflags_ptr)( rtl_funcstate ); +typedef rtl_String* (SAL_CALL *rtl_tres_getname_ptr)( rtl_funcstate ); +typedef sal_uInt32 (SAL_CALL *rtl_tres_getstart_ptr)( rtl_funcstate ); +typedef sal_uInt32 (SAL_CALL *rtl_tres_getstop_ptr)( rtl_funcstate ); +typedef rtl_cmpstate (SAL_CALL *rtl_tres_getcmpstate_ptr)( rtl_funcstate ); + +typedef sal_Bool (SAL_CALL *rtl_tres_getstat_ptr)( rtl_cmpstate ); +typedef rtl_String* (SAL_CALL *rtl_tres_getmsg_ptr)( rtl_cmpstate ); +typedef rtl_cmpstate (SAL_CALL *rtl_tres_getnextcmpstate_ptr)( rtl_cmpstate ); + + /* type definition of vtable structure for testresult */ +typedef struct _rtl_TestResult_vtable +{ + sal_uInt32 vtablesize; + rtl_tres_state_ptr state_; + rtl_tres_end_ptr end_; + rtl_tres_ispassed_ptr ispassed; + rtl_tres_isok_ptr isok; + rtl_tres_funcstate_ptr funcstate; + rtl_tres_isbit_ptr isbit; + rtl_tres_getnextfuncstate_ptr nextfuncstate; + rtl_tres_getprevfuncstate_ptr prevfuncstate; + rtl_tres_getflags_ptr flags; + rtl_tres_getname_ptr name; + rtl_tres_getstart_ptr start; + rtl_tres_getstop_ptr stop; + rtl_tres_getcmpstate_ptr cmpstate; + rtl_tres_getstat_ptr stat; + rtl_tres_getmsg_ptr msg; + rtl_tres_getnextcmpstate_ptr nextcmpstate; + +} rtl_TestResult_vtable; + + /* type definition of testresult structure */ +struct _rtl_TestResult +{ + rtl_TestResult_vtable * pFuncs; + void * pExternalData; + +}; + + + /* exports */ +rtl_TestResult* SAL_CALL rtl_tres_create( const sal_Char* meth, sal_uInt32 flags ); +void SAL_CALL rtl_tres_destroy( rtl_TestResult* res ); #ifdef __cplusplus } #endif -#endif +#endif /* _RTL_TRES_H_ */ diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx index 5831d821c101..f188db606e5a 100644 --- a/sal/inc/rtl/ustrbuf.hxx +++ b/sal/inc/rtl/ustrbuf.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ustrbuf.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sb $ $Date: 2001-10-30 13:41:07 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -722,6 +722,29 @@ public: sal_Unicode sz[RTL_USTR_MAX_VALUEOFDOUBLE]; return insert( offset, sz, rtl_ustr_valueOfDouble( sz, d ) ); } + + /** Allows access to the internal data of this OUStringBuffer, for effective + manipulation. + + This method should be used with care. After you have called this + method, you may use the returned pInternalData or pInternalCapacity only + as long as you make no other method call on this OUStringBuffer. + + @param pInternalData + This output parameter receives a pointer to the internal data + (rtl_uString pointer). pInternalData itself must not be null. + + @param pInternalCapacity + This output parameter receives a pointer to the internal capacity. + pInternalCapacity itself must not be null. + */ + inline void accessInternals(rtl_uString *** pInternalData, + sal_Int32 ** pInternalCapacity) + { + *pInternalData = &pData; + *pInternalCapacity = &nCapacity; + } + private: /** A pointer to the data structur which contains the data. @@ -738,5 +761,3 @@ private: #endif /* __cplusplus */ #endif /* _RTL_USTRBUF_HXX_ */ - - diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h index df37c8d9b4e4..7e91ce5a6c78 100644 --- a/sal/inc/rtl/ustring.h +++ b/sal/inc/rtl/ustring.h @@ -2,9 +2,9 @@ * * $RCSfile: ustring.h,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: jsc $ $Date: 2002-03-08 14:02:37 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -994,6 +994,7 @@ double SAL_CALL rtl_ustr_toDouble( const sal_Unicode * str ) SAL_THROW_EXTERN_C( /** The implementation of a Unicode string. + @internal */ typedef struct _rtl_uString { diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index c59913cff841..d037a70b0e42 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ustring.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: sb $ $Date: 2002-10-17 13:06:16 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1063,6 +1063,37 @@ public: } /** + Converts to an OString, signalling failure. + + @param pTarget + An out parameter receiving the converted OString. Must not be null; the + contents are not modified if conversion fails (convertToOString returns + false). + + @param nEncoding + The text encoding to convert into. Must be an octet encoding (i.e., + rtl_isOctetTextEncoding(nEncoding) must return true). + + @param nFlags + A combination of RTL_UNICODETOTEXT_FLAGS that detail how to do the + conversion (see rtl_convertUnicodeToText). RTL_UNICODETOTEXT_FLAGS_FLUSH + need not be included, it is implicitly assumed. Typical uses are either + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR (fail if a Unicode character cannot + be converted to the target nEncoding) or OUSTRING_TO_OSTRING_CVTFLAGS + (make a best efforts conversion). + + @return + True if the conversion succeeded, false otherwise. + */ + inline bool convertToString(OString * pTarget, rtl_TextEncoding nEncoding, + sal_uInt32 nFlags) + { + return rtl_convertUStringToString(&pTarget->pData, pData->buffer, + pData->length, nEncoding, nFlags); + } + + /** Returns the string representation of the sal_Bool argument. If the sal_Bool is true, the string "true" is returned. diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h index d12adbc2bbf6..98ea9bc123d7 100644 --- a/sal/inc/sal/config.h +++ b/sal/inc/sal/config.h @@ -2,8 +2,8 @@ * * $RCSfile: config.h,v $ * - * $Revision: 1.15 $ - * last change: $Author: hro $ $Date: 2002-12-10 12:18:23 $ + * $Revision: 1.16 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,12 @@ extern "C" { #define SAL_SYSCONFIGFILE( name ) name ".ini" #ifdef _MSC_VER + +/* warnings ought to be disabled using /wd:n option of msvc.net compiler */ +#if _MSC_VER < 1300 +/* no performance warning: int to bool */ +#pragma warning( disable : 4800 ) + /* No warning for: C++ Exception Specification ignored */ #pragma warning( disable : 4290 ) @@ -88,14 +94,15 @@ extern "C" { /* No warning for: identifier was truncated to '255' characters in the browser information */ #pragma warning( disable : 4786 ) #endif +#endif /* _MSC_VER < 1300 */ /* Provide ISO C99 compatible versions of snprint and vsnprintf */ #ifndef _SNPRINTF_H #include <systools/win32/snprintf.h> #endif -#endif -#endif +#endif /* defined _MSC_VER */ +#endif /* defined WIN32 */ /* BR: 16bit fuer Borland-Compiler */ #ifdef __BORLANDC__ diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h index 1c248010f460..c72d795ac396 100644 --- a/sal/inc/sal/mathconf.h +++ b/sal/inc/sal/mathconf.h @@ -2,9 +2,9 @@ * * $RCSfile: mathconf.h,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: sb $ $Date: 2002-11-06 15:48:48 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,7 +65,6 @@ #include "osl/endian.h" #include <float.h> -#include <limits.h> #if defined SOLARIS #include <ieeefp.h> @@ -75,79 +74,21 @@ extern "C" { #endif /* __cplusplus */ -/** @descr - Handle FP errors using exceptions and setjmp/longjmp? DON'T in C++! - Switch off with SAL_MATH_FPCONTROL() and just calculate, test results with - SAL_MATH_FINITE(d), 0==error (INFinitiy, NaN), else ok. - */ -#if 0 -#define SAL_MATH_FPSIGNAL_JUMP 1 -#else /* 0 */ -#define SAL_MATH_FPSIGNAL_JUMP 0 -#endif /* 0 */ - - -/* signal() ID for FP exceptions */ -#if defined RS6000 -#define SAL_MATH_SIGFPE SIGTRAP -#else /* RS6000 */ -#define SAL_MATH_SIGFPE SIGFPE -#endif /* RS6000 */ - -/* SAL_MATH_FPCONTROL(): switch FP exceptions on/off, depending on - SAL_MATH_FPSIGNAL_JUMP - SAL_MATH_FPRESET(): reinitialize math package -*/ -#if defined WNT || defined WIN - -#define SAL_MATH_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 ) +/* Generally, the C standard guarantees that at program startup, "trapping or + stopping (if supported) is disabled on all [floating-point] exceptions" + (F.7.3/1 of the August 3, 1998 draft of C99), and that during program + execution, "a programmer can safely assume default modes (or be unaware of + them)" (7.6/2, footnote 161 of the August 3, 1998 draft of C99). Reportedly, + on Windows there are printer drivers that switch on exceptions. To avoid + problems, the SAL_MATH_FPEXCEPTIONS_OFF macro can be used to explicitly + switch off exceptions (on Windows). + */ +#if defined WNT #define SAL_MATH_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM ) -#define SAL_MATH_FPRESET() _fpreset() - -#elif defined OS2 - -#define SAL_MATH_FPEXCEPTIONS_ON() _control87( MCW_EM, 0 ) -#define SAL_MATH_FPEXCEPTIONS_OFF() _control87( MCW_EM, MCW_EM ) -#define SAL_MATH_FPRESET() _fpreset() - -#elif defined RS6000 - -#define SAL_MATH_FPEXCEPTIONS_ON() fp_enable_all() -#define SAL_MATH_FPEXCEPTIONS_OFF() fp_disable_all() -#define SAL_MATH_FPRESET() - -#elif defined LINUX - -#include <fpu_control.h> - -void sal_math_setfpucw( fpu_control_t set ); - -#if defined POWERPC -/* set bit to 1 to enable that exception */ -/* _FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_IM */ -#define SAL_MATH_FPEXCEPTIONS_ON() sal_math_setfpucw(_FPU_DEFAULT | 0x000000F0) -#define SAL_MATH_FPEXCEPTIONS_OFF() sal_math_setfpucw(_FPU_DEFAULT) -#else /* POWERPC */ -#define SAL_MATH_FPEXCEPTIONS_ON() sal_math_setfpucw(_FPU_DEFAULT & ~0x001F) -#define SAL_MATH_FPEXCEPTIONS_OFF() sal_math_setfpucw(_FPU_IEEE) -#endif /* POWERPC */ -#define SAL_MATH_FPRESET() - -#else /* WNT, WIN, OS2, RS6000, LINUX */ - -#define SAL_MATH_FPEXCEPTIONS_ON() +#else /* WNT */ #define SAL_MATH_FPEXCEPTIONS_OFF() -#define SAL_MATH_FPRESET() - -#endif /* WNT, WIN, OS2, RS6000, LINUX */ - - -#if SAL_MATH_FPSIGNAL_JUMP -#define SAL_MATH_FPCONTROL() SAL_MATH_FPEXCEPTIONS_ON() -#else /* SAL_MATH_FPSIGNAL_JUMP */ -#define SAL_MATH_FPCONTROL() SAL_MATH_FPEXCEPTIONS_OFF() -#endif /* SAL_MATH_FPSIGNAL_JUMP */ +#endif /* WNT */ /* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */ @@ -229,6 +170,7 @@ union sal_math_Double #endif /* IEEE 754 supported */ + #if defined __cplusplus } #endif /* __cplusplus */ diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index 337bd761529b..2266eccd5a9f 100644 --- a/sal/inc/sal/types.h +++ b/sal/inc/sal/types.h @@ -2,9 +2,9 @@ * * $RCSfile: types.h,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: svesik $ $Date: 2002-03-18 00:43:54 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,14 +62,7 @@ #ifndef _SAL_TYPES_H_ #define _SAL_TYPES_H_ -#ifndef _SAL_CONFIG_H_ #include <sal/config.h> -#endif - -#ifndef INCLUDED_STDLIB_H -#include <stdlib.h> -#define INCLUDED_STDLIB_H -#endif #ifdef __cplusplus extern "C" { @@ -118,7 +111,7 @@ typedef unsigned long sal_Size; #define SAL_MAX_ENUM 0x7fff #endif -#if defined(_MSC_VER) || (defined(WNT) && defined(__GNUC__)) +#ifdef _MSC_VER # define SAL_DLLEXPORT __declspec(dllexport) # define SAL_CALL __cdecl # define SAL_CALL_ELLIPSE __cdecl @@ -138,9 +131,9 @@ typedef unsigned long sal_Size; # error("unknown platform") #endif -/* Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ... - This hinders the compiler from setting a generic vtable stating that - a pure virtual function was called and thus slightly reduces code size. +/** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ... + This hinders the compiler from setting a generic vtable stating that + a pure virtual function was called and thus slightly reduces code size. */ #ifdef _MSC_VER #define SAL_NO_VTABLE __declspec(novtable) @@ -155,21 +148,21 @@ typedef unsigned long sal_Size; #endif /** This is the binary specification of a SAL sequence. + <br> */ typedef struct _sal_Sequence { - /** reference count of sequence + /** reference count of sequence<br> */ sal_Int32 nRefCount; - /** element count + /** element count<br> */ sal_Int32 nElements; - /** elements array + /** elements array<br> */ char elements[1]; } sal_Sequence; -/** calculated header size excluding elements array -*/ + #define SAL_SEQUENCE_HEADER_SIZE ((sal_Size)&((sal_Sequence *)0)->elements) #ifdef SAL_W32 @@ -179,12 +172,12 @@ typedef struct _sal_Sequence #endif -/* Wrap C++ const_cast, reinterpret_cast and static_cast expressions in - macros to keep code portable to old compilers (since most compilers still - lack RTTI support, dynamic_cast is not included here). -*/ +/** Wrap C++ const_cast, reinterpret_cast and static_cast expressions in + macros to keep code portable to old compilers (since most compilers still + lack RTTI support, dynamic_cast is not included here). + */ #ifdef __cplusplus -#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || defined FREEBSD || defined NETBSD || defined IRIX +#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || defined FREEBSD || defined NETBSD #define SAL_CONST_CAST(type, expr) (const_cast< type >(expr)) #define SAL_REINTERPRET_CAST(type, expr) (reinterpret_cast< type >(expr)) #define SAL_STATIC_CAST(type, expr) (static_cast< type >(expr)) @@ -195,15 +188,15 @@ typedef struct _sal_Sequence #endif /* SAL_W32, SOLARIS, LINUX */ #endif /* __cplusplus */ -/* Definition of function throw clause macros. These have been introduced - to reduce code size by balancing out compiler bugs. +/** Definition of function throw clause macros. These have been introduced + to reduce code size by balancing out compiler bugs. - These macros are ONLY for function declarations, - use common C++ throw statement for throwing exceptions, e.g. - throw RuntimeException(); + These macros are ONLY for function declarations, + use common C++ throw statement for throwing exceptions, e.g. + throw RuntimeException(); - SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW( () ) - SAL_THROW_EXTERN_C() should be used for all C functions + SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW( () ) + SAL_THROW_EXTERN_C() should be used for all C functions */ #ifdef __cplusplus #if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__sgi) @@ -218,9 +211,8 @@ typedef struct _sal_Sequence #endif + #ifdef __cplusplus -/** definition of a no acquire enum for ctors -*/ enum __sal_NoAcquire { /** definition of a no acquire enum for ctors diff --git a/sal/inc/systools/win32/uwinapi.h b/sal/inc/systools/win32/uwinapi.h index 6788dc7e94c0..6abaf0468c50 100644 --- a/sal/inc/systools/win32/uwinapi.h +++ b/sal/inc/systools/win32/uwinapi.h @@ -2,9 +2,9 @@ * * $RCSfile: uwinapi.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hro $ $Date: 2002-08-26 13:45:01 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:45:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,6 +121,8 @@ EXTERN_C WINBASEAPI DWORD WINAPI GetUserDomainW( LPWSTR lpBuffer, DWORD nBuffser #define GetUserDomain GetUserDomainA #endif +EXTERN_C WINBASEAPI DWORD WINAPI GetProcessId( HANDLE hProcess ); + /* macro that calculates the count of elements of a static array */ #define elementsof(buf) (sizeof(buf) / sizeof((buf)[0])) diff --git a/sal/osl/all/filepath.c b/sal/osl/all/filepath.c index 14793bc9fe09..a93380b13f60 100644 --- a/sal/osl/all/filepath.c +++ b/sal/osl/all/filepath.c @@ -2,9 +2,9 @@ * * $RCSfile: filepath.c,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mh $ $Date: 2001-11-27 18:42:11 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,44 +62,21 @@ #include <osl/file.h> #include <rtl/ustring.h> -/*---------------------------------------------------------------------------*/ - -static sal_uInt32 SAL_CALL osl_defCalcTextWidthEx( rtl_uString *ustrText, void *pvContext ) +static sal_uInt32 SAL_CALL osl_defCalcTextWidth( rtl_uString *ustrText ) { return ustrText ? ustrText->length : 0; } -/*---------------------------------------------------------------------------*/ - -static sal_uInt32 SAL_CALL osl_calcTextWidthWrapper( rtl_uString *ustrText, void *pvContext ) -{ - if ( pvContext ) - { - return ((oslCalcTextWidthFunc)pvContext)( ustrText ); - } - else - return osl_defCalcTextWidthEx( ustrText, NULL ); -} - - -/*---------------------------------------------------------------------------*/ oslFileError SAL_CALL osl_abbreviateSystemPath( rtl_uString *ustrSystemPath, rtl_uString **pustrCompacted, sal_uInt32 uMaxWidth, oslCalcTextWidthFunc pfnCalcWidth ) { - return osl_abbreviateSystemPathEx( ustrSystemPath, pustrCompacted, uMaxWidth, osl_calcTextWidthWrapper, (void *)pfnCalcWidth ); -} - -/*---------------------------------------------------------------------------*/ - -oslFileError SAL_CALL osl_abbreviateSystemPathEx( rtl_uString *ustrSystemPath, rtl_uString **pustrCompacted, sal_uInt32 uMaxWidth, oslCalcTextWidthFuncEx pfnCalcWidth, void *pvContext ) -{ oslFileError error = osl_File_E_None; rtl_uString *ustrPath = NULL; rtl_uString *ustrFile = NULL; sal_uInt32 uPathWidth, uFileWidth; if ( !pfnCalcWidth ) - pfnCalcWidth = osl_defCalcTextWidthEx; + pfnCalcWidth = osl_defCalcTextWidth; { sal_Int32 iLastSlash = rtl_ustr_lastIndexOfChar_WithLength( ustrSystemPath->buffer, ustrSystemPath->length, SAL_PATHDELIMITER ); @@ -116,8 +93,8 @@ oslFileError SAL_CALL osl_abbreviateSystemPathEx( rtl_uString *ustrSystemPath, r } } - uPathWidth = pfnCalcWidth( ustrPath, pvContext ); - uFileWidth = pfnCalcWidth( ustrFile, pvContext ); + uPathWidth = pfnCalcWidth( ustrPath ); + uFileWidth = pfnCalcWidth( ustrFile ); /* First abbreviate the directory component of the path */ @@ -131,7 +108,7 @@ oslFileError SAL_CALL osl_abbreviateSystemPathEx( rtl_uString *ustrSystemPath, r ustrPath->buffer[ustrPath->length-1] = '.'; ustrPath->buffer[ustrPath->length] = 0; - uPathWidth = pfnCalcWidth( ustrPath, pvContext ); + uPathWidth = pfnCalcWidth( ustrPath ); } else break; @@ -149,7 +126,7 @@ oslFileError SAL_CALL osl_abbreviateSystemPathEx( rtl_uString *ustrSystemPath, r ustrFile->buffer[ustrFile->length-1] = '.'; ustrFile->buffer[ustrFile->length] = 0; - uFileWidth = pfnCalcWidth( ustrFile, pvContext ); + uFileWidth = pfnCalcWidth( ustrFile ); } else break; @@ -165,7 +142,7 @@ oslFileError SAL_CALL osl_abbreviateSystemPathEx( rtl_uString *ustrSystemPath, r { (*pustrCompacted)->length--; (*pustrCompacted)->buffer[(*pustrCompacted)->length] = 0; - uPathWidth = pfnCalcWidth( *pustrCompacted, pvContext ); + uPathWidth = pfnCalcWidth( *pustrCompacted ); } if ( ustrPath ) diff --git a/sal/osl/unx/diagnose.c b/sal/osl/unx/diagnose.c index 4bd02956b3ad..b03a979c355b 100644 --- a/sal/osl/unx/diagnose.c +++ b/sal/osl/unx/diagnose.c @@ -2,9 +2,9 @@ * * $RCSfile: diagnose.c,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: hro $ $Date: 2002-10-16 14:42:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,10 +121,10 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL szMessage[0] = '\0'; if(pszMessage != 0) - snprintf(szMessage, sizeof(szMessage), "Assertion Failed: %s: File %s, Line %lu: %s\n", + sprintf(szMessage, "Assertion Failed: %s: File %s, Line %lu: %s\n", lpszAppName, pszFileName, nLine, pszMessage); else - snprintf(szMessage, sizeof(szMessage), "Assertion Failed: %s: File %s, Line %lu:\n", + sprintf(szMessage, "Assertion Failed: %s: File %s, Line %lu:\n", lpszAppName, pszFileName, nLine); _pPrintDebugMessage( szMessage ); @@ -132,18 +132,6 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL else { /* format message into buffer */ -#ifdef S390 - if(pszMessage != 0) - { - s390_printf( "Assertion Failed: %s: File %s, Line %d: %s\n", - lpszAppName, pszFileName, nLine, pszMessage); - } - else - { - s390_printf( "Assertion Failed: %s: File %s, Line %d:\n", - lpszAppName, pszFileName, nLine); - } -#else if(pszMessage != 0) { fprintf(stderr, "Assertion Failed: %s: File %s, Line %lu: %s\n", @@ -154,7 +142,6 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL fprintf(stderr, "Assertion Failed: %s: File %s, Line %lu:\n", lpszAppName, pszFileName, nLine); } -#endif } return sal_False; /* no abort */ @@ -162,11 +149,7 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage) { -#ifdef S390 - s390_printf( pszMessage ); -#else fputs(pszMessage, stderr); -#endif return 0; } diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 3f5375fb9c61..047c06022828 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: file_path_helper.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tra $ $Date: 2002-12-14 13:20:24 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -111,9 +111,8 @@ pustrPath->buffer[pustrPath->length] = (sal_Unicode)'\0'; } - OSL_POSTCOND((0 == pustrPath->length) || \ - (1 == pustrPath->length && pustrPath->buffer[0] == FPH_CHAR_PATH_SEPARATOR) || \ - ((pustrPath->length > 0) && pustrPath->buffer[pustrPath->length - 1] != FPH_CHAR_PATH_SEPARATOR), \ + OSL_POSTCOND((0 == pustrPath->length) || (1 == pustrPath->length) || \ + (pustrPath->length > 1 && pustrPath->buffer[pustrPath->length - 1] != FPH_CHAR_PATH_SEPARATOR), \ "osl_systemPathRemoveSeparator: Post condition failed"); } diff --git a/sal/osl/unx/file_path_helper.h b/sal/osl/unx/file_path_helper.h index 59cbe4d80314..f0a61f12f70f 100644 --- a/sal/osl/unx/file_path_helper.h +++ b/sal/osl/unx/file_path_helper.h @@ -2,9 +2,9 @@ * * $RCSfile: file_path_helper.h,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tra $ $Date: 2002-12-14 13:21:31 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/sal/osl/unx/file_path_helper.hxx b/sal/osl/unx/file_path_helper.hxx index ce3fe8cd45cf..547d18654b4f 100644 --- a/sal/osl/unx/file_path_helper.hxx +++ b/sal/osl/unx/file_path_helper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: file_path_helper.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tra $ $Date: 2002-12-14 13:21:38 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx new file mode 100644 index 000000000000..430670d3db41 --- /dev/null +++ b/sal/osl/unx/file_stat.cxx @@ -0,0 +1,361 @@ +/************************************************************************* + * + * $RCSfile: file_stat.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:46:03 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _TYPES_H +#include <sys/types.h> +#endif + +#ifndef _LIMITS_H +#include <limits.h> +#endif + +#ifndef _UNISTD_H +#include <unistd.h> +#endif + +#ifndef _OSL_FILE_H_ +#include <osl/file.h> +#endif + +#ifndef _ERRNO_H +#include <errno.h> +#endif + +#ifndef _RTL_STRING_HXX_ +#include <rtl/string.hxx> +#endif + +#ifndef _OSL_UUNXAPI_H_ +#include "uunxapi.hxx" +#endif + +#ifndef _OSL_FILE_PATH_HELPER_HXX_ +#include "file_path_helper.hxx" +#endif + +#ifndef _FILE_ERROR_TRANSL_H_ +#include "file_error_transl.h" +#endif + + +namespace /* private */ +{ + + inline void set_file_type(const struct stat& file_stat, oslFileStatus* pStat) + { + /* links to directories state also to be a directory */ + if (S_ISLNK(file_stat.st_mode)) + pStat->eType = osl_File_Type_Link; + else if (S_ISDIR(file_stat.st_mode)) + pStat->eType = osl_File_Type_Directory; + else if (S_ISREG(file_stat.st_mode)) + pStat->eType = osl_File_Type_Regular; + else if (S_ISFIFO(file_stat.st_mode)) + pStat->eType = osl_File_Type_Fifo; + else if (S_ISSOCK(file_stat.st_mode)) + pStat->eType = osl_File_Type_Socket; + else if (S_ISCHR(file_stat.st_mode) || S_ISBLK(file_stat.st_mode)) + pStat->eType = osl_File_Type_Special; + else + pStat->eType = osl_File_Type_Unknown; + + pStat->uValidFields |= osl_FileStatus_Mask_Type; + } + + inline void set_file_access_mask(const struct stat& file_stat, oslFileStatus* pStat) + { + // user permissions + if (S_IRUSR & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OwnRead; + + if (S_IWUSR & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OwnWrite; + + if (S_IXUSR & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OwnExe; + + // group permissions + if (S_IRGRP & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_GrpRead; + + if (S_IWGRP & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_GrpWrite; + + if (S_IXGRP & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_GrpExe; + + // others permissions + if (S_IROTH & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OthRead; + + if (S_IWOTH & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OthWrite; + + if (S_IXOTH & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_OthExe; + + pStat->uValidFields |= osl_FileStatus_Mask_Attributes; + } + + inline void set_file_access_rights(const struct stat& file_stat, int S_IR, int S_IW, int S_IX, oslFileStatus* pStat) + { + /* we cannot really map osl_File_Attribute_ReadOnly to + the Unix access rights, it's a Windows only flag + that's why the following hack. We set osl_FileStatus_Mask_Attributes + but if there is no read access for a file we clear the flag + again to signal to the caller that there are no file attributes + to read because that's better than to give them incorrect one. + */ + pStat->uValidFields |= osl_FileStatus_Mask_Attributes; + + if (0 == (S_IR & file_stat.st_mode)) + pStat->uValidFields &= ~osl_FileStatus_Mask_Attributes; + + if (0 == (S_IW & file_stat.st_mode)) + pStat->uAttributes |= osl_File_Attribute_ReadOnly; + + if (S_IX & file_stat.st_mode) + pStat->uAttributes |= osl_File_Attribute_Executable; + } + + /* a process may belong to up to NGROUPS_MAX groups, so when + checking group access rights, we have to check all belonging + groups */ + inline bool is_in_process_grouplist(const gid_t file_group) + { + // check primary process group + + if (getgid() == file_group) + return true; + + // check supplementary process groups + + gid_t grplist[NGROUPS_MAX]; + int grp_number = getgroups(NGROUPS_MAX, grplist); + + for (int i = 0; i < grp_number; i++) + { + if (grplist[i] == file_group) + return true; + } + return false; + } + + /* Currently we are determining the file access right based + on the real user ID not the effective user ID! + We don't use access(...) because access follows links which + may cause performance problems see #97133. + */ + inline void set_file_access_rights(const struct stat& file_stat, oslFileStatus* pStat) + { + if (getuid() == file_stat.st_uid) + { + set_file_access_rights(file_stat, S_IRUSR, S_IWUSR, S_IXUSR, pStat); + } + else if (is_in_process_grouplist(file_stat.st_gid)) + { + set_file_access_rights(file_stat, S_IRGRP, S_IWGRP, S_IXGRP, pStat); + } + else + { + set_file_access_rights(file_stat, S_IROTH, S_IWOTH, S_IXOTH, pStat); + } + } + + inline void set_file_hidden_status(const rtl::OUString& file_path, oslFileStatus* pStat) + { + pStat->uAttributes = osl::systemPathIsHiddenFileOrDirectoryEntry(file_path) ? osl_File_Attribute_Hidden : 0; + pStat->uValidFields |= osl_FileStatus_Mask_Attributes; + } + + /* the set_file_access_rights must be called after set_file_hidden_status(...) and + set_file_access_mask(...) because of the hack in set_file_access_rights(...) */ + inline void set_file_attributes( + const rtl::OUString& file_path, const struct stat& file_stat, const sal_uInt32 uFieldMask, oslFileStatus* pStat) + { + set_file_hidden_status(file_path, pStat); + set_file_access_mask(file_stat, pStat); + + // we set the file access rights only on demand + // because it's potentially expensive + if (uFieldMask & osl_FileStatus_Mask_Attributes) + set_file_access_rights(file_stat, pStat); + } + + inline void set_file_access_time(const struct stat& file_stat, oslFileStatus* pStat) + { + pStat->aAccessTime.Seconds = file_stat.st_atime; + pStat->aAccessTime.Nanosec = 0; + pStat->uValidFields |= osl_FileStatus_Mask_AccessTime; + } + + inline void set_file_modify_time(const struct stat& file_stat, oslFileStatus* pStat) + { + pStat->aModifyTime.Seconds = file_stat.st_mtime; + pStat->aModifyTime.Nanosec = 0; + pStat->uValidFields |= osl_FileStatus_Mask_ModifyTime; + } + + inline void set_file_size(const struct stat& file_stat, oslFileStatus* pStat) + { + if (S_ISREG(file_stat.st_mode)) + { + pStat->uFileSize = file_stat.st_size; + pStat->uValidFields |= osl_FileStatus_Mask_FileSize; + } + } + + /* we only need to call stat or lstat if one of the + following flags is set */ + inline bool is_stat_call_necessary(sal_uInt32 field_mask) + { + return ((field_mask & osl_FileStatus_Mask_Type) || + (field_mask & osl_FileStatus_Mask_Attributes) || + (field_mask & osl_FileStatus_Mask_CreationTime) || + (field_mask & osl_FileStatus_Mask_AccessTime) || + (field_mask & osl_FileStatus_Mask_ModifyTime) || + (field_mask & osl_FileStatus_Mask_FileSize) || + (field_mask & osl_FileStatus_Mask_LinkTargetURL) || + (field_mask & osl_FileStatus_Mask_Validate)); + } + + inline oslFileError set_link_target_url(const rtl::OUString& file_path, oslFileStatus* pStat) + { + rtl::OUString link_target; + if (!osl::realpath(file_path, link_target)) + return oslTranslateFileError(OSL_FET_ERROR, errno); + + oslFileError osl_error = osl_getFileURLFromSystemPath(link_target.pData, &pStat->ustrLinkTargetURL); + if (osl_error != osl_File_E_None) + return osl_error; + + pStat->uValidFields |= osl_FileStatus_Mask_LinkTargetURL; + return osl_File_E_None; + } + + inline oslFileError setup_osl_getFileStatus(oslDirectoryItem Item, oslFileStatus* pStat, rtl::OUString& file_path) + { + if ((NULL == Item) || (NULL == pStat)) + return osl_File_E_INVAL; + + file_path = rtl::OUString(reinterpret_cast<rtl_uString*>(Item)); + + OSL_ASSERT(file_path.getLength() > 0); + + if (file_path.getLength() <= 0) + return osl_File_E_INVAL; + + pStat->uValidFields = 0; + + return osl_File_E_None; + } + +} // end namespace private + + +/**************************************************************************** + * osl_getFileStatus + ****************************************************************************/ + +oslFileError SAL_CALL osl_getFileStatus(oslDirectoryItem Item, oslFileStatus* pStat, sal_uInt32 uFieldMask) +{ + rtl::OUString file_path; + oslFileError osl_error = setup_osl_getFileStatus(Item, pStat, file_path); + if (osl_File_E_None != osl_error) + return osl_error; + + struct stat file_stat; + if (is_stat_call_necessary(uFieldMask) && (0 != osl::lstat(file_path, file_stat))) + return oslTranslateFileError(OSL_FET_ERROR, errno); + + if (is_stat_call_necessary(uFieldMask)) + { + // we set all these attributes because it's cheap + set_file_type(file_stat, pStat); + set_file_access_time(file_stat, pStat); + set_file_modify_time(file_stat, pStat); + set_file_size(file_stat, pStat); + set_file_attributes(file_path, file_stat, uFieldMask, pStat); + + // file exists semantic of osl_FileStatus_Mask_Validate + if ((uFieldMask & osl_FileStatus_Mask_LinkTargetURL) && S_ISLNK(file_stat.st_mode)) + { + osl_error = set_link_target_url(file_path, pStat); + if (osl_error != osl_File_E_None) + return osl_error; + } + } + + if (uFieldMask & osl_FileStatus_Mask_FileURL) + { + if ((osl_error = osl_getFileURLFromSystemPath(file_path.pData, &pStat->ustrFileURL)) != osl_File_E_None) + return osl_error; + + pStat->uValidFields |= osl_FileStatus_Mask_FileURL; + } + + if (uFieldMask & osl_FileStatus_Mask_FileName) + { + osl_systemPathGetFileNameOrLastDirectoryPart(file_path.pData, &pStat->ustrFileName); + pStat->uValidFields |= osl_FileStatus_Mask_FileName; + } + return osl_File_E_None; +} diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index ba0ce74131d6..3550c681d7df 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -2,9 +2,9 @@ * * $RCSfile: file_url.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tra $ $Date: 2002-12-14 13:03:13 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c index 1662b0b6de66..d7bf224cfe53 100644 --- a/sal/osl/unx/interlck.c +++ b/sal/osl/unx/interlck.c @@ -2,9 +2,9 @@ * * $RCSfile: interlck.c,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: hr $ $Date: 2001-05-02 15:03:13 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,9 +83,11 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* "lock\n\t" "xadd %0, %2\n\t" "incl %0" - : "=a" (nCount), "=m" (*pCount) + : "=&r" (nCount), "=m" (*pCount) : "m" (*pCount) : "memory"); + + return nCount; } oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount) @@ -97,9 +99,11 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* "lock\n\t" "xadd %0, %2\n\t" "decl %0" - : "=a" (nCount), "=m" (*pCount) + : "=&r" (nCount), "=m" (*pCount) : "m" (*pCount) : "memory"); + + return nCount; } #elif defined ( GCC ) && defined ( POWERPC ) @@ -117,7 +121,7 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* " addi %0,%0,1\n\t" " stwcx. %0,0,%2\n\t" " bne- 1b" - : "=r" (nCount), "=m" (*pCount) + : "=&r" (nCount), "=m" (*pCount) : "r" (pCount) : "r4", "memory"); @@ -134,7 +138,7 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* " subi %0,%0,1\n\t" " stwcx. %0,0,%2\n\t" " bne- 1b" - : "=r" (nCount), "=m" (*pCount) + : "=&r" (nCount), "=m" (*pCount) : "r" (pCount) : "r4", "memory"); diff --git a/sal/osl/unx/makefile.mk b/sal/osl/unx/makefile.mk index f7554652a47c..dfd067da9401 100644 --- a/sal/osl/unx/makefile.mk +++ b/sal/osl/unx/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.18 $ +# $Revision: 1.19 $ # -# last change: $Author: tra $ $Date: 2002-12-14 12:59:49 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:46:04 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -106,7 +106,8 @@ SLOFILES= $(SLO)$/conditn.obj \ $(SLO)$/file_error_transl.obj\ $(SLO)$/file_path_helper.obj\ $(SLO)$/uunxapi.obj\ - $(SLO)$/process_impl.obj + $(SLO)$/process_impl.obj\ + $(SLO)$/file_stat.obj #.IF "$(UPDATER)"=="YES" OBJFILES= $(OBJ)$/conditn.obj \ @@ -132,7 +133,8 @@ OBJFILES= $(OBJ)$/conditn.obj \ $(OBJ)$/file_error_transl.obj\ $(OBJ)$/file_path_helper.obj\ $(OBJ)$/uunxapi.obj\ - $(OBJ)$/process_impl.obj + $(OBJ)$/process_impl.obj\ + $(OBJ)$/file_stat.obj #.ENDIF # --- Targets ------------------------------------------------------ diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c index 6ccdce8a313e..81ebcbce5fe7 100644 --- a/sal/osl/unx/module.c +++ b/sal/osl/unx/module.c @@ -2,9 +2,9 @@ * * $RCSfile: module.c,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: hr $ $Date: 2002-08-13 14:42:46 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -284,8 +284,6 @@ oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 n /*****************************************************************************/ void SAL_CALL osl_unloadModule(oslModule hModule) { - OSL_ENSURE(hModule,"osl_unloadModule : module handle is not valid"); - #ifdef MACOSX // Unloading dylibs is not yet supported on Mac OS X. diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c index 2275dcab04d6..613e8e3b83ed 100644 --- a/sal/osl/unx/nlsupport.c +++ b/sal/osl/unx/nlsupport.c @@ -2,9 +2,9 @@ * * $RCSfile: nlsupport.c,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: obr $ $Date: 2002-07-17 11:28:23 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -288,6 +288,7 @@ const _pair _nl_language_list[] = { { "ISO8859-8", RTL_TEXTENCODING_ISO_8859_8 }, { "ISO8859-9", RTL_TEXTENCODING_ISO_8859_9 }, { "KOI8-R", RTL_TEXTENCODING_KOI8_R }, + { "KOI8-U", RTL_TEXTENCODING_KOI8_U }, { "PCK", RTL_TEXTENCODING_MS_932 }, { "SUN_EU_GREEK", RTL_TEXTENCODING_ISO_8859_7 }, /* 8859-7 + Euro */ { "TIS620.2533", RTL_TEXTENCODING_MS_874 }, /* th_TH.TIS620 */ @@ -323,7 +324,8 @@ const _pair _nl_language_list[] = { { "ASMO_449", RTL_TEXTENCODING_DONTKNOW }, /* ISO_9036 ARABIC7 */ { "BALTIC", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-179 */ { "BIG5", RTL_TEXTENCODING_BIG5 }, /* locale: zh_TW */ - { "BIG5HKSCS", RTL_TEXTENCODING_BIG5_HKSCS }, /* locale: zh_CN.BIG5HK */ + { "BIG5-HKSCS", RTL_TEXTENCODING_BIG5_HKSCS }, /* locale: zh_CN.BIG5HK */ + { "BIG5HKSCS", RTL_TEXTENCODING_BIG5_HKSCS }, /* depricated */ { "BS_4730", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-4 ISO646-GB */ { "BS_VIEWDATA", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-47 */ { "CP1250", RTL_TEXTENCODING_MS_1250 }, /* MS-EE */ @@ -464,7 +466,7 @@ const _pair _nl_language_list[] = { { "JUS_I.B1.003-SERB", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-146 SERBIAN */ { "KOI-8", RTL_TEXTENCODING_DONTKNOW }, { "KOI8-R", RTL_TEXTENCODING_KOI8_R }, - { "KOI8-U", RTL_TEXTENCODING_DONTKNOW }, + { "KOI8-U", RTL_TEXTENCODING_KOI8_U }, { "KSC5636", RTL_TEXTENCODING_DONTKNOW }, /* ISO646-KR */ { "LATIN-GREEK", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-19 */ { "LATIN-GREEK-1", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-27 */ @@ -490,7 +492,7 @@ const _pair _nl_language_list[] = { { "T.101-G2", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-128 */ { "T.61-7BIT", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-102 */ { "T.61-8BIT", RTL_TEXTENCODING_DONTKNOW }, /* T.61 ISO-IR-103 */ - { "TIS-620", RTL_TEXTENCODING_MS_874 }, /* locale: th_TH */ + { "TIS-620", RTL_TEXTENCODING_MS_874 }, /* locale: th_TH */ { "UTF-8", RTL_TEXTENCODING_UTF8 }, /* ISO-10646/UTF-8 */ { "VIDEOTEX-SUPPL", RTL_TEXTENCODING_DONTKNOW }, /* ISO-IR-70 */ { "WIN-SAMI-2", RTL_TEXTENCODING_DONTKNOW } /* WS2 */ @@ -684,6 +686,7 @@ const _pair _locale_extension_list[] = { { "iso8859-8", RTL_TEXTENCODING_ISO_8859_8 }, { "iso8859-9", RTL_TEXTENCODING_ISO_8859_9 }, { "koi8-r", RTL_TEXTENCODING_KOI8_R }, + { "koi8-u", RTL_TEXTENCODING_KOI8_U }, { "pck", RTL_TEXTENCODING_MS_932 }, #if (0) { "sun_eu_greek", RTL_TEXTENCODING_DONTKNOW }, diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index ffa7947a8ca9..d38ae0589b11 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -2,9 +2,9 @@ * * $RCSfile: process.c,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: haggai $ $Date: 2003-03-25 17:01:56 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -320,7 +320,7 @@ sal_Char *getCmdLine() name[0] = '\0'; - sprintf(name, CMD_ARG_PROC_NAME, getpid()); + snprintf(name, sizeof(name), CMD_ARG_PROC_NAME, getpid()); if ( (fp = fopen(name, "r")) != 0 ) { @@ -361,7 +361,7 @@ sal_Char *getCmdLine() name[0] = '\0'; - sprintf(name, CMD_ARG_PROC_NAME, getpid()); + snprintf(name, sizeof(name), CMD_ARG_PROC_NAME, getpid()); if ((fd = open(name, O_RDONLY)) >= 0) { @@ -381,8 +381,6 @@ sal_Char *getCmdLine() pchr = (sal_Char*) realloc(pchr, (n += l + 32) * sizeof(sal_Char)); strcpy(&pchr[i], CMD_ARG_PROC_ARGV(psinfo)[j]); -/* fprintf(stderr,"getCmdLine : arg %i is '%s'\n",j,&pchr[i]); */ -/* fprintf(stderr,"getCmdLine : argv %i is '%s'\n",j,CMD_ARG_PROC_ARGV(psinfo)[j]); */ i += l; pchr[i++] = '\0'; @@ -414,7 +412,7 @@ sal_Char *getCmdLine() cmd[0] = '\0'; - sprintf(cmd, CMD_ARG_PS, getpid()); + snprintf(cmd, sizeof(cmd), CMD_ARG_PS, getpid()); if (fp = popen(cmd, "r")) { @@ -466,10 +464,6 @@ oslProcessError SAL_CALL osl_psz_getExecutableFile(sal_Char* pszBuffer, sal_uInt char szAbsolutePath[PATH_MAX] = ""; char szRealPathBuf[PATH_MAX] = ""; - if( pszCmdLine == NULL ) { - return osl_Process_E_None; - } - /* if the command line argument #0 starts with a '/', this program has been */ /* invoked using a full qualified path */ if( '/' != pszCmdLine[0] ) @@ -712,7 +706,6 @@ oslProcessError SAL_CALL osl_getCommandArgs(sal_Char* pszBuffer, sal_uInt32 Max) while ((*pStr != '\0') && ((pBuffer + strlen(pszCmdLine)) < (CmdLine + sizeof(CmdLine) - 2))) { -/* fprintf(stderr,"osl_getCommandArgs : Arg %i is '%s'\n",nArgCount,pStr); */ strcpy(pBuffer, pStr); pBuffer += strlen(pStr) + 1; pStr += strlen(pStr) + 1; @@ -1151,10 +1144,7 @@ static void ChildStatusProc(void *pData) OSL_TRACE("ChildStatusProc : starting '%s' failed",data.m_pszArgs[0]); OSL_TRACE("Failed to launch child process, child reports errno=%d (%s)\n", status, strerror(status)); - osl_setCondition(pdata->m_started); - /* Close pipe ends */ - if ( pdata->m_pInputWrite ) *pdata->m_pInputWrite = NULL; @@ -1167,6 +1157,9 @@ static void ChildStatusProc(void *pData) close( stdInput[1] ); close( stdOutput[0] ); close( stdError[0] ); + + /* notify (and unblock) parent thread */ + osl_setCondition(pdata->m_started); } } } @@ -1662,7 +1655,7 @@ void osl_getProcStat(pid_t pid, struct osl_procStat* procstat) { int fd = 0; char name[PATH_MAX + 1]; - sprintf(name, "/proc/%u/stat", pid); + snprintf(name, sizeof(name), "/proc/%u/stat", pid); if ((fd = open(name,O_RDONLY)) >=0 ) { @@ -1711,7 +1704,7 @@ void osl_getProcStatm(pid_t pid, struct osl_procStat* procstat) { int fd = 0; char name[PATH_MAX + 1]; - sprintf(name, "/proc/%u/statm", pid); + snprintf(name, sizeof(name), "/proc/%u/statm", pid); if ((fd = open(name,O_RDONLY)) >=0 ) { @@ -1739,7 +1732,7 @@ void osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) { int fd = 0; char name[PATH_MAX + 1]; - sprintf(name, "/proc/%u/status", pid); + snprintf(name, sizeof(name), "/proc/%u/status", pid); if ((fd = open(name,O_RDONLY)) >=0 ) { @@ -1839,7 +1832,7 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F int fd; sal_Char name[PATH_MAX + 1]; - sprintf(name, "/proc/%u", pid); + snprintf(name, sizeof(name), "/proc/%u", pid); if ((fd = open(name, O_RDONLY)) >= 0) { @@ -1903,7 +1896,7 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F int fd; sal_Char name[PATH_MAX + 1]; - sprintf(name, "/proc/%u", pid); + snprintf(name, sizeof(name), "/proc/%u", pid); if ((fd = open(name, O_RDONLY)) >= 0) { @@ -1991,56 +1984,104 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; } + +/*********************************************** + helper function for osl_joinProcessWithTimeout + **********************************************/ + +static int is_timeout(const struct timeval* tend) +{ + struct timeval tcurrent; + gettimeofday(&tcurrent, NULL); + return (tcurrent.tv_sec >= tend->tv_sec); +} + /********************************************** - osl_joinProcess + kill(pid, 0) is usefull for checking if a + process is still alive, but remember that + kill even returns 0 if the process is already + a zombie. *********************************************/ -oslProcessError SAL_CALL osl_joinProcess(oslProcess Process) +static int is_process_dead(pid_t pid) +{ + return ((-1 == kill(pid, 0)) && (ESRCH == errno)); +} + +/********************************************** + osl_joinProcessWithTimeout + *********************************************/ + +oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout) { -/* int status;*/ + oslProcessImpl* pChild = ChildList; + oslProcessError osl_error = osl_Process_E_None; - if (Process != NULL) + OSL_PRECOND(Process, "osl_joinProcess: Invalid parameter"); + OSL_ASSERT(ChildListMutex); + + if (NULL == Process || 0 == ChildListMutex) + return osl_Process_E_Unknown; + + osl_acquireMutex(ChildListMutex); + + /* check if process is a child of ours */ + while (pChild != NULL) { - oslProcessImpl* pChild; + if (pChild == (oslProcessImpl*)Process) + break; - OSL_ASSERT(ChildListMutex != NULL); + pChild = pChild->m_pnext; + } - if ( ChildListMutex == 0 ) - { - return osl_Process_E_Unknown; - } + osl_releaseMutex(ChildListMutex); - osl_acquireMutex(ChildListMutex); + if (pChild != NULL) + { + oslConditionResult cond_res = osl_waitCondition(pChild->m_terminated, pTimeout); - pChild = ChildList; + if (osl_cond_result_timeout == cond_res) + osl_error = osl_Process_E_TimedOut; + else if (osl_cond_result_ok != cond_res) + osl_error = osl_Process_E_Unknown; + } + else /* alien process; StatusThread will not be able + to set the condition terminated */ + { + pid_t pid = ((oslProcessImpl*)Process)->m_pid; - /* check if process is a child of ours */ - while (pChild != NULL) + if (pTimeout) { - if (pChild == (oslProcessImpl*)Process) - break; + int timeout = 0; + struct timeval tend; - pChild = pChild->m_pnext; - } + gettimeofday(&tend, NULL); - osl_releaseMutex(ChildListMutex); + tend.tv_sec += pTimeout->Seconds; - if (pChild != NULL) - osl_waitCondition(pChild->m_terminated, NULL); - else + while (!is_process_dead(pid) && ((timeout = is_timeout(&tend)) == 0)) + sleep(1); + + if (timeout) + osl_error = osl_Process_E_TimedOut; + } + else /* infinite */ { - /* process is not a child, so the StatusThread will not be able - to set the condition terminated */ - while (kill(((oslProcessImpl*)Process)->m_pid, 0) != -1) + while (!is_process_dead(pid)) sleep(1); } - - return osl_Process_E_None; } - - return osl_Process_E_Unknown; + return osl_error; } +/********************************************** + osl_joinProcess + *********************************************/ + +oslProcessError SAL_CALL osl_joinProcess(oslProcess Process) +{ + return osl_joinProcessWithTimeout(Process, NULL); +} /****************************************************************************** diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index 18fd3af2a960..18c2318f2687 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: process_impl.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tra $ $Date: 2002-12-14 12:55:15 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,6 +91,8 @@ #include "file_path_helper.hxx" #endif + #include <string.h> + //------------------------------------ // forward //------------------------------------ diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c index 14da2386e20a..1de58130b457 100644 --- a/sal/osl/unx/security.c +++ b/sal/osl/unx/security.c @@ -2,9 +2,9 @@ * * $RCSfile: security.c,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obr $ $Date: 2001-05-28 07:18:29 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -661,84 +661,6 @@ osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd, return osl_Security_E_UserUnknown; } -#elif defined S390 - - struct passwd *pPasswd; - - if ((pszUserName == NULL) || (pszPasswd == NULL) || (pSecurity == NULL)) - return osl_SEUNKNOWN; - - OSL_TRACE("osl_loginUser %s (for now without password validation!)\n", pszUserName); - - pPasswd = getpwnam(pszUserName); - if (pPasswd) - { - int iResult = 0; -/* the function __passwd is not correctly implemented now; we have to wait for the next OS/390 release... - sal_Char* _pszUserName = strdup(pszUserName); - sal_Char* _pszPasswd = strdup(pszPasswd); - asc2ebc(_pszUserName); - asc2ebc(_pszPasswd); - - iResult = __passwd(_pszUserName, _pszPasswd, NULL); - if(iResult == -1) - { - OSL_TRACE("__passwd result: %d", errno); - perror(NULL); - } - - free(_pszUserName); - free(_pszPasswd); -*/ - if (iResult == 0) - { - if (strlen(pPasswd->pw_name) + - strlen(pPasswd->pw_dir) + - strlen(pPasswd->pw_shell) + 7 <= PASSWD_BUFFER_SIZE) - { - sal_Char *p; - oslSecurityImpl *pSecImpl = malloc(sizeof(oslSecurityImpl)); - - pSecImpl->m_pPasswd = *pPasswd; - - p = pSecImpl->m_buffer; - pSecImpl->m_pPasswd.pw_name = p; - strcpy(p, pPasswd->pw_name); - - p += strlen(pPasswd->pw_name) + 1; - pSecImpl->m_pPasswd.pw_dir = p; - strcpy(p, pPasswd->pw_dir); - - p += strlen(pPasswd->pw_dir) + 1; - pSecImpl->m_pPasswd.pw_shell = p; - strcpy(p, pPasswd->pw_shell); - - pSecImpl->m_isValid = sal_True; - *pSecurity = (oslSecurity)pSecImpl; - - OSL_TRACE("Homedirectory of %s: %s\n", pSecImpl->m_pPasswd.pw_name, pSecImpl->m_pPasswd.pw_dir); - - return osl_Security_E_None; - } - else - { - *pSecurity = NULL; - return osl_SEUNKNOWN; - } - } - else - { - *pSecurity = NULL; - return osl_Security_E_WrongPassword; - } - } - else - { - *pSecurity = NULL; - return osl_Security_E_UserUnknown; - } - - #elif (LINUX && (GLIBC >= 2)) struct passwd *pPasswd; diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index afff2624a81f..0b3a1676456c 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -2,9 +2,9 @@ * * $RCSfile: signal.c,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-10-31 08:51:02 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -252,6 +252,45 @@ static sal_Bool DeInitSignal() return sal_False; } +/*****************************************************************************/ +/* Call crash reporter */ +/*****************************************************************************/ + +static int ReportCrash( int Signal ) +{ + static sal_Bool bCrashReporterExecuted = sal_False; + + if ( !bCrashReporterExecuted ) + { + int i; + struct sigaction act; + + for (i = 0; i < NoSignals; i++) + { + if (Signals[i].Signal == Signal && Signals[i].Action == ACT_ABORT ) + { + char szShellCmd[512]; + + snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), + "crash_report -p %d -s %d", getpid(), Signal ); + + if ( -1 != system( szShellCmd ) ) + { + bCrashReporterExecuted = sal_True; + return 1; + } + else + return -1; + + } + } + + return 0; + } + + return 1; +} + static oslSignalAction CallSignalHandler(oslSignalInfo *pInfo) { oslSignalHandlerImpl* pHandler = SignalList; @@ -295,6 +334,7 @@ static void CallSystemHandler(int Signal) break; case ACT_ABORT: /* terminate witch core dump */ + ReportCrash( Signal ); act.sa_handler = SIG_DFL; act.sa_flags = 0; sigemptyset(&(act.sa_mask)); @@ -314,6 +354,7 @@ static void CallSystemHandler(int Signal) } } + /*****************************************************************************/ /* SignalHandlerFunction */ /*****************************************************************************/ @@ -357,11 +398,14 @@ static void SignalHandlerFunction(int Signal) break; } + ReportCrash( Signal ); + /* Portal Demo HACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ if (bDoHardKill && (Info.Signal == osl_Signal_AccessViolation)) _exit(255); /* Portal Demo HACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ + switch (CallSignalHandler(&Info)) { case osl_Signal_ActCallNextHdl: @@ -369,6 +413,7 @@ static void SignalHandlerFunction(int Signal) break; case osl_Signal_ActAbortApp: + ReportCrash( Signal ); act.sa_handler = SIG_DFL; act.sa_flags = 0; sigemptyset(&(act.sa_mask)); diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h index 85872da9babc..e0c73175108c 100644 --- a/sal/osl/unx/system.h +++ b/sal/osl/unx/system.h @@ -2,9 +2,9 @@ * * $RCSfile: system.h,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: hr $ $Date: 2002-08-20 15:54:55 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -341,28 +341,6 @@ extern unsigned int nanosleep(unsigned int); extern char *strdup(const char *); #endif -#ifdef S390 -# define AF_IPX -1 -# include <stropts.h> -# include <pthread.h> -# include <xti.h> -# include <sys/time.h> -# include <sys/ioctl.h> -# include <sys/ps.h> -# include <dll.h> -# define _BIG_ENDIAN -# define LIBPATH "LIPPATH" -# define PTHREAD_NONE_INIT { 0 } -# define sched_yield() pthread_yield(NULL) -# define SLEEP_TIMESPEC(timespec) OSL_TRACE("WARNINIG:sleep not implemented (%s:%d)", __FILE__, __LINE__) -# define pthread_testcancel pthread_testintr -# define pthread_detach(t) pthread_detach(&(t)) -# define NO_PTHREAD_SEMAPHORES -# define NO_PTHREAD_PRIORITY -# define NO_DL_FUNCTIONS -# define PATH_MAX _POSIX_PATH_MAX -#endif - #ifdef SOLARIS # include <shadow.h> # include <sys/procfs.h> @@ -418,7 +396,7 @@ char *macxp_tempnam( const char *tmpdir, const char *prefix ); #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \ - !defined(AIX) && !defined(HPUX) && !defined(S390) && \ + !defined(AIX) && !defined(HPUX) && \ !defined(SOLARIS) && !defined(IRIX) && !defined(MAC) && \ !defined(MACOSX) # error "Target plattform not specified !" diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index 05c12675f8f3..aeadc9363a92 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: uunxapi.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tra $ $Date: 2002-12-14 12:54:55 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,3 +113,15 @@ return bRet; } + /*********************************** + lstat_u + **********************************/ + + int lstat_u(const rtl_uString* pustrPath, struct stat* buf) + { + rtl::OString p = rtl::OUStringToOString( + rtl::OUString(const_cast<rtl_uString*>(pustrPath)), + osl_getThreadTextEncoding()); + + return lstat(p.getStr(), buf); + } diff --git a/sal/osl/unx/uunxapi.h b/sal/osl/unx/uunxapi.h index 56c686c17732..878304ba3824 100644 --- a/sal/osl/unx/uunxapi.h +++ b/sal/osl/unx/uunxapi.h @@ -2,9 +2,9 @@ * * $RCSfile: uunxapi.h,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tra $ $Date: 2002-12-14 12:54:16 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,14 @@ #include <stdlib.h> #endif + #ifndef _TYPES_H + #include <sys/types.h> + #endif + + #ifndef _STAT_H + #include <sys/stat.h> + #endif + #ifndef _RTL_USTRING_H_ #include <rtl/ustring.h> #endif @@ -105,6 +113,14 @@ const rtl_uString* pustrFileName, rtl_uString** ppustrResolvedName); + /*********************************** + lstat_u + + @see lstat + **********************************/ + + int lstat_u(const rtl_uString* pustrPath, struct stat* buf); + #ifdef __cplusplus } diff --git a/sal/osl/unx/uunxapi.hxx b/sal/osl/unx/uunxapi.hxx index 02afc4e9aa3f..4c1e29ca8457 100644 --- a/sal/osl/unx/uunxapi.hxx +++ b/sal/osl/unx/uunxapi.hxx @@ -2,9 +2,9 @@ * * $RCSfile: uunxapi.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tra $ $Date: 2002-12-14 12:54:38 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,7 +66,7 @@ #include "uunxapi.h" #endif - #ifndef _RTL_USTRING_H_ + #ifndef _RTL_USTRING_HXX_ #include <rtl/ustring.hxx> #endif @@ -74,7 +74,7 @@ { /*********************************** - uaccess + osl::access @see access **********************************/ @@ -85,7 +85,7 @@ } /*********************************** - realpath + osl::realpath @descr The return value differs from the @@ -105,6 +105,17 @@ } + /*********************************** + osl::lstat + + @see lstat + **********************************/ + + inline int lstat(const rtl::OUString& ustrPath, struct stat& buf) + { + return lstat_u(ustrPath.pData, &buf); + } + } // end namespace osl diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c index 150905162a5f..b77798beb05d 100644 --- a/sal/osl/w32/dllentry.c +++ b/sal/osl/w32/dllentry.c @@ -2,9 +2,9 @@ * * $RCSfile: dllentry.c,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: tra $ $Date: 2002-12-05 21:21:15 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,7 @@ #include <winsock.h> #include <osl/diagnose.h> #include <sal/types.h> +#include <float.h> #include <osl/diagnose.h> #include <osl/mutex.h> @@ -230,6 +231,10 @@ sal_Bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved InitDCOM(); + //We disable floating point exceptions. This is the usual state at program startup + //but on Windows 98 and ME this is not always the case. + _control87(_MCW_EM, _MCW_EM); + break; } diff --git a/sal/osl/w32/process.c b/sal/osl/w32/process.c index 7e704da994db..1790a2dfd1eb 100644 --- a/sal/osl/w32/process.c +++ b/sal/osl/w32/process.c @@ -2,9 +2,9 @@ * * $RCSfile: process.c,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: hro $ $Date: 2002-08-14 11:21:20 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -640,12 +640,33 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F oslProcessError SAL_CALL osl_joinProcess(oslProcess Process) { - if (Process == NULL) + return osl_joinProcessWithTimeout(Process, NULL); +} + +/***************************************************************************/ + +oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout) +{ + DWORD timeout = INFINITE; + oslProcessError osl_error = osl_Process_E_None; + DWORD ret; + + OSL_PRECOND(Process, "osl_joinProcessWithTimeout: Invalid parameter"); + + if (NULL == Process) return osl_Process_E_Unknown; - WaitForSingleObject(((oslProcessImpl*)Process)->m_hProcess, INFINITE); + if (pTimeout) + timeout = pTimeout->Seconds * 1000 + pTimeout->Nanosec / 1000000L; - return osl_Process_E_None; + ret = WaitForSingleObject(((oslProcessImpl*)Process)->m_hProcess, timeout); + + if (WAIT_FAILED == ret) + osl_error = osl_Process_E_Unknown; + else if (WAIT_TIMEOUT == ret) + osl_error = osl_Process_E_TimedOut; + + return osl_error; } /***************************************************************************/ diff --git a/sal/osl/w32/signal.c b/sal/osl/w32/signal.c index 068f2dbeeb9a..90d934f0e275 100644 --- a/sal/osl/w32/signal.c +++ b/sal/osl/w32/signal.c @@ -2,9 +2,9 @@ * * $RCSfile: signal.c,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jbu $ $Date: 2001-08-09 15:41:53 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,13 +59,16 @@ * ************************************************************************/ - /* system headers */ #include "system.h" +#include <tchar.h> #include <osl/diagnose.h> #include <osl/mutex.h> #include <osl/signal.h> +#include <DbgHelp.h> +#include <ErrorRep.h> +#include <systools/win32/uwinapi.h> typedef struct _oslSignalHandlerImpl { @@ -82,10 +85,21 @@ long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP); static sal_Bool InitSignal() { + HMODULE hFaultRep; + SignalListMutex = osl_createMutex(); SetUnhandledExceptionFilter(SignalHandlerFunction); + hFaultRep = LoadLibrary( "faultrep.dll" ); + if ( hFaultRep ) + { + pfn_ADDEREXCLUDEDAPPLICATIONW pfn = (pfn_ADDEREXCLUDEDAPPLICATIONW)GetProcAddress( hFaultRep, "AddERExcludedApplicationW" ); + if ( pfn ) + pfn( L"SOFFICE.EXE" ); + FreeLibrary( hFaultRep ); + } + return sal_True; } @@ -118,6 +132,60 @@ static oslSignalAction CallSignalHandler(oslSignalInfo *pInfo) /* SignalHandlerFunction */ /*****************************************************************************/ +static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP ) +{ + BOOL fSuccess = FALSE; + TCHAR szBuffer[1024]; + TCHAR szPath[MAX_PATH]; + LPTSTR lpFilePart; + PROCESS_INFORMATION ProcessInfo; + STARTUPINFO StartupInfo; + + if ( SearchPath( NULL, TEXT("crashrep.exe"), NULL, MAX_PATH, szPath, &lpFilePart ) ) + { + ZeroMemory( &StartupInfo, sizeof(StartupInfo) ); + StartupInfo.cb = sizeof(StartupInfo.cb); + + + sntprintf( szBuffer, elementsof(szBuffer), + _T("%s -p %u -excp 0x%p -t %u"), + szPath, + GetCurrentProcessId(), + lpEP, + GetCurrentThreadId() ); + + if ( + CreateProcess( + NULL, + szBuffer, + NULL, + NULL, + FALSE, +#ifdef UNICODE + CREATE_UNICODE_ENVIRONMENT, +#else + 0, +#endif + NULL, NULL, &StartupInfo, &ProcessInfo ) + ) + { + DWORD dwExitCode; + + WaitForSingleObject( ProcessInfo.hProcess, INFINITE ); + if ( GetExitCodeProcess( ProcessInfo.hProcess, &dwExitCode ) && 0 == dwExitCode ) + + fSuccess = TRUE; + + } + } + + return fSuccess; +} + +/*****************************************************************************/ +/* SignalHandlerFunction */ +/*****************************************************************************/ + static BOOL WINAPI IsWin95A() { OSVERSIONINFO ovi; @@ -142,6 +210,8 @@ static BOOL WINAPI IsWin95A() static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP) { + static sal_Bool bNested = sal_False; + sal_Bool bRaiseCrashReporter = sal_False; oslSignalInfo Info; oslSignalAction Action; @@ -156,14 +226,17 @@ static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP) case EXCEPTION_MSC_CPP_EXCEPTION: case EXCEPTION_ACCESS_VIOLATION: Info.Signal = osl_Signal_AccessViolation; + bRaiseCrashReporter = sal_True; break; case EXCEPTION_INT_DIVIDE_BY_ZERO: Info.Signal = osl_Signal_IntegerDivideByZero; + bRaiseCrashReporter = sal_True; break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: Info.Signal = osl_Signal_FloatDivideByZero; + bRaiseCrashReporter = sal_True; break; case EXCEPTION_BREAKPOINT: @@ -172,14 +245,26 @@ static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP) default: Info.Signal = osl_Signal_System; + bRaiseCrashReporter = sal_True; break; } - Action = CallSignalHandler(&Info); + if ( !bNested ) + { + bNested = sal_True; - if ( IsWin95A() ) + if ( bRaiseCrashReporter && ReportCrash( lpEP ) || IsWin95A() ) + { + CallSignalHandler(&Info); + Action = osl_Signal_ActKillApp; + } + else + Action = CallSignalHandler(&Info); + } + else Action = osl_Signal_ActKillApp; + switch ( Action ) { case osl_Signal_ActCallNextHdl: diff --git a/sal/prj/build.lst b/sal/prj/build.lst index b7612eacc85e..c52ce4d09bae 100644 --- a/sal/prj/build.lst +++ b/sal/prj/build.lst @@ -1,13 +1,13 @@ sa sal : xml2cmp NULL sa sal usr1 - all sa_mkout NULL -sa sal\rtl\source nmake - all sa_rtl NULL +sa sal\cpprt nmake - u sa_cpprt NULL +sa sal\rtl\source nmake - all sa_rtl NULL sa sal\textenc nmake - all sa_textenc NULL sa sal\osl\w16 nmake - d sa_osld NULL -sa sal\systools\win32\uwinapi nmake - n sa_uwinapi NULL -sa sal\systools\unx nmake - u sa_systools_unx NULL +sa sal\systools\win32\uwinapi nmake - n sa_uwinapi NULL sa sal\osl\w32 nmake - n sa_osln NULL sa sal\osl\os2 nmake - p sa_oslp NULL sa sal\osl\unx nmake - u sa_oslu NULL sa sal\osl\mac nmake - m sa_oslm NULL sa sal\osl\all nmake - all sa_oslall NULL -sa sal\util nmake - all sa_util sa_oslall sa_osld.d sa_oslm.m sa_uwinapi.n sa_systools_unx.u sa_osln.n sa_oslp.p sa_oslu.u sa_rtl sa_textenc NULL +sa sal\util nmake - all sa_util sa_oslall sa_osld.d sa_oslm.m sa_uwinapi.n sa_osln.n sa_oslp.p sa_oslu.u sa_rtl sa_textenc NULL diff --git a/sal/prj/d.lst b/sal/prj/d.lst index 441c7f2f9737..f2ab11d88eb1 100644 --- a/sal/prj/d.lst +++ b/sal/prj/d.lst @@ -17,7 +17,7 @@ mkdir: %_DEST%\inc%_EXT%\systools\unx ..\inc\systools\unx\*.h %_DEST%\inc%_EXT%\systools\unx\*.h ..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so -..\%__SRC%\lib\*.so.* %_DEST%\lib%_EXT%\*.so.* +..\%__SRC%\lib\*.so.* %_DEST%\lib%_EXT% ..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\%__SRC%\lib\*.dylib.* %_DEST%\lib%_EXT%\*.dylib.* diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx deleted file mode 100644 index 9dbc6dba469c..000000000000 --- a/sal/qa/ByteSequence/ByteSequence.cxx +++ /dev/null @@ -1,583 +0,0 @@ - -#ifndef _BYTE_CONST_H_ -#include <Byte_Const.h> -#endif - -#ifndef _RTL_BYTESEQ_H_ -#include <rtl/byteseq.h> -#endif - -#include <rtl/byteseq.hxx> - -#include <cppunit/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() - { - } - - 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 - - -class getArray : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { - } - - // 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 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 - ); - } - - 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 tearDown() - { - } - - // 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 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; - } - 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() - { - } - - // 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 - ); - } - - CPPUNIT_TEST_SUITE(getData); - CPPUNIT_TEST(getData_001); - CPPUNIT_TEST(getData_002); - CPPUNIT_TEST(getData_003); - 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 - - -// ----------------------------------------------------------------------------- - -// 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/ByteSequence/Byte_Const.h b/sal/qa/ByteSequence/Byte_Const.h deleted file mode 100644 index c1618c17f161..000000000000 --- a/sal/qa/ByteSequence/Byte_Const.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef _BYTE_CONST_H_ -#define _BYTE_CONST_H_ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -#ifndef _SAL_TYPES_H_ -#include <sal/types.h> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#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 = 500; -char kTestChar2 = 78; -char kTestChar3 = -155; - -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/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk deleted file mode 100644 index b65abf9a0770..000000000000 --- a/sal/qa/OStringBuffer/makefile.mk +++ /dev/null @@ -1,107 +0,0 @@ -#************************************************************************* -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# last change: $Author: lla $ $Date: 2003-01-21 13:27:01 $ -# -# The Contents of this file are made available subject to the terms of -# either of the following licenses -# -# - GNU Lesser General Public License Version 2.1 -# - Sun Industry Standards Source License Version 1.1 -# -# Sun Microsystems Inc., October, 2000 -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2000 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 -# -# -# Sun Industry Standards Source License Version 1.1 -# ================================================= -# The contents of this file are subject to the Sun Industry Standards -# Source License Version 1.1 (the "License"); You may not use this file -# except in compliance with the License. You may obtain a copy of the -# License at http://www.openoffice.org/license.html. -# -# Software provided under this License is provided on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, -# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, -# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. -# See the License for the specific provisions governing your rights and -# obligations concerning the Software. -# -# The Initial Developer of the Original Code is: Sun Microsystems, Inc. -# -# Copyright: 2000 by Sun Microsystems, Inc. -# -# All Rights Reserved. -# -# Contributor(s): _______________________________________ -# -# -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=sal -TARGET=qa -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -#------------------------------- All object files ------------------------------- -# do this here, so we get right dependencies -# SLOFILES= \ -# $(SLO)$/OStringBuffer.obj - -#----------------------------------- OStringBuffer ----------------------------------- - -SHL1OBJS= \ - $(SLO)$/rtl_OStringBuffer.obj \ - $(SLO)$/rtl_String_Utils.obj - -SHL1TARGET= OStringBuffer -SHL1STDLIBS=\ - $(SALLIB) -.IF "$(GUI)" == "WNT" -SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib -.ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a -.ENDIF - -SHL1IMPLIB= i$(SHL1TARGET) -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -DEF1EXPORTFILE= export.exp - - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx deleted file mode 100644 index 842f275c45ba..000000000000 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ /dev/null @@ -1,18312 +0,0 @@ -/************************************************************************* - * - * $RCSfile: rtl_OStringBuffer.cxx,v $ - * - * $Revision: 1.4 $ - * - * last change: $Author: lla $ $Date: 2003-03-10 11:04:07 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 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 - * - * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. - * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. - * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. - * - * Copyright: 2000 by Sun Microsystems, Inc. - * - * All Rights Reserved. - * - * Contributor(s): _______________________________________ - * - * - ************************************************************************/ - -// ----------------------------------------------------------------------------- - -#ifndef _RTL_STRING_HXX_ -#include <rtl/string.hxx> -#endif - -#ifndef _RTL_STRING_CONST_H_ -#include <rtl_String_Const.h> -#endif - -#ifndef _RTL_STRING_UTILS_HXX_ -#include <rtl_String_Utils.hxx> -#endif - -#include <rtl/strbuf.hxx> - -#include <cppunit/simpleheader.hxx> - -using namespace rtl; - -//------------------------------------------------------------------------ -// test classes -//------------------------------------------------------------------------ -const MAXBUFLENGTH = 255; -//------------------------------------------------------------------------ -// helper functions -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -// testing constructors -//------------------------------------------------------------------------ - -namespace rtl_OStringBuffer -{ - class ctors : public CppUnit::TestFixture - { - public: - - void ctor_001() - { - ::rtl::OStringBuffer aStrBuf; - - CPPUNIT_ASSERT_MESSAGE - ( - "New OStringBuffer containing no characters", - aStrBuf.getLength() == 0 && - ! *(aStrBuf.getStr()) && aStrBuf.getCapacity() == 16 - ); - } - - void ctor_002() - { - ::rtl::OString aStrtmp( kTestStr1 ); - ::rtl::OStringBuffer aStrBuftmp( aStrtmp ); - ::rtl::OStringBuffer aStrBuf( aStrBuftmp ); - sal_Bool res = cmpstr(aStrBuftmp.getStr(),aStrBuf.getStr()); - - CPPUNIT_ASSERT_MESSAGE - ( - "New OStringBuffer from another OStringBuffer", - aStrBuf.getLength()==aStrBuftmp.getLength() && - aStrBuf.getCapacity() == aStrBuftmp.getCapacity() && res - ); - - } - - void ctor_003() - { - ::rtl::OStringBuffer aStrBuf1(kTestStr2Len); - #ifdef WITH_CORE - ::rtl::OStringBuffer aStrBuf2(kSInt32Max); //will core dump - #else - ::rtl::OStringBuffer aStrBuf2(0); - #endif - ::rtl::OStringBuffer aStrBuf3(kNonSInt32Max); - -#ifdef WITH_CORE - CPPUNIT_ASSERT_MESSAGE - ( - "New OStringBuffer containing no characters and contain assigned capacity", - aStrBuf1.getLength() == 0 && - ! *(aStrBuf1.getStr()) && aStrBuf1.getCapacity() == kTestStr2Len && - aStrBuf2.getLength() == 0 && - ! *(aStrBuf2.getStr()) && aStrBuf2.getCapacity() == kSInt32Max && - aStrBuf3.getLength() == 0 && - ! *(aStrBuf3.getStr()) && aStrBuf3.getCapacity() == kNonSInt32Max - - ); -#else - CPPUNIT_ASSERT_MESSAGE - ( - "New OStringBuffer containing no characters and contain assigned capacity", - aStrBuf1.getLength() == 0 && - ! *(aStrBuf1.getStr()) && aStrBuf1.getCapacity() == kTestStr2Len && - aStrBuf2.getLength() == 0 && - ! *(aStrBuf2.getStr()) && aStrBuf2.getCapacity() == 16 && - aStrBuf3.getLength() == 0 && - ! *(aStrBuf3.getStr()) && aStrBuf3.getCapacity() == kNonSInt32Max - - ); -#endif - - } - - void ctor_004() - { - ::rtl::OString aStrtmp( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( aStrtmp ); - sal_Int32 leg = aStrBuf.getLength(); - - CPPUNIT_ASSERT_MESSAGE - ( - "New OStringBuffer from Ostring", - aStrBuf.getStr() == aStrtmp && - leg == aStrtmp.pData->length && - aStrBuf.getCapacity() == leg+16 - - ); - } - - CPPUNIT_TEST_SUITE(ctors); - CPPUNIT_TEST(ctor_001); - CPPUNIT_TEST(ctor_002); - CPPUNIT_TEST(ctor_003); - CPPUNIT_TEST(ctor_004); - CPPUNIT_TEST_SUITE_END(); - }; - - - -// ----------------------------------------------------------------------------- - - class makeStringAndClear : public CppUnit::TestFixture - { - OString* arrOUS[6]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( kTestStr14 ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( kTestStr27 ); - arrOUS[4] = new OString( kTestStr29 ); - arrOUS[5] = new OString( "\0" ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; - } - - void makeStringAndClear_001() - { - ::rtl::OStringBuffer aStrBuf1; - ::rtl::OString aStr1; - - sal_Bool lastRes = (aStrBuf1.makeStringAndClear() == aStr1 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "two empty strings(def. constructor)", - lastRes && ( aStrBuf1.getCapacity() == 0 ) && - ( *(aStrBuf1.getStr()) == '\0' ) - ); - - } - - void makeStringAndClear_002() - { - ::rtl::OStringBuffer aStrBuf2(26); - ::rtl::OString aStr2; - - sal_Bool lastRes = (aStrBuf2.makeStringAndClear() == aStr2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "two empty strings(with a argu)", - lastRes && ( aStrBuf2.getCapacity() == 0 ) && - ( *(aStrBuf2.getStr()) == '\0' ) - ); - - } - - void makeStringAndClear_003() - { - ::rtl::OStringBuffer aStrBuf3(*arrOUS[0]); - ::rtl::OString aStr3(*arrOUS[0]); - - sal_Bool lastRes = (aStrBuf3.makeStringAndClear() == aStr3 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "normal string", - lastRes && ( aStrBuf3.getCapacity() == 0 ) && - ( *(aStrBuf3.getStr()) == '\0' ) - ); - - } - - void makeStringAndClear_004() - { - ::rtl::OStringBuffer aStrBuf4(*arrOUS[1]); - ::rtl::OString aStr4(*arrOUS[1]); - - sal_Bool lastRes = (aStrBuf4.makeStringAndClear() == aStr4 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "string with space ", - lastRes && ( aStrBuf4.getCapacity() == 0 ) && - ( *(aStrBuf4.getStr()) == '\0' ) - ); - } - - void makeStringAndClear_005() - { - ::rtl::OStringBuffer aStrBuf5(*arrOUS[2]); - ::rtl::OString aStr5(*arrOUS[2]); - - sal_Bool lastRes = (aStrBuf5.makeStringAndClear() == aStr5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "empty string", - lastRes && ( aStrBuf5.getCapacity() == 0 ) && - ( *(aStrBuf5.getStr()) == '\0' ) - ); - } - - void makeStringAndClear_006() - { - ::rtl::OStringBuffer aStrBuf6(*arrOUS[3]); - ::rtl::OString aStr6(*arrOUS[3]); - - sal_Bool lastRes = (aStrBuf6.makeStringAndClear() == aStr6 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "string with a character", - lastRes && ( aStrBuf6.getCapacity() == 0 ) && - ( *(aStrBuf6.getStr()) == '\0' ) - ); - } - - void makeStringAndClear_007() - { - ::rtl::OStringBuffer aStrBuf7(*arrOUS[4]); - ::rtl::OString aStr7(*arrOUS[4]); - - sal_Bool lastRes = (aStrBuf7.makeStringAndClear() == aStr7 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "string with special characters", - lastRes && ( aStrBuf7.getCapacity() == 0 ) && - ( *(aStrBuf7.getStr()) == '\0' ) - ); - } - - void makeStringAndClear_008() - { - ::rtl::OStringBuffer aStrBuf8(*arrOUS[5]); - ::rtl::OString aStr8(*arrOUS[5]); - - sal_Bool lastRes = (aStrBuf8.makeStringAndClear() == aStr8 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "string only with (\0)", - lastRes && ( aStrBuf8.getCapacity() == 0 ) && - ( *(aStrBuf8.getStr()) == '\0' ) - ); - } - - CPPUNIT_TEST_SUITE(makeStringAndClear); - CPPUNIT_TEST(makeStringAndClear_001); - CPPUNIT_TEST(makeStringAndClear_002); - CPPUNIT_TEST(makeStringAndClear_003); - CPPUNIT_TEST(makeStringAndClear_004); - CPPUNIT_TEST(makeStringAndClear_005); - CPPUNIT_TEST(makeStringAndClear_006); - CPPUNIT_TEST(makeStringAndClear_007); - CPPUNIT_TEST(makeStringAndClear_008); - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class getLength : public CppUnit::TestFixture - { - OString* arrOUS[6]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( "1" ); - arrOUS[2] = new OString( ); - arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); - arrOUS[5] = new OString( kTestStr2 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; - } - - void getLength_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal = kTestStr1Len; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of ascii string", - aStrBuf.getLength() == expVal - ); - - } - - void getLength_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 expVal = 1; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of ascci string of size 1", - aStrBuf.getLength() == expVal - ); - } - - void getLength_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of empty string", - aStrBuf.getLength() == expVal - ); - } - - void getLength_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of empty string (empty ascii string arg)", - aStrBuf.getLength() == expVal - ); - } - - void getLength_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of empty string (string arg = '\\0')", - aStrBuf.getLength() == expVal - ); - } - - void getLength_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal = kTestStr2Len; - - CPPUNIT_ASSERT_MESSAGE - ( - "length(>16) of ascii string", - aStrBuf.getLength() == expVal - ); - } - - void getLength_007() - { - ::rtl::OStringBuffer aStrBuf; - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of empty string (default constructor)", - aStrBuf.getLength()== expVal - ); - } - - void getLength_008() - { - ::rtl::OStringBuffer aStrBuf( 26 ); - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "length of empty string (with capacity)", - aStrBuf.getLength()== expVal - ); - } - - CPPUNIT_TEST_SUITE( getLength ); - CPPUNIT_TEST( getLength_001 ); - CPPUNIT_TEST( getLength_002 ); - CPPUNIT_TEST( getLength_003 ); - CPPUNIT_TEST( getLength_004 ); - CPPUNIT_TEST( getLength_005 ); - CPPUNIT_TEST( getLength_006 ); - CPPUNIT_TEST( getLength_007 ); - CPPUNIT_TEST( getLength_008 ); - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class getCapacity : public CppUnit::TestFixture - { - OString* arrOUS[6]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( "1" ); - arrOUS[2] = new OString( ); - arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); - arrOUS[5] = new OString( kTestStr2 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; - } - - void getCapacity_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal = kTestStr1Len+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of ascii string", - aStrBuf.getCapacity()== expVal - ); - - } - - void getCapacity_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 expVal = 1+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of ascci string of size 1", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 expVal = 0+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 expVal = 0+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (empty ascii string arg)", - aStrBuf.getCapacity()== expVal - ); - } - - void getCapacity_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Int32 expVal = 0+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (string arg = '\\0')", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal = kTestStr2Len+16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity(>16) of ascii string", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_007() - { - ::rtl::OStringBuffer aStrBuf; - sal_Int32 expVal = 16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (default constructor)", - aStrBuf.getCapacity() == expVal - ); - } -#ifdef WITH_CORE - void getCapacity_008() - { - ::rtl::OStringBuffer aStrBuf ( kSInt32Max ); - sal_Int32 expVal = kSInt32Max; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity 2147483647)(code will core dump)", - aStrBuf.getCapacity() == expVal - ); - } -#endif - void getCapacity_009() - { - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 expVal = kNonSInt32Max; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity -2147483648)", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_010() - { - ::rtl::OStringBuffer aStrBuf( 16 ); - sal_Int32 expVal = 16; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity 16)", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_011() - { - ::rtl::OStringBuffer aStrBuf( 6 ); - sal_Int32 expVal = 6; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity 6)", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_012() - { - ::rtl::OStringBuffer aStrBuf( 0 ); - sal_Int32 expVal = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity 0)", - aStrBuf.getCapacity() == expVal - ); - } - - void getCapacity_013() - { - ::rtl::OStringBuffer aStrBuf( -2 ); - sal_Int32 expVal = -2; - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity of empty string (with capacity -2)", - aStrBuf.getCapacity() == expVal - ); - } - - CPPUNIT_TEST_SUITE( getCapacity ); - CPPUNIT_TEST( getCapacity_001 ); - CPPUNIT_TEST( getCapacity_002 ); - CPPUNIT_TEST( getCapacity_003 ); - CPPUNIT_TEST( getCapacity_004 ); - CPPUNIT_TEST( getCapacity_005 ); - CPPUNIT_TEST( getCapacity_006 ); - CPPUNIT_TEST( getCapacity_007 ); -#ifdef WITH_CORE - CPPUNIT_TEST( getCapacity_008 ); -#endif - CPPUNIT_TEST( getCapacity_009 ); - CPPUNIT_TEST( getCapacity_010 ); - CPPUNIT_TEST( getCapacity_011 ); - CPPUNIT_TEST( getCapacity_012 ); - CPPUNIT_TEST( getCapacity_013 ); - CPPUNIT_TEST_SUITE_END(); - }; -// ----------------------------------------------------------------------------- - - class ensureCapacity : public CppUnit::TestFixture - { - void ensureCapacity_001() - { - sal_Int32 expVal = 16; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 input = 5; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 16, minimum is 5", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_002() - { - sal_Int32 expVal = 16; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 input = -5; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 16, minimum is -5", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_003() - { - sal_Int32 expVal = 16; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 input = 0; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 16, minimum is 0", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_004() //the testcase is based on comments - { - sal_Int32 expVal = 34; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 input = 20; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 16, minimum is 20", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_005() - { - sal_Int32 expVal = 50; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 input = 50; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 16, minimum is 50", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_006() - { - sal_Int32 expVal = 20; - ::rtl::OStringBuffer aStrBuf( 6 ); - sal_Int32 input = 20; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 6, minimum is 20", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_007() - { - sal_Int32 expVal = 6; - ::rtl::OStringBuffer aStrBuf( 6 ); - sal_Int32 input = 2; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 6, minimum is 2", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_008() - { - sal_Int32 expVal = 6; - ::rtl::OStringBuffer aStrBuf( 6 ); - sal_Int32 input = -6; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 6, minimum is -6", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_009() //the testcase is based on comments - { - sal_Int32 expVal = 14; - ::rtl::OStringBuffer aStrBuf( 6 ); - sal_Int32 input = 10; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 6, minimum is -6", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_010() - { - sal_Int32 expVal = 6; - ::rtl::OStringBuffer aStrBuf( 0 ); - sal_Int32 input = 6; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 0, minimum is 6", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_011() //the testcase is based on comments - { - sal_Int32 expVal = 1; - ::rtl::OStringBuffer aStrBuf( 0 ); - sal_Int32 input = 1; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 0, minimum is 1", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_012() - { - sal_Int32 expVal = 0; - ::rtl::OStringBuffer aStrBuf( 0 ); - sal_Int32 input = -1; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 0, minimum is -1", - aStrBuf.getCapacity() == expVal - ); - - } -#ifdef WITH_CORE - void ensureCapacity_013() //will core dump - { - sal_Int32 expVal = kSInt32Max; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Int32 input = 65535; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 2147483647, minimum is 65535", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_014() //will core dump - { - sal_Int32 expVal = kSInt32Max; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Int32 input = kSInt32Max; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 2147483647, minimum is 2147483647", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_015() //will core dump - { - sal_Int32 expVal = kSInt32Max; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Int32 input = -1; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 2147483647, minimum is -1", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_016() //will core dump - { - sal_Int32 expVal = kSInt32Max; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Int32 input = 0; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 2147483647, minimum is 0", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_017() //will core dump - { - sal_Int32 expVal = kSInt32Max; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Int32 input = kNonSInt32Max; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to 2147483647, minimum is -2147483648", - aStrBuf.getCapacity() == expVal - ); - - } -#endif - void ensureCapacity_018() - { - sal_Int32 expVal = 65535; - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 input = 65535; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to -2147483648, minimum is 65535", - aStrBuf.getCapacity() == expVal - ); - - } -#ifdef WITH_CORE - void ensureCapacity_019() //will core dump - { - sal_Int32 expVal = 2147483647; - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 input = 2147483647; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to -2147483648, minimum is 2147483647", - aStrBuf.getCapacity() == expVal - ); - - } -#endif - void ensureCapacity_020() - { - sal_Int32 expVal = 2; - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 input = -1; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to -2147483648, minimum is -1", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_021() - { - sal_Int32 expVal = 2; - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 input = 0; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to -2147483648, minimum is 0", - aStrBuf.getCapacity() == expVal - ); - - } - - void ensureCapacity_022() - { - sal_Int32 expVal = kNonSInt32Max; - ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); - sal_Int32 input = kNonSInt32Max; - - aStrBuf.ensureCapacity( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "capacity equal to -2147483648, minimum is -2147483648", - aStrBuf.getCapacity() == expVal - ); - - } - - CPPUNIT_TEST_SUITE( ensureCapacity ); - CPPUNIT_TEST( ensureCapacity_001 ); - CPPUNIT_TEST( ensureCapacity_002 ); - CPPUNIT_TEST( ensureCapacity_003 ); - CPPUNIT_TEST( ensureCapacity_004 ); - CPPUNIT_TEST( ensureCapacity_005 ); - CPPUNIT_TEST( ensureCapacity_006 ); - CPPUNIT_TEST( ensureCapacity_007 ); - CPPUNIT_TEST( ensureCapacity_008 ); - CPPUNIT_TEST( ensureCapacity_009 ); - CPPUNIT_TEST( ensureCapacity_010 ); - CPPUNIT_TEST( ensureCapacity_011 ); - CPPUNIT_TEST( ensureCapacity_012 ); -#ifdef WITH_CORE - CPPUNIT_TEST( ensureCapacity_013 ); - CPPUNIT_TEST( ensureCapacity_014 ); - CPPUNIT_TEST( ensureCapacity_015 ); - CPPUNIT_TEST( ensureCapacity_016 ); - CPPUNIT_TEST( ensureCapacity_017 ); -#endif - CPPUNIT_TEST( ensureCapacity_018 ); -#ifdef WITH_CORE - CPPUNIT_TEST( ensureCapacity_019 ); -#endif - CPPUNIT_TEST( ensureCapacity_020 ); - CPPUNIT_TEST( ensureCapacity_021 ); - CPPUNIT_TEST( ensureCapacity_022 ); - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class setLength : public CppUnit::TestFixture - { - OString* arrOUS[6]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( "1" ); - arrOUS[2] = new OString( ); - arrOUS[3] = new OString( "" ); - arrOUS[4] = new OString( "\0" ); - arrOUS[5] = new OString( kTestStr2 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; - } - - void setLength_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal1 = 50; - ::rtl::OString expVal2( kTestStr1 ); - sal_Int32 expVal3 = 50; - sal_Int32 input = 50; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the capacity of OStringBuffer(kTestStr1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal1 = kTestStr13Len; - ::rtl::OString expVal2( kTestStr1 ); - sal_Int32 expVal3 = 32; - sal_Int32 input = kTestStr13Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer(kTestStr1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal1 = kTestStr1Len; - ::rtl::OString expVal2( kTestStr1 ); - sal_Int32 expVal3 = 32; - sal_Int32 input = kTestStr1Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength equal to the length of OStringBuffer(kTestStr1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal1 = kTestStr7Len; - ::rtl::OString expVal2( kTestStr7 ); - sal_Int32 expVal3 = 32; - sal_Int32 input = kTestStr7Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength less than the length of OStringBuffer(kTestStr1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 32; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength equal to 0", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 expVal1 = 25; - ::rtl::OString expVal2( *arrOUS[1] ); - sal_Int32 expVal3 = 25; - sal_Int32 input = 25; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the capacity of OStringBuffer(1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 expVal1 = kTestStr27Len; - ::rtl::OString expVal2( *arrOUS[1] ); - sal_Int32 expVal3 = 17; - sal_Int32 input = kTestStr27Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength equal to the length of OStringBuffer(1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 17; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength less than the length of OUStringBuffer(1)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 expVal1 = 20; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 20; - sal_Int32 input = 20; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the capacity of OStringBuffer()", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 expVal1 = 3; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 3; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer()", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer()", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 expVal1 = 20; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 20; - sal_Int32 input = 20; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the capacity of OStringBuffer("")", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 expVal1 = 5; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 5; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer("")", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength less than the length of OStringBuffer("")", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Int32 expVal1 = 20; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 20; - sal_Int32 input = 20; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer(\0)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Int32 expVal1 = 5; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 5; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer(\0)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 16; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength less than the length of OStringBuffer(\0)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal1 = 50; - ::rtl::OString expVal2( kTestStr2 ); - sal_Int32 expVal3 = 66; - sal_Int32 input = 50; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the capacity of OStringBuffer(kTestStr2)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal1 = 40; - ::rtl::OString expVal2(kTestStr2); - sal_Int32 expVal3 = 48; - sal_Int32 input = 40; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength more than the length of OStringBuffer(kTestStr2)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal1 = kTestStr2Len; - ::rtl::OString expVal2(kTestStr2); - sal_Int32 expVal3 = 48; - sal_Int32 input = kTestStr2Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength equal to the length of OUStringBuffer(kTestStr2)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal1 = kTestStr7Len; - ::rtl::OString expVal2(kTestStr7); - sal_Int32 expVal3 = 48; - sal_Int32 input = kTestStr7Len; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength less than the length of OUStringBuffer(TestStr2)", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - void setLength_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); - sal_Int32 expVal1 = 0; - ::rtl::OString expVal2; - sal_Int32 expVal3 = 48; - sal_Int32 input = 0; - - aStrBuf.setLength( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "newLength equal to 0", - aStrBuf.getStr() == expVal2 && - aStrBuf.getLength() == expVal1 && - aStrBuf.getCapacity() == expVal3 - ); - - } - - - - CPPUNIT_TEST_SUITE( setLength ); - CPPUNIT_TEST( setLength_001 ); - CPPUNIT_TEST( setLength_002 ); - CPPUNIT_TEST( setLength_003 ); - CPPUNIT_TEST( setLength_004 ); - CPPUNIT_TEST( setLength_005 ); - CPPUNIT_TEST( setLength_006 ); - CPPUNIT_TEST( setLength_007 ); - CPPUNIT_TEST( setLength_008 ); - CPPUNIT_TEST( setLength_009 ); - CPPUNIT_TEST( setLength_010 ); - CPPUNIT_TEST( setLength_011 ); - CPPUNIT_TEST( setLength_012 ); - CPPUNIT_TEST( setLength_013 ); - CPPUNIT_TEST( setLength_014 ); - CPPUNIT_TEST( setLength_015 ); - CPPUNIT_TEST( setLength_016 ); - CPPUNIT_TEST( setLength_017 ); - CPPUNIT_TEST( setLength_018 ); - CPPUNIT_TEST( setLength_019 ); - CPPUNIT_TEST( setLength_020 ); - CPPUNIT_TEST( setLength_021 ); - CPPUNIT_TEST( setLength_022 ); - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class charAt : public CppUnit::TestFixture - { - OString* arrOUS[4]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( kTestStr27 ); - arrOUS[2] = new OString( kTestStr28 ); - arrOUS[3] = new OString( ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; - } - - void charAt_001() - { - sal_Unicode expVal = 83; - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the first character of OStringBuffer(kTestStr1)", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_002() - { - sal_Unicode expVal = 32; - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input = 3; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the middle character of OStringBuffer(kTestStr1)", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_003() - { - sal_Unicode expVal = 115; - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input = 15; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the last character of OStringBuffer(kTestStr1)", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_004() - { - sal_Unicode expVal = 115; - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 input = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the only character of OStringBuffer(kTestStr27)", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_005() - { - sal_Unicode expVal = 40; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 input = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the first of OStringBuffer(kTestStr28) with special character", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_006() - { - sal_Unicode expVal = 11; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 input = 5; - - CPPUNIT_ASSERT_MESSAGE - ( - "return the mid of OStringBuffer(kTestStr28) with special character", - aStrBuf.charAt(input) == expVal - ); - - } - - void charAt_007() - { - sal_Unicode expVal = 0; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 input = 0; - - CPPUNIT_ASSERT_MESSAGE - ( - "invalid character of OStringBuffer()", - sal_True - ); - - } - - void charAt_008() - { - sal_Unicode expVal = 0; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 input = -2; - - CPPUNIT_ASSERT_MESSAGE - ( - "invalid character of OStringBuffer()", - sal_True - ); - - } - - CPPUNIT_TEST_SUITE( charAt ); - CPPUNIT_TEST( charAt_001 ); - CPPUNIT_TEST( charAt_002 ); - CPPUNIT_TEST( charAt_003 ); - CPPUNIT_TEST( charAt_004 ); - CPPUNIT_TEST( charAt_005 ); - CPPUNIT_TEST( charAt_006 ); - CPPUNIT_TEST( charAt_007 ); - CPPUNIT_TEST( charAt_008 ); - CPPUNIT_TEST_SUITE_END(); - }; -// ----------------------------------------------------------------------------- - - class csuc : public CppUnit::TestFixture - { - void csuc_001() - { - const sal_Char* expVal = kTestStr1; - ::rtl::OStringBuffer aStrBuf( kTestStr1 ); - sal_Int32 cmpLen = kTestStr1Len; - - const sal_Char* pstr = *&aStrBuf; - - CPPUNIT_ASSERT_MESSAGE - ( - "test normal string", - cmpstr( pstr, expVal, cmpLen ) - ); - - } - - void csuc_002() - { - const sal_Char expVal=0x0; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 cmpLen = 1; - - const sal_Char* pstr = *&aStrBuf; - - CPPUNIT_ASSERT_MESSAGE - ( - "test empty string", - cmpstr( pstr, &expVal, cmpLen ) - ); - - } - - - CPPUNIT_TEST_SUITE( csuc ); - CPPUNIT_TEST( csuc_001 ); - CPPUNIT_TEST( csuc_002 ); - CPPUNIT_TEST_SUITE_END(); - }; - - -// ----------------------------------------------------------------------------- - - class getStr : public CppUnit::TestFixture - { - void getStr_001() - { - const sal_Char* expVal = kTestStr1; - ::rtl::OStringBuffer aStrBuf( kTestStr1 ); - sal_Int32 cmpLen = kTestStr1Len; - - const sal_Char* pstr = aStrBuf.getStr(); - - CPPUNIT_ASSERT_MESSAGE - ( - "test normal string", - cmpstr( pstr, expVal, cmpLen ) - ); - - } - - void getStr_002() - { - const sal_Char tmpUC=0x0; - const sal_Char* expVal=&tmpUC; - ::rtl::OStringBuffer aStrBuf; - sal_Int32 cmpLen = 1; - - const sal_Char* pstr = aStrBuf.getStr(); - - CPPUNIT_ASSERT_MESSAGE - ( - "test empty string", - cmpstr( pstr, expVal, cmpLen ) - ); - - } - - - CPPUNIT_TEST_SUITE( getStr ); - CPPUNIT_TEST( getStr_001 ); - CPPUNIT_TEST( getStr_002 ); - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class setCharAt : public CppUnit::TestFixture - { - OString* arrOUS[4]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr1 ); - arrOUS[1] = new OString( kTestStr27 ); - arrOUS[2] = new OString( kTestStr28 ); - arrOUS[3] = new OString( ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; - } - - void setCharAt_001() - { - OString expVal( kTestStr31 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input1 = 0; - sal_Char input2 = 's'; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the first character of OStringBuffer(kTestStr1) with s", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } - - void setCharAt_002() - { - OString expVal( kTestStr3 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input1 = 4; - sal_Char input2 = 'm'; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the middle character of OStringBuffer(kTestStr1) with m", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } - - void setCharAt_003() - { - OString expVal( kTestStr32 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Int32 input1 = 15; - sal_Char input2 = ' '; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the last character of OStringBuffer(kTestStr1) with ' '", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } - - - void setCharAt_004() - { - OString expVal( kTestStr33 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Int32 input1 = 0; - sal_Char input2 = ' '; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the only character of OStringBuffer(kTestStr27) with ' '", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } - - - void setCharAt_005() - { - OString expVal( kTestStr34 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 input1 = 1; - sal_Char input2 = (sal_Char)5; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the only of OStringBuffer(kTestStr28) with special character", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } - - void setCharAt_006() - { - OString expVal( kTestStr35 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Int32 input1 = 1; - sal_Char input2 = (sal_Char)-5; - - CPPUNIT_ASSERT_MESSAGE - ( - "set the only of OStringBuffer(kTestStr28) with special character", - (aStrBuf.setCharAt(input1, input2)).getStr() == expVal - ); - - } -#ifdef WITH_CORE - void setCharAt_007() - { - OString* expVal = 0; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 input1 = 0; - sal_Char input2 = (sal_Char)5; - - CPPUNIT_ASSERT_MESSAGE - ( - "invalid character of OStringBuffer()", - sal_True - ); - - delete expVal; - - } - - void setCharAt_008() - { - OString* expVal = 0; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 input1 = -2; - sal_Char input2 = (sal_Char)5; - - CPPUNIT_ASSERT_MESSAGE - ( - "invalid character of OStringBuffer()", - sal_True - ); - - delete expVal; - - } - - void setCharAt_009() - { - OString* expVal = 0; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Int32 input1 = 3; - sal_Char input2 = (sal_Char)5; - - CPPUNIT_ASSERT_MESSAGE - ( - "invalid character of OStringBuffer()", - sal_True - ); - - delete expVal; - - } -#endif - CPPUNIT_TEST_SUITE( setCharAt ); - CPPUNIT_TEST( setCharAt_001 ); - CPPUNIT_TEST( setCharAt_002 ); - CPPUNIT_TEST( setCharAt_003 ); - CPPUNIT_TEST( setCharAt_004 ); - CPPUNIT_TEST( setCharAt_005 ); - CPPUNIT_TEST( setCharAt_006 ); -#ifdef WITH_CORE - CPPUNIT_TEST( setCharAt_007 ); - CPPUNIT_TEST( setCharAt_008 ); - CPPUNIT_TEST( setCharAt_009 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class append_001 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001_001() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString input2( kTestStr8 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_001_002() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString input2( kTestStr36 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_003() - { - OString expVal( kTestStr37 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString input2( kTestStr23 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_004() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_005() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString input2( kTestStr7 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_006() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString input2( kTestStr2 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_007() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString input2( kTestStr1 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_008() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_009() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString input2( kTestStr7 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_010() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString input2( kTestStr2 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_011() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString input2( kTestStr1 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_012() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_013() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString input2( kTestStr7 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_014() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString input2( kTestStr2 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_015() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString input2( kTestStr1 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_016() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_017() - { - OString expVal( kTestStr29 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString input2( kTestStr38 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_018() - { - OString expVal( kTestStr39 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString input2( kTestStr17 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_019() - { - OString expVal( kTestStr40 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString input2( kTestStr31 ); - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_001_020() - { - OString expVal( kTestStr28 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - -#ifdef WITH_CORE - void append_001_021() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString input2; - - aStrBuf.append( input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_001 ); - CPPUNIT_TEST( append_001_001 ); - CPPUNIT_TEST( append_001_002 ); - CPPUNIT_TEST( append_001_003 ); - CPPUNIT_TEST( append_001_004 ); - CPPUNIT_TEST( append_001_005 ); - CPPUNIT_TEST( append_001_006 ); - CPPUNIT_TEST( append_001_007 ); - CPPUNIT_TEST( append_001_008 ); - CPPUNIT_TEST( append_001_009 ); - CPPUNIT_TEST( append_001_010 ); - CPPUNIT_TEST( append_001_011 ); - CPPUNIT_TEST( append_001_012 ); - CPPUNIT_TEST( append_001_013 ); - CPPUNIT_TEST( append_001_014 ); - CPPUNIT_TEST( append_001_015 ); - CPPUNIT_TEST( append_001_016 ); - CPPUNIT_TEST( append_001_017 ); - CPPUNIT_TEST( append_001_018 ); - CPPUNIT_TEST( append_001_019 ); - CPPUNIT_TEST( append_001_020 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_001_021 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; - -// ----------------------------------------------------------------------------- - - class append_002 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_002_001() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input = kTestStr8; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_002() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input = kTestStr36; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_003() - { - OString expVal( kTestStr37 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input = kTestStr23; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_004() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_005() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input = kTestStr7; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_006() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input = kTestStr2; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_007() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input = kTestStr1; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_008() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_009() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input = kTestStr7; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_010() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input = kTestStr2; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_011() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input = kTestStr1; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_012() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_013() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input = kTestStr7; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_014() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input = kTestStr2; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_015() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input = kTestStr1; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_016() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_017() - { - OString expVal( kTestStr29 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input = kTestStr38; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_018() - { - OString expVal( kTestStr39 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input = kTestStr17; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_019() - { - OString expVal( kTestStr40 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input = kTestStr31; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002_020() - { - OString expVal( kTestStr28 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - -#ifdef WITH_CORE - void append_002_021() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - const sal_Char* input = kTestStr25; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer(with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_002 ); - CPPUNIT_TEST( append_002_001 ); - CPPUNIT_TEST( append_002_002 ); - CPPUNIT_TEST( append_002_003 ); - CPPUNIT_TEST( append_002_004 ); - CPPUNIT_TEST( append_002_005 ); - CPPUNIT_TEST( append_002_006 ); - CPPUNIT_TEST( append_002_007 ); - CPPUNIT_TEST( append_002_008 ); - CPPUNIT_TEST( append_002_009 ); - CPPUNIT_TEST( append_002_010 ); - CPPUNIT_TEST( append_002_011 ); - CPPUNIT_TEST( append_002_012 ); - CPPUNIT_TEST( append_002_013 ); - CPPUNIT_TEST( append_002_014 ); - CPPUNIT_TEST( append_002_015 ); - CPPUNIT_TEST( append_002_016 ); - CPPUNIT_TEST( append_002_017 ); - CPPUNIT_TEST( append_002_018 ); - CPPUNIT_TEST( append_002_019 ); - CPPUNIT_TEST( append_002_020 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_002_021 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -// ----------------------------------------------------------------------------- - - class append_003 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_003_001() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input1 = kTestStr36; - sal_Int32 input2 = 12; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_002() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input1 = kTestStr36; - sal_Int32 input2 = 28; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_003() - { - OString expVal( kTestStr37 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input1 = kTestStr23; - sal_Int32 input2 = 16; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_004() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_005() - { - OString expVal( kTestStr41 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = -1; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 0) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_006() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 4; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_007() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 32; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_008() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 16; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_009() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_010() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = -1; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 0) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_011() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 4; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_012() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 32; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_013() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 16; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_014() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_015() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = -1; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 0) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_016() - { - OString expVal( kTestStr7 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 4; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_017() - { - OString expVal( kTestStr2 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 32; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_018() - { - OString expVal( kTestStr1 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 16; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_019() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_020() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = -1; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 0) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_021() - { - OString expVal( kTestStr29 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input1 = kTestStr38; - sal_Int32 input2 = 7; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_022() - { - OString expVal( kTestStr39 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input1 = kTestStr17; - sal_Int32 input2 = 22; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length more than 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_023() - { - OString expVal( kTestStr40 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input1 = kTestStr31; - sal_Int32 input2 = 16; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 16) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_024() - { - OString expVal( kTestStr28 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003_025() - { - OString expVal( kTestStr42 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - const sal_Char* input1 = kTestStr2; - sal_Int32 input2 = -1; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length less than 0) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - -#ifdef WITH_CORE - void append_003_026() - { - OString expVal; - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - const sal_Char* input1 = kTestStr25; - sal_Int32 input2 = 0; - - aStrBuf.append( input1, input2 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the string(length equal to 0) to the string buffer(with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_003 ); - CPPUNIT_TEST( append_003_001 ); - CPPUNIT_TEST( append_003_002 ); - CPPUNIT_TEST( append_003_003 ); - CPPUNIT_TEST( append_003_004 ); - CPPUNIT_TEST( append_003_005 ); - CPPUNIT_TEST( append_003_006 ); - CPPUNIT_TEST( append_003_007 ); - CPPUNIT_TEST( append_003_008 ); - CPPUNIT_TEST( append_003_009 ); - CPPUNIT_TEST( append_003_010 ); - CPPUNIT_TEST( append_003_011 ); - CPPUNIT_TEST( append_003_012 ); - CPPUNIT_TEST( append_003_013 ); - CPPUNIT_TEST( append_003_014 ); - CPPUNIT_TEST( append_003_015 ); - CPPUNIT_TEST( append_003_016 ); - CPPUNIT_TEST( append_003_017 ); - CPPUNIT_TEST( append_003_018 ); - CPPUNIT_TEST( append_003_019 ); - CPPUNIT_TEST( append_003_020 ); - CPPUNIT_TEST( append_003_021 ); - CPPUNIT_TEST( append_003_022 ); - CPPUNIT_TEST( append_003_023 ); - CPPUNIT_TEST( append_003_024 ); - CPPUNIT_TEST( append_003_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_003_026 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -// ----------------------------------------------------------------------------- - - class append_004 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_004_001() - { - OString expVal( kTestStr45 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_002() - { - OString expVal( kTestStr46 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_003() - { - OString expVal( kTestStr47 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_004() - { - OString expVal( kTestStr48 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_005() - { - OString expVal( kTestStr47 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_006() - { - OString expVal( kTestStr48 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_007() - { - OString expVal( kTestStr47 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_008() - { - OString expVal( kTestStr48 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_009() - { - OString expVal( kTestStr49 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_010() - { - OString expVal( kTestStr50 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - -#ifdef WITH_CORE - void append_004_011() - { - OString expVal( kTestStr47 ); - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Bool input = sal_True; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_True) to the string buffer(with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004_012() - { - OString expVal( kTestStr48 ); - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Bool input = sal_False; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Bool(sal_False) to the string buffer(with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_004 ); - CPPUNIT_TEST( append_004_001 ); - CPPUNIT_TEST( append_004_002 ); - CPPUNIT_TEST( append_004_003 ); - CPPUNIT_TEST( append_004_004 ); - CPPUNIT_TEST( append_004_005 ); - CPPUNIT_TEST( append_004_006 ); - CPPUNIT_TEST( append_004_007 ); - CPPUNIT_TEST( append_004_008 ); - CPPUNIT_TEST( append_004_009 ); - CPPUNIT_TEST( append_004_010 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_004_011 ); - CPPUNIT_TEST( append_004_012 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append(sal_Char c) -//------------------------------------------------------------------------ - class append_005 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - OString expVal( kTestStr51 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Char input = 'M'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(M) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_002() - { - OString expVal( kTestStr143 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Unicode(kSInt8Max) to the string buffer arrOUS[0]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_003() - { - OString expVal( kTestStr27 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Char input = 's'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(s) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_004() - { - OString expVal( kTestStr144 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[1]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_005_005() - { - OString expVal( kTestStr27 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Char input = 's'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(s) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_006() - { - OString expVal( kTestStr144 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[2]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_007() - { - OString expVal( kTestStr27 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Char input = 's'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(s) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_008() - { - OString expVal( kTestStr144 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[3]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_009() - { - OString expVal( kTestStr56 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Char input = 's'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(s) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_010() - { - OString expVal( kTestStr145 ); - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[4]", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - -#ifdef WITH_CORE - void append_011() - { - OString expVal( kTestStr27 ); - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Char input = 's'; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(s) to the string buffer(with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } - - void append_012() - { - OString expVal( kTestStr144 ); - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - sal_Char input = (sal_Char)255; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the sal_Char(kSInt8Max) to the string buffer with INT_MAX)", - ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_005 ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -/** - * Calls the method append(T, radix) and compares - * returned OUString with OUString that passed in the array resArray. - * - * @param T, type of argument, passed to append - * @param resArray, array of result ustrings to compare to - * @param n the number of elements in the array resArray (testcases) - * @param pTestResult the instance of the class TestResult - * @param inArray [optional], array of value that is passed as first argument - * to append - * - * @return true, if all returned OUString are equal to corresponding OUString in - * resArray else, false. - */ -/*template <class T> -sal_Bool test_append( const char** resArray, int n, sal_Int16 radix, - const T *inArray, OStringBuffer &aStr1 ) -{ - sal_Bool bRes = sal_True; - - //sal_Char methName[MAXBUFLENGTH]; - //sal_Char* pMeth = methName; - sal_Int32 i; -// static sal_Unicode aUchar[80]={0x12}; - - for (i = 0; i < n; i++) - { - - OSL_ENSURE( i < 80, "ERROR: leave aUchar bound"); - -// AStringToUStringCopy(aUchar,resArray[i]); - - ::rtl::OString aStr2(aStr1.getStr()); - ::rtl::OString aStr3( "-" ); - - if (inArray == 0) - { - aStr2 += OString(resArray[i]); - aStr1.append((T)i, radix); - } - else - { - // sal_Unicode aStr4[100]; - if ( inArray[i] < 0 ) - { - aStr2 += aStr3; - - } -// if(AStringToUStringCopy(aStr4,resArray[i])) -// { - aStr2 += OString(resArray[i]); -// } - aStr1.append((T)inArray[i], radix); - } - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]", - aStr1.getStr()== aStr2 && - aStr1.getLength() == aStr2.getLength() - ); - } - - return (bRes); -} -#define test_append_Int32 test_append<sal_Int32> -#define test_append_Int64 test_append<sal_Int64> -#define test_append_float test_append<float> -#define test_append_double test_append<double>*/ -//------------------------------------------------------------------------ -// testing the method append( sal_Int32 i, sal_Int16 radix=2 ) -// testing the method append( sal_Int32 i, sal_Int16 radix=8 ) -// testing the method append( sal_Int32 i, sal_Int16 radix=10 ) -// testing the method append( sal_Int32 i, sal_Int16 radix=16 ) -// testing the method append( sal_Int32 i, sal_Int16 radix=36 ) -//------------------------------------------------------------------------ - class append_006_Int32 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - /*test_append_Int32((const char**)kBinaryNumsStr, - kBinaryNumsCount, kRadixBinary, - 0, aStrBuf );*/ - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_051() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_052() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_053() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_054() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_055() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_056() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_057() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_058() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_059() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_060() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_061() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_062() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_063() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_064() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_065() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_066() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_067() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_068() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_069() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_070() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_071() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_072() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_073() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_074() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_075() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_076() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_077() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_078() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_079() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_080() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_081() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_082() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_083() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_084() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_085() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_086() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_087() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_088() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_089() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_090() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_091() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_092() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_093() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_094() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_095() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_096() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_097() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_098() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_099() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_100() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_006_Int32 ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST( append_051 ); CPPUNIT_TEST( append_052 ); - CPPUNIT_TEST( append_053 ); CPPUNIT_TEST( append_054 ); - CPPUNIT_TEST( append_055 ); CPPUNIT_TEST( append_056 ); - CPPUNIT_TEST( append_057 ); CPPUNIT_TEST( append_058 ); - CPPUNIT_TEST( append_059 ); CPPUNIT_TEST( append_060 ); - CPPUNIT_TEST( append_061 ); CPPUNIT_TEST( append_062 ); - CPPUNIT_TEST( append_063 ); CPPUNIT_TEST( append_064 ); - CPPUNIT_TEST( append_065 ); CPPUNIT_TEST( append_066 ); - CPPUNIT_TEST( append_067 ); CPPUNIT_TEST( append_068 ); - CPPUNIT_TEST( append_069 ); CPPUNIT_TEST( append_070 ); - CPPUNIT_TEST( append_071 ); CPPUNIT_TEST( append_072 ); - CPPUNIT_TEST( append_073 ); CPPUNIT_TEST( append_074 ); - CPPUNIT_TEST( append_075 ); CPPUNIT_TEST( append_076 ); - CPPUNIT_TEST( append_077 ); CPPUNIT_TEST( append_078 ); - CPPUNIT_TEST( append_079 ); CPPUNIT_TEST( append_080 ); - CPPUNIT_TEST( append_081 ); CPPUNIT_TEST( append_082 ); - CPPUNIT_TEST( append_083 ); CPPUNIT_TEST( append_084 ); - CPPUNIT_TEST( append_085 ); CPPUNIT_TEST( append_086 ); - CPPUNIT_TEST( append_087 ); CPPUNIT_TEST( append_088 ); - CPPUNIT_TEST( append_089 ); CPPUNIT_TEST( append_090 ); - CPPUNIT_TEST( append_091 ); CPPUNIT_TEST( append_092 ); - CPPUNIT_TEST( append_093 ); CPPUNIT_TEST( append_094 ); - CPPUNIT_TEST( append_095 ); CPPUNIT_TEST( append_096 ); - CPPUNIT_TEST( append_097 ); CPPUNIT_TEST( append_098 ); - CPPUNIT_TEST( append_099 ); CPPUNIT_TEST( append_100 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int32 i, sal_Int16 radix=2 ) -// where i = large constants -// testing the method append( sal_Int32 i, sal_Int16 radix=8 ) -// where i = large constants -// testing the method append( sal_Int32 i, sal_Int16 radix=10 ) -// where i = large constants -// testing the method append( sal_Int32 i, sal_Int16 radix=16 ) -// where i = large constants -// testing the method append( sal_Int32 i, sal_Int16 radix=36 ) -// where i = large constants -//------------------------------------------------------------------------ - class append_006_Int32_Bounderies : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 8; - - expVal += OString( "17777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 10; - - expVal += OString( "2147483647" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 36; - - expVal += OString( "zik0zj" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 8; - - expVal += OString( "17777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 10; - - expVal += OString( "2147483647" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 36; - - expVal += OString( "zik0zj" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 8; - - expVal += OString( "17777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 10; - - expVal += OString( "2147483647" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 36; - - expVal += OString( "zik0zj" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 8; - - expVal += OString( "17777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 10; - - expVal += OString( "2147483647" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 36; - - expVal += OString( "zik0zj" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 8; - - expVal += OString( "17777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 10; - - expVal += OString( "2147483647" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = kSInt32Max; - sal_Int16 radix = 36; - - expVal += OString( "zik0zj" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_006_Int32_Bounderies ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int32 i, sal_Int16 radix=2 ) -// for negative value -// testing the method append( sal_Int32 i, sal_Int16 radix=8 ) -// for negative value -// testing the method append( sal_Int32 i, sal_Int16 radix=10 ) -// for negative value -// testing the method append( sal_Int32 i, sal_Int16 radix=16 ) -// for negative value -// testing the method append( sal_Int32 i, sal_Int16 radix=36 ) -// for negative value -//------------------------------------------------------------------------ - class append_006_Int32_Negative : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_051() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_052() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_053() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_054() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_055() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_056() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_057() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_058() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_059() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_060() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_061() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_062() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_063() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_064() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_065() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_066() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_067() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_068() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_069() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_070() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_071() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_072() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_073() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_074() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_075() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_076() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_077() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_078() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_079() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_080() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_081() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_082() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_083() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_084() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_085() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_086() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_087() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_088() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_089() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_090() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_091() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_092() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_093() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_094() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_095() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_096() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_097() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_098() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_099() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_100() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int32 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_006_Int32_Negative ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST( append_051 ); CPPUNIT_TEST( append_052 ); - CPPUNIT_TEST( append_053 ); CPPUNIT_TEST( append_054 ); - CPPUNIT_TEST( append_055 ); CPPUNIT_TEST( append_056 ); - CPPUNIT_TEST( append_057 ); CPPUNIT_TEST( append_058 ); - CPPUNIT_TEST( append_059 ); CPPUNIT_TEST( append_060 ); - CPPUNIT_TEST( append_061 ); CPPUNIT_TEST( append_062 ); - CPPUNIT_TEST( append_063 ); CPPUNIT_TEST( append_064 ); - CPPUNIT_TEST( append_065 ); CPPUNIT_TEST( append_066 ); - CPPUNIT_TEST( append_067 ); CPPUNIT_TEST( append_068 ); - CPPUNIT_TEST( append_069 ); CPPUNIT_TEST( append_070 ); - CPPUNIT_TEST( append_071 ); CPPUNIT_TEST( append_072 ); - CPPUNIT_TEST( append_073 ); CPPUNIT_TEST( append_074 ); - CPPUNIT_TEST( append_075 ); CPPUNIT_TEST( append_076 ); - CPPUNIT_TEST( append_077 ); CPPUNIT_TEST( append_078 ); - CPPUNIT_TEST( append_079 ); CPPUNIT_TEST( append_080 ); - CPPUNIT_TEST( append_081 ); CPPUNIT_TEST( append_082 ); - CPPUNIT_TEST( append_083 ); CPPUNIT_TEST( append_084 ); - CPPUNIT_TEST( append_085 ); CPPUNIT_TEST( append_086 ); - CPPUNIT_TEST( append_087 ); CPPUNIT_TEST( append_088 ); - CPPUNIT_TEST( append_089 ); CPPUNIT_TEST( append_090 ); - CPPUNIT_TEST( append_091 ); CPPUNIT_TEST( append_092 ); - CPPUNIT_TEST( append_093 ); CPPUNIT_TEST( append_094 ); - CPPUNIT_TEST( append_095 ); CPPUNIT_TEST( append_096 ); - CPPUNIT_TEST( append_097 ); CPPUNIT_TEST( append_098 ); - CPPUNIT_TEST( append_099 ); CPPUNIT_TEST( append_100 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int32 i, sal_Int16 radix ) where radix = -5 -//------------------------------------------------------------------------ - class append_006_Int32_WrongRadix : public CppUnit::TestFixture - { - OString* arrOUS[5]; - sal_Int32 intVal; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - intVal = 11; - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr59 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[0]", - sal_True - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[1]", - sal_True - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[2]", - sal_True - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[3]", - sal_True - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr61 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[4]", - sal_True - ); - - } -#ifdef WITH_CORE - void append_006() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer(with INT_MAX)", - sal_True - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_006_Int32_WrongRadix ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_006 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ - class append_006_Int32_defaultParam : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr59 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer[0]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr62 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OStringBuffer[0]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr63 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OStringBuffer[0]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr64 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer[0]+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr65 ); - sal_Int32 input = kNonSInt32Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer[0]+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr60 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer[1]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr66 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OStringBuffer[1]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr67 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OStringBuffer[1]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr68 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer[1]+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr69 ); - sal_Int32 input = -2147483648; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer[1]+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr60 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer[2]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr66 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OUStringBuffer[2]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr67 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OUStringBuffer[2]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr68 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer[2]+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr69 ); - sal_Int32 input = -2147483648; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer[2]+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr60 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer[3]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr66 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OStringBuffer[3]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr67 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OStringBuffer[3]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr68 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer[3]+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr69 ); - sal_Int32 input = -2147483648; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer[3]+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr61 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer[4]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr70 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OStringBuffer[4]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr71 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OStringBuffer[4]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr72 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer[4]+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr73 ); - sal_Int32 input = -2147483648; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer[4]+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_026() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr60 ); - sal_Int32 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 11 and return OStringBuffer(kSInt32Max)+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr66 ); - sal_Int32 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 0 and return OStringBuffer(kSInt32Max)+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr67 ); - sal_Int32 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -11 and return OStringBuffer(kSInt32Max)+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr68 ); - sal_Int32 input = 2147483647; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 2147483647 and return OStringBuffer(kSInt32Max)+2147483647", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr69 ); - sal_Int32 input = -2147483648; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int32 -2147483648 and return OStringBuffer(kSInt32Max)+(-2147483648)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_006_Int32_defaultParam ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int64 l, sal_Int16 radix=2 ) -// testing the method append( sal_Int64 l, sal_Int16 radix=8 ) -// testing the method append( sal_Int64 l, sal_Int16 radix=10 ) -// testing the method append( sal_Int64 l, sal_Int16 radix=16 ) -// testing the method append( sal_Int64 l, sal_Int16 radix=36 ) -//------------------------------------------------------------------------ - class append_007_Int64 : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_051() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_052() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_053() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_054() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_055() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_056() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_057() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_058() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_059() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_060() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_061() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_062() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_063() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_064() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_065() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_066() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_067() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_068() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_069() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_070() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_071() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_072() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_073() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_074() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_075() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_076() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_077() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_078() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_079() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_080() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_081() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_082() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 2; - - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_083() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 2; - - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_084() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 2; - - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_085() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_086() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 8; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_087() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 8; - - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_088() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 8; - - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_089() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_090() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 10; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_091() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 10; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_092() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 10; - - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_093() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_094() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 16; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_095() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 16; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_096() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 15; - sal_Int16 radix = 16; - - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_097() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_098() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 4; - sal_Int16 radix = 36; - - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_099() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 8; - sal_Int16 radix = 36; - - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_100() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = 35; - sal_Int16 radix = 36; - - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_007_Int64 ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST( append_051 ); CPPUNIT_TEST( append_052 ); - CPPUNIT_TEST( append_053 ); CPPUNIT_TEST( append_054 ); - CPPUNIT_TEST( append_055 ); CPPUNIT_TEST( append_056 ); - CPPUNIT_TEST( append_057 ); CPPUNIT_TEST( append_058 ); - CPPUNIT_TEST( append_059 ); CPPUNIT_TEST( append_060 ); - CPPUNIT_TEST( append_061 ); CPPUNIT_TEST( append_062 ); - CPPUNIT_TEST( append_063 ); CPPUNIT_TEST( append_064 ); - CPPUNIT_TEST( append_065 ); CPPUNIT_TEST( append_066 ); - CPPUNIT_TEST( append_067 ); CPPUNIT_TEST( append_068 ); - CPPUNIT_TEST( append_069 ); CPPUNIT_TEST( append_070 ); - CPPUNIT_TEST( append_071 ); CPPUNIT_TEST( append_072 ); - CPPUNIT_TEST( append_073 ); CPPUNIT_TEST( append_074 ); - CPPUNIT_TEST( append_075 ); CPPUNIT_TEST( append_076 ); - CPPUNIT_TEST( append_077 ); CPPUNIT_TEST( append_078 ); - CPPUNIT_TEST( append_079 ); CPPUNIT_TEST( append_080 ); - CPPUNIT_TEST( append_081 ); CPPUNIT_TEST( append_082 ); - CPPUNIT_TEST( append_083 ); CPPUNIT_TEST( append_084 ); - CPPUNIT_TEST( append_085 ); CPPUNIT_TEST( append_086 ); - CPPUNIT_TEST( append_087 ); CPPUNIT_TEST( append_088 ); - CPPUNIT_TEST( append_089 ); CPPUNIT_TEST( append_090 ); - CPPUNIT_TEST( append_091 ); CPPUNIT_TEST( append_092 ); - CPPUNIT_TEST( append_093 ); CPPUNIT_TEST( append_094 ); - CPPUNIT_TEST( append_095 ); CPPUNIT_TEST( append_096 ); - CPPUNIT_TEST( append_097 ); CPPUNIT_TEST( append_098 ); - CPPUNIT_TEST( append_099 ); CPPUNIT_TEST( append_100 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int64 i, sal_Int16 radix=2 ) -// where i = large constants -// testing the method append( sal_Int64 i, sal_Int16 radix=8 ) -// where i = large constants -// testing the method append( sal_Int64 i, sal_Int16 radix=10 ) -// where i = large constants -// testing the method append( sal_Int64 i, sal_Int16 radix=16 ) -// where i = large constants -// testing the method append( sal_Int64 i, sal_Int16 radix=36 ) -// where i = large constants -//------------------------------------------------------------------------ - class append_007_Int64_Bounderies : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 2; - - expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 8; - - expVal += OString( "777777777777777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 10; - - expVal += OString( "9223372036854775807" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffffffffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 36; - - expVal += OString( "1y2p0ij32e8e7" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 2; - - expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 8; - - expVal += OString( "777777777777777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 10; - - expVal += OString( "9223372036854775807" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffffffffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 36; - - expVal += OString( "1y2p0ij32e8e7" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 2; - - expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 8; - - expVal += OString( "777777777777777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 10; - - expVal += OString( "9223372036854775807" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffffffffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 36; - - expVal += OString( "1y2p0ij32e8e7" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 2; - - expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 8; - - expVal += OString( "777777777777777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 10; - - expVal += OString( "9223372036854775807" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffffffffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 36; - - expVal += OString( "1y2p0ij32e8e7" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 2; - - expVal += OString( "1111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 2; - - expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 8; - - expVal += OString( "177" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 8; - - expVal += OString( "777777777777777777777" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 10; - - expVal += OString( "127" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 10; - - expVal += OString( "9223372036854775807" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 16; - - expVal += OString( "7f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 16; - - expVal += OString( "7fffffffffffffff" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt8Max; - sal_Int16 radix = 36; - - expVal += OString( "3j" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = kSInt64Max; - sal_Int16 radix = 36; - - expVal += OString( "1y2p0ij32e8e7" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_007_Int64_Bounderies ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int64 i, sal_Int16 radix=2 ) -// for negative value -// testing the method append( sal_Int64 i, sal_Int16 radix=8 ) -// for negative value -// testing the method append( sal_Int64 i, sal_Int16 radix=10 ) -// for negative value -// testing the method append( sal_Int64 i, sal_Int16 radix=16 ) -// for negative value -// testing the method append( sal_Int64 i, sal_Int16 radix=36 ) -// for negative value -//------------------------------------------------------------------------ - class append_007_Int64_Negative : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_036() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_043() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_044() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_045() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_046() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_047() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_048() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_049() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_050() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_051() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_052() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_053() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_054() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_055() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_056() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_057() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_058() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_059() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_060() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_061() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_062() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_063() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_064() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_065() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_066() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_067() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_068() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_069() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_070() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_071() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_072() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_073() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_074() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_075() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_076() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_077() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_078() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_079() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_080() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_081() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 2; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_082() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "100" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_083() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1000" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_084() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 2; - - expVal += OString( "-" ); - expVal += OString( "1111" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_085() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 8; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_086() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_087() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "10" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_088() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 8; - - expVal += OString( "-" ); - expVal += OString( "17" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_089() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 10; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_090() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_091() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_092() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 10; - - expVal += OString( "-" ); - expVal += OString( "15" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_093() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 16; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_094() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_095() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_096() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -15; - sal_Int16 radix = 16; - - expVal += OString( "-" ); - expVal += OString( "f" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_097() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -0; - sal_Int16 radix = 36; - - expVal += OString( "0" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_098() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -4; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "4" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_099() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -8; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "8" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_100() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( aStrBuf.getStr() ); - sal_Int64 input = -35; - sal_Int16 radix = 36; - - expVal += OString( "-" ); - expVal += OString( "z" ); - aStrBuf.append( input, radix ); - - CPPUNIT_ASSERT_MESSAGE - ( - "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]", - aStrBuf.getStr()== expVal && - aStrBuf.getLength() == expVal.getLength() - ); - - } - - CPPUNIT_TEST_SUITE( append_007_Int64_Negative ); - CPPUNIT_TEST( append_001 ); CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); CPPUNIT_TEST( append_030 ); - CPPUNIT_TEST( append_031 ); CPPUNIT_TEST( append_032 ); - CPPUNIT_TEST( append_033 ); CPPUNIT_TEST( append_034 ); - CPPUNIT_TEST( append_035 ); CPPUNIT_TEST( append_036 ); - CPPUNIT_TEST( append_037 ); CPPUNIT_TEST( append_038 ); - CPPUNIT_TEST( append_039 ); CPPUNIT_TEST( append_040 ); - CPPUNIT_TEST( append_041 ); CPPUNIT_TEST( append_042 ); - CPPUNIT_TEST( append_043 ); CPPUNIT_TEST( append_044 ); - CPPUNIT_TEST( append_045 ); CPPUNIT_TEST( append_046 ); - CPPUNIT_TEST( append_047 ); CPPUNIT_TEST( append_048 ); - CPPUNIT_TEST( append_049 ); CPPUNIT_TEST( append_050 ); - CPPUNIT_TEST( append_051 ); CPPUNIT_TEST( append_052 ); - CPPUNIT_TEST( append_053 ); CPPUNIT_TEST( append_054 ); - CPPUNIT_TEST( append_055 ); CPPUNIT_TEST( append_056 ); - CPPUNIT_TEST( append_057 ); CPPUNIT_TEST( append_058 ); - CPPUNIT_TEST( append_059 ); CPPUNIT_TEST( append_060 ); - CPPUNIT_TEST( append_061 ); CPPUNIT_TEST( append_062 ); - CPPUNIT_TEST( append_063 ); CPPUNIT_TEST( append_064 ); - CPPUNIT_TEST( append_065 ); CPPUNIT_TEST( append_066 ); - CPPUNIT_TEST( append_067 ); CPPUNIT_TEST( append_068 ); - CPPUNIT_TEST( append_069 ); CPPUNIT_TEST( append_070 ); - CPPUNIT_TEST( append_071 ); CPPUNIT_TEST( append_072 ); - CPPUNIT_TEST( append_073 ); CPPUNIT_TEST( append_074 ); - CPPUNIT_TEST( append_075 ); CPPUNIT_TEST( append_076 ); - CPPUNIT_TEST( append_077 ); CPPUNIT_TEST( append_078 ); - CPPUNIT_TEST( append_079 ); CPPUNIT_TEST( append_080 ); - CPPUNIT_TEST( append_081 ); CPPUNIT_TEST( append_082 ); - CPPUNIT_TEST( append_083 ); CPPUNIT_TEST( append_084 ); - CPPUNIT_TEST( append_085 ); CPPUNIT_TEST( append_086 ); - CPPUNIT_TEST( append_087 ); CPPUNIT_TEST( append_088 ); - CPPUNIT_TEST( append_089 ); CPPUNIT_TEST( append_090 ); - CPPUNIT_TEST( append_091 ); CPPUNIT_TEST( append_092 ); - CPPUNIT_TEST( append_093 ); CPPUNIT_TEST( append_094 ); - CPPUNIT_TEST( append_095 ); CPPUNIT_TEST( append_096 ); - CPPUNIT_TEST( append_097 ); CPPUNIT_TEST( append_098 ); - CPPUNIT_TEST( append_099 ); CPPUNIT_TEST( append_100 ); - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( sal_Int64 i, sal_Int16 radix ) where radix = -5 -//------------------------------------------------------------------------ - class append_007_Int64_WrongRadix : public CppUnit::TestFixture - { - OString* arrOUS[5]; - sal_Int64 intVal; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - intVal = 11; - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr59 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[0]", - sal_True - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[1]", - sal_True - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[2]", - sal_True - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[3]", - sal_True - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr61 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer arrOUS[4]", - sal_True - ); - - } -#ifdef WITH_CORE - void append_006() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr60 ); - - aStrBuf.append( intVal, -5 ); - - CPPUNIT_ASSERT_MESSAGE - ( - "Appends the WrongRadix to the string buffer(with INT_MAX)", - sal_True - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_007_Int64_WrongRadix ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_006 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ - class append_007_Int64_defaultParam : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr59 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer[0]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr62 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OStringBuffer[0]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr63 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OStringBuffer[0]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr116 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer[0]+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr117 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer[0]+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr60 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer[1]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr66 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OStringBuffer[1]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr67 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OStringBuffer[1]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr118 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer[1]+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr119 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer[1]+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr60 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer[2]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr66 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OUStringBuffer[2]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr67 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OUStringBuffer[2]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr118 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer[2]+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr119 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer[2]+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr60 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer[3]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr66 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OStringBuffer[3]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr67 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OStringBuffer[3]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr118 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer[3]+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr119 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer[3]+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr61 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer[4]+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr70 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OStringBuffer[4]+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr71 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OStringBuffer[4]+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr120 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer[4]+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr121 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer[4]+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_026() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr60 ); - sal_Int64 input = 11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 11 and return OStringBuffer(kSInt64Max)+11", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr66 ); - sal_Int64 input = 0; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 0 and return OStringBuffer(kSInt64Max)+0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr67 ); - sal_Int64 input = -11; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -11 and return OStringBuffer(kSInt64Max)+(-11)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr118 ); - sal_Int64 input = 9223372036854775807; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 9223372036854775807 and return OStringBuffer(kSInt64Max)+9223372036854775807", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( kSInt64Max ); - OString expVal( kTestStr119 ); - sal_Int64 input = kNonSInt64Max; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "input Int64 -9223372036854775808 and return OStringBuffer(kSInt64Max)+(-9223372036854775808)", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_007_Int64_defaultParam ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( float f ) -//------------------------------------------------------------------------ - class append_008_float : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr74 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr75 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr76 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr77 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr78 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr79 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr80 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr81 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr82 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr83 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr84 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr85 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr86 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr87 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr81 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr82 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr83 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr84 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr85 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr86 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr87 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr81 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr82 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr83 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr84 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr85 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr86 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr87 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr88 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr89 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr90 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr91 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr92 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr93 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr94 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_036() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr81 ); - float input = (float)atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr82 ); - float input = (float)atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr83 ); - float input = (float)atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr84 ); - float input = (float)atof("3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr85 ); - float input = (float)atof("3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr86 ); - float input = (float)atof("3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr87 ); - float input = (float)atof("3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_008_float ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( float f ) for negative value -//------------------------------------------------------------------------ - class append_008_Float_Negative : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr95 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr96 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr97 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr98 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr99 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr100 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr101 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr102 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr103 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr104 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr105 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr106 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr107 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr108 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr102 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr103 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr104 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr105 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr106 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr107 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr108 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr102 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr103 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr104 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr105 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr106 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr107 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr108 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr109 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr110 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr111 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr112 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr113 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr114 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr115 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_036() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr102 ); - float input = (float)atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr103 ); - float input = (float)atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr104 ); - float input = (float)atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr105 ); - float input = (float)atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr106 ); - float input = (float)atof("-3.141592"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.141592", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr107 ); - float input = (float)atof("-3.5025255"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.5025255", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr108 ); - float input = (float)atof("-3.00390625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.0039062", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_008_Float_Negative ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( double d ) -//------------------------------------------------------------------------ -/* - class append_009_double : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr74 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr75 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr76 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr122 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr123 ); - double input = atof("3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr124 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr125 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr81 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr82 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr83 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr126 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr127 ); - double input = atof("3.141592653589793"); - - aStrBuf.append( input ); - OString *result = new OString( aStrBuf.getStr()); - double output = result->toDouble(); - OString *final = new OString(); - *final = final->valueOf(output); -printf("the OStringvalus is:"); -for(int m=0;m<final->getLength();m++) -{ - printf("%c",final->pData->buffer[m]); -} -printf("\n"); -printf("the OStringBuffer is %d\n", aStrBuf.getLength()); -printf("the expVal is %d\n", expVal.getLength()); -printf("the OStringbuffervalus is:"); -for(int j=0;j<aStrBuf.getLength();j++) -{ - printf("%c",*(aStrBuf.getStr()+j)); -} -printf("\n"); -printf("the expVlavalus is:"); -for(int k=0;k<expVal.getLength();k++) -{ - printf("%c",expVal.pData->buffer[k]); -} -printf("\n"); - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr128 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr129 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr81 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr82 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr83 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr126 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr127 ); - double input = atof("3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr128 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr129 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr81 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr82 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr83 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr126 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr127 ); - double input = atof("3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr128 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr129 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr88 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr89 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr90 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr130 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr131 ); - double input = atof("3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr132 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr133 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_036() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr81 ); - double input = atof("3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr82 ); - double input = atof("3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr83 ); - double input = atof("3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr126 ); - double input = atof("3.1415926535"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.1415926535", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr127 ); - double input = atof("3.141592653589793"; - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr128 ); - double input = atof("3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr129 ); - double input = atof("3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append 3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_009_double ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - }; -//------------------------------------------------------------------------ -// testing the method append( double f ) for negative value -//------------------------------------------------------------------------ - class append_009_Double_Negative : public CppUnit::TestFixture - { - OString* arrOUS[5]; - - public: - void setUp() - { - arrOUS[0] = new OString( kTestStr7 ); - arrOUS[1] = new OString( ); - arrOUS[2] = new OString( kTestStr25 ); - arrOUS[3] = new OString( "\0" ); - arrOUS[4] = new OString( kTestStr28 ); - - } - - void tearDown() - { - delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; - delete arrOUS[3]; delete arrOUS[4]; - } - - void append_001() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr95 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_002() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr96 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_003() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr97 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_004() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr98 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_005() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr134 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_006() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr135 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_007() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - OString expVal( kTestStr136 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[0] append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_008() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr102 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_009() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr103 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_010() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr104 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - OString *result = new OString( aStrBuf.getStr()); - double output = result->toDouble(); - OString *final = new OString(); - *final = final->valueOf(output); -printf("the OStringvalus is:"); -for(int m=0;m<final->getLength();m++) -{ - printf("%c",final->pData->buffer[m]); -} -printf("\n"); -printf("the OStringBuffer is %d\n", aStrBuf.getLength()); -printf("the expVal is %d\n", expVal.getLength()); -printf("the OStringbuffervalus is:"); -for(int j=0;j<aStrBuf.getLength();j++) -{ - printf("%c",*(aStrBuf.getStr()+j)); -} -printf("\n"); -printf("the expVlavalus is:"); -for(int k=0;k<expVal.getLength();k++) -{ - printf("%c",expVal.pData->buffer[k]); -} -printf("\n"); - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_011() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr105 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - double output = atof("-3.50252"); - OString *final = new OString(); - *final = final->valueOf(output); -printf("the OStringvalus is:"); -for(int m=0;m<final->getLength();m++) -{ - printf("%c",final->pData->buffer[m]); -} -printf("\n"); -printf("the OStringBuffer is %d\n", aStrBuf.getLength()); -printf("the expVal is %d\n", expVal.getLength()); -printf("the OStringbuffervalus is:"); -for(int j=0;j<aStrBuf.getLength();j++) -{ - printf("%c",*(aStrBuf.getStr()+j)); -} -printf("\n"); -printf("the expVlavalus is:"); -for(int k=0;k<expVal.getLength();k++) -{ - printf("%c",expVal.pData->buffer[k]); -} -printf("\n"); - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_012() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr137 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_013() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr138 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_014() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - OString expVal( kTestStr139 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_015() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr102 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_016() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr103 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_017() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr104 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_018() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr105 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_019() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr137 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_020() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr138 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_021() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - OString expVal( kTestStr139 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[2] append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_022() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr102 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_023() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr103 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_024() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr104 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_025() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr105 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_026() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr137 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_027() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr138 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[1] append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_028() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - OString expVal( kTestStr139 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[3] append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_029() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr109 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_030() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr110 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_031() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr111 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_032() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr112 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_033() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr140 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_034() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr141 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_035() - { - ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); - OString expVal( kTestStr142 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "arrOUS[4] append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#ifdef WITH_CORE - void append_036() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr102 ); - double input = atof("-3.0"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.0", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_037() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr103 ); - double input = atof("-3.5"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.5", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_038() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr104 ); - double input = atof("-3.0625"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.0625", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_039() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr105 ); - double input = atof("-3.502525"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.502525", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_040() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr137 ); - double input = atof("-3.141592653589793"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.141592653589793", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_041() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr138 ); - double input = atof("-3.14159265358979323"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.14159265358979323", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } - - void append_042() - { - ::rtl::OStringBuffer aStrBuf( kSInt32Max ); - OString expVal( kTestStr139 ); - double input = atof("-3.141592653589793238462643"); - - aStrBuf.append( input ); - - CPPUNIT_ASSERT_MESSAGE - ( - "OStringBuffer( kSInt32Max ) append -3.141592653589793238462643", - aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength() - ); - - } -#endif - - CPPUNIT_TEST_SUITE( append_009_Double_Negative ); - CPPUNIT_TEST( append_001 ); - CPPUNIT_TEST( append_002 ); - CPPUNIT_TEST( append_003 ); - CPPUNIT_TEST( append_004 ); - CPPUNIT_TEST( append_005 ); - CPPUNIT_TEST( append_006 ); - CPPUNIT_TEST( append_007 ); - CPPUNIT_TEST( append_008 ); - CPPUNIT_TEST( append_009 ); - CPPUNIT_TEST( append_010 ); - CPPUNIT_TEST( append_011 ); - CPPUNIT_TEST( append_012 ); - CPPUNIT_TEST( append_013 ); - CPPUNIT_TEST( append_014 ); - CPPUNIT_TEST( append_015 ); - CPPUNIT_TEST( append_016 ); - CPPUNIT_TEST( append_017 ); - CPPUNIT_TEST( append_018 ); - CPPUNIT_TEST( append_019 ); - CPPUNIT_TEST( append_020 ); - CPPUNIT_TEST( append_021 ); - CPPUNIT_TEST( append_022 ); - CPPUNIT_TEST( append_023 ); - CPPUNIT_TEST( append_024 ); - CPPUNIT_TEST( append_025 ); -#ifdef WITH_CORE - CPPUNIT_TEST( append_026 ); - CPPUNIT_TEST( append_027 ); - CPPUNIT_TEST( append_028 ); - CPPUNIT_TEST( append_029 ); - CPPUNIT_TEST( append_030 ); -#endif - CPPUNIT_TEST_SUITE_END(); - };*/ -} // namespace rtl_OStringBuffer - - -// ----------------------------------------------------------------------------- -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; diff --git a/sal/qa/OStringBuffer/rtl_String_Const.h b/sal/qa/OStringBuffer/rtl_String_Const.h deleted file mode 100644 index b45e38791b76..000000000000 --- a/sal/qa/OStringBuffer/rtl_String_Const.h +++ /dev/null @@ -1,1425 +0,0 @@ -/************************************************************************* - * - * $RCSfile: rtl_String_Const.h,v $ - * - * $Revision: 1.4 $ - * - * last change: $Author: lla $ $Date: 2003-03-10 11:04:08 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 - * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 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 - * - * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. - * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. - * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. - * - * Copyright: 2000 by Sun Microsystems, Inc. - * - * All Rights Reserved. - * - * Contributor(s): _______________________________________ - * - * - ************************************************************************/ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _RTL_STRING_CONST_H_ -#define _RTL_STRING_CONST_H_ - -#ifndef _RTL_STRING_UTILS_HXX_ - #include <rtl_String_Utils.hxx> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#include <limits.h> - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _SAL_TYPES_H_ - #include <sal/types.h> -#endif - -#ifndef _RTL_TEXTENC_H - #include <rtl/textenc.h> -#endif - -#ifndef _RTL_USTRING_H_ - #include <rtl/ustring.h> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifdef __cplusplus -extern "C" -{ -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const rtl_TextEncoding kEncodingRTLTextUSASCII = RTL_TEXTENCODING_ASCII_US; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_uInt32 kConvertFlagsOUStringToOString = OUSTRING_TO_OSTRING_CVTFLAGS; -static const sal_uInt32 kConvertFlagsOStringToOUString = OSTRING_TO_OUSTRING_CVTFLAGS; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Char *kTestStr1 = "Sun Microsystems"; -static const sal_Char *kTestStr2 = "Sun Microsystems Java Technology"; -static const sal_Char *kTestStr3 = "Sun microsystems"; -static const sal_Char *kTestStr4 = "SUN MICROSYSTEMS"; -static const sal_Char *kTestStr5 = "sun microsystems"; -static const sal_Char *kTestStr6 = "Java Technology"; -static const sal_Char *kTestStr7 = "Sun "; -static const sal_Char *kTestStr8 = "Microsystems"; -static const sal_Char *kTestStr9 = "sun microsystems java technology"; -static const sal_Char *kTestStr10 = " Sun Microsystems"; -static const sal_Char *kTestStr11 = "Sun Microsystems "; -static const sal_Char *kTestStr12 = " Sun Microsystems "; -static const sal_Char *kTestStr13 = "Sun Microsystems "; -static const sal_Char *kTestStr14 = " Sun Microsystems"; -static const sal_Char *kTestStr15 = " Sun Microsystems "; -static const sal_Char *kTestStr16 = " Sun Microsystems "; -static const sal_Char *kTestStr17 = " Sun Microsystems "; -static const sal_Char *kTestStr18 = "sUN MICROsYsTEMs"; -static const sal_Char *kTestStr19 = "---Sun-Microsystems---"; -static const sal_Char *kTestStr20 = "sun"; -static const sal_Char *kTestStr21 = "SUN"; -static const sal_Char *kTestStr22 = "SUN MICROSYSTEMS JAVA TECHNOLOGY"; -static const sal_Char *kTestStr23 = " Java Technology"; -static const sal_Char *kTestStr24 = "Sun Microsystems Java Technolog"; -static const sal_Char *kTestStr25 = ""; -static const sal_Char *kTestStr26 = " Mic"; -static const sal_Char *kTestStr27 = "s"; -static const sal_Char *kTestStr28 = "\50\3\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr29 = "\50\3\5\7\11\13\15\17sun\21\23\25\27\31\33\50"; -static const sal_Char *kTestStr30 = "sun\21\23\25\27\31\33\50"; -static const sal_Char *kTestStr31 = "sun Microsystems"; -static const sal_Char *kTestStr32 = "Sun Microsystem "; -static const sal_Char *kTestStr33 = " "; -static const sal_Char *kTestStr34 = "\50\5\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr35 = "\50\373\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr36 = "Microsystems Java Technology"; -static const sal_Char *kTestStr37 = "Sun Java Technology"; -static const sal_Char *kTestStr38 = "\21\23\25\27\31\33\50"; -static const sal_Char *kTestStr39 = "\50\3\5\7\11\13\15\17sun Sun Microsystems "; -static const sal_Char *kTestStr40 = "\50\3\5\7\11\13\15\17sunsun Microsystems"; -static const sal_Char *kTestStr41 = "Sun"; -static const sal_Char *kTestStr42 = "\50\3\5\7\11\13\15\17su"; -static const sal_Char *kTestStr43 = "\50\3\5\7\11\13\15\17sun\256\345"; -static const sal_Char *kTestStr44 = "\256\345"; -static const sal_Char *kTestStr45 = "Sun true"; -static const sal_Char *kTestStr46 = "Sun false"; -static const sal_Char *kTestStr47 = "true"; -static const sal_Char *kTestStr48 = "false"; -static const sal_Char *kTestStr49 = "\50\3\5\7\11\13\15\17suntrue"; -static const sal_Char *kTestStr50 = "\50\3\5\7\11\13\15\17sunfalse"; -static const sal_Char *kTestStr51 = "Sun M"; -//static const sal_Char *kTestStr52 = "Sun \077777"; -//static const sal_Char *kTestStr53 = "Sun \100000"; -//static const sal_Char *kTestStr54 = "\77777"; -//static const sal_Char *kTestStr55 = "\100000"; -static const sal_Char *kTestStr56 = "\50\3\5\7\11\13\15\17suns"; -//static const sal_Char *kTestStr57 = "\50\3\5\7\11\13\15\17sun\77777"; -//static const sal_Char *kTestStr58 = "\50\3\5\7\11\13\15\17sun\10000"; -static const sal_Char *kTestStr59 = "Sun 11"; -static const sal_Char *kTestStr60 = "11"; -static const sal_Char *kTestStr61 = "\50\3\5\7\11\13\15\17sun11"; -static const sal_Char *kTestStr62 = "Sun 0"; -static const sal_Char *kTestStr63 = "Sun -11"; -static const sal_Char *kTestStr64 = "Sun 2147483647"; -static const sal_Char *kTestStr65 = "Sun -2147483648"; -static const sal_Char *kTestStr66 = "0"; -static const sal_Char *kTestStr67 = "-11"; -static const sal_Char *kTestStr68 = "2147483647"; -static const sal_Char *kTestStr69 = "-2147483648"; -static const sal_Char *kTestStr70 = "\50\3\5\7\11\13\15\17sun0"; -static const sal_Char *kTestStr71 = "\50\3\5\7\11\13\15\17sun-11"; -static const sal_Char *kTestStr72 = "\50\3\5\7\11\13\15\17sun2147483647"; -static const sal_Char *kTestStr73 = "\50\3\5\7\11\13\15\17sun-2147483648"; -static const sal_Char *kTestStr74 = "Sun 3.0"; -static const sal_Char *kTestStr75 = "Sun 3.5"; -static const sal_Char *kTestStr76 = "Sun 3.0625"; -static const sal_Char *kTestStr77 = "Sun 3.502525"; -static const sal_Char *kTestStr78 = "Sun 3.141592"; -static const sal_Char *kTestStr79 = "Sun 3.5025255"; -static const sal_Char *kTestStr80 = "Sun 3.0039062"; -static const sal_Char *kTestStr81 = "3.0"; -static const sal_Char *kTestStr82 = "3.5"; -static const sal_Char *kTestStr83 = "3.0625"; -static const sal_Char *kTestStr84 = "3.502525"; -static const sal_Char *kTestStr85 = "3.141592"; -static const sal_Char *kTestStr86 = "3.5025255"; -static const sal_Char *kTestStr87 = "3.0039062"; -static const sal_Char *kTestStr88 = "\50\3\5\7\11\13\15\17sun3.0"; -static const sal_Char *kTestStr89 = "\50\3\5\7\11\13\15\17sun3.5"; -static const sal_Char *kTestStr90 = "\50\3\5\7\11\13\15\17sun3.0625"; -static const sal_Char *kTestStr91 = "\50\3\5\7\11\13\15\17sun3.502525"; -static const sal_Char *kTestStr92 = "\50\3\5\7\11\13\15\17sun3.141592"; -static const sal_Char *kTestStr93 = "\50\3\5\7\11\13\15\17sun3.5025255"; -static const sal_Char *kTestStr94 = "\50\3\5\7\11\13\15\17sun3.0039062"; -static const sal_Char *kTestStr95 = "Sun -3.0"; -static const sal_Char *kTestStr96 = "Sun -3.5"; -static const sal_Char *kTestStr97 = "Sun -3.0625"; -static const sal_Char *kTestStr98 = "Sun -3.502525"; -static const sal_Char *kTestStr99 = "Sun -3.141592"; -static const sal_Char *kTestStr100 = "Sun -3.5025255"; -static const sal_Char *kTestStr101 = "Sun -3.0039062"; -static const sal_Char *kTestStr102 = "-3.0"; -static const sal_Char *kTestStr103 = "-3.5"; -static const sal_Char *kTestStr104 = "-3.0625"; -static const sal_Char *kTestStr105 = "-3.502525"; -static const sal_Char *kTestStr106 = "-3.141592"; -static const sal_Char *kTestStr107 = "-3.5025255"; -static const sal_Char *kTestStr108 = "-3.0039062"; -static const sal_Char *kTestStr109 = "\50\3\5\7\11\13\15\17sun-3.0"; -static const sal_Char *kTestStr110 = "\50\3\5\7\11\13\15\17sun-3.5"; -static const sal_Char *kTestStr111 = "\50\3\5\7\11\13\15\17sun-3.0625"; -static const sal_Char *kTestStr112 = "\50\3\5\7\11\13\15\17sun-3.502525"; -static const sal_Char *kTestStr113 = "\50\3\5\7\11\13\15\17sun-3.141592"; -static const sal_Char *kTestStr114 = "\50\3\5\7\11\13\15\17sun-3.5025255"; -static const sal_Char *kTestStr115 = "\50\3\5\7\11\13\15\17sun-3.0039062"; -static const sal_Char *kTestStr116 = "Sun 9223372036854775807"; -static const sal_Char *kTestStr117 = "Sun -9223372036854775808"; -static const sal_Char *kTestStr118 = "9223372036854775807"; -static const sal_Char *kTestStr119 = "-9223372036854775808"; -static const sal_Char *kTestStr120 = "\50\3\5\7\11\13\15\17sun9223372036854775807"; -static const sal_Char *kTestStr121 = "\50\3\5\7\11\13\15\17sun-9223372036854775808"; -static const sal_Char *kTestStr122 = "Sun 3.1415926535"; -static const sal_Char *kTestStr123 = "Sun 3.141592653589793"; -static const sal_Char *kTestStr124 = "Sun 3.14159265358979323"; -static const sal_Char *kTestStr125 = "Sun 3.141592653589793238462643"; -static const sal_Char *kTestStr126 = "3.1415926535"; -static const sal_Char *kTestStr127 = "3.141592653589793"; -static const sal_Char *kTestStr128 = "3.14159265358979323"; -static const sal_Char *kTestStr129 = "3.141592653589793238462643"; -static const sal_Char *kTestStr130 = "\50\3\5\7\11\13\15\17sun3.1415926535"; -static const sal_Char *kTestStr131 = "\50\3\5\7\11\13\15\17sun3.141592653589793"; -static const sal_Char *kTestStr132 = "\50\3\5\7\11\13\15\17sun3.14159265358979323"; -static const sal_Char *kTestStr133 = "\50\3\5\7\11\13\15\17sun3.141592653589793238462643"; -static const sal_Char *kTestStr134 = "Sun -3.141592653589793"; -static const sal_Char *kTestStr135 = "Sun -3.14159265358979323"; -static const sal_Char *kTestStr136 = "Sun -3.141592653589793238462643"; -static const sal_Char *kTestStr137 = "-3.141592653589793"; -static const sal_Char *kTestStr138 = "-3.14159265358979323"; -static const sal_Char *kTestStr139 = "-3.141592653589793238462643"; -static const sal_Char *kTestStr140 = "\50\3\5\7\11\13\15\17sun-3.141592653589793"; -static const sal_Char *kTestStr141 = "\50\3\5\7\11\13\15\17sun-3.14159265358979323"; -static const sal_Char *kTestStr142 = "\50\3\5\7\11\13\15\17sun-3.141592653589793238462643"; -static const sal_Char *kTestStr143 = "Sun \377"; -static const sal_Char *kTestStr144 = "\377"; -static const sal_Char *kTestStr145 = "\50\3\5\7\11\13\15\17sun\377"; -static const sal_Char *kTestStr146 = "Sun Java Technology"; -static const sal_Char *kTestStr147 = "Java Sun Technology"; -static const sal_Char *kTestStr148 = "Java TechnologySun "; -static const sal_Char *kTestStr149 = "Java Sun Microsystems Technology"; -static const sal_Char *kTestStr150 = "Java TechnologySun Microsystems "; -static const sal_Char *kTestStr151 = "Sun MicrosystemsJava Technology"; -static const sal_Char *kTestStr152 = "Java Sun MicrosystemsTechnology"; -static const sal_Char *kTestStr153 = "Java TechnologySun Microsystems"; -static const sal_Char *kTestStr154 = "Sun Sun Microsystems Java Technology"; -static const sal_Char *kTestStr155 = "Sun Sun Microsystems Java Technology"; -static const sal_Char *kTestStr156 = "Sun Microsystems Java TechnologySun "; -static const sal_Char *kTestStr157 = "Sun Microsystems Sun Microsystems Java Technology"; -static const sal_Char *kTestStr158 = "Sun Sun Microsystems Microsystems Java Technology"; -static const sal_Char *kTestStr159 = "Sun Microsystems Java TechnologySun Microsystems "; -static const sal_Char *kTestStr160 = "Sun MicrosystemsSun Microsystems Java Technology"; -static const sal_Char *kTestStr161 = "Sun Sun MicrosystemsMicrosystems Java Technology"; -static const sal_Char *kTestStr162 = "Sun Microsystems Java TechnologySun Microsystems"; -static const sal_Char *kTestStr163 = "Sun \50\3\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr164 = "\50\3\5\7Sun \11\13\15\17sun"; -static const sal_Char *kTestStr165 = "\50\3\5\7\11\13\15\17sunSun "; -static const sal_Char *kTestStr166 = "Sun Microsystems \50\3\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr167 = "\50\3\5\7Sun Microsystems \11\13\15\17sun"; -static const sal_Char *kTestStr168 = "\50\3\5\7\11\13\15\17sunSun Microsystems "; -static const sal_Char *kTestStr169 = "Sun Microsystems\50\3\5\7\11\13\15\17sun"; -static const sal_Char *kTestStr170 = "\50\3\5\7Sun Microsystems\11\13\15\17sun"; -static const sal_Char *kTestStr171 = "\50\3\5\7\11\13\15\17sunSun Microsystems"; -static const sal_Char *kTestStr1PlusStr6 = "Sun Microsystems" "Java Technology"; - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int32 kTestStr1Len = 16; -static const sal_Int32 kTestStr2Len = 32; -static const sal_Int32 kTestStr3Len = 16; -static const sal_Int32 kTestStr4Len = 16; -static const sal_Int32 kTestStr5Len = 16; -static const sal_Int32 kTestStr6Len = 15; -static const sal_Int32 kTestStr7Len = 4; -static const sal_Int32 kTestStr8Len = 12; -static const sal_Int32 kTestStr9Len = 32; -static const sal_Int32 kTestStr10Len = 17; -static const sal_Int32 kTestStr11Len = 17; -static const sal_Int32 kTestStr12Len = 18; -static const sal_Int32 kTestStr13Len = 19; -static const sal_Int32 kTestStr14Len = 19; -static const sal_Int32 kTestStr15Len = 20; -static const sal_Int32 kTestStr16Len = 20; -static const sal_Int32 kTestStr17Len = 22; -static const sal_Int32 kTestStr18Len = 16; -static const sal_Int32 kTestStr19Len = 22; -static const sal_Int32 kTestStr20Len = 3; -static const sal_Int32 kTestStr21Len = 3; -static const sal_Int32 kTestStr22Len = 32; -static const sal_Int32 kTestStr23Len = 16; -static const sal_Int32 kTestStr24Len = 31; -static const sal_Int32 kTestStr25Len = 0; -static const sal_Int32 kTestStr26Len = 4; -static const sal_Int32 kTestStr27Len = 1; -static const sal_Int32 kTestStr28Len = 11; -static const sal_Int32 kTestStr29Len = 18; -static const sal_Int32 kTestStr30Len = 10; -static const sal_Int32 kTestStr31Len = 16; -static const sal_Int32 kTestStr32Len = 16; -static const sal_Int32 kTestStr33Len = 1; -static const sal_Int32 kTestStr34Len = 11; -static const sal_Int32 kTestStr35Len = 11; -static const sal_Int32 kTestStr36Len = 28; -static const sal_Int32 kTestStr37Len = 20; -static const sal_Int32 kTestStr38Len = 7; -static const sal_Int32 kTestStr39Len = 33; -static const sal_Int32 kTestStr40Len = 27; -static const sal_Int32 kTestStr41Len = 3; -static const sal_Int32 kTestStr42Len = 10; -static const sal_Int32 kTestStr43Len = 13; -static const sal_Int32 kTestStr44Len = 2; -static const sal_Int32 kTestStr45Len = 8; -static const sal_Int32 kTestStr46Len = 9; -static const sal_Int32 kTestStr47Len = 4; -static const sal_Int32 kTestStr48Len = 5; -static const sal_Int32 kTestStr49Len = 15; -static const sal_Int32 kTestStr50Len = 16; -static const sal_Int32 kTestStr51Len = 5; -static const sal_Int32 kTestStr52Len = 5; -static const sal_Int32 kTestStr53Len = 5; -static const sal_Int32 kTestStr54Len = 1; -static const sal_Int32 kTestStr55Len = 1; -static const sal_Int32 kTestStr56Len = 12; -static const sal_Int32 kTestStr57Len = 12; -static const sal_Int32 kTestStr58Len = 12; -static const sal_Int32 kTestStr59Len = 6; -static const sal_Int32 kTestStr60Len = 2; -static const sal_Int32 kTestStr61Len = 13; -static const sal_Int32 kTestStr62Len = 5; -static const sal_Int32 kTestStr63Len = 7; -static const sal_Int32 kTestStr64Len = 14; -static const sal_Int32 kTestStr65Len = 15; -static const sal_Int32 kTestStr66Len = 1; -static const sal_Int32 kTestStr67Len = 3; -static const sal_Int32 kTestStr68Len = 10; -static const sal_Int32 kTestStr69Len = 11; -static const sal_Int32 kTestStr70Len = 12; -static const sal_Int32 kTestStr71Len = 14; -static const sal_Int32 kTestStr72Len = 21; -static const sal_Int32 kTestStr73Len = 22; -static const sal_Int32 kTestStr74Len = 7; -static const sal_Int32 kTestStr75Len = 7; -static const sal_Int32 kTestStr76Len = 10; -static const sal_Int32 kTestStr77Len = 12; -static const sal_Int32 kTestStr78Len = 12; -static const sal_Int32 kTestStr79Len = 13; -static const sal_Int32 kTestStr80Len = 13; -static const sal_Int32 kTestStr81Len = 3; -static const sal_Int32 kTestStr82Len = 3; -static const sal_Int32 kTestStr83Len = 6; -static const sal_Int32 kTestStr84Len = 8; -static const sal_Int32 kTestStr85Len = 8; -static const sal_Int32 kTestStr86Len = 9; -static const sal_Int32 kTestStr87Len = 9; -static const sal_Int32 kTestStr88Len = 14; -static const sal_Int32 kTestStr89Len = 14; -static const sal_Int32 kTestStr90Len = 17; -static const sal_Int32 kTestStr91Len = 19; -static const sal_Int32 kTestStr92Len = 19; -static const sal_Int32 kTestStr93Len = 20; -static const sal_Int32 kTestStr94Len = 20; -static const sal_Int32 kTestStr95Len = 8; -static const sal_Int32 kTestStr96Len = 8; -static const sal_Int32 kTestStr97Len = 11; -static const sal_Int32 kTestStr98Len = 13; -static const sal_Int32 kTestStr99Len = 13; -static const sal_Int32 kTestStr100Len = 14; -static const sal_Int32 kTestStr101Len = 14; -static const sal_Int32 kTestStr102Len = 4; -static const sal_Int32 kTestStr103Len = 4; -static const sal_Int32 kTestStr104Len = 7; -static const sal_Int32 kTestStr105Len = 9; -static const sal_Int32 kTestStr106Len = 9; -static const sal_Int32 kTestStr107Len = 10; -static const sal_Int32 kTestStr108Len = 10; -static const sal_Int32 kTestStr109Len = 15; -static const sal_Int32 kTestStr110Len = 15; -static const sal_Int32 kTestStr111Len = 18; -static const sal_Int32 kTestStr112Len = 20; -static const sal_Int32 kTestStr113Len = 20; -static const sal_Int32 kTestStr114Len = 21; -static const sal_Int32 kTestStr115Len = 21; -static const sal_Int32 kTestStr116Len = 23; -static const sal_Int32 kTestStr117Len = 24; -static const sal_Int32 kTestStr118Len = 19; -static const sal_Int32 kTestStr119Len = 20; -static const sal_Int32 kTestStr120Len = 30; -static const sal_Int32 kTestStr121Len = 31; -static const sal_Int32 kTestStr122Len = 16; -static const sal_Int32 kTestStr123Len = 21; -static const sal_Int32 kTestStr124Len = 23; -static const sal_Int32 kTestStr125Len = 30; -static const sal_Int32 kTestStr126Len = 12; -static const sal_Int32 kTestStr127Len = 17; -static const sal_Int32 kTestStr128Len = 19; -static const sal_Int32 kTestStr129Len = 26; -static const sal_Int32 kTestStr130Len = 23; -static const sal_Int32 kTestStr131Len = 28; -static const sal_Int32 kTestStr132Len = 30; -static const sal_Int32 kTestStr133Len = 37; -static const sal_Int32 kTestStr134Len = 22; -static const sal_Int32 kTestStr135Len = 24; -static const sal_Int32 kTestStr136Len = 31; -static const sal_Int32 kTestStr137Len = 18; -static const sal_Int32 kTestStr138Len = 20; -static const sal_Int32 kTestStr139Len = 27; -static const sal_Int32 kTestStr140Len = 29; -static const sal_Int32 kTestStr141Len = 31; -static const sal_Int32 kTestStr142Len = 38; -static const sal_Int32 kTestStr143Len = 5; -static const sal_Int32 kTestStr144Len = 1; -static const sal_Int32 kTestStr145Len = 12; -static const sal_Int32 kTestStr146Len = 19; -static const sal_Int32 kTestStr147Len = 19; -static const sal_Int32 kTestStr148Len = 19; -static const sal_Int32 kTestStr149Len = 32; -static const sal_Int32 kTestStr150Len = 32; -static const sal_Int32 kTestStr151Len = 31; -static const sal_Int32 kTestStr152Len = 31; -static const sal_Int32 kTestStr153Len = 31; -static const sal_Int32 kTestStr154Len = 36; -static const sal_Int32 kTestStr155Len = 36; -static const sal_Int32 kTestStr156Len = 36; -static const sal_Int32 kTestStr157Len = 49; -static const sal_Int32 kTestStr158Len = 49; -static const sal_Int32 kTestStr159Len = 49; -static const sal_Int32 kTestStr160Len = 48; -static const sal_Int32 kTestStr161Len = 48; -static const sal_Int32 kTestStr162Len = 48; -static const sal_Int32 kTestStr163Len = 15; -static const sal_Int32 kTestStr164Len = 15; -static const sal_Int32 kTestStr165Len = 15; -static const sal_Int32 kTestStr166Len = 28; -static const sal_Int32 kTestStr167Len = 28; -static const sal_Int32 kTestStr168Len = 28; -static const sal_Int32 kTestStr169Len = 27; -static const sal_Int32 kTestStr170Len = 27; -static const sal_Int32 kTestStr171Len = 27; -static const sal_Int32 kTestStr1PlusStr6Len = kTestStr1Len + kTestStr6Len; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - static sal_Unicode aUStr1[kTestStr1Len+1]; - static sal_Unicode aUStr2[kTestStr2Len+1]; - static sal_Unicode aUStr3[kTestStr3Len+1]; - static sal_Unicode aUStr4[kTestStr4Len+1]; - static sal_Unicode aUStr5[kTestStr5Len+1]; - static sal_Unicode aUStr6[kTestStr6Len+1]; - static sal_Unicode aUStr7[kTestStr7Len+1]; - static sal_Unicode aUStr8[kTestStr8Len+1]; - static sal_Unicode aUStr9[kTestStr9Len+1]; - static sal_Unicode aUStr10[kTestStr10Len+1]; - static sal_Unicode aUStr11[kTestStr11Len+1]; - static sal_Unicode aUStr12[kTestStr12Len+1]; - static sal_Unicode aUStr13[kTestStr13Len+1]; - static sal_Unicode aUStr14[kTestStr14Len+1]; - static sal_Unicode aUStr15[kTestStr15Len+1]; - static sal_Unicode aUStr16[kTestStr16Len+1]; - static sal_Unicode aUStr17[kTestStr17Len+1]; - static sal_Unicode aUStr18[kTestStr18Len+1]; - static sal_Unicode aUStr19[kTestStr19Len+1]; - static sal_Unicode aUStr20[kTestStr20Len+1]; - static sal_Unicode aUStr21[kTestStr21Len+1]; - static sal_Unicode aUStr22[kTestStr22Len+1]; - static sal_Unicode aUStr23[kTestStr23Len+1]; - static sal_Unicode aUStr24[kTestStr24Len+1]; - static sal_Unicode aUStr25[kTestStr25Len+1]; - static sal_Unicode aUStr26[kTestStr26Len+1]; - static sal_Unicode aUStr27[kTestStr27Len+1]; - static sal_Unicode aUStr28[kTestStr28Len+1]; - static sal_Unicode aUStr29[kTestStr29Len+1]; - static sal_Unicode aUStr30[kTestStr30Len+1]; - static sal_Unicode aUStr31[kTestStr31Len+1]; - static sal_Unicode aUStr32[kTestStr32Len+1]; - static sal_Unicode aUStr33[kTestStr33Len+1]; - static sal_Unicode aUStr34[kTestStr34Len+1]; - static sal_Unicode aUStr35[kTestStr35Len+1]; - static sal_Unicode aUStr36[kTestStr36Len+1]; - static sal_Unicode aUStr37[kTestStr37Len+1]; - static sal_Unicode aUStr38[kTestStr38Len+1]; - static sal_Unicode aUStr39[kTestStr39Len+1]; - static sal_Unicode aUStr40[kTestStr40Len+1]; - static sal_Unicode aUStr41[kTestStr41Len+1]; - static sal_Unicode aUStr42[kTestStr42Len+1]; - static sal_Unicode aUStr43[kTestStr43Len+1]; - static sal_Unicode aUStr44[kTestStr44Len+1]; - static sal_Unicode aUStr45[kTestStr45Len+1]; - static sal_Unicode aUStr46[kTestStr46Len+1]; - static sal_Unicode aUStr47[kTestStr47Len+1]; - static sal_Unicode aUStr48[kTestStr48Len+1]; - static sal_Unicode aUStr49[kTestStr49Len+1]; - static sal_Unicode aUStr50[kTestStr50Len+1]; - static sal_Unicode aUStr51[kTestStr51Len+1]; - static sal_Unicode aUStr52[kTestStr52Len+1]={83,117,110,32,32767}; - static sal_Unicode aUStr53[kTestStr53Len+1]={83,117,110,32,-32768}; - static sal_Unicode aUStr54[kTestStr54Len+1]={32767}; - static sal_Unicode aUStr55[kTestStr55Len+1]={-32768}; - static sal_Unicode aUStr56[kTestStr56Len+1]; - static sal_Unicode aUStr57[kTestStr57Len+1]={40,3,5,7,9,11,13,15,115,117,110,32767}; - static sal_Unicode aUStr58[kTestStr58Len+1]={40,3,5,7,9,11,13,15,115,117,110,-32768}; - static sal_Unicode aUStr59[kTestStr59Len+1]; - static sal_Unicode aUStr60[kTestStr60Len+1]; - static sal_Unicode aUStr61[kTestStr61Len+1]; - static sal_Unicode aUStr62[kTestStr62Len+1]; - static sal_Unicode aUStr63[kTestStr63Len+1]; - static sal_Unicode aUStr64[kTestStr64Len+1]; - static sal_Unicode aUStr65[kTestStr65Len+1]; - static sal_Unicode aUStr66[kTestStr66Len+1]; - static sal_Unicode aUStr67[kTestStr67Len+1]; - static sal_Unicode aUStr68[kTestStr68Len+1]; - static sal_Unicode aUStr69[kTestStr69Len+1]; - static sal_Unicode aUStr70[kTestStr70Len+1]; - static sal_Unicode aUStr71[kTestStr71Len+1]; - static sal_Unicode aUStr72[kTestStr72Len+1]; - static sal_Unicode aUStr73[kTestStr73Len+1]; - static sal_Unicode aUStr74[kTestStr74Len+1]; - static sal_Unicode aUStr75[kTestStr75Len+1]; - static sal_Unicode aUStr76[kTestStr76Len+1]; - static sal_Unicode aUStr77[kTestStr77Len+1]; - static sal_Unicode aUStr78[kTestStr78Len+1]; - static sal_Unicode aUStr79[kTestStr79Len+1]; - static sal_Unicode aUStr80[kTestStr80Len+1]; - static sal_Unicode aUStr81[kTestStr81Len+1]; - static sal_Unicode aUStr82[kTestStr82Len+1]; - static sal_Unicode aUStr83[kTestStr83Len+1]; - static sal_Unicode aUStr84[kTestStr84Len+1]; - static sal_Unicode aUStr85[kTestStr85Len+1]; - static sal_Unicode aUStr86[kTestStr86Len+1]; - static sal_Unicode aUStr87[kTestStr87Len+1]; - static sal_Unicode aUStr88[kTestStr88Len+1]; - static sal_Unicode aUStr89[kTestStr89Len+1]; - static sal_Unicode aUStr90[kTestStr90Len+1]; - static sal_Unicode aUStr91[kTestStr91Len+1]; - static sal_Unicode aUStr92[kTestStr92Len+1]; - static sal_Unicode aUStr93[kTestStr93Len+1]; - static sal_Unicode aUStr94[kTestStr94Len+1]; - static sal_Unicode aUStr95[kTestStr95Len+1]; - static sal_Unicode aUStr96[kTestStr96Len+1]; - static sal_Unicode aUStr97[kTestStr97Len+1]; - static sal_Unicode aUStr98[kTestStr98Len+1]; - static sal_Unicode aUStr99[kTestStr99Len+1]; - static sal_Unicode aUStr100[kTestStr100Len+1]; - static sal_Unicode aUStr101[kTestStr101Len+1]; - static sal_Unicode aUStr102[kTestStr102Len+1]; - static sal_Unicode aUStr103[kTestStr103Len+1]; - static sal_Unicode aUStr104[kTestStr104Len+1]; - static sal_Unicode aUStr105[kTestStr105Len+1]; - static sal_Unicode aUStr106[kTestStr106Len+1]; - static sal_Unicode aUStr107[kTestStr107Len+1]; - static sal_Unicode aUStr108[kTestStr108Len+1]; - static sal_Unicode aUStr109[kTestStr109Len+1]; - static sal_Unicode aUStr110[kTestStr110Len+1]; - static sal_Unicode aUStr111[kTestStr111Len+1]; - static sal_Unicode aUStr112[kTestStr112Len+1]; - static sal_Unicode aUStr113[kTestStr113Len+1]; - static sal_Unicode aUStr114[kTestStr114Len+1]; - static sal_Unicode aUStr115[kTestStr115Len+1]; - static sal_Unicode aUStr116[kTestStr116Len+1]; - static sal_Unicode aUStr117[kTestStr117Len+1]; - static sal_Unicode aUStr118[kTestStr118Len+1]; - static sal_Unicode aUStr119[kTestStr119Len+1]; - static sal_Unicode aUStr120[kTestStr120Len+1]; - static sal_Unicode aUStr121[kTestStr121Len+1]; - static sal_Unicode aUStr122[kTestStr122Len+1]; - static sal_Unicode aUStr123[kTestStr123Len+1]; - static sal_Unicode aUStr124[kTestStr124Len+1]; - static sal_Unicode aUStr125[kTestStr125Len+1]; - static sal_Unicode aUStr126[kTestStr126Len+1]; - static sal_Unicode aUStr127[kTestStr127Len+1]; - static sal_Unicode aUStr128[kTestStr128Len+1]; - static sal_Unicode aUStr129[kTestStr129Len+1]; - static sal_Unicode aUStr130[kTestStr130Len+1]; - static sal_Unicode aUStr131[kTestStr131Len+1]; - static sal_Unicode aUStr132[kTestStr132Len+1]; - static sal_Unicode aUStr133[kTestStr133Len+1]; - static sal_Unicode aUStr134[kTestStr134Len+1]; - static sal_Unicode aUStr135[kTestStr135Len+1]; - static sal_Unicode aUStr136[kTestStr136Len+1]; - static sal_Unicode aUStr137[kTestStr137Len+1]; - static sal_Unicode aUStr138[kTestStr138Len+1]; - static sal_Unicode aUStr139[kTestStr139Len+1]; - static sal_Unicode aUStr140[kTestStr140Len+1]; - static sal_Unicode aUStr141[kTestStr141Len+1]; - static sal_Unicode aUStr142[kTestStr142Len+1]; - static sal_Unicode aUStr143[kTestStr143Len+1]; - static sal_Unicode aUStr144[kTestStr144Len+1]; - static sal_Unicode aUStr145[kTestStr145Len+1]; - static sal_Unicode aUStr146[kTestStr146Len+1]; - static sal_Unicode aUStr147[kTestStr147Len+1]; - static sal_Unicode aUStr148[kTestStr148Len+1]; - static sal_Unicode aUStr149[kTestStr149Len+1]; - static sal_Unicode aUStr150[kTestStr150Len+1]; - static sal_Unicode aUStr151[kTestStr151Len+1]; - static sal_Unicode aUStr152[kTestStr152Len+1]; - static sal_Unicode aUStr153[kTestStr153Len+1]; - static sal_Unicode aUStr154[kTestStr154Len+1]; - static sal_Unicode aUStr155[kTestStr155Len+1]; - static sal_Unicode aUStr156[kTestStr156Len+1]; - static sal_Unicode aUStr157[kTestStr157Len+1]; - static sal_Unicode aUStr158[kTestStr158Len+1]; - static sal_Unicode aUStr159[kTestStr159Len+1]; - static sal_Unicode aUStr160[kTestStr160Len+1]; - static sal_Unicode aUStr161[kTestStr161Len+1]; - static sal_Unicode aUStr162[kTestStr162Len+1]; - static sal_Unicode aUStr163[kTestStr163Len+1]; - static sal_Unicode aUStr164[kTestStr164Len+1]; - static sal_Unicode aUStr165[kTestStr165Len+1]; - static sal_Unicode aUStr166[kTestStr166Len+1]; - static sal_Unicode aUStr167[kTestStr167Len+1]; - static sal_Unicode aUStr168[kTestStr168Len+1]; - static sal_Unicode aUStr169[kTestStr169Len+1]; - static sal_Unicode aUStr170[kTestStr170Len+1]; - static sal_Unicode aUStr171[kTestStr171Len+1]; - static sal_Unicode aUStr1PlusUStr6[kTestStr1Len + kTestStr6Len + 1]; - -// we are already in "C" -static sal_Bool SAL_CALL test_ini_uString() -{ - - sal_Bool iniResult= sal_True; - - iniResult &=AStringToUStringNCopy( aUStr1, kTestStr1, kTestStr1Len ); - - iniResult &=AStringToUStringNCopy( aUStr2, kTestStr2, kTestStr2Len ); - - iniResult &=AStringToUStringNCopy( aUStr3, kTestStr3, kTestStr3Len ); - - iniResult &=AStringToUStringNCopy( aUStr4, kTestStr4, kTestStr4Len ); - - iniResult &=AStringToUStringNCopy( aUStr5, kTestStr5, kTestStr5Len ); - - iniResult &=AStringToUStringNCopy( aUStr6, kTestStr6, kTestStr6Len ); - - iniResult &=AStringToUStringNCopy( aUStr7, kTestStr7, kTestStr7Len ); - - iniResult &=AStringToUStringNCopy( aUStr8, kTestStr8, kTestStr8Len ); - - iniResult &=AStringToUStringNCopy( aUStr9, kTestStr9, kTestStr9Len ); - - iniResult &=AStringToUStringNCopy( aUStr10, kTestStr10, kTestStr10Len ); - - iniResult &=AStringToUStringNCopy( aUStr11, kTestStr11, kTestStr11Len ); - - iniResult &=AStringToUStringNCopy( aUStr12, kTestStr12, kTestStr12Len ); - - iniResult &=AStringToUStringNCopy( aUStr13, kTestStr13, kTestStr13Len ); - - iniResult &=AStringToUStringNCopy( aUStr14, kTestStr14, kTestStr14Len ); - - iniResult &=AStringToUStringNCopy( aUStr15, kTestStr15, kTestStr15Len ); - - iniResult &=AStringToUStringNCopy( aUStr16, kTestStr16, kTestStr16Len ); - - iniResult &=AStringToUStringNCopy( aUStr17, kTestStr17, kTestStr17Len ); - - iniResult &=AStringToUStringNCopy( aUStr18, kTestStr18, kTestStr18Len ); - - iniResult &=AStringToUStringNCopy( aUStr19, kTestStr19, kTestStr19Len ); - - iniResult &=AStringToUStringNCopy( aUStr20, kTestStr20, kTestStr20Len ); - - iniResult &=AStringToUStringNCopy( aUStr21, kTestStr21, kTestStr21Len ); - - iniResult &=AStringToUStringNCopy( aUStr22, kTestStr22, kTestStr22Len ); - - iniResult &=AStringToUStringNCopy( aUStr23, kTestStr23, kTestStr23Len ); - - iniResult &=AStringToUStringNCopy( aUStr1PlusUStr6, kTestStr1PlusStr6, kTestStr1PlusStr6Len ); - - iniResult &=AStringToUStringNCopy( aUStr24, kTestStr24, kTestStr24Len ); - - iniResult &=AStringToUStringNCopy( aUStr25, kTestStr25, kTestStr25Len ); - - iniResult &=AStringToUStringNCopy( aUStr26, kTestStr26, kTestStr26Len ); - - iniResult &=AStringToUStringNCopy( aUStr27, kTestStr27, kTestStr27Len ); - - iniResult &=AStringToUStringNCopy( aUStr28, kTestStr28, kTestStr28Len ); - - iniResult &=AStringToUStringNCopy( aUStr29, kTestStr29, kTestStr29Len ); - - iniResult &=AStringToUStringNCopy( aUStr30, kTestStr30, kTestStr30Len ); - - iniResult &=AStringToUStringNCopy( aUStr31, kTestStr31, kTestStr31Len ); - - iniResult &=AStringToUStringNCopy( aUStr32, kTestStr32, kTestStr32Len ); - - iniResult &=AStringToUStringNCopy( aUStr33, kTestStr33, kTestStr33Len ); - - iniResult &=AStringToUStringNCopy( aUStr34, kTestStr34, kTestStr34Len ); - - iniResult &=AStringToUStringNCopy( aUStr35, kTestStr35, kTestStr35Len ); - - iniResult &=AStringToUStringNCopy( aUStr36, kTestStr36, kTestStr36Len ); - - iniResult &=AStringToUStringNCopy( aUStr37, kTestStr37, kTestStr37Len ); - - iniResult &=AStringToUStringNCopy( aUStr38, kTestStr38, kTestStr38Len ); - - iniResult &=AStringToUStringNCopy( aUStr39, kTestStr39, kTestStr39Len ); - - iniResult &=AStringToUStringNCopy( aUStr40, kTestStr40, kTestStr40Len ); - - iniResult &=AStringToUStringNCopy( aUStr41, kTestStr41, kTestStr41Len ); - - iniResult &=AStringToUStringNCopy( aUStr42, kTestStr42, kTestStr42Len ); - - iniResult &=AStringToUStringNCopy( aUStr43, kTestStr43, kTestStr43Len ); - - iniResult &=AStringToUStringNCopy( aUStr44, kTestStr44, kTestStr44Len ); - - iniResult &=AStringToUStringNCopy( aUStr45, kTestStr45, kTestStr45Len ); - - iniResult &=AStringToUStringNCopy( aUStr46, kTestStr46, kTestStr46Len ); - - iniResult &=AStringToUStringNCopy( aUStr47, kTestStr47, kTestStr47Len ); - - iniResult &=AStringToUStringNCopy( aUStr48, kTestStr48, kTestStr48Len ); - - iniResult &=AStringToUStringNCopy( aUStr49, kTestStr49, kTestStr49Len ); - - iniResult &=AStringToUStringNCopy( aUStr50, kTestStr50, kTestStr50Len ); - - iniResult &=AStringToUStringNCopy( aUStr51, kTestStr51, kTestStr51Len ); - - //iniResult &=AStringToUStringNCopy( aUStr52, kTestStr52, kTestStr52Len ); - - // iniResult &=AStringToUStringNCopy( aUStr53, kTestStr53, kTestStr53Len ); - - //iniResult &=AStringToUStringNCopy( aUStr54, kTestStr54, kTestStr54Len ); - - //iniResult &=AStringToUStringNCopy( aUStr55, kTestStr55, kTestStr55Len ); - - iniResult &=AStringToUStringNCopy( aUStr56, kTestStr56, kTestStr56Len ); - - // iniResult &=AStringToUStringNCopy( aUStr57, kTestStr57, kTestStr57Len ); - - //iniResult &=AStringToUStringNCopy( aUStr58, kTestStr58, kTestStr58Len ); - - iniResult &=AStringToUStringNCopy( aUStr59, kTestStr59, kTestStr59Len ); - - iniResult &=AStringToUStringNCopy( aUStr60, kTestStr60, kTestStr60Len ); - - iniResult &=AStringToUStringNCopy( aUStr61, kTestStr61, kTestStr61Len ); - - iniResult &=AStringToUStringNCopy( aUStr62, kTestStr62, kTestStr62Len ); - - iniResult &=AStringToUStringNCopy( aUStr63, kTestStr63, kTestStr63Len ); - - iniResult &=AStringToUStringNCopy( aUStr64, kTestStr64, kTestStr64Len ); - - iniResult &=AStringToUStringNCopy( aUStr65, kTestStr65, kTestStr65Len ); - - iniResult &=AStringToUStringNCopy( aUStr66, kTestStr66, kTestStr66Len ); - - iniResult &=AStringToUStringNCopy( aUStr67, kTestStr67, kTestStr67Len ); - - iniResult &=AStringToUStringNCopy( aUStr68, kTestStr68, kTestStr68Len ); - - iniResult &=AStringToUStringNCopy( aUStr69, kTestStr69, kTestStr69Len ); - - iniResult &=AStringToUStringNCopy( aUStr70, kTestStr70, kTestStr70Len ); - - iniResult &=AStringToUStringNCopy( aUStr71, kTestStr71, kTestStr71Len ); - - iniResult &=AStringToUStringNCopy( aUStr72, kTestStr72, kTestStr72Len ); - - iniResult &=AStringToUStringNCopy( aUStr73, kTestStr73, kTestStr73Len ); - - iniResult &=AStringToUStringNCopy( aUStr74, kTestStr74, kTestStr74Len ); - - iniResult &=AStringToUStringNCopy( aUStr75, kTestStr75, kTestStr75Len ); - - iniResult &=AStringToUStringNCopy( aUStr76, kTestStr76, kTestStr76Len ); - - iniResult &=AStringToUStringNCopy( aUStr77, kTestStr77, kTestStr77Len ); - - iniResult &=AStringToUStringNCopy( aUStr78, kTestStr78, kTestStr78Len ); - - iniResult &=AStringToUStringNCopy( aUStr79, kTestStr79, kTestStr79Len ); - - iniResult &=AStringToUStringNCopy( aUStr80, kTestStr80, kTestStr80Len ); - - iniResult &=AStringToUStringNCopy( aUStr81, kTestStr81, kTestStr81Len ); - - iniResult &=AStringToUStringNCopy( aUStr82, kTestStr82, kTestStr82Len ); - - iniResult &=AStringToUStringNCopy( aUStr83, kTestStr83, kTestStr83Len ); - - iniResult &=AStringToUStringNCopy( aUStr84, kTestStr84, kTestStr84Len ); - - iniResult &=AStringToUStringNCopy( aUStr85, kTestStr85, kTestStr85Len ); - - iniResult &=AStringToUStringNCopy( aUStr86, kTestStr86, kTestStr86Len ); - - iniResult &=AStringToUStringNCopy( aUStr87, kTestStr87, kTestStr87Len ); - - iniResult &=AStringToUStringNCopy( aUStr88, kTestStr88, kTestStr88Len ); - - iniResult &=AStringToUStringNCopy( aUStr89, kTestStr89, kTestStr89Len ); - - iniResult &=AStringToUStringNCopy( aUStr90, kTestStr90, kTestStr90Len ); - - iniResult &=AStringToUStringNCopy( aUStr91, kTestStr91, kTestStr91Len ); - - iniResult &=AStringToUStringNCopy( aUStr92, kTestStr92, kTestStr92Len ); - - iniResult &=AStringToUStringNCopy( aUStr93, kTestStr93, kTestStr93Len ); - - iniResult &=AStringToUStringNCopy( aUStr94, kTestStr94, kTestStr94Len ); - - iniResult &=AStringToUStringNCopy( aUStr95, kTestStr95, kTestStr95Len ); - - iniResult &=AStringToUStringNCopy( aUStr96, kTestStr96, kTestStr96Len ); - - iniResult &=AStringToUStringNCopy( aUStr97, kTestStr97, kTestStr97Len ); - - iniResult &=AStringToUStringNCopy( aUStr98, kTestStr98, kTestStr98Len ); - - iniResult &=AStringToUStringNCopy( aUStr99, kTestStr99, kTestStr99Len ); - - iniResult &=AStringToUStringNCopy( aUStr100, kTestStr100, kTestStr100Len ); - - iniResult &=AStringToUStringNCopy( aUStr101, kTestStr101, kTestStr101Len ); - - iniResult &=AStringToUStringNCopy( aUStr102, kTestStr102, kTestStr102Len ); - - iniResult &=AStringToUStringNCopy( aUStr103, kTestStr103, kTestStr103Len ); - - iniResult &=AStringToUStringNCopy( aUStr104, kTestStr104, kTestStr104Len ); - - iniResult &=AStringToUStringNCopy( aUStr105, kTestStr105, kTestStr105Len ); - - iniResult &=AStringToUStringNCopy( aUStr106, kTestStr106, kTestStr106Len ); - - iniResult &=AStringToUStringNCopy( aUStr107, kTestStr107, kTestStr107Len ); - - iniResult &=AStringToUStringNCopy( aUStr108, kTestStr108, kTestStr108Len ); - - iniResult &=AStringToUStringNCopy( aUStr109, kTestStr109, kTestStr109Len ); - - iniResult &=AStringToUStringNCopy( aUStr110, kTestStr110, kTestStr110Len ); - - iniResult &=AStringToUStringNCopy( aUStr111, kTestStr111, kTestStr111Len ); - - iniResult &=AStringToUStringNCopy( aUStr112, kTestStr112, kTestStr112Len ); - - iniResult &=AStringToUStringNCopy( aUStr113, kTestStr113, kTestStr113Len ); - - iniResult &=AStringToUStringNCopy( aUStr114, kTestStr114, kTestStr114Len ); - - iniResult &=AStringToUStringNCopy( aUStr115, kTestStr115, kTestStr115Len ); - - iniResult &=AStringToUStringNCopy( aUStr116, kTestStr116, kTestStr116Len ); - - iniResult &=AStringToUStringNCopy( aUStr117, kTestStr117, kTestStr117Len ); - - iniResult &=AStringToUStringNCopy( aUStr118, kTestStr118, kTestStr118Len ); - - iniResult &=AStringToUStringNCopy( aUStr119, kTestStr119, kTestStr119Len ); - - iniResult &=AStringToUStringNCopy( aUStr120, kTestStr120, kTestStr120Len ); - - iniResult &=AStringToUStringNCopy( aUStr121, kTestStr121, kTestStr121Len ); - - iniResult &=AStringToUStringNCopy( aUStr122, kTestStr122, kTestStr122Len ); - - iniResult &=AStringToUStringNCopy( aUStr123, kTestStr123, kTestStr123Len ); - - iniResult &=AStringToUStringNCopy( aUStr124, kTestStr124, kTestStr124Len ); - - iniResult &=AStringToUStringNCopy( aUStr125, kTestStr125, kTestStr125Len ); - - iniResult &=AStringToUStringNCopy( aUStr126, kTestStr126, kTestStr126Len ); - - iniResult &=AStringToUStringNCopy( aUStr127, kTestStr127, kTestStr127Len ); - - iniResult &=AStringToUStringNCopy( aUStr128, kTestStr128, kTestStr128Len ); - - iniResult &=AStringToUStringNCopy( aUStr129, kTestStr129, kTestStr129Len ); - - iniResult &=AStringToUStringNCopy( aUStr130, kTestStr130, kTestStr130Len ); - - iniResult &=AStringToUStringNCopy( aUStr131, kTestStr131, kTestStr131Len ); - - iniResult &=AStringToUStringNCopy( aUStr132, kTestStr132, kTestStr132Len ); - - iniResult &=AStringToUStringNCopy( aUStr133, kTestStr133, kTestStr133Len ); - - iniResult &=AStringToUStringNCopy( aUStr134, kTestStr134, kTestStr134Len ); - - iniResult &=AStringToUStringNCopy( aUStr135, kTestStr135, kTestStr135Len ); - - iniResult &=AStringToUStringNCopy( aUStr136, kTestStr136, kTestStr136Len ); - - iniResult &=AStringToUStringNCopy( aUStr137, kTestStr137, kTestStr137Len ); - - iniResult &=AStringToUStringNCopy( aUStr138, kTestStr138, kTestStr138Len ); - - iniResult &=AStringToUStringNCopy( aUStr139, kTestStr139, kTestStr139Len ); - - iniResult &=AStringToUStringNCopy( aUStr140, kTestStr140, kTestStr140Len ); - - iniResult &=AStringToUStringNCopy( aUStr141, kTestStr141, kTestStr141Len ); - - iniResult &=AStringToUStringNCopy( aUStr142, kTestStr142, kTestStr142Len ); - - iniResult &=AStringToUStringNCopy( aUStr143, kTestStr143, kTestStr143Len ); - - iniResult &=AStringToUStringNCopy( aUStr144, kTestStr144, kTestStr144Len ); - - iniResult &=AStringToUStringNCopy( aUStr145, kTestStr145, kTestStr145Len ); - - iniResult &=AStringToUStringNCopy( aUStr146, kTestStr146, kTestStr146Len ); - - iniResult &=AStringToUStringNCopy( aUStr147, kTestStr147, kTestStr147Len ); - - iniResult &=AStringToUStringNCopy( aUStr148, kTestStr148, kTestStr148Len ); - - iniResult &=AStringToUStringNCopy( aUStr149, kTestStr149, kTestStr149Len ); - - iniResult &=AStringToUStringNCopy( aUStr150, kTestStr150, kTestStr150Len ); - - iniResult &=AStringToUStringNCopy( aUStr151, kTestStr151, kTestStr151Len ); - - iniResult &=AStringToUStringNCopy( aUStr152, kTestStr152, kTestStr152Len ); - - iniResult &=AStringToUStringNCopy( aUStr153, kTestStr153, kTestStr153Len ); - - iniResult &=AStringToUStringNCopy( aUStr154, kTestStr154, kTestStr154Len ); - - iniResult &=AStringToUStringNCopy( aUStr155, kTestStr155, kTestStr155Len ); - - iniResult &=AStringToUStringNCopy( aUStr156, kTestStr156, kTestStr156Len ); - - iniResult &=AStringToUStringNCopy( aUStr157, kTestStr157, kTestStr157Len ); - - iniResult &=AStringToUStringNCopy( aUStr158, kTestStr158, kTestStr158Len ); - - iniResult &=AStringToUStringNCopy( aUStr159, kTestStr159, kTestStr159Len ); - - iniResult &=AStringToUStringNCopy( aUStr160, kTestStr160, kTestStr160Len ); - - iniResult &=AStringToUStringNCopy( aUStr161, kTestStr161, kTestStr161Len ); - - iniResult &=AStringToUStringNCopy( aUStr162, kTestStr162, kTestStr162Len ); - - iniResult &=AStringToUStringNCopy( aUStr163, kTestStr163, kTestStr163Len ); - - iniResult &=AStringToUStringNCopy( aUStr164, kTestStr164, kTestStr164Len ); - - iniResult &=AStringToUStringNCopy( aUStr165, kTestStr165, kTestStr165Len ); - - iniResult &=AStringToUStringNCopy( aUStr166, kTestStr166, kTestStr166Len ); - - iniResult &=AStringToUStringNCopy( aUStr167, kTestStr167, kTestStr167Len ); - - iniResult &=AStringToUStringNCopy( aUStr168, kTestStr168, kTestStr168Len ); - - iniResult &=AStringToUStringNCopy( aUStr169, kTestStr169, kTestStr169Len ); - - iniResult &=AStringToUStringNCopy( aUStr170, kTestStr170, kTestStr170Len ); - - iniResult &=AStringToUStringNCopy( aUStr171, kTestStr171, kTestStr171Len ); - - return iniResult; - -} - - - - -static const sal_Int32 uTestStr1Len = 16; -static const sal_Int32 uTestStr2Len = 32; -static const sal_Int32 uTestStr3Len = 16; -static const sal_Int32 uTestStr4Len = 16; -static const sal_Int32 uTestStr5Len = 16; -static const sal_Int32 uTestStr9Len = 32; -static const sal_Int32 uTestStr22Len = 32; - - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -const sal_Unicode uTestStr31[]= {0x400,0x410,0x4DF}; -const sal_Unicode uTestStr32[]= {0x9F9F,0xA000,0x8F80,0x9AD9}; - - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int32 uTestStr31Len = 3; -static const sal_Int32 uTestStr32Len = 4; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int16 kRadixBinary = 2; -static const sal_Int16 kRadixOctol = 8; -static const sal_Int16 kRadixDecimal = 10; -static const sal_Int16 kRadixHexdecimal = 16; -static const sal_Int16 kRadixBase36 = 36; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int8 kSInt8Max = SCHAR_MAX; -static const sal_Int16 kUInt8Max = UCHAR_MAX; -static const sal_Int16 kSInt16Max = SHRT_MAX; -static const sal_Int32 kUInt16Max = USHRT_MAX; -static const sal_Int32 kSInt32Max = INT_MAX; -static const sal_Int64 kUInt32Max = UINT_MAX; -static const sal_Int64 kSInt64Max = 9223372036854775807; - -//------------------------------------------------------------------------ - -static const sal_Int32 kInt32MaxNumsCount = 5; - -static const sal_Int32 kInt32MaxNums[kInt32MaxNumsCount] = - { - kSInt8Max, kUInt8Max, - kSInt16Max, kUInt16Max, - kSInt32Max - }; - -static const sal_Int32 kInt64MaxNumsCount = 7; - -static const sal_Int64 kInt64MaxNums[kInt64MaxNumsCount] = - { - kSInt8Max, kUInt8Max, - kSInt16Max, kUInt16Max, - kSInt32Max, kUInt32Max, - kSInt64Max - }; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Char *kSInt8MaxBinaryStr = "1111111"; -static const sal_Char *kUInt8MaxBinaryStr = "11111111"; -static const sal_Char *kSInt16MaxBinaryStr = "111111111111111"; -static const sal_Char *kUInt16MaxBinaryStr = "1111111111111111"; -static const sal_Char *kSInt32MaxBinaryStr = - "1111111111111111111111111111111"; -static const sal_Char *kUInt32MaxBinaryStr = - "11111111111111111111111111111111"; -static const sal_Char *kSInt64MaxBinaryStr = - "111111111111111111111111111111111111111111111111111111111111111"; - -//------------------------------------------------------------------------ - -static const sal_Char *kSInt8MaxOctolStr = "177"; -static const sal_Char *kUInt8MaxOctolStr = "377"; -static const sal_Char *kSInt16MaxOctolStr = "77777"; -static const sal_Char *kUInt16MaxOctolStr = "177777"; -static const sal_Char *kSInt32MaxOctolStr = "17777777777"; -static const sal_Char *kUInt32MaxOctolStr = "37777777777"; -static const sal_Char *kSInt64MaxOctolStr = "777777777777777777777"; - -//------------------------------------------------------------------------ - -static const sal_Char *kSInt8MaxDecimalStr = "127"; -static const sal_Char *kUInt8MaxDecimalStr = "255"; -static const sal_Char *kSInt16MaxDecimalStr = "32767"; -static const sal_Char *kUInt16MaxDecimalStr = "65535"; -static const sal_Char *kSInt32MaxDecimalStr = "2147483647"; -static const sal_Char *kUInt32MaxDecimalStr = "4294967295"; -static const sal_Char *kSInt64MaxDecimalStr = "9223372036854775807"; - -//------------------------------------------------------------------------ - -static const sal_Char *kSInt8MaxHexDecimalStr = "7f"; -static const sal_Char *kUInt8MaxHexDecimalStr = "ff"; -static const sal_Char *kSInt16MaxHexDecimalStr = "7fff"; -static const sal_Char *kUInt16MaxHexDecimalStr = "ffff"; -static const sal_Char *kSInt32MaxHexDecimalStr = "7fffffff"; -static const sal_Char *kUInt32MaxHexDecimalStr = "ffffffff"; -static const sal_Char *kSInt64MaxHexDecimalStr = "7fffffffffffffff"; - -//------------------------------------------------------------------------ - -static const sal_Char *kSInt8MaxBase36Str = "3j"; -static const sal_Char *kUInt8MaxBase36Str = "73"; -static const sal_Char *kSInt16MaxBase36Str = "pa7"; -static const sal_Char *kUInt16MaxBase36Str = "1ekf"; -static const sal_Char *kSInt32MaxBase36Str = "zik0zj"; -static const sal_Char *kUInt32MaxBase36Str = "1z141z3"; -static const sal_Char *kSInt64MaxBase36Str = "1y2p0ij32e8e7"; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int32 kBinaryNumsCount = 16; - -static const sal_Char *kBinaryNumsStr[kBinaryNumsCount] = - { - "0", "1", "10", "11", - "100", "101", "110", "111", - "1000", "1001", "1010", "1011", - "1100", "1101", "1110", "1111" - }; - -static const sal_Int32 kBinaryMaxNumsCount = 7; - -static const sal_Char *kBinaryMaxNumsStr[kBinaryMaxNumsCount] = - { - kSInt8MaxBinaryStr, - kUInt8MaxBinaryStr, - kSInt16MaxBinaryStr, - kUInt16MaxBinaryStr, - kSInt32MaxBinaryStr, - kUInt32MaxBinaryStr, - kSInt64MaxBinaryStr - }; - -//------------------------------------------------------------------------ - -static const sal_Int32 kOctolNumsCount = 16; - -static const sal_Char *kOctolNumsStr[kOctolNumsCount] = - { - "0", "1", "2", "3", - "4", "5", "6", "7", - "10", "11", "12", "13", - "14", "15", "16", "17" - }; - -static const sal_Int32 kOctolMaxNumsCount = 7; - -static const sal_Char *kOctolMaxNumsStr[kOctolMaxNumsCount] = - { - kSInt8MaxOctolStr, - kUInt8MaxOctolStr, - kSInt16MaxOctolStr, - kUInt16MaxOctolStr, - kSInt32MaxOctolStr, - kUInt32MaxOctolStr, - kSInt64MaxOctolStr - }; - -//------------------------------------------------------------------------ - -static const sal_Int32 kDecimalNumsCount = 16; - -static const sal_Char *kDecimalNumsStr[kDecimalNumsCount] = - { - "0", "1", "2", "3", - "4", "5", "6", "7", - "8", "9", "10", "11", - "12", "13", "14", "15" - }; - -static const sal_Int32 kDecimalMaxNumsCount = 7; - -static const sal_Char *kDecimalMaxNumsStr[kDecimalMaxNumsCount] = - { - kSInt8MaxDecimalStr, - kUInt8MaxDecimalStr, - kSInt16MaxDecimalStr, - kUInt16MaxDecimalStr, - kSInt32MaxDecimalStr, - kUInt32MaxDecimalStr, - kSInt64MaxDecimalStr - }; - -//------------------------------------------------------------------------ - -static const sal_Int32 kHexDecimalNumsCount = 16; - -static const sal_Char *kHexDecimalNumsStr[kHexDecimalNumsCount] = - { - "0", "1", "2", "3", - "4", "5", "6", "7", - "8", "9", "a", "b", - "c", "d", "e", "f" - }; - -static const sal_Int32 kHexDecimalMaxNumsCount = 7; - -static const sal_Char *kHexDecimalMaxNumsStr[kHexDecimalMaxNumsCount] = - { - kSInt8MaxHexDecimalStr, - kUInt8MaxHexDecimalStr, - kSInt16MaxHexDecimalStr, - kUInt16MaxHexDecimalStr, - kSInt32MaxHexDecimalStr, - kUInt32MaxHexDecimalStr, - kSInt64MaxHexDecimalStr - }; - -//------------------------------------------------------------------------ - -static const sal_Int32 kBase36NumsCount = 36; - -static const sal_Char *kBase36NumsStr[kBase36NumsCount] = - { - "0", "1", "2", "3", - "4", "5", "6", "7", - "8", "9", "a", "b", - "c", "d", "e", "f", - "g", "h", "i", "j", - "k", "l", "m", "n", - "o", "p", "q", "r", - "s", "t", "u", "v", - "w", "x", "y", "z" - }; - -static const sal_Int32 kBase36MaxNumsCount = 7; - -static const sal_Char *kBase36MaxNumsStr[kBase36MaxNumsCount] = - { - kSInt8MaxBase36Str, - kUInt8MaxBase36Str, - kSInt16MaxBase36Str, - kUInt16MaxBase36Str, - kSInt32MaxBase36Str, - kUInt32MaxBase36Str, - kSInt64MaxBase36Str - }; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -static const sal_Int32 nDoubleCount=24; -static const sal_Char *inputDouble[nDoubleCount] = - { - "3","3.1","3.1415","3.1415926535","3.141592653589793", - "3.1415926535897932","3.14159265358979323","+3.1", - "3.141592653589793238462643","9.1096e-31","2.997925e8","6.241e18","5.381e+18", - "1.7e-309","6.5822e-16","1.7e+307","2.2e30","03.1"," 3.1","-3.1", - "-0.0","0.0","","1.00e308" - }; -static const double expValDouble[nDoubleCount]= - { - 3.0,3.1,3.1415,3.1415926535,3.141592653589793, - 3.1415926535897932,3.14159265358979323,3.1, - 3.141592653589793238462643,9.1096e-31,2.997925e8,6.241e18,5.381e18, - 1.7e-309,6.5822e-16,1.7e+307,2.2e30,3.1,3.1,-3.1, - 0.0,0.0,0.0,1.00e+308 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nFloatCount=22; -static const sal_Char *inputFloat[nFloatCount] = - { - "3","3.1","3.1415","3.14159","3.141592", - "3.1415926","3.14159265","3.141592653589793238462643", - "6.5822e-16","9.1096e-31","2.997925e8","6.241e18", - "1.00e38","6.241e-37","6.241e37","03.1"," 3.1","-3.1", - "+3.1","-0.0","0.0","" - }; -static const float expValFloat[nFloatCount] = - { - 3.0f,3.1f,3.1415f,3.14159f,3.141592f, - 3.1415926f,3.14159265f,3.141592653589793238462643f, - 6.5822e-16f,9.1096e-31f,2.997925e8f,6.241e18f, - 1.00e38,6.241e-37,6.241e37,3.1f,3.1f,-3.1f, - 3.1f,0.0f,0.0f,0.0f - }; -//------------------------------------------------------------------------ -static const sal_Int32 nCharCount=15; -static const sal_Char *inputChar[nCharCount] = - { - "A","a","0","-","_", - "\25","\33","\35", - "@","\n","\'","\"", - "\0","","Sun Microsystems" - }; -static const sal_Unicode expValChar[nCharCount] = - { - 65,97,48,45,95, - 21,27,29, - 64,10,39,34, - 0,0,83 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nDefaultCount=6; -static const sal_Unicode input1Default[nDefaultCount] = - { - 77,115,85,119,32,0 - }; -static const sal_Int32 input2Default[nDefaultCount] = - { - 0,0,0,0,0,0 - }; -static const sal_Int32 expValDefault[nDefaultCount] = - { - 4,9,-1,-1,3,-1 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nNormalCount=10; -static const sal_Unicode input1Normal[nNormalCount] = - { - 77,77,77,115,115,115,119,119,0,0 - }; -static const sal_Int32 input2Normal[nNormalCount] = - { - 0,32,80,0,13,20,0,80,0,32 - }; -static const sal_Int32 expValNormal[nNormalCount] = - { - 4,-1,-1,9,15,-1,-1,-1,-1,-1 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nlastDefaultCount=5; -static const sal_Unicode input1lastDefault[nlastDefaultCount] = - { - 77,115,119,32,0 - }; -static const sal_Int32 input2lastDefault[nlastDefaultCount] = - { - 31,31,31,31,31 - }; -static const sal_Int32 expVallastDefault[nlastDefaultCount] = - { - 4,15,-1,21,-1 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nlastNormalCount=8; -static const sal_Unicode input1lastNormal[nlastNormalCount] = - { - 77,77,77,115,115,119,119,0 - }; -static const sal_Int32 input2lastNormal[nlastNormalCount] = - { - 29,0,80,31,3,31,80,31 - }; -static const sal_Int32 expVallastNormal[nlastNormalCount] = - { - 4,-1,4,15,-1,-1,-1,-1 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nStrDefaultCount=6; -static const sal_Unicode *input1StrDefault[nStrDefaultCount] = - { - aUStr7,aUStr8,aUStr21, - aUStr30,aUStr25,aUStr26 - }; -static const sal_Int32 input2StrDefault[nStrDefaultCount] = - { - 0,0,0,0,0,0 - }; -static const sal_Int32 expValStrDefault[nStrDefaultCount] = - { - 0,4,-1,-1,-1,3 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nStrNormalCount=9; -static const sal_Unicode *input1StrNormal[nStrNormalCount] = - { - aUStr7,aUStr7,aUStr8,aUStr8,aUStr21,aUStr30,aUStr25,aUStr25,aUStr26 - }; -static const sal_Int32 input2StrNormal[nStrNormalCount] = - { - 0,32,0,30,0,0,0,32,0 - }; -static const sal_Int32 expValStrNormal[nStrNormalCount] = - { - 0,-1,4,-1,-1,-1,-1,-1,3 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nStrLastDefaultCount=6; -static const sal_Unicode *input1StrLastDefault[nStrLastDefaultCount] = - { - aUStr7,aUStr8,aUStr21,aUStr30,aUStr25,aUStr26 - }; -static const sal_Int32 input2StrLastDefault[nStrLastDefaultCount] = - { - 31,31,31,31,31,31 - }; -static const sal_Int32 expValStrLastDefault[nStrLastDefaultCount] = - { - 0,4,-1,-1,-1,3 - }; -//------------------------------------------------------------------------ -static const sal_Int32 nStrLastNormalCount=12; -static const sal_Unicode *input1StrLastNormal[nStrLastNormalCount] = - { - aUStr7,aUStr7,aUStr7,aUStr8,aUStr8,aUStr21,aUStr30, - aUStr25,aUStr25,aUStr26,aUStr27,aUStr27 - }; -static const sal_Int32 input2StrLastNormal[nStrLastNormalCount] = - { - 31,0,80,31,2,31,31,31,0,31,31,14 - }; -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; -//------------------------------------------------------------------------ -#ifdef __cplusplus -} -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#endif /* _RTL_STRING_CONST_H_ */ - diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.cxx b/sal/qa/OStringBuffer/rtl_String_Utils.cxx deleted file mode 100644 index 0b8dbbd005cf..000000000000 --- a/sal/qa/OStringBuffer/rtl_String_Utils.cxx +++ /dev/null @@ -1,643 +0,0 @@ -/************************************************************************* -# -# $RCSfile: rtl_String_Utils.cxx,v $ -# -# $Revision: 1.1 $ -# -# last change: $Author: lwang $ $Date: 2003-01-03 09:52:13 $ -# -# The Contents of this file are made available subject to the terms of -# either of the following licenses -# -# - GNU Lesser General Public License Version 2.1 -# - Sun Industry Standards Source License Version 1.1 -# -# Sun Microsystems Inc., October, 2000 -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2000 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 -# -# -# Sun Industry Standards Source License Version 1.1 -# ================================================= -# The contents of this file are subject to the Sun Industry Standards -# Source License Version 1.1 (the "License"); You may not use this file -# except in compliance with the License. You may obtain a copy of the -# License at http://www.openoffice.org/license.html. -# -# Software provided under this License is provided on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, -# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, -# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. -# See the License for the specific provisions governing your rights and -# obligations concerning the Software. -# -# The Initial Developer of the Original Code is: Sun Microsystems, Inc. -# -# Copyright: 2000 by Sun Microsystems, Inc. -# -# All Rights Reserved. -# -# Contributor(s): _______________________________________ -# -# -# -#*************************************************************************/ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#include <math.h> -#include <stdlib.h> - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _SAL_TYPES_H_ - #include <sal/types.h> -#endif - -#ifndef _RTL_USTRING_H_ - #include <rtl/ustring.h> -#endif - -#ifndef _RTL_STRING_HXX_ - #include <rtl/string.hxx> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _RTL_STRING_UTILS_CONST_H_ - #include <rtl_String_Utils_Const.h> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -using namespace rtl; - -sal_uInt32 AStringLen( const sal_Char *pAStr ) -{ - sal_uInt32 nStrLen = 0; - - if ( pAStr != NULL ) - { - const sal_Char *pTempStr = pAStr; - - while( *pTempStr ) - { - pTempStr++; - } // while - - nStrLen = (sal_uInt32)( pTempStr - pAStr ); - } // if - - return nStrLen; -} // AStringLen -sal_Char* cpystr( sal_Char* dst, const sal_Char* src ) -{ - const sal_Char* psrc = src; - sal_Char* pdst = dst; - - while( *pdst++ = *psrc++ ); - return ( dst ); -} - -sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt ) -{ - - const sal_Char* psrc = src; - sal_Char* pdst = dst; - sal_uInt32 len = cnt; - sal_uInt32 i; - - if ( len >= AStringLen(src) ) - { - return( cpystr( dst, src ) ); - } - - // copy string by char - for( i = 0; i < len; i++ ) - *pdst++ = *psrc++; - *pdst = '\0'; - - return ( dst ); -} - -//------------------------------------------------------------------------ -sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len ) -{ - const sal_Char* pBuf1 = str1; - const sal_Char* pBuf2 = str2; - sal_uInt32 i = 0; - - while ( (*pBuf1 == *pBuf2) && i < len ) - { - (pBuf1)++; - (pBuf2)++; - i++; - } - return( i == len ); -} -//----------------------------------------------------------------------- -sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2 ) -{ - const sal_Char* pBuf1 = str1; - const sal_Char* pBuf2 = str2; - sal_Bool res = sal_True; - - while ( (*pBuf1 == *pBuf2) && *pBuf1 !='\0' && *pBuf2 != '\0') - { - (pBuf1)++; - (pBuf2)++; - } - if (*pBuf1 == '\0' && *pBuf2 == '\0') - res = sal_True; - else - res = sal_False; - return (res); -} -//------------------------------------------------------------------------ -sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len ) -{ - const sal_Unicode* pBuf1 = str1; - const sal_Unicode* pBuf2 = str2; - sal_uInt32 i = 0; - - while ( (*pBuf1 == *pBuf2) && i < len ) - { - (pBuf1)++; - (pBuf2)++; - i++; - } - return( i == len ); -} - -//----------------------------------------------------------------------- -sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 ) -{ - const sal_Unicode* pBuf1 = str1; - const sal_Unicode* pBuf2 = str2; - sal_Bool res = sal_True; - - while ( (*pBuf1 == *pBuf2) && *pBuf1 !='\0' && *pBuf2 != '\0') - { - (pBuf1)++; - (pBuf2)++; - } - if (*pBuf1 == '\0' && *pBuf2 == '\0') - res = sal_True; - else - res = sal_False; - return (res); -} - -sal_Char* createName( sal_Char* dst, const sal_Char* meth, sal_uInt32 cnt ) -{ - sal_Char* pdst = dst; - sal_Char nstr[16]; - sal_Char* pstr = nstr; - rtl_str_valueOfInt32( pstr, cnt, 10 ); - - cpystr( pdst, meth ); - cpystr( pdst+ AStringLen(meth), "_" ); - - if ( cnt < 100 ) - { - cpystr(pdst + AStringLen(pdst), "0" ); - } - if ( cnt < 10 ) - { - cpystr(pdst + AStringLen(pdst), "0" ); - } - - cpystr( pdst + AStringLen(pdst), nstr ); - return( pdst ); -} - -//------------------------------------------------------------------------ -// testing the method compareTo( const OString & aStr ) -//------------------------------------------------------------------------ -void makeComment( char *com, const char *str1, const char *str2, - sal_Int32 sgn ) -{ - cpystr(com, str1); - int str1Length = AStringLen( str1 ); - const char *sign = (sgn == 0) ? " == " : (sgn > 0) ? " > " : " < " ; - cpystr(com + str1Length, sign); - int signLength = AStringLen(sign); - cpystr(com + str1Length + signLength, str2); - com[str1Length + signLength + AStringLen(str2)] = 0; -} - - -//------------------------------------------------------------------------ - -sal_Bool AStringToFloatCompare ( const sal_Char *pStr, - const float nX, - const float nEPS - ) -{ - sal_Bool cmp = sal_False; - - if ( pStr != NULL ) - { - ::rtl::OString aStr(pStr); - - float actNum = 0; - float expNum = nX; - float eps = nEPS; - - actNum = aStr.toFloat(); - - if ( abs( (int)(actNum - expNum) ) <= eps ) - { - cmp = sal_True; - } // if - } // if - - return cmp; -} // AStringToFloatCompare - -//------------------------------------------------------------------------ - -sal_Bool AStringToDoubleCompare ( const sal_Char *pStr, - const double nX, - const double nEPS - ) -{ - sal_Bool cmp = sal_False; - - if ( pStr != NULL ) - { - ::rtl::OString aStr(pStr); - - double actNum = 0; - double expNum = nX; - double eps = nEPS; - - actNum = aStr.toDouble(); - - if ( abs( (int)(actNum - expNum) ) <= eps ) - { - cmp = sal_True; - } // if - } // if - - return cmp; -} // AStringToDoubleCompare - -//------------------------------------------------------------------------ - - -//------------------------------------------------------------------------ - -sal_uInt32 UStringLen( const sal_Unicode *pUStr ) -{ - sal_uInt32 nUStrLen = 0; - - if ( pUStr != NULL ) - { - const sal_Unicode *pTempUStr = pUStr; - - while( *pTempUStr ) - { - pTempUStr++; - } // while - - nUStrLen = (sal_uInt32)( pTempUStr - pUStr ); - } // if - - return nUStrLen; -} // UStringLen - -//------------------------------------------------------------------------ - -sal_Bool AStringIsValid( const sal_Char *pAStr ) -{ - if ( pAStr != NULL ) - { - sal_uInt32 nLen = AStringLen( pAStr ); - sal_uChar uChar = 0; - - while ( ( nLen >= 0 ) && ( *pAStr ) ) - { - uChar = (unsigned char)*pAStr; - - if ( uChar > 127 ) - { - return sal_False; - } // if - - pAStr++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nLen > 0 ) - { - nLen--; - } // if - else - { - break; - } // else - } // while - } // if - - return sal_True; -} // AStringIsValid - -//------------------------------------------------------------------------ - -sal_Bool AStringNIsValid( const sal_Char *pAStr, - const sal_uInt32 nStrLen - ) -{ - sal_uInt32 nLen = nStrLen; - sal_uChar uChar = 0; - - while ( ( nLen >= 0 ) && ( *pAStr ) ) - { - uChar = (unsigned char)*pAStr; - - if ( uChar > 127 ) - { - return sal_False; - } // if - - pAStr++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nLen > 0 ) - { - nLen--; - } // if - else - { - break; - } // else - } // while - - return sal_True; -} // AStringNIsValid - -//------------------------------------------------------------------------ - -static inline sal_Int32 ACharToUCharCompare( const sal_Unicode *pUStr, - const sal_Char *pAStr - ) -{ - sal_Int32 nCmp = 0; - sal_Int32 nUChar = (sal_Int32)*pUStr; - sal_Int32 nChar = (sal_Int32)((unsigned char)*pAStr); - - nCmp = nUChar - nChar; - - return nCmp; -} // ACharToUCharCompare - -//------------------------------------------------------------------------ - -sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr, - const sal_Char *pAStr - ) -{ - sal_Int32 nCmp = kErrCompareAStringToUString; - - if ( ( pUStr != NULL ) && ( pAStr != NULL ) ) - { - nCmp = ACharToUCharCompare( pUStr, pAStr ); - - while ( ( nCmp == 0 ) && ( *pAStr ) ) - { - pUStr++; - pAStr++; - - nCmp = ACharToUCharCompare( pUStr, pAStr ); - } // while - } // if - - return nCmp; -} // AStringToUStringCompare - -//------------------------------------------------------------------------ - -sal_Int32 AStringToUStringNCompare( const sal_Unicode *pUStr, - const sal_Char *pAStr, - const sal_uInt32 nAStrCount - ) -{ - sal_Int32 nCmp = kErrCompareNAStringToUString; - - if ( ( pUStr != NULL ) && ( pAStr != NULL ) ) - { - sal_uInt32 nCount = nAStrCount; - - nCmp = ACharToUCharCompare( pUStr, pAStr ); - - while ( ( nCmp == 0 ) && ( *pAStr ) && ( nCount ) ) - { - pUStr++; - pAStr++; - - nCmp = ACharToUCharCompare( pUStr, pAStr ); - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nCount > 0 ) - { - nCount--; - } // if - else - { - break; - } // else - } // while - } // if - - return nCmp; -} // AStringToUStringNCompare - -//------------------------------------------------------------------------ - -sal_Int32 AStringToRTLUStringCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr - ) -{ - sal_Int32 nCmp = kErrCompareAStringToRTLUString; - - if ( ( pRTLUStr != NULL ) && ( pAStr != NULL ) ) - { - rtl_uString *pRTLUStrCopy = NULL; - - rtl_uString_newFromString( &pRTLUStrCopy, pRTLUStr ); - - if ( pRTLUStrCopy != NULL ) - { - const sal_Unicode *pUStr = rtl_uString_getStr( pRTLUStrCopy ); - - if ( pUStr != NULL ) - { - nCmp = AStringToUStringCompare( pUStr, pAStr ); - } // if - - rtl_uString_release( pRTLUStrCopy ); - - pRTLUStrCopy = NULL; - } // if - } // if - - return nCmp; -} // AStringToRTLUStringCompare - -//------------------------------------------------------------------------ - -sal_Int32 AStringToRTLUStringNCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr, - const sal_uInt32 nAStrCount - ) -{ - sal_Int32 nCmp = kErrCompareNAStringToRTLUString; - - if ( ( pRTLUStr != NULL ) && ( pAStr != NULL ) ) - { - rtl_uString *pRTLUStrCopy = NULL; - - rtl_uString_newFromString( &pRTLUStrCopy, pRTLUStr ); - - if ( pRTLUStrCopy != NULL ) - { - const sal_Unicode *pUStr = rtl_uString_getStr( pRTLUStrCopy ); - - if ( pUStr != NULL ) - { - nCmp = AStringToUStringNCompare( pUStr, pAStr, nAStrCount ); - } // if - - rtl_uString_release( pRTLUStrCopy ); - - pRTLUStrCopy = NULL; - } // if - } // if - - return nCmp; -} // AStringToRTLUStringNCompare - -//------------------------------------------------------------------------ - -sal_Bool AStringToUStringCopy( sal_Unicode *pDest, - const sal_Char *pSrc - ) -{ - sal_Bool bCopied = sal_False; - sal_uInt32 nCount = AStringLen( pSrc ); - sal_uInt32 nLen = nCount; - - if ( ( pDest != NULL ) - && ( pSrc != NULL ) - && ( AStringNIsValid( pSrc, nLen ) ) - ) - { - while ( nCount >= 0 ) - { - *pDest = (unsigned char)*pSrc; - - pDest++; - pSrc++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nCount > 0 ) - { - nCount--; - } // if - else - { - break; - } // else - } // while - - if ( nCount == 0 ) - { - bCopied = sal_True; - } // if - } // if - - return bCopied; -} // AStringToUStringCopy - -//------------------------------------------------------------------------ - -sal_Bool AStringToUStringNCopy( sal_Unicode *pDest, - const sal_Char *pSrc, - const sal_uInt32 nSrcLen - ) -{ - sal_Bool bCopied = sal_False; - sal_uInt32 nCount = nSrcLen; - sal_uInt32 nLen = nSrcLen; - - if ( ( pDest != NULL ) - && ( pSrc != NULL ) - && ( AStringNIsValid( pSrc, nLen ) ) - ) - { - while ( nCount >= 0 ) - { - *pDest = (unsigned char)*pSrc; - - pDest++; - pSrc++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nCount > 0 ) - { - nCount--; - } // if - else - { - break; - } // else - } // while - - if ( nCount == 0 ) - { - bCopied = sal_True; - } // if - } // if - - return bCopied; -} // AStringToUStringNCopy - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.hxx b/sal/qa/OStringBuffer/rtl_String_Utils.hxx deleted file mode 100644 index 2cdba9ea551e..000000000000 --- a/sal/qa/OStringBuffer/rtl_String_Utils.hxx +++ /dev/null @@ -1,173 +0,0 @@ -/************************************************************************* -# -# $RCSfile: rtl_String_Utils.hxx,v $ -# -# $Revision: 1.1 $ -# -# last change: $Author: lwang $ $Date: 2003-01-03 09:52:14 $ -# -# The Contents of this file are made available subject to the terms of -# either of the following licenses -# -# - GNU Lesser General Public License Version 2.1 -# - Sun Industry Standards Source License Version 1.1 -# -# Sun Microsystems Inc., October, 2000 -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2000 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 -# -# -# Sun Industry Standards Source License Version 1.1 -# ================================================= -# The contents of this file are subject to the Sun Industry Standards -# Source License Version 1.1 (the "License"); You may not use this file -# except in compliance with the License. You may obtain a copy of the -# License at http://www.openoffice.org/license.html. -# -# Software provided under this License is provided on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, -# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, -# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. -# See the License for the specific provisions governing your rights and -# obligations concerning the Software. -# -# The Initial Developer of the Original Code is: Sun Microsystems, Inc. -# -# Copyright: 2000 by Sun Microsystems, Inc. -# -# All Rights Reserved. -# -# Contributor(s): _______________________________________ -# -# -# -#*************************************************************************/ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _RTL_STRING_UTILS_HXX_ -#define _RTL_STRING_UTILS_HXX_ - -#ifdef __cplusplus - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#include <math.h> -#include <stdlib.h> - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _SAL_TYPES_H_ - #include <sal/types.h> -#endif - -#ifndef _RTL_USTRING_H_ - #include <rtl/ustring.h> -#endif - -#ifndef _RTL_STRING_HXX_ - #include <rtl/string.hxx> -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -sal_Char* cpystr( sal_Char* dst, const sal_Char* src ); -sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt ); - -sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len ); -sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2 ); -sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len ); -sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 ); - -sal_Char* createName( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt ); -void makeComment(char *com, const char *str1, const char *str2, sal_Int32 sgn); - - -sal_uInt32 AStringLen( const sal_Char *pAStr ); - -sal_uInt32 UStringLen( const sal_Unicode *pUStr ); - -//------------------------------------------------------------------------ - -sal_Bool AStringToFloatCompare ( const sal_Char *pStr, - const float nX, - const float nEPS - ); - -sal_Bool AStringToDoubleCompare ( const sal_Char *pStr, - const double nX, - const double nEPS - ); - -//------------------------------------------------------------------------ - -sal_Bool AStringIsValid( const sal_Char *pAStr ); - -sal_Bool AStringNIsValid( const sal_Char *pAStr, - const sal_uInt32 nStrLen - ); - -//------------------------------------------------------------------------ - -sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr, - const sal_Char *pAStr - ); - -sal_Int32 AStringToUStringNCompare( const sal_Unicode *pUStr, - const sal_Char *pAStr, - const sal_uInt32 nAStrCount - ); - -sal_Int32 AStringToRTLUStringCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr - ); - -sal_Int32 AStringToRTLUStringNCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr, - const sal_uInt32 nAStrCount - ); - -//------------------------------------------------------------------------ - -sal_Bool AStringToUStringCopy( sal_Unicode *pDest, - const sal_Char *pSrc - ); - -sal_Bool AStringToUStringNCopy( sal_Unicode *pDest, - const sal_Char *pSrc, - const sal_uInt32 nSrcLen - ); - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#endif /* __cplusplus */ - -#endif /* _RTL_STRING_UTILS_HXX */ - - - - - - - diff --git a/sal/qa/libs2test.txt b/sal/qa/libs2test.txt deleted file mode 100644 index 46f1cf6e71ad..000000000000 --- a/sal/qa/libs2test.txt +++ /dev/null @@ -1,18 +0,0 @@ -# This file contain a list of todos for testshl2 automated tests. -# -# $Id: libs2test.txt,v 1.1 2003-03-20 13:38:23 lla Exp $ -# -# Legend: -# there exist 2 formats -# 1. file -# 2. path ; file -# -# 1. if only a file exist, it will be assume, that a directory with name 'file' -# exist, and a library with name 'file' create. -# 2. if the path to the file differ from the library file, use this format. -# - - -ByteSequence -OStringBuffer ; OStringBuffer - diff --git a/sal/qa/makefile.mk b/sal/qa/makefile.mk index 4b48fb1d3566..73c8f3c22437 100644 --- a/sal/qa/makefile.mk +++ b/sal/qa/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.9 $ +# $Revision: 1.10 $ # -# last change: $Author: lwang $ $Date: 2002-11-06 03:09:23 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:46:14 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -62,11 +62,12 @@ PRJ=.. PRJNAME=sal -TARGET=qa -TESTDIR=TRUE +TARGET=tests # --- Settings ----------------------------------------------------- +.INCLUDE : svpre.mk .INCLUDE : settings.mk +.INCLUDE : sv.mk .IF "$(OS)" == "WNT" REGEXP="s/^[\#].*$$//" @@ -77,8 +78,7 @@ REGEXP='s/^[\#].*$$//' DEPOBJFILES = \ $(SLO)$/rtl_String_Utils.obj \ $(SLO)$/rtl_OString.obj \ - $(SLO)$/rtl_OUString.obj \ - $(SLO)$/rtl_OUStringBuffer.obj + $(SLO)$/rtl_OUString.obj SHL1OBJS = \ $(SLO)$/rtl_String_Utils.obj \ @@ -89,20 +89,14 @@ SHL1STDLIBS+=\ $(SALLIB) \ $(SALHELPERLIB) -SHL1VERSIONMAP = $(MISC)$/$(SHL1TARGET).map SHL1DEPN= SHL1IMPLIB= i$(SHL1TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) +DEF1EXPORTFILE= $(MISC)$/$(SHL1TARGET).exp -#------------------------------------------------------------------------------- -.IF "$(COM)"=="GCC" -NOOPTFILES= \ - $(SLO)$/rtl_String_Utils.obj \ - $(SLO)$/rtl_OUString.obj -.ENDIF SHL2OBJS = \ $(SLO)$/rtl_String_Utils.obj \ @@ -113,88 +107,73 @@ SHL2STDLIBS+=\ $(SALLIB) \ $(SALHELPERLIB) -SHL2VERSIONMAP = $(MISC)$/$(SHL2TARGET).map SHL2DEPN= SHL2IMPLIB= i$(SHL2TARGET) SHL2DEF= $(MISC)$/$(SHL2TARGET).def DEF2NAME =$(SHL2TARGET) -#------------------------------------------------------------------------------- - -.IF "$(COM)"=="GCC" -NOOPTFILES= \ - $(SLO)$/rtl_String_Utils.obj \ - $(SLO)$/rtl_OUStringBuffer.obj -.ENDIF - -SHL3OBJS = \ - $(SLO)$/rtl_String_Utils.obj \ - $(SLO)$/rtl_OUStringBuffer.obj - -SHL3TARGET= rtl_OUStringBuffer -SHL3STDLIBS+=\ - $(SALLIB) \ - $(SALHELPERLIB) +DEF2EXPORTFILE= $(MISC)$/$(SHL2TARGET).exp + +#SHL2OBJS = \ +# $(SLO)$/rtl_String_Utils.obj \ +# $(SLO)$/rtl_OUString.obj \ +# $(SLO)$/osl_apitest_conditn.obj \ +# $(SLO)$/osl_apitest_diagnose.obj \ +# $(SLO)$/osl_apitest_file.obj \ +# $(SLO)$/osl_apitest_interlck.obj \ +# $(SLO)$/osl_apitest_mutex.obj \ +# $(SLO)$/osl_apitest_nlsupport.obj \ +# $(SLO)$/osl_apitest_pipe.obj \ +# $(SLO)$/osl_apitest_profile.obj \ +# $(SLO)$/osl_apitest_time.obj \ +# $(SLO)$/osl_apitest_util.obj + +SHL3TARGET = test_rtl_math +SHL3OBJS = $(SLO)$/$(SHL3TARGET).obj +SHL3STDLIBS = $(SALLIB) +SHL3DEPN = +SHL3IMPLIB = i$(SHL3TARGET) +SHL3DEF = $(MISC)$/$(SHL3TARGET).def +DEF3NAME = $(SHL3TARGET) +DEF3EXPORTFILE = $(MISC)$/$(SHL3TARGET).exp + +#SHL1TARGET= rtl_apitest +#SHL1STDLIBS+=\ +#$(SALLIB) +#SHL1DEPN= +#SHL1IMPLIB= i$(SHL1TARGET) +#SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +#DEF1NAME =$(SHL1TARGET) +#DEF1EXPORTFILE= $(MISC)$/$(SHL1TARGET).exp -SHL3VERSIONMAP = $(MISC)$/$(SHL3TARGET).map -SHL3DEPN= -SHL3IMPLIB= i$(SHL3TARGET) -SHL3DEF= $(MISC)$/$(SHL3TARGET).def +# --- Targets ------------------------------------------------------ -DEF3NAME =$(SHL3TARGET) +.INCLUDE : target.mk +#$(MISC)$/$(SHL1TARGET).exp : sce$/$(SHL1TARGET).sce +# +$(TYPE) $< | sed $(REGEXP) | sed "s/^/test_/" | sed "/test_./ w $@" +#$(MISC)$/$(SHL2TARGET).exp : sce$/$(SHL2TARGET).sce +# +$(TYPE) $< | sed $(REGEXP) | sed "s/^/test_/" | sed "/test_./ w $@" -# --- Targets ------------------------------------------------------ +$(MISC)$/$(SHL1TARGET).exp : sce$/$(SHL1TARGET).sce + +$(TYPE) $< | sed $(REGEXP) > $@ + +$(TYPE) $@ | sed "s/^/test_/" > $(MISC)$/$(SHL1TARGET).tst + +$(TYPE) $(MISC)$/$(SHL1TARGET).tst | sed "/test_./ w $@" -.INCLUDE : target.mk +$(MISC)$/$(SHL2TARGET).exp : sce$/$(SHL2TARGET).sce + +$(TYPE) $< | sed $(REGEXP) > $@ + +$(TYPE) $@ | sed "s/^/test_/" > $(MISC)$/$(SHL2TARGET).tst + +$(TYPE) $(MISC)$/$(SHL2TARGET).tst | sed "/test_./ w $@" -$(MISC)$/$(SHL1TARGET).map : sce$/$(SHL1TARGET).sce - +$(RM) $(MISC)$/$(SHL1TARGET).tst - +$(RM) $(MISC)$/$(SHL1TARGET).map - +$(TYPE) $< | sed $(REGEXP) > $@ - +$(TYPE) $@ | sed "s/^/test_/" >> $(MISC)$/$(SHL1TARGET).tst - +$(TYPE) mapHeader > $(MISC)$/$(SHL1TARGET).map - +$(TYPE) $(MISC)$/$(SHL1TARGET).tst | sed "/test_./ w $(MISC)$/$(SHL1TARGET).map1" - +$(TYPE) $(MISC)$/$(SHL1TARGET).map1 | sed "s/.*/&;/" >> $(MISC)$/$(SHL1TARGET).map - +$(RM) $(MISC)$/$(SHL1TARGET).map1 - +$(TYPE) mapFooter >> $(MISC)$/$(SHL1TARGET).map - -$(MISC)$/$(SHL2TARGET).map : sce$/$(SHL2TARGET).sce - +$(RM) $(MISC)$/$(SHL2TARGET).tst - +$(RM) $(MISC)$/$(SHL2TARGET).map - +$(TYPE) $< | sed $(REGEXP) > $@ - +$(TYPE) $@ | sed "s/^/test_/" >> $(MISC)$/$(SHL2TARGET).tst - +$(TYPE) mapHeader > $(MISC)$/$(SHL2TARGET).map - +$(TYPE) $(MISC)$/$(SHL2TARGET).tst | sed "/test_./ w $(MISC)$/$(SHL2TARGET).map1" - +$(TYPE) $(MISC)$/$(SHL2TARGET).map1 | sed "s/.*/&;/" >> $(MISC)$/$(SHL2TARGET).map - +$(RM) $(MISC)$/$(SHL2TARGET).map1 - +$(TYPE) mapFooter >> $(MISC)$/$(SHL2TARGET).map - -$(MISC)$/$(SHL3TARGET).map : sce$/$(SHL3TARGET).sce - +$(RM) $(MISC)$/$(SHL3TARGET).tst - +$(RM) $(MISC)$/$(SHL3TARGET).map - +$(TYPE) $< | sed $(REGEXP) > $@ - +$(TYPE) $@ | sed "s/^/test_/" >> $(MISC)$/$(SHL3TARGET).tst - +$(TYPE) mapHeader > $(MISC)$/$(SHL3TARGET).map - +$(TYPE) $(MISC)$/$(SHL3TARGET).tst | sed "/test_./ w $(MISC)$/$(SHL3TARGET).map1" - +$(TYPE) $(MISC)$/$(SHL3TARGET).map1 | sed "s/.*/&;/" >> $(MISC)$/$(SHL3TARGET).map - +$(RM) $(MISC)$/$(SHL3TARGET).map1 - +$(TYPE) mapFooter >> $(MISC)$/$(SHL3TARGET).map +$(MISC)$/$(SHL3TARGET).exp : sce$/$(SHL3TARGET).sce + +$(TYPE) $< | sed $(REGEXP) > $@ + +$(TYPE) $@ | sed "s/^/test_/" > $(MISC)$/$(SHL3TARGET).tst + +$(TYPE) $(MISC)$/$(SHL3TARGET).tst | sed "/test_./ w $@" cleanup: - +$(RM) $(MISCX)$/$(SHL1TARGET).map - +$(RM) $(MISCX)$/$(SHL2TARGET).map - +$(RM) $(MISCX)$/$(SHL3TARGET).map - +$(RM) $(MISCX)$/$(SHL1TARGET).tst - +$(RM) $(MISCX)$/$(SHL2TARGET).tst - +$(RM) $(MISCX)$/$(SHL3TARGET).tst - +$(RM) $(MISCX)$/$(SHL1TARGET).def - +$(RM) $(MISCX)$/$(SHL2TARGET).def - +$(RM) $(MISCX)$/$(SHL3TARGET).def - +$(RM) sce$/$(SHL1TARGET).out - +$(RM) sce$/$(SHL2TARGET).out - +$(RM) sce$/$(SHL3TARGET).out - +$(RM) sce$/$(SHL1TARGET).qadev - +$(RM) sce$/$(SHL2TARGET).qadev - +$(RM) sce$/$(SHL3TARGET).qadev + +$(RM) sce$/$(SHL1TARGET).exp + +$(RM) sce$/$(SHL2TARGET).exp + +$(RM) sce$/$(SHL1TARGET).tst + diff --git a/sal/rtl/source/alloc.c b/sal/rtl/source/alloc.c index bdf1240a7d3e..f88fe9b4459e 100644 --- a/sal/rtl/source/alloc.c +++ b/sal/rtl/source/alloc.c @@ -2,9 +2,9 @@ * * $RCSfile: alloc.c,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mhu $ $Date: 2002-04-09 09:46:50 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -139,7 +139,7 @@ static sal_uInt32 __rtl_memory_vmpagesize (void) /* #95880# building on Solaris 8 provides MAP_ANON, but it is not available on Solaris 7 */ -#if defined (SOLARIS) && defined (INTEL) +#if defined (SOLARIS) #ifdef MAP_ANON #undef MAP_ANON #endif diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 2267823f88a6..338256cd9729 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bootstrap.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dbo $ $Date: 2002-10-23 09:41:09 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -202,6 +202,7 @@ namespace _STL //---------------------------------------------------------------------------- + struct rtl_bootstrap_NameValue { rtl::OUString sName; @@ -534,6 +535,7 @@ rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName) return static_cast<rtlBootstrapHandle>(pImpl); } + void SAL_CALL rtl_bootstrap_args_close(rtlBootstrapHandle handle) { delete static_cast<Bootstrap_Impl*>(handle); diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk index 5aa4dce1b825..737f3f40e1cb 100644 --- a/sal/rtl/source/makefile.mk +++ b/sal/rtl/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.18 $ +# $Revision: 1.19 $ # -# last change: $Author: obo $ $Date: 2002-11-18 16:22:29 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:46:39 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -99,7 +99,7 @@ SLOFILES= $(SLO)$/alloc.obj \ $(SLO)$/macro.obj \ $(SLO)$/unload.obj \ $(SLO)$/logfile.obj \ - $(SLO)$/tresimpl.obj \ + $(SLO)$/tres.obj \ $(SLO)$/math.obj #.IF "$(UPDATER)"=="YES" @@ -124,7 +124,7 @@ OBJFILES= $(OBJ)$/alloc.obj \ $(OBJ)$/macro.obj \ $(OBJ)$/unload.obj \ $(OBJ)$/logfile.obj \ - $(OBJ)$/tresimpl.obj \ + $(OBJ)$/tres.obj \ $(OBJ)$/math.obj #.ENDIF diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index ba856bedb482..28c1f0d87cde 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -2,9 +2,9 @@ * * $RCSfile: math.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sb $ $Date: 2002-11-07 10:51:14 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -187,8 +187,6 @@ inline void doubleToString(StringT ** pResult, typename T::Char cGroupSeparator, bool bEraseTrailingDecZeros) { - // TODO: pGroups, cGroupSeparator - static double const nRoundVal[] = { 5.0e+0, 0.5e+0, 0.5e-1, 0.5e-2, 0.5e-3, 0.5e-4, 0.5e-5, 0.5e-6, 0.5e-7, 0.5e-8, 0.5e-9, 0.5e-10,0.5e-11,0.5e-12,0.5e-13,0.5e-14 @@ -248,13 +246,12 @@ inline void doubleToString(StringT ** pResult, if ( fValue > 0.0 ) { if ( fValue < 1e-8 || fValue > 1e8 ) - { // die Schere, ob's schneller ist oder nicht, liegt zwischen 1e7 und - // 1e8 + { // the shear whether it's faster or not is between 1e7 and 1e8 nExp = static_cast< int >( floor( log10( fValue ) ) ); fValue /= pow( 10.0, static_cast< double >( nExp ) ); } else - { // man stelle sich sonst 1E+308 vor.. + { // else imagine 1E+308 ... while( fValue < 1.0 ) { fValue *= 10.0; @@ -271,9 +268,9 @@ inline void doubleToString(StringT ** pResult, switch ( eFormat ) { case rtl_math_StringFormat_Automatic : - { // Automatik + { // E or F depending on exponent magnitude int nPrec; - if ( nExp <= -15 || nExp >= 15 ) // #58531# war <-16, >16 + if ( nExp <= -15 || nExp >= 15 ) // #58531# was <-16, >16 { nPrec = 14; eFormat = rtl_math_StringFormat_E; @@ -291,13 +288,13 @@ inline void doubleToString(StringT ** pResult, eFormat = rtl_math_StringFormat_F; } } - if ( nDecPlaces < 0 ) + if ( nDecPlaces == rtl_math_DecimalPlaces_Max ) nDecPlaces = nPrec; } break; case rtl_math_StringFormat_G : - { // G-Point, wie sprintf %G - if ( nDecPlaces < 0 ) + { // G-Point, similar to sprintf %G + if ( nDecPlaces == rtl_math_DecimalPlaces_DefaultSignificance ) nDecPlaces = 6; if ( nExp < -4 || nExp >= nDecPlaces ) { @@ -312,7 +309,6 @@ inline void doubleToString(StringT ** pResult, } break; } - OSL_ASSERT(nDecPlaces >= 0); sal_Int32 nDigits = nDecPlaces + 1; @@ -336,7 +332,7 @@ inline void doubleToString(StringT ** pResult, typename T::Char * pBuf; sal_Int32 nBuf = static_cast< sal_Int32 > ( nDigits <= 0 ? std::max< sal_Int32 >( nDecPlaces, abs(nExp) ) - : nDigits + nDecPlaces ) + 10; + : nDigits + nDecPlaces ) + 10 + (pGroups ? abs(nDigits) * 2 : 0); if ( nBuf > nBufMax ) { pBuf = reinterpret_cast< typename T::Char * >( @@ -374,12 +370,29 @@ inline void doubleToString(StringT ** pResult, else nDecPos = 1; + int nGrouping = 0, nGroupSelector = 0, nGroupExceed = 0; + if ( nDecPos > 1 && pGroups && pGroups[0] && cGroupSeparator ) + { + while ( nGrouping + pGroups[nGroupSelector] < nDecPos ) + { + nGrouping += pGroups[ nGroupSelector ]; + if ( pGroups[nGroupSelector+1] ) + { + if ( nGrouping + pGroups[nGroupSelector+1] >= nDecPos ) + break; // while + ++nGroupSelector; + } + else if ( !nGroupExceed ) + nGroupExceed = nGrouping; + } + } + // print the number if( nDigits > 0 ) { for ( int i = 0; ; i++ ) { - if( i < 15 ) // vorher 16 + if( i < 15 ) { int nDigit; if (nDigits-1 == 0 && i > 0 && i < 14) @@ -387,9 +400,8 @@ inline void doubleToString(StringT ** pResult, + nKorrVal[15-i] ) ); else nDigit = static_cast< int >( fValue + 1E-15 ); - // vorher 1E-14 if (nDigit >= 10) - { // Nachbehandlung: + { // after-treatment of up-rounding to the next decade sal_Int32 sLen = static_cast< long >(p-pBuf)-1; if (sLen == -1) { @@ -418,7 +430,7 @@ inline void doubleToString(StringT ** pResult, if ( cS != static_cast< typename T::Char >('9')) { pBuf[j] = ++cS; - j = -1; // abbruch + j = -1; // break loop } else { @@ -469,15 +481,30 @@ inline void doubleToString(StringT ** pResult, *p++ = cDecSeparator; bHasDec = true; } + else if ( nDecPos == nGrouping ) + { + *p++ = cGroupSeparator; + nGrouping -= pGroups[ nGroupSelector ]; + if ( nGroupSelector && nGrouping < nGroupExceed ) + --nGroupSelector; + } } } } if ( !bHasDec && eFormat == rtl_math_StringFormat_F ) - { + { // nDecPlaces < 0 did round the value while ( --nDecPos > 0 ) + { // fill before decimal point + if ( nDecPos == nGrouping ) + { + *p++ = cGroupSeparator; + nGrouping -= pGroups[ nGroupSelector ]; + if ( nGroupSelector && nGrouping < nGroupExceed ) + --nGroupSelector; + } *p++ = static_cast< typename T::Char >('0'); - // Vorkomma Rundung auffuellen + } } if ( bEraseTrailingDecZeros && bHasDec && p > pBuf ) @@ -495,7 +522,7 @@ inline void doubleToString(StringT ** pResult, { if ( p == pBuf ) *p++ = static_cast< typename T::Char >('1'); - // bei negativem nDecPlaces keine nDigits + // maybe no nDigits if nDecPlaces < 0 *p++ = static_cast< typename T::Char >('E'); if( nExp < 0 ) { @@ -564,7 +591,7 @@ void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult, namespace { -// ob nExp * 10 + nAdd Overflow gibt +// if nExp * 10 + nAdd would result in overflow inline bool long10Overflow( long& nExp, int nAdd ) { if ( nExp > (LONG_MAX/10) @@ -609,14 +636,13 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, } CharT const * p = p0; - // fuehrende Nullen und Tausenderseparatoren brauchen nicht berechnet zu - // werden + // leading zeros and group separators may be safely ignored while (p != pEnd && (*p == CharT('0') || *p == cGroupSeparator)) ++p; - long nValExp = 0; // Exponent der Mantisse mitfuehren + long nValExp = 0; // carry along exponent of mantissa - // Mantisse Integer + // integer part of mantissa for (; p != pEnd; ++p) { CharT c = *p; @@ -629,7 +655,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, break; } - // Mantisse Fraction + // fraction part of mantissa if (p != pEnd && *p == cDecSeparator) { ++p; @@ -641,8 +667,8 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, ++p; } if ( nValExp == 0 ) - nValExp = nFracExp - 1; // kein Integer-Teil => Fraction Exponent - // eine Ziffer braucht ld(10) ~= 3.32 Bits + nValExp = nFracExp - 1; // no integer part => fraction exponent + // one decimal digit needs ld(10) ~= 3.32 bits static const int nSigs = (DBL_MANT_DIG / 3) + 1; int nDigs = 0; for (; p != pEnd; ++p) @@ -651,7 +677,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, if (!isDigit(c)) break; if ( nDigs < nSigs ) - { // bei weiteren Ziffern geht jegliche Signifikanz verloren + { // further digits (more than nSigs) don't have any significance fFrac = fFrac * 10.0 + static_cast< double >( c - CharT('0') ); --nFracExp; ++nDigs; @@ -660,11 +686,11 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, if ( fFrac != 0.0 ) fVal += rtl::math::pow10Exp( fFrac, nFracExp ); else if ( nValExp < 0 ) - nValExp = 0; // keine Ziffer ungleich 0 hinterm Komma + nValExp = 0; // no digit other than 0 after decimal point } if ( nValExp > 0 ) - --nValExp; // bei der ersten Vorkomma-Ziffer zuviel + --nValExp; // started with offset +1 at the first mantissa digit // Exponent if (p != p0 && p != pEnd && (*p == CharT('E') || *p == CharT('e'))) @@ -683,7 +709,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, ++p; } if ( fVal == 0.0 ) - { // egal was hier kommt: es bleibt Null, aber Offset weiterfuehren + { // no matter what follows, zero stays zero, but carry on the offset while (p != pEnd && isDigit(*p)) ++p; } @@ -708,17 +734,17 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, nExp = -nExp; long nAllExp = ( bOverFlow ? 0 : nExp + nValExp ); if ( nAllExp > DBL_MAX_10_EXP || (bOverFlow && !bExpSign) ) - { // Ueberlauf + { // overflow fVal = HUGE_VAL; eStatus = rtl_math_ConversionStatus_OutOfRange; } else if ( nAllExp < DBL_MIN_10_EXP || (bOverFlow && bExpSign) ) - { // Unterlauf + { // underflow fVal = 0.0; eStatus = rtl_math_ConversionStatus_OutOfRange; } else if ( nExp > DBL_MAX_10_EXP || nExp < DBL_MIN_10_EXP ) - { // Exponenten ausgleichen + { // compensate exponents fVal = rtl::math::pow10Exp( fVal, -nValExp ); fVal = rtl::math::pow10Exp( fVal, nAllExp ); } @@ -759,8 +785,8 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, } } - // z.B. auch wenn mehr als DBL_MAX_10_EXP Ziffern ohne Dezimalseparator - // oder 0. und mehr als DBL_MIN_10_EXP Ziffern u.ae. + // overflow also if more than DBL_MAX_10_EXP digits without decimal + // separator, or 0. and more than DBL_MIN_10_EXP digits, ... bool bHuge = fVal == HUGE_VAL; // g++ 3.0.1 requires it this way... if ( bHuge ) eStatus = rtl_math_ConversionStatus_OutOfRange; diff --git a/sal/rtl/source/string.c b/sal/rtl/source/string.c index 3034ad1aa008..e20c6ba9ec6f 100644 --- a/sal/rtl/source/string.c +++ b/sal/rtl/source/string.c @@ -2,9 +2,9 @@ * * $RCSfile: string.c,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sb $ $Date: 2002-11-05 11:01:36 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:46:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -227,17 +227,20 @@ static int rtl_ImplGetFastUTF8ByteLen( const sal_Unicode* pStr, sal_Int32 nLen ) /* ----------------------------------------------------------------------- */ -void SAL_CALL rtl_uString2String( rtl_String** ppThis, - const sal_Unicode* pUStr, - sal_Int32 nULen, - rtl_TextEncoding eTextEncoding, - sal_uInt32 nCvtFlags ) +sal_Bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget, + sal_Unicode const * pSource, + sal_Int32 nLength, + rtl_TextEncoding nEncoding, + sal_uInt32 nFlags, + sal_Bool bCheckErrors) { - OSL_ENSURE(rtl_isOctetTextEncoding(eTextEncoding), - "rtl_uString2String() - Wrong TextEncoding"); + OSL_ASSERT(pTarget != NULL + && (pSource != NULL || nLength == 0) + && nLength >= 0 + && rtl_isOctetTextEncoding(nEncoding)); - if ( !nULen ) - rtl_string_new( ppThis ); + if ( !nLength ) + rtl_string_new( pTarget ); else { rtl_String* pTemp; @@ -249,77 +252,79 @@ void SAL_CALL rtl_uString2String( rtl_String** ppThis, sal_Size nNotConvertedChars; sal_Size nMaxCharLen; - if ( *ppThis ) - IMPL_RTL_STRINGNAME( release )( *ppThis ); - /* Optimization for UTF-8 - we try to calculate the exact length */ /* For all other encoding we try an good estimation */ - if ( eTextEncoding == RTL_TEXTENCODING_UTF8 ) + if ( nEncoding == RTL_TEXTENCODING_UTF8 ) { - nNewLen = rtl_ImplGetFastUTF8ByteLen( pUStr, nULen ); + nNewLen = rtl_ImplGetFastUTF8ByteLen( pSource, nLength ); /* Includes the string only ASCII, then we could copy the buffer faster */ - if ( nNewLen == (sal_Size)nULen ) + if ( nNewLen == (sal_Size)nLength ) { IMPL_RTL_STRCODE* pBuffer; - *ppThis = IMPL_RTL_STRINGNAME( ImplAlloc )( nULen ); - pBuffer = (*ppThis)->buffer; + if ( *pTarget ) + IMPL_RTL_STRINGNAME( release )( *pTarget ); + *pTarget = IMPL_RTL_STRINGNAME( ImplAlloc )( nLength ); + pBuffer = (*pTarget)->buffer; do { /* Check ASCII range */ - OSL_ENSURE( *pUStr <= 127, + OSL_ENSURE( *pSource <= 127, "rtl_uString2String() - UTF8 test is encoding is wrong" ); - *pBuffer = (IMPL_RTL_STRCODE)(unsigned char)*pUStr; + *pBuffer = (IMPL_RTL_STRCODE)(unsigned char)*pSource; pBuffer++; - pUStr++; - nULen--; + pSource++; + nLength--; } - while ( nULen ); - return; + while ( nLength ); + return sal_True; } - nMaxCharLen = 6; + nMaxCharLen = 4; } else { rtl_TextEncodingInfo aTextEncInfo; aTextEncInfo.StructSize = sizeof( aTextEncInfo ); - if ( !rtl_getTextEncodingInfo( eTextEncoding, &aTextEncInfo ) ) + if ( !rtl_getTextEncodingInfo( nEncoding, &aTextEncInfo ) ) { aTextEncInfo.AverageCharSize = 1; aTextEncInfo.MaximumCharSize = 8; } - nNewLen = nULen*aTextEncInfo.AverageCharSize; + nNewLen = nLength*aTextEncInfo.AverageCharSize; nMaxCharLen = aTextEncInfo.MaximumCharSize; } - nCvtFlags |= RTL_UNICODETOTEXT_FLAGS_FLUSH; - hConverter = rtl_createUnicodeToTextConverter( eTextEncoding ); + nFlags |= RTL_UNICODETOTEXT_FLAGS_FLUSH; + hConverter = rtl_createUnicodeToTextConverter( nEncoding ); - pTemp = IMPL_RTL_STRINGNAME( ImplAlloc )( nNewLen ); - nDestBytes = rtl_convertUnicodeToText( hConverter, 0, - pUStr, nULen, - pTemp->buffer, nNewLen, - nCvtFlags, - &nInfo, &nSrcChars ); - - /* Buffer not big enough, try again with enough space */ - while ( nInfo & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL ) + for (;;) { + pTemp = IMPL_RTL_STRINGNAME( ImplAlloc )( nNewLen ); + nDestBytes = rtl_convertUnicodeToText( hConverter, 0, + pSource, nLength, + pTemp->buffer, nNewLen, + nFlags, + &nInfo, &nSrcChars ); + if (bCheckErrors && (nInfo & RTL_UNICODETOTEXT_INFO_ERROR) != 0) + { + rtl_freeMemory(pTemp); + rtl_destroyUnicodeToTextConverter(hConverter); + return sal_False; + } + + if ((nInfo & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL) == 0) + break; + + /* Buffer not big enough, try again with enough space */ rtl_freeMemory( pTemp ); /* Try with the max. count of characters with additional overhead for replacing functionality */ - nNotConvertedChars = nULen-nSrcChars; + nNotConvertedChars = nLength-nSrcChars; nNewLen = nDestBytes+(nNotConvertedChars*nMaxCharLen)+nNotConvertedChars+4; - pTemp = IMPL_RTL_STRINGNAME( ImplAlloc )( nNewLen ); - nDestBytes = rtl_convertUnicodeToText( hConverter, 0, - pUStr, nULen, - pTemp->buffer, nNewLen, - nCvtFlags, - &nInfo, &nSrcChars ); } /* Set the buffer to the correct size or is there to @@ -338,12 +343,34 @@ void SAL_CALL rtl_uString2String( rtl_String** ppThis, } rtl_destroyUnicodeToTextConverter( hConverter ); - *ppThis = pTemp; + if ( *pTarget ) + IMPL_RTL_STRINGNAME( release )( *pTarget ); + *pTarget = pTemp; /* Results the conversion in an empty buffer - create an empty string */ if ( pTemp && !nDestBytes ) - rtl_string_new( ppThis ); + rtl_string_new( pTarget ); } + return sal_True; +} + +void SAL_CALL rtl_uString2String( rtl_String** ppThis, + const sal_Unicode* pUStr, + sal_Int32 nULen, + rtl_TextEncoding eTextEncoding, + sal_uInt32 nCvtFlags ) +{ + rtl_impl_convertUStringToString(ppThis, pUStr, nULen, eTextEncoding, + nCvtFlags, sal_False); } +sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget, + sal_Unicode const * pSource, + sal_Int32 nLength, + rtl_TextEncoding nEncoding, + sal_uInt32 nFlags) +{ + return rtl_impl_convertUStringToString(pTarget, pSource, nLength, nEncoding, + nFlags, sal_True); +} diff --git a/sal/rtl/source/tres.c b/sal/rtl/source/tres.c index 8efedfc33edf..13a6adf93d4e 100644 --- a/sal/rtl/source/tres.c +++ b/sal/rtl/source/tres.c @@ -5,7 +5,7 @@ #include <osl/diagnose.h> #endif -#ifndef _OSL_TIME_H_ +#ifndef _OSL_TIMEE_H_ #include <osl/time.h> #endif @@ -36,6 +36,7 @@ typedef struct _rtl_FuncState } rtl_FuncState; + typedef struct _rtl_TestResult_Data { rtl_TestResult_vtable* m_funcs; diff --git a/sal/systools/win32/uwinapi/EnumProcesses.cpp b/sal/systools/win32/uwinapi/EnumProcesses.cpp new file mode 100644 index 000000000000..b98541ff1f40 --- /dev/null +++ b/sal/systools/win32/uwinapi/EnumProcesses.cpp @@ -0,0 +1,41 @@ +#include "macros.h" +#include <tlhelp32.h> + +IMPLEMENT_THUNK( psapi, WINDOWS, BOOL, WINAPI, EnumProcesses, ( LPDWORD lpProcesses, DWORD cbSize, LPDWORD lpcbCopied ) ) +{ + BOOL fSuccess = FALSE; + HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); + + if ( IsValidHandle( hSnapshot ) ) + { + PROCESSENTRY32 pe; + + if ( lpcbCopied ) + *lpcbCopied = 0; + + pe.dwSize = sizeof(pe); + if ( Process32First( hSnapshot, &pe ) ) + { + fSuccess = TRUE; + + while ( cbSize >= sizeof(*lpProcesses) ) + { + *(lpProcesses++) = pe.th32ProcessID; + if ( lpcbCopied ) + *lpcbCopied += sizeof(*lpProcesses); + cbSize -= sizeof(*lpProcesses); + + if ( !Process32Next( hSnapshot, &pe ) ) + break; + } + } + + CloseHandle( hSnapshot ); + } + else + SetLastError( ERROR_INVALID_HANDLE ); + + return fSuccess; +} + + diff --git a/sal/systools/win32/uwinapi/GetModuleFileNameExA.cpp b/sal/systools/win32/uwinapi/GetModuleFileNameExA.cpp new file mode 100644 index 000000000000..de78c68b74ac --- /dev/null +++ b/sal/systools/win32/uwinapi/GetModuleFileNameExA.cpp @@ -0,0 +1,47 @@ +#include "macros.h" +#include <psapi.h> +#include <tlhelp32.h> + +IMPLEMENT_THUNK( psapi, WINDOWS, DWORD, WINAPI, GetModuleFileNameExA, (HANDLE hProcess, HMODULE hModule, LPSTR lpFileName, DWORD nSize ) ) +{ + DWORD dwProcessId = 0; + DWORD dwResult = 0; + + if ( !hProcess || hProcess == GetCurrentProcess() || GetCurrentProcessId() == (dwProcessId = GetProcessId( hProcess )) ) + return GetModuleFileNameA( hModule, lpFileName, nSize ); + + HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwProcessId ); + + if ( IsValidHandle( hSnapshot ) ) + { + MODULEENTRY32 me; + + me.dwSize = sizeof(me); + if ( Module32First( hSnapshot, &me ) ) + { + BOOL fFound = FALSE; + + if ( NULL == hModule ) + fFound = TRUE; + else do + { + fFound = (me.hModule == hModule); + } while ( !fFound && Module32Next( hSnapshot, &me ) ); + + if ( fFound ) + { + dwResult = _tcslen( me.szExePath ); + + if ( dwResult > nSize && nSize > 0 ) + lpFileName[nSize -1] = 0; + + _tcsncpy( lpFileName, me.szExePath, nSize ); + } + } + + CloseHandle( hSnapshot ); + } + + return dwResult; +} + diff --git a/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp b/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp new file mode 100644 index 000000000000..7b95364ec975 --- /dev/null +++ b/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp @@ -0,0 +1,12 @@ +#include "macros.h" +#include <psapi.h> + +IMPLEMENT_THUNK( psapi, WINDOWS, DWORD, WINAPI, GetModuleFileNameExW, (HANDLE hProcess, HMODULE hModule, LPWSTR lpFileNameW, DWORD nSize ) ) +{ + AUTO_STR( lpFileName, 2 * nSize ); + + if ( GetModuleFileNameExA( hProcess, hModule, lpFileNameA, 2 * nSize ) ) + return STR2WSTR( lpFileName, nSize ); + else + return 0; +} diff --git a/sal/systools/win32/uwinapi/GetProcessId.cpp b/sal/systools/win32/uwinapi/GetProcessId.cpp new file mode 100644 index 000000000000..ca809c3fa4e3 --- /dev/null +++ b/sal/systools/win32/uwinapi/GetProcessId.cpp @@ -0,0 +1,199 @@ +/************************************************************************* + * + * $RCSfile: GetProcessId.cpp,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:46:48 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "macros.h" +#include "win95sys.h" +#include <tlhelp32.h> +static FARPROC WINAPI GetRealProcAddress( HMODULE hModule, LPCSTR lpProcName ) +{ + FARPROC lpfn = GetProcAddress( hModule, lpProcName ); + + if ( lpfn ) + { + if ( 0x68 == *(LPBYTE)lpfn ) + { + /* + 82C9F460 68 36 49 F8 BF push 0BFF84936h + 82C9F465 E9 41 62 2F 3D jmp BFF956AB + */ + + lpfn = (FARPROC)*(LPDWORD)((LPBYTE)lpfn + 1); + + /* + BFF956AB 9C pushfd + BFF956AC FC cld + BFF956AD 50 push eax + BFF956AE 53 push ebx + BFF956AF 52 push edx + BFF956B0 64 8B 15 20 00 00 00 mov edx,dword ptr fs:[20h] + BFF956B7 0B D2 or edx,edx + BFF956B9 74 09 je BFF956C4 + BFF956BB 8B 42 04 mov eax,dword ptr [edx+4] + BFF956BE 0B C0 or eax,eax + BFF956C0 74 07 je BFF956C9 + BFF956C2 EB 42 jmp BFF95706 + BFF956C4 5A pop edx + BFF956C5 5B pop ebx + BFF956C6 58 pop eax + BFF956C7 9D popfd + BFF956C8 C3 ret + */ + } + } + + return lpfn; +} + + +typedef DWORD (WINAPI OBFUSCATE)( DWORD dwPTID ); +typedef OBFUSCATE *LPOBFUSCATE; +OBFUSCATE Obfuscate; + +static DWORD WINAPI Obfuscate( DWORD dwPTID ) +{ + static LPOBFUSCATE lpfnObfuscate = NULL; + + if ( !lpfnObfuscate ) + { + LPBYTE lpCode = (LPBYTE)GetRealProcAddress( GetModuleHandleA("KERNEL32"), "GetCurrentThreadId" ); + + if ( lpCode ) + { + /* + GetCurrentThreadId: + lpCode + 00 BFF84936 A1 DC 9C FC BF mov eax,[BFFC9CDC] ; This is the real thread id + lpcode + 05 BFF8493B FF 30 push dword ptr [eax] + lpCode + 07 BFF8493D E8 17 C5 FF FF call BFF80E59 ; call Obfuscate function + lpcode + 0C BFF84942 C3 ret + */ + + DWORD dwOffset = *(LPDWORD)(lpCode + 0x08); + + lpfnObfuscate = (LPOBFUSCATE)(lpCode + 0x0C + dwOffset); + /* + Obfuscate: + BFF80E59 A1 CC 98 FC BF mov eax,[BFFC98CC] + BFF80E5E 85 C0 test eax,eax + BFF80E60 75 04 jne BFF80E66 + BFF80E62 33 C0 xor eax,eax + BFF80E64 EB 04 jmp BFF80E6A + BFF80E66 33 44 24 04 xor eax,dword ptr [esp+4] + BFF80E6A C2 04 00 ret 4 + */ + } + + } + + return lpfnObfuscate ? lpfnObfuscate( dwPTID ) : 0; +} + + +EXTERN_C DWORD WINAPI GetProcessId_WINDOWS( HANDLE hProcess ) +{ + if ( GetCurrentProcess() == hProcess ) + return GetCurrentProcessId(); + + DWORD dwProcessId = 0; + PPROCESS_DATABASE pPDB = (PPROCESS_DATABASE)Obfuscate( GetCurrentProcessId() ); + + if ( pPDB && K32OBJ_PROCESS == pPDB->Type ) + { + DWORD dwHandleNumber = (DWORD)hProcess >> 2; + + if ( 0 == ((DWORD)hProcess & 0x03) && dwHandleNumber < pPDB->pHandleTable->cEntries ) + { + if ( + pPDB->pHandleTable->array[dwHandleNumber].pObject && + K32OBJ_PROCESS == pPDB->pHandleTable->array[dwHandleNumber].pObject->Type + ) + dwProcessId = Obfuscate( (DWORD)pPDB->pHandleTable->array[dwHandleNumber].pObject ); + } + + SetLastError( ERROR_INVALID_HANDLE ); + } + + return dwProcessId; +} + + +EXTERN_C DWORD WINAPI GetProcessId_NT( HANDLE hProcess ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return 0; +} + + +EXTERN_C void WINAPI ResolveThunk_GetProcessId( FARPROC *lppfn, LPCSTR lpLibFileName, LPCSTR lpFuncName ) +{ + if ( (LONG)GetVersion() < 0 ) + *lppfn = (FARPROC)GetProcessId_WINDOWS; + else + { + FARPROC lpfnResult = GetProcAddress( LoadLibraryA( lpLibFileName ), lpFuncName ); + if ( !lpfnResult ) + lpfnResult = (FARPROC)GetProcessId_NT; + + *lppfn = lpfnResult; + } +} + + +DEFINE_CUSTOM_THUNK( kernel32, GetProcessId, DWORD, WINAPI, GetProcessId, ( HANDLE hProcess ) ); diff --git a/sal/systools/win32/uwinapi/SHILCreateFromPathW.cpp b/sal/systools/win32/uwinapi/SHILCreateFromPathW.cpp new file mode 100644 index 000000000000..f00eae8025b6 --- /dev/null +++ b/sal/systools/win32/uwinapi/SHILCreateFromPathW.cpp @@ -0,0 +1,32 @@ +#include "uwinapi.h" + +EXTERN_C LPITEMIDLIST WINAPI SHSimpleIDListFromPathW_Failure( LPCWSTR lpPathW ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return NULL; +} + +EXTERN_C LPITEMIDLIST WINAPI SHSimpleIDListFromPathW_WINDOWS( LPCWSTR lpPathW ) +{ + AUTO_WSTR2STR( lpPath ); + + return SHSimpleIDListFromPathA( lpPathA ); +} + + +EXTERN_C void WINAPI ResolveThunk_SHSimpleIDListFromPathW( FARPROC *lppfn, LPCSTR lpLibFileName, LPCSTR lpFuncName ) +{ + if ( (LONG)GetVersion < 0 ) + *lppfn = (FARPROC)SHSimpleIDListFromPathW_WINDOWS; + else + { + FARPROC lpfnResult = GetProcAddress( LoadLibraryA( lpLibFileName ), MAKEINTRESOURCE(162) ); + if ( !lpfnResult ) + lpfnResult = (FARPROC)SHSimpleIDListFromPathW_Failure; + + *lppfn = lpfnResult; + } +} + + +DEFINE_CUSTOM_THUNK( kernel32, GetLongPathNameW, DWORD, WINAPI, GetLongPathNameW, ( LPCWSTR lpShortPathW, LPWSTR lpLongPathW, DWORD cchBuffer ) ); diff --git a/sal/systools/win32/uwinapi/makefile.mk b/sal/systools/win32/uwinapi/makefile.mk index 1f5099fc9c2a..d9ba4c7154c9 100644 --- a/sal/systools/win32/uwinapi/makefile.mk +++ b/sal/systools/win32/uwinapi/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: hro $ $Date: 2002-12-10 12:17:06 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:46:49 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -83,15 +83,20 @@ SLOFILES=\ $(SLO)$/CopyFileExA.obj\ $(SLO)$/CopyFileExW.obj\ $(SLO)$/DrawStateW.obj\ + $(SLO)$/EnumProcesses.obj\ $(SLO)$/GetLogicalDriveStringsW.obj\ $(SLO)$/GetLongPathNameA.obj\ $(SLO)$/GetLongPathNameW.obj\ + $(SLO)$/GetModuleFileNameExA.obj\ + $(SLO)$/GetModuleFileNameExW.obj\ + $(SLO)$/GetProcessId.obj\ $(SLO)$/GetUserDomainA.obj\ $(SLO)$/GetUserDomainW.obj\ $(SLO)$/GetDiskFreeSpaceExA.obj\ $(SLO)$/GetDiskFreeSpaceExW.obj\ $(SLO)$/MoveFileExA.obj\ $(SLO)$/MoveFileExW.obj\ + $(SLO)$/toolhelp.obj\ $(SLO)$/DllGetVersion.obj\ $(SLO)$/DllMain.obj\ $(SLO)$/ResolveThunk.obj\ diff --git a/sal/systools/win32/uwinapi/toolhelp.cpp b/sal/systools/win32/uwinapi/toolhelp.cpp new file mode 100644 index 000000000000..7b651581bae7 --- /dev/null +++ b/sal/systools/win32/uwinapi/toolhelp.cpp @@ -0,0 +1,57 @@ +#include "macros.h" +#include <tlhelp32.h> + + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Module32First, (HANDLE hSnapshot, LPMODULEENTRY32 lpme ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Module32FirstW, (HANDLE hSnapshot, LPMODULEENTRY32W lpme ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Module32Next, (HANDLE hSnapshot, LPMODULEENTRY32 lpme ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Module32NextW, (HANDLE hSnapshot, LPMODULEENTRY32W lpme ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Process32First, (HANDLE hSnapshot, LPPROCESSENTRY32 lppe ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Process32FirstW, (HANDLE hSnapshot, LPPROCESSENTRY32W lppe ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Process32Next, (HANDLE hSnapshot, LPPROCESSENTRY32 lppe ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, Process32NextW, (HANDLE hSnapshot, LPPROCESSENTRY32W lppe ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +IMPLEMENT_THUNK( kernel32, TRYLOAD, HANDLE, WINAPI, CreateToolhelp32Snapshot, (DWORD dwFlags, DWORD th32ProcessID ) ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return NULL; +} diff --git a/sal/systools/win32/uwinapi/unicows.dxp b/sal/systools/win32/uwinapi/unicows.dxp index 6594ba71e9b9..d0ba027f68cd 100644 --- a/sal/systools/win32/uwinapi/unicows.dxp +++ b/sal/systools/win32/uwinapi/unicows.dxp @@ -2,9 +2,9 @@ ; ; $RCSfile: unicows.dxp,v $ ; -; $Revision: 1.1 $ +; $Revision: 1.2 $ ; -; last change: $Author: hro $ $Date: 2002-08-26 12:56:07 $ +; last change: $Author: hr $ $Date: 2003-03-26 16:46:50 $ ; ; The Contents of this file are made available subject to the terms of ; either of the following licenses @@ -411,7 +411,7 @@ RasConnectionNotificationW RasCreatePhonebookEntryW RasDeleteEntryW RasDeleteSubEntryW -RasDialW +;RasDialW RasEditPhonebookEntryW RasEnumConnectionsW RasEnumDevicesW diff --git a/sal/systools/win32/uwinapi/uwinapi.dxp b/sal/systools/win32/uwinapi/uwinapi.dxp index 3867e9d0b0ae..c0746424f46e 100644 --- a/sal/systools/win32/uwinapi/uwinapi.dxp +++ b/sal/systools/win32/uwinapi/uwinapi.dxp @@ -2,9 +2,9 @@ ; ; $RCSfile: uwinapi.dxp,v $ ; -; $Revision: 1.3 $ +; $Revision: 1.4 $ ; -; last change: $Author: hro $ $Date: 2002-08-26 13:36:16 $ +; last change: $Author: hr $ $Date: 2003-03-26 16:46:51 $ ; ; The Contents of this file are made available subject to the terms of ; either of the following licenses @@ -64,13 +64,26 @@ DllGetVersion CommandLineToArgvW CopyFileExA CopyFileExW +CreateToolhelp32Snapshot DrawStateW +EnumProcesses GetDiskFreeSpaceExA GetDiskFreeSpaceExW GetLogicalDriveStringsW GetLongPathNameA GetLongPathNameW +GetModuleFileNameExA +GetModuleFileNameExW +GetProcessId GetUserDomainA GetUserDomainW +Module32First +Module32FirstW +Module32Next +Module32NextW MoveFileExA MoveFileExW +Process32First +Process32FirstW +Process32Next +Process32NextW diff --git a/sal/systools/win32/uwinapi/win95sys.h b/sal/systools/win32/uwinapi/win95sys.h new file mode 100644 index 000000000000..f64a751767aa --- /dev/null +++ b/sal/systools/win32/uwinapi/win95sys.h @@ -0,0 +1,346 @@ +#pragma once + +//Kernel32 objects + +#define K32OBJ_SEMAPHORE 0x1 +#define K32OBJ_EVENT 0x2 +#define K32OBJ_MUTEX 0x3 +#define K32OBJ_CRITICAL_SECTION 0x4 +#define K32OBJ_PROCESS 0x5 +#define K32OBJ_THREAD 0x6 +#define K32OBJ_FILE 0x7 +#define K32OBJ_CHANGE 0x8 +#define K32OBJ_CONSOLE 0x9 +#define K32OBJ_SCREEN_BUFFER 0xA +#define K32OBJ_MEM_MAPPED_FILE 0xB +#define K32OBJ_SERIAL 0xC +#define K32OBJ_DEVICE_IOCTL 0xD +#define K32OBJ_PIPE 0xE +#define K32OBJ_MAILSLOT 0xF +#define K32OBJ_TOOLHELP_SNAPSHOT 0x10 +#define K32OBJ_SOCKET 0x11 + + +//Process Database flags + +#define fDebugSingle 0x00000001 +#define fCreateProcessEvent 0x00000002 +#define fExitProcessEvent 0x00000004 +#define fWin16Process 0x00000008 +#define fDosProcess 0x00000010 +#define fConsoleProcess 0x00000020 +#define fFileApisAreOem 0x00000040 +#define fNukeProcess 0x00000080 +#define fServiceProcess 0x00000100 +#define fLoginScriptHack 0x00000800 + + +//Thread Database flags + +#define fCreateThreadEvent 0x00000001 +#define fCancelExceptionAbort 0x00000002 +#define fOnTempStack 0x00000004 +#define fGrowableStack 0x00000008 +#define fDelaySingleStep 0x00000010 +#define fOpenExeAsImmovableFile 0x00000020 +#define fCreateSuspended 0x00000040 +#define fStackOverflow 0x00000080 +#define fNestedCleanAPCs 0x00000100 +#define fWasOemNowAnsi 0x00000200 +#define fOKToSetThreadOem 0x00000400 + + +#pragma pack(1) + + +//MODREF and IMTE structures + +typedef struct _MODREF { + struct _MODREF *pNextModRef; // 00h + DWORD un1; // 04h + DWORD un2; // 08h + DWORD un3; // 0Ch + WORD mteIndex; // 10h + WORD un4; // 12h + DWORD un5; // 14h + PVOID ppdb; // 18h Pointer to process database + DWORD un6; // 1Ch + DWORD un7; // 20h + DWORD un8; // 24h +} MODREF, *PMODREF; + +typedef struct _IMTE { + DWORD un1; // 00h + PIMAGE_NT_HEADERS pNTHdr; // 04h + DWORD un2; // 08h + PSTR pszFileName; // 0Ch + PSTR pszModName; // 10h + WORD cbFileName; // 14h + WORD cbModName; // 16h + DWORD un3; // 18h + DWORD cSections; // 1Ch + DWORD un5; // 20h + DWORD baseAddress; // 24h + WORD hModule16; // 28h + WORD cUsage; // 2Ah + DWORD un7; // 2Ch + PSTR pszFileName2; // 30h + WORD cbFileName2; // 34h + DWORD pszModName2; // 36h + WORD cbModName2; // 3Ah +} IMTE, *PIMTE; + + +//Process Database structure + +typedef struct _ENVIRONMENT_DATABASE { +PSTR pszEnvironment; // 00h Pointer to Environment +DWORD un1; // 04h +PSTR pszCmdLine; // 08h Pointer to command line +PSTR pszCurrDirectory; // 0Ch Pointer to current directory +LPSTARTUPINFOA pStartupInfo;// 10h Pointer to STARTUPINFOA struct +HANDLE hStdIn; // 14h Standard Input +HANDLE hStdOut; // 18h Standard Output +HANDLE hStdErr; // 1Ch Standard Error +DWORD un2; // 20h +DWORD InheritConsole; // 24h +DWORD BreakType; // 28h +DWORD BreakSem; // 2Ch +DWORD BreakEvent; // 30h +DWORD BreakThreadID; // 34h +DWORD BreakHandlers; // 38h +} ENVIRONMENT_DATABASE, *PENVIRONMENT_DATABASE; + +typedef struct _KERNEL_OBJECT { +DWORD Type; // 00h KERNEL32 object type (5) +DWORD cReference; // 04h Number of references to process +} KERNEL_OBJECT, *PKERNEL_OBJECT; + +typedef struct _HANDLE_TABLE_ENTRY { + DWORD flags; // Valid flags depend on what type of object this is + PKERNEL_OBJECT pObject; // Pointer to the object that the handle refers to +} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY; + +typedef struct _HANDLE_TABLE { + DWORD cEntries; // Max number of handles in table + HANDLE_TABLE_ENTRY array[1]; // An array (number is given by cEntries) +} HANDLE_TABLE, *PHANDLE_TABLE; + + +typedef struct _PROCESS_DATABASE { +DWORD Type; // 00h KERNEL32 object type (5) +DWORD cReference; // 04h Number of references to process +DWORD un1; // 08h +DWORD someEvent; // 0Ch An event object (What's it used for???) +DWORD TerminationStatus; // 10h Returned by GetExitCodeProcess +DWORD un2; // 14h +DWORD DefaultHeap; // 18h Address of the process heap +DWORD MemoryContext; // 1Ch pointer to the process's context +DWORD flags; // 20h + // 0x00000001 - fDebugSingle + // 0x00000002 - fCreateProcessEvent + // 0x00000004 - fExitProcessEvent + // 0x00000008 - fWin16Process + // 0x00000010 - fDosProcess + // 0x00000020 - fConsoleProcess + // 0x00000040 - fFileApisAreOem + // 0x00000080 - fNukeProcess + // 0x00000100 - fServiceProcess + // 0x00000800 - fLoginScriptHack +DWORD pPSP; // 24h Linear address of PSP? +WORD PSPSelector; // 28h +WORD MTEIndex; // 2Ah +WORD cThreads; // 2Ch +WORD cNotTermThreads; // 2Eh +WORD un3; // 30h +WORD cRing0Threads; // 32h number of ring 0 threads +HANDLE HeapHandle; // 34h Heap to allocate handle tables out of + // This seems to always be the KERNEL32 heap +HTASK W16TDB; // 38h Win16 Task Database selector +DWORD MemMapFiles; // 3Ch memory mapped file list (?) +PENVIRONMENT_DATABASE pEDB; // 40h Pointer to Environment Database +PHANDLE_TABLE pHandleTable; // 44h Pointer to process handle table +struct _PROCESS_DATABASE *ParentPDB; // 48h Parent process database +PMODREF MODREFlist; // 4Ch Module reference list +DWORD ThreadList; // 50h Threads in this process +DWORD DebuggeeCB; // 54h Debuggee Context block? +DWORD LocalHeapFreeHead; // 58h Head of free list in process heap +DWORD InitialRing0ID; // 5Ch +CRITICAL_SECTION crst; // 60h +DWORD un4[3]; // 78h +DWORD pConsole; // 84h Pointer to console for process +DWORD tlsInUseBits1; // 88h // Represents TLS indices 0 - 31 +DWORD tlsInUseBits2; // 8Ch // Represents TLS indices 32 - 63 +DWORD ProcessDWORD; // 90h +struct _PROCESS_DATABASE *ProcessGroup; // 94h +DWORD pExeMODREF; // 98h pointer to EXE's MODREF +DWORD TopExcFilter; // 9Ch Top Exception Filter? +DWORD BasePriority; // A0h Base scheduling priority for process +DWORD HeapOwnList; // A4h Head of the list of process heaps +DWORD HeapHandleBlockList;// A8h Pointer to head of heap handle block list +DWORD pSomeHeapPtr; // ACh normally zero, but can a pointer to a + // moveable handle block in the heap +DWORD pConsoleProvider; // B0h Process that owns the console we're using? +WORD EnvironSelector; // B4h Selector containing process environment +WORD ErrorMode; // B6H SetErrorMode value (also thunks to Win16) +DWORD pevtLoadFinished; // B8h Pointer to event LoadFinished? +WORD UTState; // BCh +} PROCESS_DATABASE, *PPROCESS_DATABASE; + + +//TIB (Thread Information Block) structure + +typedef struct _SEH_record { + struct _SEH_record *pNext; + FARPROC pfnHandler; +} SEH_record, *PSEH_record; + +// This is semi-documented in the NTDDK.H file from the NT DDK +typedef struct _TIB { +PSEH_record pvExcept; // 00h Head of exception record list +PVOID pvStackUserTop; // 04h Top of user stack +PVOID pvStackUserBase; // 08h Base of user stack +WORD pvTDB; // 0Ch TDB +WORD pvThunksSS; // 0Eh SS selector used for thunking to 16 bits +DWORD SelmanList; // 10h +PVOID pvArbitrary; // 14h Available for application use +struct _tib *ptibSelf; // 18h Linear address of TIB structure +WORD TIBFlags; // 1Ch +WORD Win16MutexCount; // 1Eh +DWORD DebugContext; // 20h +DWORD pCurrentPriority; // 24h +DWORD pvQueue; // 28h Message Queue selector +PVOID *pvTLSArray; // 2Ch Thread Local Storage array +} TIB, *PTIB; + + +//TDBX structure + +typedef struct _TDBX { + DWORD ptdb; // 00h // PTHREAD_DATABASE + DWORD ppdb; // 04h // PPROCESDS_DATABASE + DWORD ContextHandle; // 08h + DWORD un1; // 0Ch + DWORD TimeOutHandle; // 10h + DWORD WakeParam; // 14h + DWORD BlockHandle; // 18h + DWORD BlockState; // 1Ch + DWORD SuspendCount; // 20h + DWORD SuspendHandle; // 24h + DWORD MustCompleteCount; // 28h + DWORD WaitExFlags; // 2Ch + // 0x00000001 - WAITEXBIT + // 0x00000002 - WAITACKBIT + // 0x00000004 - SUSPEND_APC_PENDING + // 0x00000008 - SUSPEND_TERMINATED + // 0x00000010 - BLOCKED_FOR_TERMINATION + // 0x00000020 - EMULATE_NPX + // 0x00000040 - WIN32_NPX + // 0x00000080 - EXTENDED_HANDLES + // 0x00000100 - FROZEN + // 0x00000200 - DONT_FREEZE + // 0x00000400 - DONT_UNFREEZE + // 0x00000800 - DONT_TRACE + // 0x00001000 - STOP_TRACING + // 0x00002000 - WAITING_FOR_CRST_SAFE + // 0x00004000 - CRST_SAFE + // 0x00040000 - BLOCK_TERMINATE_APC + DWORD SyncWaitCount; // 30h + DWORD QueuedSyncFuncs; // 34h + DWORD UserAPCList; // 38h + DWORD KernAPCList; // 3Ch + DWORD pPMPSPSelector; // 40h + DWORD BlockedOnID; // 44h + DWORD un2[7]; // 48h + DWORD TraceRefData; // 64h + DWORD TraceCallBack; // 68h + DWORD TraceEventHandle; // 6Ch + WORD TraceOutLastCS; // 70h + WORD K16TDB; // 72h + WORD K16PDB; // 74h + WORD DosPDBSeg; // 76h + WORD ExceptionCount; // 78h +} TDBX, *PTDBX; + + +//Thread Database structure + +typedef struct _THREAD_DATABASE { +DWORD Type; // 00h +DWORD cReference; // 04h +PPROCESS_DATABASE pProcess; // 08h +DWORD someEvent; // 0Ch An event object (What's it used for???) +DWORD pvExcept; // 10h This field through field 3CH is a TIB + // structure (see TIB.H) +DWORD TopOfStack; // 14h +DWORD StackLow; // 18h +WORD W16TDB; // 1Ch +WORD StackSelector16; // 1Eh Used when thunking down to 16 bits +DWORD SelmanList; // 20h +DWORD UserPointer; // 24h +PTIB pTIB; // 28h +WORD TIBFlags; // 2Ch TIBF_WIN32 = 1, TIBF_TRAP = 2 +WORD Win16MutexCount; // 2Eh +DWORD DebugContext; // 30h +PDWORD pCurrentPriority; // 34h +DWORD MessageQueue; // 38h +DWORD pTLSArray; // 3Ch +PPROCESS_DATABASE pProcess2;// 40h Another copy of the thread's process??? +DWORD Flags; // 44h + // 0x00000001 - fCreateThreadEvent + // 0x00000002 - fCancelExceptionAbort + // 0x00000004 - fOnTempStack + // 0x00000008 - fGrowableStack + // 0x00000010 - fDelaySingleStep + // 0x00000020 - fOpenExeAsImmovableFile + // 0x00000040 - fCreateSuspended + // 0x00000080 - fStackOverflow + // 0x00000100 - fNestedCleanAPCs + // 0x00000200 - fWasOemNowAnsi + // 0x00000400 - fOKToSetThreadOem +DWORD TerminationStatus; // 48h Returned by GetExitCodeThread +WORD TIBSelector; // 4Ch +WORD EmulatorSelector; // 4Eh +DWORD cHandles; // 50h +DWORD WaitNodeList; // 54h +DWORD un4; // 58h +DWORD Ring0Thread; // 5Ch +PTDBX pTDBX; // 60 +DWORD StackBase; // 64h +DWORD TerminationStack; // 68h +DWORD EmulatorData; // 6Ch +DWORD GetLastErrorCode; // 70h +DWORD DebuggerCB; // 74h +DWORD DebuggerThread; // 78h +PCONTEXT ThreadContext; // 7Ch // register context defined in WINNT.H +DWORD Except16List; // 80h +DWORD ThunkConnect; // 84h +DWORD NegStackBase; // 88h +DWORD CurrentSS; // 8Ch +DWORD SSTable; // 90h +DWORD ThunkSS16; // 94h +DWORD TLSArray[64]; // 98h +DWORD DeltaPriority; // 198h + +// The retail version breaks off somewhere around here. +// All the remaining fields are most likely only in the debug version + +DWORD un5[7]; // 19Ch +DWORD pCreateData16; // 1B8h +DWORD APISuspendCount; // 1BCh # of times SuspendThread has been called +DWORD un6; // 1C0h +DWORD WOWChain; // 1C4h +WORD wSSBig; // 1C8h +WORD un7; // 1CAh +DWORD lp16SwitchRec; // 1CCh +DWORD un8[6]; // 1D0h +DWORD pSomeCritSect1; // 1E8h +DWORD pWin16Mutex; // 1ECh +DWORD pWin32Mutex; // 1F0h +DWORD pSomeCritSect2; // 1F4h +DWORD un9; // 1F8h +DWORD ripString; // 1FCh +DWORD LastTlsSetValueEIP[64]; // 200h (parallel to TlsArray, contains EIP + // where TLS value was last set from) +} THREAD_DATABASE, *PTHREAD_DATABASE; + diff --git a/sal/test/unloading/unloadTest.cxx b/sal/test/unloading/unloadTest.cxx index cfeabe448fd6..16ccdcc61929 100644 --- a/sal/test/unloading/unloadTest.cxx +++ b/sal/test/unloading/unloadTest.cxx @@ -68,8 +68,61 @@ void SAL_CALL listenerCallback( void* id); int main(int argc, char* argv[]) { - sal_Bool ret1= test1(); - if( ret1) printf( "\n Test 1 successful \n"); + // Test if the servicemanager can be created and if the sample libs + // can be loaded +// Reference<XMultiServiceFactory> serviceManager= createRegistryServiceFactory( +// OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb"))); +// if( !serviceManager.is()) +// { +// printf("\n ####################################################\n" +// "Error: could not create service manager. \n" +// "Is the executable in the office program directory?\n"); +// return -1; +// } + +// Reference<XInterface> xint1= serviceManager->createInstance( OUString( +// RTL_CONSTASCII_USTRINGPARAM(SERVICENAME1))); + +// if( !xint1.is()) +// { +// printf("\n ###################################################\n" +// "Error: could not create service from samplelib1\n" +// "Is samplelib1 in the office program directory and is it " +// "registered?\n"); +// return -1; +// } +// Reference<XInterface> xint2= serviceManager->createInstance( OUString( +// RTL_CONSTASCII_USTRINGPARAM(SERVICENAME21))); +// if( !xint2.is()) +// { +// printf("\n ###################################################" +// "Error: could not create service from samplelib2\n" +// "Is samplelib2 in the office program directory and is it " +// "registered?\n"); +// return -1; +// } +// //destroy servicemanager +// Reference<XPropertySet> xSet( serviceManager, UNO_QUERY); +// Any any_prop= xSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))); +// Reference<XComponentContext> xContext; +// any_prop >>= xContext; +// Reference<XComponent> xComponent( xContext, UNO_QUERY); +// xComponent->dispose(); + +// //unload samplelib1 and samplelib2. We need the handles, therefore load +// // the libs +// OUString libname1( RTL_CONSTASCII_USTRINGPARAM(LIBRARY1)); +// OUString libname2( RTL_CONSTASCII_USTRINGPARAM(LIBRARY2)); +// oslModule m1= osl_loadModule(libname1.pData, 0); +// oslModule m2= osl_loadModule(libname2.pData, 0); +// osl_unloadModule( m1); +// osl_unloadModule( m1); +// osl_unloadModule( m2); +// osl_unloadModule( m2); + + + sal_Bool ret1= test1(); + if( ret1) printf( "\n Test 1 successful \n"); else printf("\n !!!!!! Test 1 failed\n"); sal_Bool ret2= test2(); if( ret2) printf( "\n Test 2 successful \n"); @@ -89,7 +142,7 @@ int main(int argc, char* argv[]) sal_Bool ret8= test8(); if( ret8) printf( "\n Test 8 successful \n"); else printf("\n !!!!!! Test 8 failed\n"); - sal_Bool ret9= test9(); + sal_Bool ret9= test9(); if( ret9) printf( "\n Test 9 successful: service manager is unloading listener\n"); else printf("\n !!!!! Test 9 failed\n"); @@ -563,10 +616,7 @@ sal_Bool test9() OUString sSymbol( RTL_CONSTASCII_USTRINGPARAM("component_getFactory")); void* pSymbol= osl_getSymbol( handleMod, sSymbol.pData); - xint= serviceManager->createInstance( OUString( - RTL_CONSTASCII_USTRINGPARAM(SERVICENAME1))); - - if( pSymbol || !xint.is()) + if( pSymbol) { retval= sal_False; } diff --git a/sal/textenc/makefile.mk b/sal/textenc/makefile.mk index 0a7018f8dd7e..adedc551a9ce 100644 --- a/sal/textenc/makefile.mk +++ b/sal/textenc/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.8 $ +# $Revision: 1.9 $ # -# last change: $Author: sb $ $Date: 2002-01-15 17:01:35 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:47:12 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -84,7 +84,7 @@ SLOFILES = \ $(SLO)$/textenc.obj \ $(SLO)$/unichars.obj -.IF "$(UPDATER)" != "" +#.IF "$(UPDATER)" != "" OBJFILES = \ $(OBJ)$/context.obj \ @@ -105,7 +105,7 @@ OBJFILES = \ $(OBJ)$/textenc.obj \ $(OBJ)$/unichars.obj -.ENDIF # UPDATER +#.ENDIF # UPDATER # Optimization off on Solaris Intel due to internal compiler error; to be # reevaluated after compiler upgrade: diff --git a/sal/textenc/tcvtest1.tab b/sal/textenc/tcvtest1.tab index 2bd8155192bc..ca1f039c1576 100644 --- a/sal/textenc/tcvtest1.tab +++ b/sal/textenc/tcvtest1.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtest1.tab,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: sb $ $Date: 2002-12-12 12:29:14 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -4300,3 +4300,161 @@ static ImplTextEncodingData const aImplKOI8RTextEncodingData "koi8-r", RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; /* SCRIPT_CYRILLIC, pc code page 866 (855?), mac encoding 7 */ + +/* ======================================================================= */ + +/* KOI8_U */ +/* Standard Charset for Ukrainian Cyrillic */ +/* Single Byte, 0x00-0x7F equals ASCII */ +/* Conversion Tables: hand made */ + +#define KOI8UUNI_START 0x80 +#define KOI8UUNI_END 0xFF +static sal_uInt16 const aImplKOI8UToUniTab[KOI8UUNI_END - KOI8UUNI_START + 1] = +{ +/* 0 1 2 3 4 5 6 7 */ +/* 8 9 A B C D E F */ + 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, /* 0x80 */ + 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, /* 0x80 */ + 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, /* 0x90 */ + 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, /* 0x90 */ + 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, /* 0xA0 */ + 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E, /* 0xA0 */ + 0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, /* 0xB0 */ + 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9, /* 0xB0 */ + 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, /* 0xC0 */ + 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, /* 0xC0 */ + 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, /* 0xD0 */ + 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, /* 0xD0 */ + 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, /* 0xE0 */ + 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, /* 0xE0 */ + 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, /* 0xF0 */ + 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A /* 0xF0 */ +}; + +#define KOI8UCHAR_START 0x0410 +#define KOI8UCHAR_END 0x044F +static sal_uChar const +aImplKOI8UToCharTab[KOI8UCHAR_END - KOI8UCHAR_START + 1] = +{ +/* 0 1 2 3 4 5 6 7 */ +/* 8 9 A B C D E F */ + 0xE1, 0xE2, 0xF7, 0xE7, 0xE4, 0xE5, 0xF6, 0xFA, /* 0x0410 */ + 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, /* 0x0410 */ + 0xF2, 0xF3, 0xF4, 0xF5, 0xE6, 0xE8, 0xE3, 0xFE, /* 0x0420 */ + 0xFB, 0xFD, 0xFF, 0xF9, 0xF8, 0xFC, 0xE0, 0xF1, /* 0x0420 */ + 0xC1, 0xC2, 0xD7, 0xC7, 0xC4, 0xC5, 0xD6, 0xDA, /* 0x0430 */ + 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, /* 0x0430 */ + 0xD2, 0xD3, 0xD4, 0xD5, 0xC6, 0xC8, 0xC3, 0xDE, /* 0x0440 */ + 0xDB, 0xDD, 0xDF, 0xD9, 0xD8, 0xDC, 0xC0, 0xD1 /* 0x0440 */ +}; + +#define KOI8UTOCHARTABEX_COUNT 72 +static ImplUniCharTabData const aImplKOI8UToCharTabEx[KOI8UTOCHARTABEX_COUNT] = +{ + { 0x00A0, 0x9A }, + { 0x00A9, 0xBF }, + { 0x00B0, 0x9C }, + { 0x00B2, 0x9D }, + { 0x00B7, 0x9E }, + { 0x00F7, 0x9F }, + { 0x0401, 0xB3 }, + { 0x0404, 0xB4 }, + { 0x0406, 0xB6 }, + { 0x0407, 0xB7 }, + { 0x0451, 0xA3 }, + { 0x0454, 0xA4 }, + { 0x0456, 0xA6 }, + { 0x0457, 0xA7 }, + { 0x0490, 0xBD }, + { 0x0491, 0xAD }, + { 0x2219, 0x95 }, + { 0x221A, 0x96 }, + { 0x2248, 0x97 }, + { 0x2264, 0x98 }, + { 0x2265, 0x99 }, + { 0x2320, 0x93 }, + { 0x2321, 0x9B }, + { 0x2500, 0x80 }, + { 0x2502, 0x81 }, + { 0x250C, 0x82 }, + { 0x2510, 0x83 }, + { 0x2514, 0x84 }, + { 0x2518, 0x85 }, + { 0x251C, 0x86 }, + { 0x2524, 0x87 }, + { 0x252C, 0x88 }, + { 0x2534, 0x89 }, + { 0x253C, 0x8A }, + { 0x2550, 0xA0 }, + { 0x2551, 0xA1 }, + { 0x2552, 0xA2 }, + { 0x2553, 0xA4 }, + { 0x2554, 0xA5 }, + { 0x2555, 0xA6 }, + { 0x2556, 0xA7 }, + { 0x2557, 0xA8 }, + { 0x2558, 0xA9 }, + { 0x2559, 0xAA }, + { 0x255A, 0xAB }, + { 0x255B, 0xAC }, + { 0x255C, 0xAD }, + { 0x255D, 0xAE }, + { 0x255E, 0xAF }, + { 0x255F, 0xB0 }, + { 0x2560, 0xB1 }, + { 0x2561, 0xB2 }, + { 0x2562, 0xB4 }, + { 0x2563, 0xB5 }, + { 0x2564, 0xB6 }, + { 0x2565, 0xB7 }, + { 0x2566, 0xB8 }, + { 0x2567, 0xB9 }, + { 0x2568, 0xBA }, + { 0x2569, 0xBB }, + { 0x256A, 0xBC }, + { 0x256B, 0xBD }, + { 0x256C, 0xBE }, + { 0x2580, 0x8B }, + { 0x2584, 0x8C }, + { 0x2588, 0x8D }, + { 0x258C, 0x8E }, + { 0x2590, 0x8F }, + { 0x2591, 0x90 }, + { 0x2592, 0x91 }, + { 0x2593, 0x92 }, + { 0x25A0, 0x94 } +}; + +static ImplByteConvertData const aImplKOI8UByteCvtData = +{ + aImplKOI8UToUniTab, + NULL, + KOI8UUNI_START, KOI8UUNI_END, + NOTABUNI_START, NOTABUNI_END, + aImplKOI8UToCharTab, + NULL, + aImplKOI8UToCharTabEx, + KOI8UCHAR_START, KOI8UCHAR_END, + NOTABCHAR_START, NOTABCHAR_END, + KOI8UTOCHARTABEX_COUNT +}; + +static ImplTextEncodingData const aImplKoi8UTextEncodingData + = { { &aImplKOI8UByteCvtData, + ImplCharToUnicode, + ImplUnicodeToChar, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }, + 1, + 1, + 1, + 204, + "koi8-u", + "KOI8-U", + RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; + /* SCRIPT_CYRILLIC */ diff --git a/sal/textenc/tcvtjp6.tab b/sal/textenc/tcvtjp6.tab index 05fb82fafd43..53e042d8dbdf 100644 --- a/sal/textenc/tcvtjp6.tab +++ b/sal/textenc/tcvtjp6.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtjp6.tab,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-12-10 10:14:01 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -609,6 +609,7 @@ static ImplDBCSConvertData const aImplSJISDBCSCvtData = { aSJISUniLeadTab, aSJISDBCSHighTab, + 0x00, 0xFF, 0x40, 0xFC, aImplSJISDBCSEUDCTab, DBCS_EUDC_SJIS_COUNT @@ -1165,6 +1166,7 @@ static ImplDBCSConvertData const aImplMS932DBCSCvtData = { aMS932UniLeadTab, aMS932DBCSHighTab, + 0x00, 0xFF, 0x40, 0xFC, aImplSJISDBCSEUDCTab, DBCS_EUDC_SJIS_COUNT @@ -1721,6 +1723,7 @@ static ImplDBCSConvertData const aImplAPPLEJAPANESEDBCSCvtData = { aAPPLEJAPANESEUniLeadTab, aAPPLEJAPANESEDBCSHighTab, + 0x00, 0xFF, 0x40, 0xFC, aImplSJISDBCSEUDCTab, DBCS_EUDC_SJIS_COUNT @@ -2630,6 +2633,7 @@ static ImplDBCSConvertData const aImplJISX0208DBCSCvtData = { NULL, aJIS0208DBCSHighTab, + 0x00, 0xFF, 0x21, 0x7E, NULL, 0 @@ -2662,6 +2666,7 @@ static ImplDBCSConvertData const aImplJISX0212DBCSCvtData = { NULL, aJIS0212DBCSHighTab, + 0x00, 0xFF, 0x21, 0x7E, NULL, 0 diff --git a/sal/textenc/tcvtkr6.tab b/sal/textenc/tcvtkr6.tab index 5b3e9360431e..fe5510f88c5d 100644 --- a/sal/textenc/tcvtkr6.tab +++ b/sal/textenc/tcvtkr6.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtkr6.tab,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: sb $ $Date: 2002-12-10 10:14:02 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -243,8 +243,8 @@ static ImplDBCSToUniLeadTab const aKSC5601UniLeadTab[256] = { 0, 0x41, 0xF6, aImplDBCSToUniTab_KSC5601_AB }, /* 0xAB */ { 0, 0x41, 0xF1, aImplDBCSToUniTab_KSC5601_AC }, /* 0xAC */ { 0, 0x41, 0xA0, aImplDBCSToUniTab_KSC5601_AD }, /* 0xAD */ - { 0, 0x41, 0xA1, aImplDBCSToUniTab_KSC5601_AE }, /* 0xAE */ - { 0, 0x41, 0xA1, aImplDBCSToUniTab_KSC5601_AF }, /* 0xAF */ + { 0, 0x41, 0xA0, aImplDBCSToUniTab_KSC5601_AE }, /* 0xAE */ + { 0, 0x41, 0xA0, aImplDBCSToUniTab_KSC5601_AF }, /* 0xAF */ { 0, 0x41, 0xFE, aImplDBCSToUniTab_KSC5601_B0 }, /* 0xB0 */ { 0, 0x41, 0xFE, aImplDBCSToUniTab_KSC5601_B1 }, /* 0xB1 */ { 0, 0x41, 0xFE, aImplDBCSToUniTab_KSC5601_B2 }, /* 0xB2 */ @@ -270,7 +270,7 @@ static ImplDBCSToUniLeadTab const aKSC5601UniLeadTab[256] = { 0, 0x41, 0xFE, aImplDBCSToUniTab_KSC5601_C6 }, /* 0xC6 */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_C7 }, /* 0xC7 */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_C8 }, /* 0xC8 */ - { 0, 1, 0, aImplDoubleByteIdentifierTab }, /* 0xC9 */ /* We convert this as double byte */ + { 0, 1, 0, aImplDoubleByteIdentifierTab }, /* 0xC9 */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_CA }, /* 0xCA */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_CB }, /* 0xCB */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_CC }, /* 0xCC */ @@ -323,7 +323,7 @@ static ImplDBCSToUniLeadTab const aKSC5601UniLeadTab[256] = { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_FB }, /* 0xFB */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_FC }, /* 0xFC */ { 0, 0xA1, 0xFE, aImplDBCSToUniTab_KSC5601_FD }, /* 0xFD */ - { 0, 1, 0, NULL }, /* 0xFE */ + { 0, 1, 0, aImplDoubleByteIdentifierTab }, /* 0xFE */ { 0, 1, 0, NULL } /* 0xFF */ }; @@ -600,10 +600,10 @@ static ImplDBCSEUDCData const aImplMS949DBCSEUDCTab[DBCS_EUDC_MS949_COUNT] = /* EUDC-Range */ /* Lead: C9-C9 */ /* Trail: A1-FE */ - { 0xC9, 0xC9, 0xA1, 0xFE, 0, 0, 0, 0, 1, 0x5D, 0xE000, 0xE05D }, + { 0xC9, 0xC9, 0xA1, 0xFE, 0, 0, 0, 0, 1, 0x5E, 0xE000, 0xE05D }, /* Lead: FE-FE */ /* Trail: A1-FE */ - { 0xFE, 0xFE, 0xA1, 0xFE, 0, 0, 0, 0, 1, 0x5D, 0xE05E, 0xE0BB } + { 0xFE, 0xFE, 0xA1, 0xFE, 0, 0, 0, 0, 1, 0x5E, 0xE05E, 0xE0BB } }; /* ----------------------------------------------------------------------- */ @@ -612,6 +612,19 @@ static ImplDBCSConvertData const aImplKSC5601DBCSCvtData = { aKSC5601UniLeadTab, aKSC5601DBCSHighTab, + 0xA1, 0xFE, + 0xA1, 0xFE, + aImplMS949DBCSEUDCTab, + DBCS_EUDC_MS949_COUNT +}; + +/* ----------------------------------------------------------------------- */ + +static ImplDBCSConvertData const aImplMS949DBCSCvtData = +{ + aKSC5601UniLeadTab, + aKSC5601DBCSHighTab, + 0x00, 0xFF, 0x41, 0xFE, aImplMS949DBCSEUDCTab, DBCS_EUDC_MS949_COUNT @@ -619,10 +632,6 @@ static ImplDBCSConvertData const aImplKSC5601DBCSCvtData = /* ======================================================================= */ -// TODO EUC-KR should only use two-byte characters in the range 0xA1--FE -// 0xA1--FE, and thus should have the RTL_TEXTENCODING_INFO_ASCII property. For -// whatever reason, EUC-KR is treated like MS-949 that uses trail bytes starting -// from 0x41. static ImplTextEncodingData const aImplEUCKRTextEncodingData = { { &aImplKSC5601DBCSCvtData, ImplDBCSToUnicode, @@ -639,13 +648,15 @@ static ImplTextEncodingData const aImplEUCKRTextEncodingData 129, "euc-kr", "euc-kr", - RTL_TEXTENCODING_INFO_MULTIBYTE | RTL_TEXTENCODING_INFO_MIME }; + RTL_TEXTENCODING_INFO_ASCII + | RTL_TEXTENCODING_INFO_MULTIBYTE + | RTL_TEXTENCODING_INFO_MIME }; /* SCRIPT_KOREAN, pc code page 934, mac encoding 3 */ /* ======================================================================= */ static ImplTextEncodingData const aImplMS949TextEncodingData - = { { &aImplKSC5601DBCSCvtData, + = { { &aImplMS949DBCSCvtData, ImplDBCSToUnicode, ImplUnicodeToDBCS, NULL, @@ -668,7 +679,7 @@ static ImplTextEncodingData const aImplMS949TextEncodingData /* Apple has some extension, which we don't support */ static ImplTextEncodingData const aImplAPPLEKOREANTextEncodingData - = { { &aImplKSC5601DBCSCvtData, + = { { &aImplMS949DBCSCvtData, ImplDBCSToUnicode, ImplUnicodeToDBCS, NULL, @@ -1233,6 +1244,7 @@ static ImplDBCSConvertData const aImplJOHABDBCSCvtData = { aJOHABUniLeadTab, aJOHABDBCSHighTab, + 0x00, 0xFF, 0x31, 0xFE, aImplMS1361DBCSEUDCTab, DBCS_EUDC_MS1361_COUNT diff --git a/sal/textenc/tcvtlat1.tab b/sal/textenc/tcvtlat1.tab index 2379d9876cda..193483fb1de1 100644 --- a/sal/textenc/tcvtlat1.tab +++ b/sal/textenc/tcvtlat1.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtlat1.tab,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: sb $ $Date: 2002-12-12 12:29:14 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -542,8 +542,8 @@ static ImplTextEncodingData const aImplIBM860TextEncodingData 1, 0, "iso8859-1", - "iso-8859-1", - RTL_TEXTENCODING_INFO_ASCII }; + "IBM860", + RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; /* DOS/OS2, SCRIPT_LATIN, pc code page 860 */ /* ======================================================================= */ @@ -717,8 +717,8 @@ static ImplTextEncodingData const aImplIBM861TextEncodingData 1, 0, "iso8859-1", - "iso-8859-1", - RTL_TEXTENCODING_INFO_ASCII }; + "IBM861", + RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; /* DOS/OS2, SCRIPT_LATIN, pc code page 861, mac encoding 37 */ /* ======================================================================= */ @@ -892,8 +892,8 @@ static ImplTextEncodingData const aImplIBM863TextEncodingData 1, 0, "iso8859-1", - "iso-8859-1", - RTL_TEXTENCODING_INFO_ASCII }; + "IBM863", + RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; /* DOS/OS2, SCRIPT_LATIN, pc code page 863 */ /* ======================================================================= */ @@ -1067,8 +1067,8 @@ static ImplTextEncodingData const aImplIBM865TextEncodingData 1, 0, "iso8859-1", - "iso-8859-1", - RTL_TEXTENCODING_INFO_ASCII }; + "IBM865", + RTL_TEXTENCODING_INFO_ASCII | RTL_TEXTENCODING_INFO_MIME }; /* DOS/OS2, SCRIPT_LATIN, pc code page 865 */ /* ======================================================================= */ diff --git a/sal/textenc/tcvtmb.c b/sal/textenc/tcvtmb.c index 93a40a390020..c4c6ed12da68 100644 --- a/sal/textenc/tcvtmb.c +++ b/sal/textenc/tcvtmb.c @@ -2,9 +2,9 @@ * * $RCSfile: tcvtmb.c,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-11-06 10:06:03 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -105,7 +105,9 @@ sal_Size ImplDBCSToUnicode( const ImplTextConverterData* pData, void* pContext, pLeadEntry = pLeadTab+cLead; /* SingleByte char? */ - if ( !pLeadEntry->mpToUniTrailTab ) + if (pLeadEntry->mpToUniTrailTab == NULL + || cLead < pConvertData->mnLeadStart + || cLead > pConvertData->mnLeadEnd) { cConv = pLeadEntry->mnUniChar; if ( !cConv && (cLead != 0) ) @@ -202,7 +204,10 @@ sal_Size ImplDBCSToUnicode( const ImplTextConverterData* pData, void* pContext, /* moeglich auch richtig zu behandeln, das double byte */ /* characters auch als ein einzelner Character behandelt */ /* wird. */ - if ( (cTrail < pConvertData->mnTrailStart) || (cTrail > pConvertData->mnTrailEnd) ) + if (cLead < pConvertData->mnLeadStart + || cLead > pConvertData->mnLeadEnd + || cTrail < pConvertData->mnTrailStart + || cTrail > pConvertData->mnTrailEnd) { *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) @@ -271,6 +276,12 @@ sal_Size ImplUnicodeToDBCS( const ImplTextConverterData* pData, void* pContext, sal_Char* pEndDestBuf; const sal_Unicode* pEndSrcBuf; + sal_Bool bCheckRange = (pConvertData->mnLeadStart != 0 + || pConvertData->mnLeadEnd != 0xFF); + /* this statement has the effect that this extra check is only done for + EUC-KR, which uses the MS-949 tables, but does not support the full + range of MS-949 */ + *pInfo = 0; pEndDestBuf = pDestBuf+nDestBytes; pEndSrcBuf = pSrcBuf+nSrcChars; @@ -285,7 +296,15 @@ sal_Size ImplUnicodeToDBCS( const ImplTextConverterData* pData, void* pContext, /* is low byte in the table range */ if ( (nLowChar >= pHighEntry->mnLowStart) && (nLowChar <= pHighEntry->mnLowEnd) ) + { cConv = pHighEntry->mpToUniTrailTab[nLowChar-pHighEntry->mnLowStart]; + if (bCheckRange && cConv > 0x7F + && ((cConv >> 8) < pConvertData->mnLeadStart + || (cConv >> 8) > pConvertData->mnLeadEnd + || (cConv & 0xFF) < pConvertData->mnTrailStart + || (cConv & 0xFF) > pConvertData->mnTrailEnd)) + cConv = 0; + } else cConv = 0; diff --git a/sal/textenc/tcvtscn6.tab b/sal/textenc/tcvtscn6.tab index 8bed3a1cbce5..6a4b23ce7ebb 100644 --- a/sal/textenc/tcvtscn6.tab +++ b/sal/textenc/tcvtscn6.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtscn6.tab,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-12-10 10:14:02 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -622,6 +622,7 @@ static ImplDBCSConvertData const aImplGB2312DBCSCvtData = { aGB2312UniLeadTab, aGB2312DBCSHighTab, + 0x00, 0xFF, 0xA1, 0xFE, aImplMS936DBCSEUDCTab, DBCS_EUDC_MS936_COUNT @@ -1201,6 +1202,7 @@ static ImplDBCSConvertData const aImplGBT12345DBCSCvtData = { aGBT12345UniLeadTab, aGBT12345DBCSHighTab, + 0x00, 0xFF, 0xA1, 0xFE, aImplMS936DBCSEUDCTab, DBCS_EUDC_MS936_COUNT @@ -1845,6 +1847,7 @@ static ImplDBCSConvertData const aImplGBKDBCSCvtData = { aGBKUniLeadTab, aGBKDBCSHighTab, + 0x00, 0xFF, 0x40, 0xFE, aImplMS936DBCSEUDCTab, DBCS_EUDC_MS936_COUNT @@ -2401,6 +2404,7 @@ static ImplDBCSConvertData const aImplMS936DBCSCvtData = { aMS936UniLeadTab, aMS936DBCSHighTab, + 0x00, 0xFF, 0x40, 0xFE, aImplMS936DBCSEUDCTab, DBCS_EUDC_MS936_COUNT @@ -2958,6 +2962,7 @@ static ImplDBCSConvertData const aImplAPPLECHINSIMPDBCSCvtData = { aAPPLECHINSIMPUniLeadTab, aAPPLECHINSIMPDBCSHighTab, + 0x00, 0xFF, 0xA1, 0xFE, NULL, 0 diff --git a/sal/textenc/tcvttcn6.tab b/sal/textenc/tcvttcn6.tab index 02123d09009d..a224c28d9b2e 100644 --- a/sal/textenc/tcvttcn6.tab +++ b/sal/textenc/tcvttcn6.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvttcn6.tab,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: sb $ $Date: 2002-12-10 10:14:02 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -624,6 +624,7 @@ static ImplDBCSConvertData const aImplBIG5DBCSCvtData = { aBIG5UniLeadTab, aBIG5DBCSHighTab, + 0x00, 0xFF, 0x40, 0xFE, aImplMS950DBCSEUDCTab, DBCS_EUDC_MS950_COUNT @@ -1180,6 +1181,7 @@ static ImplDBCSConvertData const aImplMS950DBCSCvtData = { aMS950UniLeadTab, aMS950DBCSHighTab, + 0x00, 0xFF, 0x40, 0xFE, aImplMS950DBCSEUDCTab, DBCS_EUDC_MS950_COUNT @@ -1737,6 +1739,7 @@ static ImplDBCSConvertData const aImplAPPLECHINTRADDBCSCvtData = { aAPPLECHINTRADUniLeadTab, aAPPLECHINTRADDBCSHighTab, + 0x00, 0xFF, 0x40, 0xFE, NULL, 0 diff --git a/sal/textenc/tcvtuni1.tab b/sal/textenc/tcvtuni1.tab index e7a3247f4851..29fad070d8a4 100644 --- a/sal/textenc/tcvtuni1.tab +++ b/sal/textenc/tcvtuni1.tab @@ -2,9 +2,9 @@ * * $RCSfile: tcvtuni1.tab,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sb $ $Date: 2002-10-04 13:37:06 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,10 @@ * ************************************************************************/ +#ifndef INCLUDED_RTL_TEXTENC_CONTEXT_H +#include "context.h" +#endif + /* Unicode Encodings */ static ImplTextEncodingData const aImplUTF7TextEncodingData @@ -86,14 +90,14 @@ static ImplTextEncodingData const aImplUTF7TextEncodingData static ImplTextEncodingData const aImplUTF8TextEncodingData = { { NULL, - ImplUTF8ToUnicode, - ImplUnicodeToUTF8, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL }, + &ImplConvertUtf8ToUnicode, + &ImplConvertUnicodeToUtf8, + &ImplCreateUtf8ToUnicodeContext, + &ImplDestroyContext, + &ImplResetUtf8ToUnicodeContext, + &ImplCreateUnicodeToUtf8Context, + &ImplDestroyContext, + &ImplResetUnicodeToUtf8Context }, 1, 6, 1, diff --git a/sal/textenc/tcvtutf8.c b/sal/textenc/tcvtutf8.c index f1b01d62eeb7..b6cde12b5969 100644 --- a/sal/textenc/tcvtutf8.c +++ b/sal/textenc/tcvtutf8.c @@ -2,9 +2,9 @@ * * $RCSfile: tcvtutf8.c,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sb $ $Date: 2001-10-17 14:35:30 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,354 +59,379 @@ * ************************************************************************/ -#ifndef INCLUDED_RTL_TEXTENC_TENCHELP_H +#include "sal/types.h" +#include "rtl/alloc.h" +#include "rtl/textcvt.h" + +#include "converter.h" #include "tenchelp.h" -#endif -#ifndef INCLUDED_RTL_TEXTENC_UNICHARS_H #include "unichars.h" -#endif -#ifndef _RTL_TEXTCVT_H -#include "rtl/textcvt.h" -#endif +static struct ImplUtf8ToUnicodeContext +{ + sal_uInt32 nUtf32; + int nShift; + sal_Bool bCheckBom; +}; -/* ----------------------------------------------------------------------- */ +static struct ImplUnicodeToUtf8Context +{ + sal_Unicode nHighSurrogate; // 0xFFFF: write BOM +}; -sal_Size ImplUTF8ToUnicode( const ImplTextConverterData* pData, void* pContext, - const sal_Char* pSrcBuf, sal_Size nSrcBytes, - sal_Unicode* pDestBuf, sal_Size nDestChars, - sal_uInt32 nFlags, sal_uInt32* pInfo, - sal_Size* pSrcCvtBytes ) +void * ImplCreateUtf8ToUnicodeContext(void) { - static sal_uInt8 const nExtraBytesFromUTF8Tab[16] = - { - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 0, 0 - }; - static sal_uInt8 const nFirstByteMaskTab[3] = - { - 0x07, 0x03, 0x01 - }; - - sal_uInt8 nBytes; - sal_uInt8 nTempBytes; - sal_uChar c; - sal_uInt32 cConv; - sal_Unicode* pEndDestBuf; - const sal_Char* pEndSrcBuf; - - *pInfo = 0; - pEndDestBuf = pDestBuf+nDestChars; - pEndSrcBuf = pSrcBuf+nSrcBytes; - while ( pSrcBuf < pEndSrcBuf ) + void * p = rtl_allocateMemory(sizeof (struct ImplUtf8ToUnicodeContext)); + ImplResetUtf8ToUnicodeContext(p); + return p; +} + +void ImplResetUtf8ToUnicodeContext(void * pContext) +{ + if (pContext != NULL) { - if ( pDestBuf == pEndDestBuf ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; - break; - } + ((struct ImplUtf8ToUnicodeContext *) pContext)->nShift = -1; + ((struct ImplUtf8ToUnicodeContext *) pContext)->bCheckBom = sal_True; + } +} - c = (sal_uChar)*pSrcBuf; +sal_Size ImplConvertUtf8ToUnicode(ImplTextConverterData const * pData, + void * pContext, sal_Char const * pSrcBuf, + sal_Size nSrcBytes, sal_Unicode * pDestBuf, + sal_Size nDestChars, sal_uInt32 nFlags, + sal_uInt32 * pInfo, sal_Size * pSrcCvtBytes) +{ + // This function is very liberal with the UTF-8 input. Accepted are: + // - non-shortest forms (e.g., C0 41 instead of 41 to represent U+0041) + // - surrogates (e.g., ED A0 80 to represent U+D800) + // - encodings with up to six bytes (everything outside the range + // U+0000..10FFFF is considered "undefined") - /* 1 Byte */ - /* 0aaaaaaa (000000000aaaaaaa) */ - if ( !(c & 0x80) ) - { - *pDestBuf = (sal_Unicode)c; - pDestBuf++; - pSrcBuf++; - } - /* 2-3 Bytes */ - else if ( (c & 0xF0) != 0xF0 ) - { - /* 110aaaaa 10bbbbbb (00000aaaaabbbbbb) */ - if ( (c & 0xE0) == 0xC0 ) - { - nBytes = 2; - c &= 0x1F; /* 00001111; */ - } - /* 1110aaaa 10bbbbbb 10cccccc (aaaabbbbbbcccccc) */ - else if ( (c & 0xF0) == 0xE0 ) + sal_uInt32 nUtf32; + int nShift = -1; + sal_Bool bCheckBom = sal_True; + sal_uInt32 nInfo = 0; + sal_uChar const * pSrcBufPtr = (sal_uChar const *) pSrcBuf; + sal_uChar const * pSrcBufEnd = pSrcBufPtr + nSrcBytes; + sal_Unicode * pDestBufPtr = pDestBuf; + sal_Unicode * pDestBufEnd = pDestBufPtr + nDestChars; + + if (pContext != NULL) + { + nUtf32 = ((struct ImplUtf8ToUnicodeContext *) pContext)->nUtf32; + nShift = ((struct ImplUtf8ToUnicodeContext *) pContext)->nShift; + bCheckBom = ((struct ImplUtf8ToUnicodeContext *) pContext)->bCheckBom; + } + + while (pSrcBufPtr < pSrcBufEnd) + { + sal_Bool bUndefined = sal_False; + sal_Bool bConsume = sal_True; + sal_uInt32 nChar = *pSrcBufPtr++; + if (nShift < 0) + if (nChar <= 0x7F) { - nBytes = 3; - c &= 0x0F; /* 00001111; */ + nUtf32 = nChar; + goto transform; } - else + else if (nChar <= 0xBF) + goto bad_input; + else if (nChar <= 0xDF) { - *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) != RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ) - { - if ( pDestBuf >= pEndDestBuf ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; - break; - } - *pDestBuf++ = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - } - pSrcBuf++; - continue; + nUtf32 = (nChar & 0x1F) << 6; + nShift = 0; } - - if ( pSrcBuf+nBytes > pEndSrcBuf ) + else if (nChar <= 0xEF) { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL; - break; + nUtf32 = (nChar & 0x0F) << 12; + nShift = 6; } - - cConv = c; - pSrcBuf++; - if ( (*pSrcBuf & 0xC0) != 0x80 ) + else if (nChar <= 0xF7) { - *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) - { - pSrcBuf--; - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) != RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ) - *pDestBuf++ = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - continue; + nUtf32 = (nChar & 0x07) << 18; + nShift = 12; } - else + else if (nChar <= 0xFB) { - c = (sal_uChar)*pSrcBuf; - cConv <<= 6; - cConv += c & 0x3F; /* 00111111 */ + nUtf32 = (nChar & 0x03) << 24; + nShift = 18; } - if ( nBytes == 3 ) + else if (nChar <= 0xFD) { - pSrcBuf++; - if ( (*pSrcBuf & 0xC0) != 0x80 ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) - { - pSrcBuf -= 2; - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) != RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ) - *pDestBuf++ - = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - continue; - } - else - { - c = (sal_uChar)*pSrcBuf; - cConv <<= 6; - cConv += c & 0x3F; /* 00111111 */ - } + nUtf32 = (nChar & 0x01) << 30; + nShift = 24; } - *pDestBuf = (sal_Unicode)cConv; - pDestBuf++; - pSrcBuf++; + else + goto bad_input; + else if ((nChar & 0xC0) == 0x80) + { + nUtf32 |= (nChar & 0x3F) << nShift; + if (nShift == 0) + goto transform; + else + nShift -= 6; } - /* 4-6 Bytes */ else { - /* convert to ucs4 */ - nBytes = nExtraBytesFromUTF8Tab[c & 0x0F]; - if ( !nBytes ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) != RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ) - { - if ( pDestBuf >= pEndDestBuf ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; - break; - } - *pDestBuf++ = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - } - pSrcBuf++; - continue; - } - else if ( pSrcBuf+nBytes+1 > pEndSrcBuf ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL; - break; - } + // This byte is preceeded by a broken UTF-8 sequence; if this byte + // is neither in the range [0x80..0xBF] nor in the range + // [0xFE..0xFF], assume that this byte does not belong to that + // broken sequence, but instead starts a new, legal UTF-8 sequence: + bConsume = nChar >= 0xFE; + goto bad_input; + } + continue; - cConv = c & nFirstByteMaskTab[nBytes-3]; - nTempBytes = nBytes; - do - { - pSrcBuf++; - if ( (*pSrcBuf & 0xC0) != 0x80 ) - break; - c = (sal_uChar)*pSrcBuf; - cConv <<= 6; - cConv += c & 0x3F; /* 00111111 */ - nTempBytes--; - } - while ( nTempBytes ); - if ( nTempBytes ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_INVALID; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ) + transform: + if (!bCheckBom || nUtf32 != 0xFEFF + || (nFlags & RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE) == 0) + if (nUtf32 <= 0xFFFF) + if (pDestBufPtr != pDestBufEnd) + *pDestBufPtr++ = (sal_Unicode) nUtf32; + else + goto no_output; + else if (nUtf32 <= 0x10FFFF) + if (pDestBufEnd - pDestBufPtr >= 2) { - pSrcBuf -= nBytes-nTempBytes+1; - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; + *pDestBufPtr++ = (sal_Unicode) ImplGetHighSurrogate(nUtf32); + *pDestBufPtr++ = (sal_Unicode) ImplGetLowSurrogate(nUtf32); } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK) != RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ) - *pDestBuf++ = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - pSrcBuf++; - continue; - } + else + goto no_output; else { - pSrcBuf++; - if ( cConv > 0x10FFFF ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_MBUNDEFINED; - if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK) == RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK) != RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_IGNORE ) - *pDestBuf++ - = RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER; - } - else if ( pDestBuf+2 > pEndDestBuf ) - { - *pInfo |= RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; - break; - } - else - { - *pDestBuf++ = (sal_Unicode) ImplGetHighSurrogate(cConv); - *pDestBuf++ = (sal_Unicode) ImplGetLowSurrogate(cConv); - } + bUndefined = sal_True; + goto bad_input; } + nShift = -1; + bCheckBom = sal_False; + continue; + + bad_input: + switch (ImplHandleBadInputMbTextToUnicodeConversion(bUndefined, nFlags, + &pDestBufPtr, + pDestBufEnd, + &nInfo)) + { + case IMPL_BAD_INPUT_STOP: + nShift = -1; + bCheckBom = sal_False; + if (!bConsume) + --pSrcBufPtr; + break; + + case IMPL_BAD_INPUT_CONTINUE: + nShift = -1; + bCheckBom = sal_False; + if (!bConsume) + --pSrcBufPtr; + continue; + + case IMPL_BAD_INPUT_NO_OUTPUT: + goto no_output; } + break; + + no_output: + --pSrcBufPtr; + nInfo |= RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; + break; } - *pSrcCvtBytes = nSrcBytes - (pEndSrcBuf-pSrcBuf); - return (nDestChars - (pEndDestBuf-pDestBuf)); + if (nShift >= 0 + && (nInfo & (RTL_TEXTTOUNICODE_INFO_ERROR + | RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL)) + == 0) + if ((nFlags & RTL_TEXTTOUNICODE_FLAGS_FLUSH) == 0) + nInfo |= RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL; + else + switch (ImplHandleBadInputMbTextToUnicodeConversion(sal_False, + nFlags, + &pDestBufPtr, + pDestBufEnd, + &nInfo)) + { + case IMPL_BAD_INPUT_STOP: + case IMPL_BAD_INPUT_CONTINUE: + nShift = -1; + bCheckBom = sal_False; + break; + + case IMPL_BAD_INPUT_NO_OUTPUT: + nInfo |= RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL; + break; + } + + if (pContext != NULL) + { + ((struct ImplUtf8ToUnicodeContext *) pContext)->nUtf32 = nUtf32; + ((struct ImplUtf8ToUnicodeContext *) pContext)->nShift = nShift; + ((struct ImplUtf8ToUnicodeContext *) pContext)->bCheckBom = bCheckBom; + } + if (pInfo != NULL) + *pInfo = nInfo; + if (pSrcCvtBytes != NULL) + *pSrcCvtBytes = (sal_Char const *) pSrcBufPtr - pSrcBuf; + return pDestBufPtr - pDestBuf; } -/* ----------------------------------------------------------------------- */ +void * ImplCreateUnicodeToUtf8Context(void) +{ + void * p = rtl_allocateMemory(sizeof (struct ImplUnicodeToUtf8Context)); + ImplResetUnicodeToUtf8Context(p); + return p; +} + +void ImplResetUnicodeToUtf8Context(void * pContext) +{ + if (pContext != NULL) + ((struct ImplUnicodeToUtf8Context *) pContext)->nHighSurrogate = 0xFFFF; +} -sal_Size ImplUnicodeToUTF8( const ImplTextConverterData* pData, void* pContext, - const sal_Unicode* pSrcBuf, sal_Size nSrcChars, - sal_Char* pDestBuf, sal_Size nDestBytes, - sal_uInt32 nFlags, sal_uInt32* pInfo, - sal_Size* pSrcCvtChars ) +sal_Size ImplConvertUnicodeToUtf8(ImplTextConverterData const * pData, + void * pContext, sal_Unicode const * pSrcBuf, + sal_Size nSrcChars, sal_Char * pDestBuf, + sal_Size nDestBytes, sal_uInt32 nFlags, + sal_uInt32 * pInfo, sal_Size* pSrcCvtChars) { - static sal_uInt8 const nFirstByteMarkTab[6] = + sal_Unicode nHighSurrogate = 0xFFFF; + sal_uInt32 nInfo = 0; + sal_Unicode const * pSrcBufPtr = pSrcBuf; + sal_Unicode const * pSrcBufEnd = pSrcBufPtr + nSrcChars; + sal_Char * pDestBufPtr = pDestBuf; + sal_Char * pDestBufEnd = pDestBufPtr + nDestBytes; + + if (pContext != NULL) + nHighSurrogate + = ((struct ImplUnicodeToUtf8Context *) pContext)->nHighSurrogate; + + if (nHighSurrogate == 0xFFFF) { - 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC - }; - - sal_Unicode c; - sal_Unicode c2; - sal_uInt32 nUCS4Char; - sal_uInt8 nBytes; - sal_Char* pTempDestBuf; - sal_Char* pEndDestBuf; - const sal_Unicode* pEndSrcBuf; - - *pInfo = 0; - pEndDestBuf = pDestBuf+nDestBytes; - pEndSrcBuf = pSrcBuf+nSrcChars; - while ( pSrcBuf < pEndSrcBuf ) + if ((nFlags & RTL_UNICODETOTEXT_FLAGS_GLOBAL_SIGNATURE) != 0) + if (pDestBufEnd - pDestBufPtr >= 3) + { + // Write BOM (U+FEFF) as UTF-8: + *pDestBufPtr++ = (sal_Char) 0xEF; + *pDestBufPtr++ = (sal_Char) 0xBB; + *pDestBufPtr++ = (sal_Char) 0xBF; + } + else + { + nInfo |= RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL; + goto done; + } + nHighSurrogate = 0; + } + + while (pSrcBufPtr < pSrcBufEnd) { - c = *pSrcBuf; - if ( c < 0x80 ) + sal_uInt32 nChar = *pSrcBufPtr++; + if (nHighSurrogate == 0) { - if ( pDestBuf == pEndDestBuf ) + if (ImplIsHighSurrogate(nChar)) { - *pInfo |= RTL_UNICODETOTEXT_INFO_ERROR | RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL; - break; + nHighSurrogate = (sal_Unicode) nChar; + continue; } - - *pDestBuf = (sal_Char)(sal_uChar)c; - pDestBuf++; - pSrcBuf++; } + else if (ImplIsLowSurrogate(nChar)) + nChar = ImplCombineSurrogates(nHighSurrogate, nChar); else - { - nUCS4Char = c; - if ( nUCS4Char < 0x800 ) - nBytes = 2; - else - { - if (ImplIsHighSurrogate(c)) - { - if ( pSrcBuf == pEndSrcBuf ) - { - *pInfo |= RTL_UNICODETOTEXT_INFO_ERROR | RTL_UNICODETOTEXT_INFO_SRCBUFFERTOSMALL; - break; - } - - c2 = *(pSrcBuf+1); - if (ImplIsLowSurrogate(c2)) - { - nUCS4Char = ImplCombineSurrogates(c, c2); - pSrcBuf++; - } - else - { - *pInfo |= RTL_UNICODETOTEXT_INFO_INVALID; - if ( (nFlags & RTL_UNICODETOTEXT_FLAGS_INVALID_MASK) == RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ) - { - *pInfo |= RTL_UNICODETOTEXT_INFO_ERROR; - break; - } - else if ( (nFlags & RTL_UNICODETOTEXT_FLAGS_INVALID_MASK) == RTL_UNICODETOTEXT_FLAGS_INVALID_IGNORE ) - { - pSrcBuf++; - continue; - } - /* in UTF8 we save the original code. I think */ - /* this is better than the default char, */ - /* because it is a unicode format. */ - } - } + goto bad_input; - if ( nUCS4Char < 0x10000 ) - nBytes = 3; - else if ( nUCS4Char < 0x200000 ) - nBytes = 4; - else if ( nUCS4Char < 0x4000000 ) - nBytes = 5; - else - nBytes = 6; - } + if (ImplIsLowSurrogate(nChar) || ImplIsNoncharacter(nChar)) + goto bad_input; - if ( pDestBuf+nBytes > pEndDestBuf ) + if (nChar <= 0x7F) + if (pDestBufPtr != pDestBufEnd) + *pDestBufPtr++ = (sal_Char) nChar; + else + goto no_output; + else if (nChar <= 0x7FF) + if (pDestBufEnd - pDestBufPtr >= 2) { - *pInfo |= RTL_UNICODETOTEXT_INFO_ERROR | RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL; - break; + *pDestBufPtr++ = (sal_Char) (0xC0 | (nChar >> 6)); + *pDestBufPtr++ = (sal_Char) (0x80 | (nChar & 0x3F)); } - pDestBuf += nBytes; - pTempDestBuf = pDestBuf; - switch ( nBytes ) /* no breaks, only jump table */ + else + goto no_output; + else if (nChar <= 0xFFFF) + if (pDestBufEnd - pDestBufPtr >= 3) { - case 6: pTempDestBuf--; *pTempDestBuf = (sal_Char)((((sal_uChar)nUCS4Char) | 0x80) & 0xBF); nUCS4Char >>= 6; - case 5: pTempDestBuf--; *pTempDestBuf = (sal_Char)((((sal_uChar)nUCS4Char) | 0x80) & 0xBF); nUCS4Char >>= 6; - case 4: pTempDestBuf--; *pTempDestBuf = (sal_Char)((((sal_uChar)nUCS4Char) | 0x80) & 0xBF); nUCS4Char >>= 6; - case 3: pTempDestBuf--; *pTempDestBuf = (sal_Char)((((sal_uChar)nUCS4Char) | 0x80) & 0xBF); nUCS4Char >>= 6; - case 2: pTempDestBuf--; *pTempDestBuf = (sal_Char)((((sal_uChar)nUCS4Char) | 0x80) & 0xBF); nUCS4Char >>= 6; - }; - pTempDestBuf--; - *pTempDestBuf = (sal_Char)(((sal_uChar)nUCS4Char) | nFirstByteMarkTab[nBytes-1]); - pSrcBuf++; + *pDestBufPtr++ = (sal_Char) (0xE0 | (nChar >> 12)); + *pDestBufPtr++ = (sal_Char) (0x80 | ((nChar >> 6) & 0x3F)); + *pDestBufPtr++ = (sal_Char) (0x80 | (nChar & 0x3F)); + } + else + goto no_output; + else if (pDestBufEnd - pDestBufPtr >= 4) + { + *pDestBufPtr++ = (sal_Char) (0xF0 | (nChar >> 18)); + *pDestBufPtr++ = (sal_Char) (0x80 | ((nChar >> 12) & 0x3F)); + *pDestBufPtr++ = (sal_Char) (0x80 | ((nChar >> 6) & 0x3F)); + *pDestBufPtr++ = (sal_Char) (0x80 | (nChar & 0x3F)); + } + else + goto no_output; + nHighSurrogate = 0; + continue; + + bad_input: + switch (ImplHandleBadInputUnicodeToTextConversion(sal_False, 0, nFlags, + &pDestBufPtr, + pDestBufEnd, &nInfo, + NULL, 0, NULL)) + { + case IMPL_BAD_INPUT_STOP: + nHighSurrogate = 0; + break; + + case IMPL_BAD_INPUT_CONTINUE: + nHighSurrogate = 0; + continue; + + case IMPL_BAD_INPUT_NO_OUTPUT: + goto no_output; } + break; + + no_output: + --pSrcBufPtr; + nInfo |= RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL; + break; } - *pSrcCvtChars = nSrcChars - (pEndSrcBuf-pSrcBuf); - return (nDestBytes - (pEndDestBuf-pDestBuf)); + if (nHighSurrogate != 0 + && (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR + | RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) + == 0) + if ((nFlags & RTL_UNICODETOTEXT_FLAGS_FLUSH) != 0) + nInfo |= RTL_UNICODETOTEXT_INFO_SRCBUFFERTOSMALL; + else + switch (ImplHandleBadInputUnicodeToTextConversion(sal_False, 0, + nFlags, + &pDestBufPtr, + pDestBufEnd, + &nInfo, NULL, 0, + NULL)) + { + case IMPL_BAD_INPUT_STOP: + case IMPL_BAD_INPUT_CONTINUE: + nHighSurrogate = 0; + break; + + case IMPL_BAD_INPUT_NO_OUTPUT: + nInfo |= RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL; + break; + } + + done: + if (pContext != NULL) + ((struct ImplUnicodeToUtf8Context *) pContext)->nHighSurrogate + = nHighSurrogate; + if (pInfo != NULL) + *pInfo = nInfo; + if (pSrcCvtChars != NULL) + *pSrcCvtChars = pSrcBufPtr - pSrcBuf; + return pDestBufPtr - pDestBuf; } diff --git a/sal/textenc/tenchelp.h b/sal/textenc/tenchelp.h index 1f997859a4a5..fed24ac6fbc7 100644 --- a/sal/textenc/tenchelp.h +++ b/sal/textenc/tenchelp.h @@ -2,9 +2,9 @@ * * $RCSfile: tenchelp.h,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: sb $ $Date: 2002-10-04 13:37:07 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -215,6 +215,8 @@ typedef struct { const ImplDBCSToUniLeadTab* mpToUniLeadTab; const ImplUniToDBCSHighTab* mpToDBCSHighTab; + sal_uChar mnLeadStart; + sal_uChar mnLeadEnd; sal_uChar mnTrailStart; sal_uChar mnTrailEnd; const ImplDBCSEUDCData* mpEUDCTab; @@ -307,16 +309,23 @@ sal_Size ImplUnicodeToUTF7( const ImplTextConverterData* pData, void* pContext, sal_Char* pDestBuf, sal_Size nDestBytes, sal_uInt32 nFlags, sal_uInt32* pInfo, sal_Size* pSrcCvtChars ); -sal_Size ImplUTF8ToUnicode( const ImplTextConverterData* pData, void* pContext, - const sal_Char* pSrcBuf, sal_Size nSrcBytes, - sal_Unicode* pDestBuf, sal_Size nDestChars, - sal_uInt32 nFlags, sal_uInt32* pInfo, - sal_Size* pSrcCvtBytes ); -sal_Size ImplUnicodeToUTF8( const ImplTextConverterData* pData, void* pContext, - const sal_Unicode* pSrcBuf, sal_Size nSrcChars, - sal_Char* pDestBuf, sal_Size nDestBytes, - sal_uInt32 nFlags, sal_uInt32* pInfo, - sal_Size* pSrcCvtChars ); + +void * ImplCreateUtf8ToUnicodeContext(void) SAL_THROW_EXTERN_C(); +void ImplResetUtf8ToUnicodeContext(void * pContext) SAL_THROW_EXTERN_C(); +sal_Size ImplConvertUtf8ToUnicode(ImplTextConverterData const * pData, + void * pContext, sal_Char const * pSrcBuf, + sal_Size nSrcBytes, sal_Unicode * pDestBuf, + sal_Size nDestChars, sal_uInt32 nFlags, + sal_uInt32 * pInfo, sal_Size * pSrcCvtBytes) + SAL_THROW_EXTERN_C(); +void * ImplCreateUnicodeToUtf8Context(void) SAL_THROW_EXTERN_C(); +void ImplResetUnicodeToUtf8Context(void * pContext) SAL_THROW_EXTERN_C(); +sal_Size ImplConvertUnicodeToUtf8(ImplTextConverterData const * pData, + void * pContext, sal_Unicode const * pSrcBuf, + sal_Size nSrcChars, sal_Char * pDestBuf, + sal_Size nDestBytes, sal_uInt32 nFlags, + sal_uInt32 * pInfo, sal_Size* pSrcCvtChars) + SAL_THROW_EXTERN_C(); #if defined __cplusplus } diff --git a/sal/textenc/tencinfo.c b/sal/textenc/tencinfo.c index 4fa6dc847cfc..2e25744cc75f 100644 --- a/sal/textenc/tencinfo.c +++ b/sal/textenc/tencinfo.c @@ -2,9 +2,9 @@ * * $RCSfile: tencinfo.c,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: sb $ $Date: 2002-05-29 11:41:24 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,7 +86,7 @@ sal_Bool SAL_CALL rtl_isOctetTextEncoding(rtl_TextEncoding nEncoding) { return nEncoding > RTL_TEXTENCODING_DONTKNOW - && nEncoding <= RTL_TEXTENCODING_TIS_620 /* always update this! */ + && nEncoding <= RTL_TEXTENCODING_KOI8_U /* always update this! */ && nEncoding != 9; /* RTL_TEXTENCODING_SYSTEM */ } @@ -543,6 +543,7 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromUnixCharset( const sal_Char* pU static ImplStrCharsetDef const aUnixCharsetKOI8Tab[] = { { "r", RTL_TEXTENCODING_KOI8_R }, + { "u", RTL_TEXTENCODING_KOI8_U }, { NULL, RTL_TEXTENCODING_DONTKNOW } }; @@ -942,6 +943,8 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( const sal_Char* pM { "windows874", RTL_TEXTENCODING_MS_874 }, /* This is no official MIME character set name, but it might be in use in Thailand. */ + { "koi8u", RTL_TEXTENCODING_KOI8_U }, + { "cpis", RTL_TEXTENCODING_IBM_861 }, { NULL, RTL_TEXTENCODING_DONTKNOW } }; diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index 40379be77f4b..27b383792887 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.28 $ +# $Revision: 1.29 $ # -# last change: $Author: obo $ $Date: 2002-11-19 10:21:49 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:47:20 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -96,24 +96,18 @@ LIB1TARGET=$(SLB)$/$(TARGET).lib LIB1FILES=$(SLB)$/cpposl.lib $(SLB)$/oslall.lib $(SLB)$/cpprtl.lib .IF "$(GUI)"!="WIN" -LIB1FILES+=$(SLB)$/textenc.lib -.ENDIF -.IF "$(GUI)"=="UNX" -LIB1FILES+=$(SLB)$/systoolsunx.lib +LIB1FILES+=$(SLB)$/textenc.lib .ENDIF LIB3TARGET=$(LB)$/a$(TARGET).lib LIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a LIB3FILES=$(LB)$/cpposl.lib $(LB)$/oslall.lib $(LB)$/cpprtl.lib -.IF "$(UPDATER)"!="" +#.IF "$(UPDATER)"!="" .IF "$(GUI)"!="WIN" LIB3FILES+=$(LB)$/textenc.lib .ENDIF -.IF "$(GUI)"=="UNX" -LIB3FILES+=$(LB)$/systoolsunx.lib -.ENDIF -.ENDIF +#.ENDIF SHL1TARGET= $(TARGET) SHL1IMPLIB= i$(TARGET) @@ -152,14 +146,11 @@ SHL1STDLIBS+=-init InitLibrary -term ExitLibrary .IF "$(GUI)"=="UNX" .IF "$(OS)"=="SOLARIS" # libposix4.so (SunOS 5.6) -> librt.so (SunOS >= 5.7) -SHL1STDLIBS= -lpthread -lposix4 -lsocket -lnsl -ldl +SHL1STDLIBS= -lnsl -lsocket -lpthread -lposix4 .IF "$(COM)" == "C50" SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract .ENDIF # C50 .ENDIF # SOLARIS -.IF "$(OS)" == "LINUX" -SHL1STDLIBS+= -lstdc++ -.ENDIF .ENDIF # UNX .IF "$(GUI)"=="OS2" diff --git a/sal/util/sal.map b/sal/util/sal.map index 075ebbf3bed5..922c6821f767 100755 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -460,7 +460,7 @@ UDK_3_0_0 { rtl_uriDecode; rtl_bootstrap_get; - rtl_bootstrap_set; + rtl_bootstrap_set; rtl_bootstrap_setIniFileName; rtl_bootstrap_args_open; rtl_bootstrap_args_close; @@ -481,7 +481,6 @@ UDK_3_0_0 { rtl_removeUnloadingListener; rtl_logfile_trace; - rtl_tres_state; rtl_tres_create; rtl_tres_destroy; osl_getProcessLocale; @@ -501,4 +500,7 @@ UDK_3.1 { rtl_math_round; rtl_math_stringToDouble; rtl_math_uStringToDouble; + rtl_convertUStringToString; + + osl_joinProcessWithTimeout; } UDK_3_0_0; diff --git a/sal/workben/export.exp b/sal/workben/export.exp new file mode 100644 index 000000000000..8a37bf2291a8 --- /dev/null +++ b/sal/workben/export.exp @@ -0,0 +1 @@ +registerAllTestFunction
\ No newline at end of file diff --git a/sal/workben/getlocaleinfotest.cxx b/sal/workben/getlocaleinfotest.cxx index 2b42d6d18a97..272e2c9db173 100644 --- a/sal/workben/getlocaleinfotest.cxx +++ b/sal/workben/getlocaleinfotest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: getlocaleinfotest.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obr $ $Date: 2001-09-11 12:49:16 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,67 +61,19 @@ #include <rtl/locale.h> #include <osl/nlsupport.h> -#include <osl/process.h> #include <rtl/ustring.hxx> -#include <stdio.h> - -#ifdef WNT -#define _CDECL _cdecl -#else -#define _CDECL -#endif - -int _CDECL main( int argc, char * argv[] ) +int _cdecl main( int argc, char * argv[] ) { -/* - rtl::OUString lang = rtl::OUString::createFromAscii( "zh" ); - rtl::OUString country = rtl::OUString::createFromAscii( "TW" ); -*/ - rtl::OUString lang = rtl::OUString::createFromAscii( argv[1] ); - rtl::OUString country = rtl::OUString::createFromAscii( argv[2] ); + rtl::OUString lang = rtl::OUString::createFromAscii( "de" ); + rtl::OUString country = rtl::OUString::createFromAscii( "DE" ); rtl_TextEncoding rtlTextEnc; - rtl_Locale* rtlLocale = NULL; - - osl_getProcessLocale( &rtlLocale ); - - if ( rtlLocale ) - { - rtlTextEnc = osl_getTextEncodingFromLocale( rtlLocale ); - printf( "default text encoding is %d.\n", rtlTextEnc ); - } - else - fprintf( stderr, "osl_getProcessLocale did not return a locale !!\n" ); - - rtlLocale = rtl_locale_register( lang.getStr( ), country.getStr( ), NULL ); - - if ( rtlLocale ) - { - rtlTextEnc = osl_getTextEncodingFromLocale( rtlLocale ); - printf( "text encoding for %s_%s is %d.\n", argv[1], argv[2], rtlTextEnc ); - } - else - fprintf( stderr, "rtl_locale_register did not return a locale !!\n" ); - - rtlTextEnc = osl_getTextEncodingFromLocale( NULL ); - printf( "process text encoding is %d.\n", rtlTextEnc ); - - if( osl_setProcessLocale( rtlLocale ) ) - fprintf( stderr, "osl_setProcessLocale failed !!\n" ); - - - rtlTextEnc = osl_getTextEncodingFromLocale( NULL ); - printf( "process text encoding is now: %d.\n", rtlTextEnc ); - osl_getProcessLocale( &rtlLocale ); + rtl_Locale* rtlLocale = + rtl_locale_register( lang.getStr( ), country.getStr( ), NULL ); if ( rtlLocale ) - { rtlTextEnc = osl_getTextEncodingFromLocale( rtlLocale ); - printf( "text encoding for process locale is now: %d.\n", rtlTextEnc ); - } - else - fprintf( stderr, "osl_getProcessLocale did not return a locale !!\n" ); return(0); } diff --git a/sal/workben/makefile.mk b/sal/workben/makefile.mk index f134776554f6..672fcba0da68 100644 --- a/sal/workben/makefile.mk +++ b/sal/workben/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.9 $ +# $Revision: 1.10 $ # -# last change: $Author: tra $ $Date: 2002-12-06 10:19:52 $ +# last change: $Author: hr $ $Date: 2003-03-26 16:47:23 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -66,19 +66,19 @@ PRJNAME=sal TARGET=workben LIBTARGET=NO TARGETTYPE=CUI +ENABLE_EXCEPTIONS=TRUE -TESTAPP=t_searchfurl -#TESTAPP=getlocaleinfotest -#TESTAPP=testftmp -#TESTAPP=abbreviatetest +TESTAPP=test_osl_joinProcess #TESTAPP=getlocaleinfotest #TESTAPP=salstattest #TESTAPP=saldyntest -#TESTAPP=t_alloc #TESTAPP=t_cipher #TESTAPP=t_digest #TESTAPP=t_random +#TESTAPP=t_layer +#TESTAPP=t_tls +#TESTAPP=t_zip #TESTAPP=testfile #TESTAPP=testpipe @@ -93,36 +93,33 @@ TESTAPP=t_searchfurl # --- Files -------------------------------------------------------- -# -# t_searchfulr -# -.IF "$(TESTAPP)" == "t_searchfurl" +.IF "$(TESTAPP)" == "test_osl_joinProcess" +OBJFILES=$(OBJ)$/t_ojp_exe.obj +APP1TARGET=ojpx +APP1OBJS=$(OBJFILES) -OBJFILES= $(OBJ)$/t_searchfurl.obj +.IF "$(GUI)" == "UNX" +APP1STDLIBS=$(LB)$/libsal.so +.ENDIF -APP1TARGET= t_searchfulr -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +SHL1OBJS=$(SLO)$/t_osl_joinProcess.obj +SHL1TARGET=tojp -.ENDIF # t_searchfurl +.IF "$(GUI)" == "WNT" +APP1STDLIBS=kernel32.lib +SHL1STDLIBS=$(LB)$/isal.lib +SHL1STDLIBS+=$(SOLARLIBDIR)$/cppunit.lib +.ENDIF -.IF "$(TESTAPP)" == "testftmp" - - OBJFILES=$(OBJ)$/testftmp.obj - APP1TARGET=testftmp - APP1OBJS=$(OBJFILES) - - .IF "$(GUI)"=="WNT" - CFLAGS+=/Ob1 - APP1STDLIBS=kernel32.lib - APP1LIBS=$(LB)$/isal.lib - APP1DEPN=$(LB)$/isal.lib - .ELSE - APP1STDLIBS=$(SALLIB) - APP1DEPN=$(SLB)$/sal.lib - .ENDIF +.IF "$(GUI)" == "UNX" +SHL1STDLIBS=$(LB)$/libsal.so +SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a +.ENDIF +SHL1IMPLIB=i$(SHL1TARGET) +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=export.exp .ENDIF .IF "$(TESTAPP)" == "getlocaleinfotest" @@ -143,24 +140,6 @@ APP1DEPN= $(SLB)$/sal.lib .ENDIF -.IF "$(TESTAPP)" == "abbreviatetest" - - OBJFILES=$(OBJ)$/abbreviatetest.obj - - APP1TARGET= abbreviatetest - APP1OBJS=$(OBJFILES) - - APP1STDLIBS=\ - kernel32.lib - - APP1LIBS=\ - $(LB)$/kernel9x.lib\ - $(LB)$/isal.lib - - APP1DEPN=$(LB)$/isal.lib - -.ENDIF - .IF "$(TESTAPP)" == "salstattest" CFLAGS+= /DUSE_SAL_STATIC @@ -198,21 +177,6 @@ APP1DEPN= $(SLB)$/sal.lib .ENDIF # salstattest # -# t_alloc. -# -.IF "$(TESTAPP)" == "t_alloc" - -CFILES= t_alloc.c -OBJFILES= $(OBJ)$/t_alloc.obj - -APP1TARGET= t_alloc -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib - -.ENDIF # t_layer - -# # t_cipher # .IF "$(TESTAPP)" == "t_cipher" @@ -235,10 +199,10 @@ APP1DEPN= $(SLB)$/sal.lib CFILES= t_digest.c OBJFILES= $(OBJ)$/t_digest.obj -APP1TARGET= t_digest -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP2TARGET= t_digest +APP2OBJS= $(OBJFILES) +APP2STDLIBS=$(SALLIB) +APP2DEPN= $(SLB)$/sal.lib .ENDIF # t_digest @@ -250,14 +214,83 @@ APP1DEPN= $(SLB)$/sal.lib CFILES= t_random.c OBJFILES= $(OBJ)$/t_random.obj -APP1TARGET= t_random -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP3TARGET= t_random +APP3OBJS= $(OBJFILES) +APP3STDLIBS=$(SALLIB) +APP3DEPN= $(SLB)$/sal.lib .ENDIF # t_random # +# t_layer. +# +.IF "$(TESTAPP)" == "t_layer" + +CFILES= t_layer.c +OBJFILES= $(OBJ)$/t_layer.obj + +APP4TARGET= t_layer +APP4OBJS= $(OBJFILES) +APP4STDLIBS=$(SALLIB) +APP4DEPN= $(SLB)$/sal.lib + +.ENDIF # t_layer + +# +# t_tls. +# +.IF "$(TESTAPP)" == "t_tls" + +CFILES= t_tls.c +OBJFILES= $(OBJ)$/t_tls.obj + +.IF "$(SALTLSLIB)" == "" + +.IF "$(GUI)" == "UNX" +SALTLSLIB= -lsaltls2 +.ENDIF # unx + +.IF "$(GUI)" == "WNT" +SALTLSLIB= isaltls.lib +.ENDIF # wnt + +.ENDIF # saltlslib + +APP5TARGET= t_tls +APP5OBJS= $(OBJFILES) +APP5STDLIBS=$(SALTLSLIB) $(SALLIB) +APP5DEPN= $(SLB)$/sal.lib + +.ENDIF # t_tls + +# +# t_zip. +# +.IF "$(TESTAPP)" == "t_zip" + +CFILES= t_zip.c +OBJFILES= $(OBJ)$/t_zip.obj + +.IF "$(SALZIPLIB)" == "" + +.IF "$(GUI)" == "UNX" +SALZIPLIB= -lsalzip2 +.ENDIF # unx + +.IF "$(GUI)" == "WNT" +SALZIPLIB= isalzip.lib +.ENDIF # wnt + +.ENDIF # salziplib + +APP6TARGET= t_zip +APP6OBJS= $(OBJFILES) +APP6STDLIBS=$(SALZIPLIB) $(SALLIB) +APP6DEPN= $(SLB)$/sal.lib + +.ENDIF # t_zip + +# # testfile # .IF "$(TESTAPP)" == "testfile" @@ -280,10 +313,10 @@ APP1DEPN= $(SLB)$/sal.lib CXXFILES= testpipe.cxx OBJFILES= $(OBJ)$/testpipe.obj -APP1TARGET= testpipe -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP2TARGET= testpipe +APP2OBJS= $(OBJFILES) +APP2STDLIBS=$(SALLIB) +APP2DEPN= $(SLB)$/sal.lib .ENDIF # testpipe @@ -295,10 +328,10 @@ APP1DEPN= $(SLB)$/sal.lib CXXFILES= testpip2.cxx OBJFILES= $(OBJ)$/testpip2.obj -APP1TARGET= testpip2 -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP3TARGET= testpip2 +APP3OBJS= $(OBJFILES) +APP3STDLIBS=$(SALLIB) +APP3DEPN= $(SLB)$/sal.lib .ENDIF # testpip2 @@ -310,10 +343,10 @@ APP1DEPN= $(SLB)$/sal.lib CXXFILES= testproc.cxx OBJFILES= $(OBJ)$/testproc.obj -APP1TARGET= testproc -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP4TARGET= testproc +APP4OBJS= $(OBJFILES) +APP4STDLIBS=$(SALLIB) +APP4DEPN= $(SLB)$/sal.lib .ENDIF # testproc @@ -326,10 +359,10 @@ APP1DEPN= $(SLB)$/sal.lib CXXFILES= tgetpwnam.cxx OBJFILES= $(OBJ)$/tgetpwnam.obj -APP1TARGET= tgetpwnam -APP1OBJS= $(OBJFILES) -APP1STDLIBS=$(SALLIB) -APP1DEPN= $(SLB)$/sal.lib +APP5TARGET= tgetpwnam +APP5OBJS= $(OBJFILES) +APP5STDLIBS=$(SALLIB) +APP5DEPN= $(SLB)$/sal.lib .ENDIF # (sco | netbsd) .ENDIF # tgetpwname diff --git a/sal/workben/t_layer.c b/sal/workben/t_layer.c new file mode 100644 index 000000000000..f611d61289fe --- /dev/null +++ b/sal/workben/t_layer.c @@ -0,0 +1,353 @@ +/************************************************************************* + * + * $RCSfile: t_layer.c,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:47:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif +#ifndef _RTL_ALLOC_H_ +#include <rtl/alloc.h> +#endif +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +#ifndef _OSL_INTERLCK_H_ +#include <osl/interlck.h> +#endif +#ifndef _OSL_ISOCKET_H_ +#include <osl/isocket.h> +#endif + +/*======================================================================== + * + * osl/debug.c + * + *======================================================================*/ +/* + * __osl_debug_create. + */ +static oslSocketResult SAL_CALL __osl_debug_create ( + oslSocketDescriptor *socket, + oslAddrFamily family, + oslSocketType type, + oslProtocol protocol) +{ + oslSocketResult result; + + if (!(socket->m_lower)) + { + oslSocketDescriptor *lower; + lower = osl_socket_createSocketLayer (osl_socket_getSocketMethods()); + osl_socket_pushSocketLayer (socket, lower); + } + + result = (socket->m_lower->m_methods->m_create)( + socket->m_lower, family, type, protocol); + if (!(result == osl_Socket_Ok)) + return (result); + + if (!(socket->m_private)) + { + /* ... */ + } + return (osl_Socket_Ok); +} + +/* + * __osl_debug_delete. + */ +static void SAL_CALL __osl_debug_delete (oslSocketDescriptor *socket) +{ + if (socket->m_private) + { + /* ... */ + } + if (socket->m_lower) + { + (socket->m_lower->m_methods->m_delete)(socket->m_lower); + osl_socket_deleteSocketLayer (socket->m_lower); + } +} + +/* + * __osl_debug_getOption. + */ +static oslSocketResult SAL_CALL __osl_debug_getOption ( + oslSocketDescriptor *socket, + oslSocketOptionLevel level, + oslSocketOption option, + void *buffer, + sal_uInt32 length) +{ + if (level == osl_Socket_LevelSocketLayer) + { + /* ... */ + return (osl_Socket_Ok); + } + + return (socket->m_lower->m_methods->m_getoption)( + socket->m_lower, level, option, buffer, length); +} + +/* + * __osl_debug_setOption. + */ +static oslSocketResult SAL_CALL __osl_debug_setOption ( + oslSocketDescriptor *socket, + oslSocketOptionLevel level, + oslSocketOption option, + const void *buffer, + sal_uInt32 length) +{ + if (level == osl_Socket_LevelSocketLayer) + { + /* ... */ + return (osl_Socket_Ok); + } + + return (socket->m_lower->m_methods->m_setoption)( + socket->m_lower, level, option, buffer, length); +} + +/* + * __osl_debug_accept. + */ +static oslSocketDescriptor* SAL_CALL __osl_debug_accept ( + oslSocketDescriptor *socket, oslSocketAddr *fromaddr) +{ + oslSocketDescriptor *lower; + lower = (socket->m_lower->m_methods->m_accept)(socket->m_lower, fromaddr); + if (lower) + { + oslSocketDescriptor *upper; + upper = osl_socket_createSocketLayer (socket->m_methods); + osl_socket_pushSocketLayer (upper, lower); + return (upper); + } + return ((oslSocketDescriptor*)NULL); +} + +/* + * __osl_debug_connect. + */ +static oslSocketResult SAL_CALL __osl_debug_connect ( + oslSocketDescriptor *socket, oslSocketAddr addr) +{ + return (socket->m_lower->m_methods->m_connect)(socket->m_lower, addr); +} + +/* + * __osl_debug_close. + */ +static void SAL_CALL __osl_debug_close (oslSocketDescriptor *socket) +{ + (socket->m_lower->m_methods->m_close)(socket->m_lower); +} + +/* + * __osl_shutdown. + */ +static void SAL_CALL __osl_debug_shutdown ( + oslSocketDescriptor *socket, oslSocketDirection direction) +{ + (socket->m_lower->m_methods->m_shutdown)(socket->m_lower, direction); +} + +/* + * __osl_debug_methods. + */ +static oslSocketMethods __osl_debug_methods = +{ + NULL /* initialized on demand */ +}; + +/* + * osl_debug_getSocketMethods. + */ +const oslSocketMethods* SAL_CALL osl_debug_getSocketMethods (void) +{ + static oslInterlockedCount nonce = 0; + if (osl_incrementInterlockedCount (&nonce) == 1) + { + const oslSocketMethods *methods = osl_socket_getDefaultSocketMethods(); + __osl_debug_methods = *methods; + + __osl_debug_methods.m_create = __osl_debug_create; + __osl_debug_methods.m_delete = __osl_debug_delete; + + __osl_debug_methods.m_getoption = __osl_debug_getOption; + __osl_debug_methods.m_setoption = __osl_debug_setOption; + + __osl_debug_methods.m_accept = __osl_debug_accept; + __osl_debug_methods.m_connect = __osl_debug_connect; + __osl_debug_methods.m_close = __osl_debug_close; + + __osl_debug_methods.m_shutdown = __osl_debug_shutdown; + + osl_incrementInterlockedCount (&nonce); + } + + osl_decrementInterlockedCount (&nonce); + return (&__osl_debug_methods); +} + +/*======================================================================== + * + * osl/socket.c (physical, bottom layer). + * + *======================================================================*/ +#if 0 /* NYI */ + +static oslSocketResult SAL_CALL __osl_socket_create ( + oslSocketDescriptor *socket, + oslAddrFamily family, + oslSocketType type, + oslProtocol protocol) +{ +#ifdef DEBUG + const oslSocketMethods *debug = osl_debug_getSocketMethods(); + if (!(socket->m_upper || socket->m_upper->m_methods == debug)) + { + oslSocketDescriptor *upper; + + upper = osl_socket_createSocketLayer (debug); + osl_socket_pushSocketLayer (upper, socket); + + return (upper->m_methods->m_create)(upper, family, type, protocol); + } +#endif /* DEBUG */ + if (!(socket->m_private)) + { + /* ... */ + socket->m_private = osl_createSocket (family, type, protocol); + } + return (osl_Socket_Ok); +} + +#endif /* NYI */ + +/*======================================================================== + * + * main. + * + *======================================================================*/ +int SAL_CALL main (int argc, char **argv) +{ + oslSocketDescriptor *socket; + + socket = osl_socket_createSocketLayer (osl_debug_getSocketMethods()); + if (socket) + { + oslSocketDescriptor *connection; + oslSocketResult result; + oslSocketAddr addr, from; + sal_Int32 option = 1; + + result = osl_socket_create ( + socket, + osl_Socket_FamilyInet, + osl_Socket_TypeStream, + osl_Socket_ProtocolIp); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_setOption ( + socket, + osl_Socket_LevelSocket, + osl_Socket_OptionReuseAddr, + &option, sizeof(option)); + OSL_ASSERT(result == osl_Socket_Ok); + + addr = osl_createEmptySocketAddr (osl_Socket_FamilyInet); + osl_setInetPortOfSocketAddr (addr, 7777); + + result = osl_socket_bind (socket, addr); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_listen (socket, 1); + OSL_ASSERT(result == osl_Socket_Ok); + + connection = osl_socket_accept (socket, &from); + if (connection) + { + sal_Char buffer[1024]; + sal_Int32 k, n = sizeof(buffer); + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + + while ((k = osl_socket_recv (connection, buffer, n, flag)) > 0) + { + if (osl_socket_send (connection, buffer, k, flag) < 0) + break; + } + + osl_socket_close (connection); + osl_socket_delete (connection); + + osl_socket_deleteSocketLayer (connection); + } + + osl_socket_close (socket); + osl_socket_delete (socket); + + osl_socket_deleteSocketLayer (socket); + } + + return 0; +} + diff --git a/sal/qa/OStringBuffer/rtl_String_Utils_Const.h b/sal/workben/t_ojp_exe.cxx index d445d4778c21..c0fb5803d7ef 100644 --- a/sal/qa/OStringBuffer/rtl_String_Utils_Const.h +++ b/sal/workben/t_ojp_exe.cxx @@ -1,10 +1,10 @@ /************************************************************************* * - * $RCSfile: rtl_String_Utils_Const.h,v $ + * $RCSfile: t_ojp_exe.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: lwang $ $Date: 2003-01-03 09:52:13 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,50 +59,28 @@ * ************************************************************************/ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -#ifndef _RTL_STRING_UTILS_CONST_H_ -#define _RTL_STRING_UTILS_CONST_H_ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _SAL_TYPES_H_ - #include <sal/types.h> +#ifdef WNT +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +#else +# include <unistd.h> #endif -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ +#include <stdio.h> -#ifdef __cplusplus -extern "C" +int main(int argc, char* argv[]) { -#endif - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -static const sal_Int32 kErrCompareAStringToUString = -2; -static const sal_Int32 kErrCompareNAStringToUString = -3; -static const sal_Int32 kErrCompareAStringToRTLUString = -4; -static const sal_Int32 kErrCompareNAStringToRTLUString = -5; -static const sal_Int32 kErrAStringToByteStringCompare = -6; -static const sal_Int32 kErrAStringToByteStringNCompare = -7; -static const sal_Int32 kErrCompareAStringToString = -8; -static const sal_Int32 kErrCompareNAStringToString = -9; + printf("osl process test executable started:\n"); -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifdef __cplusplus -} +#ifdef WNT + Sleep(5000); +#else + sleep(5); #endif -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#endif /* _RTL_STRING_UTILS_CONST_H_ */ - + printf("osl process test executable ended:\n"); + return (0); +} diff --git a/sal/workben/t_osl_joinProcess.cxx b/sal/workben/t_osl_joinProcess.cxx new file mode 100644 index 000000000000..b050d39e7677 --- /dev/null +++ b/sal/workben/t_osl_joinProcess.cxx @@ -0,0 +1,259 @@ +/************************************************************************* + * + * $RCSfile: t_osl_joinProcess.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:47:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <cppunit/simpleheader.hxx> +#include <osl/process.h> +#include <rtl/ustring.hxx> +#include <unistd.h> +#include <signal.h> + +#ifdef WNT + const rtl::OUString IMAGE_NAME = rtl::OUString::createFromAscii("ojpx.exe"); +#else + const rtl::OUString IMAGE_NAME = rtl::OUString::createFromAscii("ojpx"); +#endif + +const rtl::OUString CWD = rtl::OUString::createFromAscii("."); + +//------------------------------ +// +//------------------------------ + +class Test_osl_Process : public CppUnit::TestFixture +{ +public: + + /*------------------------------------- + Start a process and join with this + process specify a timeout so that + osl_joinProcessWithTimeout returns + osl_Process_E_TimedOut + -------------------------------------*/ + + void test_osl_joinProcessWithTimeout_timeout_failure() + { + oslProcess process; + oslProcessError osl_error = osl_executeProcess( + IMAGE_NAME.pData, + NULL, + 0, + osl_Process_NORMAL, + osl_getCurrentSecurity(), + CWD.pData, + NULL, + 0, + &process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_createProcess failed", + osl_error == osl_Process_E_None + ); + + TimeValue timeout; + timeout.Seconds = 1; + timeout.Nanosec = 0; + + osl_error = osl_joinProcessWithTimeout(process, &timeout); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_joinProcessWithTimeout returned without timeout failure", + osl_Process_E_TimedOut == osl_error + ); + + osl_error = osl_terminateProcess(process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_terminateProcess failed", + osl_error == osl_Process_E_None + ); + + osl_freeProcessHandle(process); + } + + /*------------------------------------- + Start a process and join with this + process specify a timeout so that + osl_joinProcessWithTimeout returns + osl_Process_E_None + -------------------------------------*/ + + void test_osl_joinProcessWithTimeout_without_timeout_failure() + { + oslProcess process; + oslProcessError osl_error = osl_executeProcess( + IMAGE_NAME.pData, + NULL, + 0, + osl_Process_NORMAL, + osl_getCurrentSecurity(), + CWD.pData, + NULL, + 0, + &process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_createProcess failed", + osl_error == osl_Process_E_None + ); + + TimeValue timeout; + timeout.Seconds = 10; + timeout.Nanosec = 0; + + osl_error = osl_joinProcessWithTimeout(process, &timeout); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_joinProcessWithTimeout returned with failure", + osl_Process_E_None == osl_error + ); + + osl_freeProcessHandle(process); + } + + /*------------------------------------- + Start a process and join with this + process specify an infinite timeout + -------------------------------------*/ + + void test_osl_joinProcessWithTimeout_infinite() + { + oslProcess process; + oslProcessError osl_error = osl_executeProcess( + IMAGE_NAME.pData, + NULL, + 0, + osl_Process_NORMAL, + osl_getCurrentSecurity(), + CWD.pData, + NULL, + 0, + &process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_createProcess failed", + osl_error == osl_Process_E_None + ); + + osl_error = osl_joinProcessWithTimeout(process, NULL); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_joinProcessWithTimeout returned with failure", + osl_Process_E_None == osl_error + ); + + osl_freeProcessHandle(process); + } + + /*------------------------------------- + Start a process and join with this + process using osl_joinProcess + -------------------------------------*/ + + void test_osl_joinProcess() + { + oslProcess process; + oslProcessError osl_error = osl_executeProcess( + IMAGE_NAME.pData, + NULL, + 0, + osl_Process_NORMAL, + osl_getCurrentSecurity(), + CWD.pData, + NULL, + 0, + &process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_createProcess failed", + osl_error == osl_Process_E_None + ); + + osl_error = osl_joinProcess(process); + + CPPUNIT_ASSERT_MESSAGE + ( + "osl_joinProcess returned with failure", + osl_Process_E_None == osl_error + ); + + osl_freeProcessHandle(process); + } + + CPPUNIT_TEST_SUITE(Test_osl_Process); + CPPUNIT_TEST(test_osl_joinProcessWithTimeout_timeout_failure); + CPPUNIT_TEST(test_osl_joinProcessWithTimeout_without_timeout_failure); + CPPUNIT_TEST(test_osl_joinProcessWithTimeout_infinite); + CPPUNIT_TEST(test_osl_joinProcess); + CPPUNIT_TEST_SUITE_END(); +}; + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test_osl_Process, "Test_osl_Process"); + +NOADDITIONAL; + diff --git a/sal/workben/t_tls.c b/sal/workben/t_tls.c new file mode 100644 index 000000000000..98e91793c5b6 --- /dev/null +++ b/sal/workben/t_tls.c @@ -0,0 +1,301 @@ +/************************************************************************* + * + * $RCSfile: t_tls.c,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:47:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif +#ifndef _RTL_ALLOC_H_ +#include <rtl/alloc.h> +#endif +#ifndef _RTL_USTRING_H_ +#include <rtl/ustring.h> +#endif + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +#ifndef _OSL_FILE_H_ +#include <osl/file.h> +#endif +#ifndef _OSL_INTERLCK_H_ +#include <osl/interlck.h> +#endif +#ifndef _OSL_ISOCKET_H_ +#include <osl/isocket.h> +#endif + +#ifndef _OSL_TLS_H_ +#include <osl/tls.h> +#endif + +#include <string.h> +#include <stdio.h> + +/*======================================================================== + * + * Internals. + * + *======================================================================*/ +void SAL_CALL __rtl_sequence_release (sal_Sequence *value) +{ + if (value) + { + if (osl_decrementInterlockedCount (&(value->nRefCount)) == 0) + rtl_freeMemory (value); + } +} + +void SAL_CALL __rtl_sequence_new (sal_Sequence **value, sal_Int32 length) +{ + if (value) + { + __rtl_sequence_release (*value); + + *value = (sal_Sequence*)rtl_allocateMemory ( + SAL_SEQUENCE_HEADER_SIZE + length); + + (*value)->nRefCount = 1; + (*value)->nElements = 0; + } +} + +void load_sequence (sal_Sequence **ppSequence, const sal_Char *name) +{ + oslFileError result; + rtl_uString *pName, *pPath; + + if (ppSequence) + { + __rtl_sequence_release (*ppSequence); + *ppSequence = NULL; + } + + pName = NULL; + rtl_uString_newFromAscii (&pName, name); + + pPath = NULL; + result = osl_searchNormalizedPath (pName, NULL, &pPath); + if (result == osl_File_E_None) + { + oslFileHandle hFile; + + result = osl_openFile (pPath, &hFile, osl_File_OpenFlag_Read); + if (result == osl_File_E_None) + { + sal_uInt64 nSize = 0, nRead = 0; + + osl_setFilePos (hFile, osl_Pos_End, 0); + osl_getFilePos (hFile, &nSize); + osl_setFilePos (hFile, osl_Pos_Absolut, 0); + + __rtl_sequence_new (ppSequence, (sal_Int32)nSize); + + osl_readFile (hFile, (*ppSequence)->elements, nSize, &nRead); + (*ppSequence)->nElements = (sal_Int32)nRead; + } + osl_closeFile (hFile); + + rtl_uString_release (pPath); + } + + rtl_uString_release (pName); +} + +/*======================================================================== + * + * main. + * + *======================================================================*/ +int SAL_CALL main (int argc, char **argv) +{ + static const sal_Char p[] = "GET / HTTP/1.0\015\012\015\012"; + oslSocketDescriptor *socket; + + + socket = osl_socket_createSocketLayer (osl_tls_getSocketMethods()); + if (socket) + { + oslSocketAddr target; + oslSocketResult result; + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + rtl_uString *dotted = NULL; + + + rtl_uString_newFromAscii (&dotted, argv[1]); + target = osl_createInetSocketAddr (dotted, 443); + rtl_uString_release (dotted); + + result = osl_socket_create ( + socket, + osl_Socket_FamilyInet, + osl_Socket_TypeStream, + osl_Socket_ProtocolIp); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_connect (socket, target); + osl_destroySocketAddr (target); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_connect_handshake (socket, target); + OSL_ASSERT(result == osl_Socket_Ok); + + if (osl_socket_send (socket, p, strlen(p), flag) > 0) + { + sal_Char buffer[1024]; + sal_Int32 k, n = sizeof(buffer); + + while ((k = osl_socket_recv (socket, buffer, n, flag)) > 0) + fwrite (buffer, 1, k, stdout); + } + + osl_socket_shutdown (socket, osl_Socket_DirReadWrite); + osl_socket_close (socket); + + osl_socket_delete (socket); + osl_socket_deleteSocketLayer (socket); + } + + + socket = osl_socket_createSocketLayer (osl_tls_getSocketMethods()); + if (socket) + { + oslSocketDescriptor *connection; + oslSocketResult result; + oslSocketAddr addr, from; + sal_Int32 option = 1; + sal_Sequence *data = NULL; + + + result = osl_socket_create ( + socket, + osl_Socket_FamilyInet, + osl_Socket_TypeStream, + osl_Socket_ProtocolIp); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_setOption ( + socket, + osl_Socket_LevelSocket, + osl_Socket_OptionReuseAddr, + &option, sizeof(option)); + OSL_ASSERT(result == osl_Socket_Ok); + + addr = osl_createEmptySocketAddr (osl_Socket_FamilyInet); + osl_setInetPortOfSocketAddr (addr, 7777); + + result = osl_socket_bind (socket, addr); + OSL_ASSERT(result == osl_Socket_Ok); + + load_sequence (&data, "s_cert.der"); + if (data && data->nElements) + { + result = osl_socket_setOption ( + socket, + osl_Socket_LevelTLS, + osl_Socket_OptionCertificate, + data->elements, data->nElements); + OSL_ASSERT(result == osl_Socket_Ok); + } + + load_sequence (&data, "s_pkey.der"); + if (data && data->nElements) + { + result = osl_socket_setOption ( + socket, + osl_Socket_LevelTLS, + osl_Socket_OptionPrivateKey, + data->elements, data->nElements); + OSL_ASSERT(result == osl_Socket_Ok); + } + __rtl_sequence_release (data); + + result = osl_socket_listen (socket, 1); + OSL_ASSERT(result == osl_Socket_Ok); + + connection = osl_socket_accept (socket, &from); + if (connection) + { + sal_Char buffer[1024]; + sal_Int32 k, n = sizeof(buffer); + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + + result = osl_socket_accept_handshake (connection, from); + OSL_ASSERT(result == osl_Socket_Ok); + + while ((k = osl_socket_recv (connection, buffer, n, flag)) > 0) + { + if (osl_socket_send (connection, buffer, k, flag) < 0) + break; + } + + osl_socket_close (connection); + + osl_socket_delete (connection); + osl_socket_deleteSocketLayer (connection); + } + + osl_socket_delete (socket); + osl_socket_deleteSocketLayer (socket); + } + + return 0; +} + diff --git a/sal/workben/t_zip.c b/sal/workben/t_zip.c new file mode 100644 index 000000000000..40298cf86b14 --- /dev/null +++ b/sal/workben/t_zip.c @@ -0,0 +1,223 @@ +/************************************************************************* + * + * $RCSfile: t_zip.c,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 16:47:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif +#ifndef _RTL_USTRING_H_ +#include <rtl/ustring.h> +#endif + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +#ifndef _OSL_THREAD_H_ +#include <osl/thread.h> +#endif +#ifndef _OSL_ZSOCKET_H_ +#include <osl/zsocket.h> +#endif + +#include <stdio.h> + +/*======================================================================== + * + * internals. + * + *======================================================================*/ +void SAL_CALL clientSocketReader (void *pData) +{ + oslSocketDescriptor *socket; + + socket = (oslSocketDescriptor*)pData; + if (socket) + { + sal_Char buffer[128]; + sal_Int32 k, n = sizeof(buffer); + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + + while ((k = osl_socket_recv (socket, buffer, n, flag)) > 0) + { + fwrite (buffer, 1, k, stdout); + fflush (stdout); + } + } +} + +/*======================================================================== + * + * main. + * + *======================================================================*/ +int SAL_CALL main (int argc, char **argv) +{ + oslSocketDescriptor *socket; + + socket = osl_socket_createSocketLayer (osl_zlib_getSocketMethods()); + if (socket) + { + oslSocketAddr addr = 0; + oslSocketResult result; + + result = osl_socket_create ( + socket, + osl_Socket_FamilyInet, + osl_Socket_TypeStream, + osl_Socket_ProtocolIp); + OSL_ASSERT(result == osl_Socket_Ok); + + if (argc > 1) + { + rtl_uString *host = 0; + + rtl_uString_newFromAscii (&host, argv[1]); + addr = osl_resolveHostname (host); + rtl_uString_release (host); + } + + if (addr) + { + sal_Char buffer[128]; + sal_Int32 k, n = sizeof(buffer); + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + oslThread reader; + + osl_setInetPortOfSocketAddr (addr, 7777); + + result = osl_socket_connect (socket, addr); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_connect_handshake (socket, addr); + osl_destroySocketAddr (addr); + OSL_ASSERT(result == osl_Socket_Ok); + + reader = osl_createSuspendedThread (clientSocketReader, socket); + OSL_ASSERT(reader); + osl_resumeThread (reader); + + while ((k = fread (buffer, 1, n, stdin)) > 0) + { + if (osl_socket_send (socket, buffer, k, flag) < 0) + break; + } + + osl_socket_shutdown (socket, osl_Socket_DirReadWrite); + osl_socket_close (socket); + + osl_joinWithThread (reader); + osl_destroyThread (reader); + } + else + { + oslSocketDescriptor *connection; + oslSocketAddr from = 0; + sal_Int32 option = 1; + + addr = osl_createEmptySocketAddr (osl_Socket_FamilyInet); + osl_setInetPortOfSocketAddr (addr, 7777); + + result = osl_socket_setOption ( + socket, + osl_Socket_LevelSocket, + osl_Socket_OptionReuseAddr, + &option, sizeof(option)); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_bind (socket, addr); + osl_destroySocketAddr (addr); + OSL_ASSERT(result == osl_Socket_Ok); + + result = osl_socket_listen (socket, 1); + OSL_ASSERT(result == osl_Socket_Ok); + + connection = osl_socket_accept (socket, &from); + if (connection) + { + sal_Char buffer[64]; + sal_Int32 k, n = sizeof(buffer); + oslSocketMsgFlag flag = osl_Socket_MsgNormal; + + result = osl_socket_accept_handshake (connection, from); + osl_destroySocketAddr (from); + OSL_ASSERT(result == osl_Socket_Ok); + + while ((k = osl_socket_recv (connection, buffer, n, flag)) > 0) + { + if (osl_socket_send (connection, buffer, k, flag) < 0) + break; + } + + osl_socket_close (connection); + + osl_socket_delete (connection); + osl_socket_deleteSocketLayer (connection); + } + + osl_socket_close (socket); + } + + osl_socket_delete (socket); + osl_socket_deleteSocketLayer (socket); + } + + return 0; +} + diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx index 07a1bdf48283..15a0bae48ff3 100644 --- a/sal/workben/testfile.cxx +++ b/sal/workben/testfile.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testfile.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obr $ $Date: 2001-09-04 06:52:25 $ + * last change: $Author: hr $ $Date: 2003-03-26 16:47:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,7 +64,6 @@ #include <osl/file.hxx> #include <osl/process.h> -#include <osl/thread.h> #include <osl/time.h> #include <rtl/alloc.h> #include <rtl/ustring.hxx> @@ -115,7 +114,7 @@ void printFileName(::rtl::OUString& str) { rtl::OString aString; - aString = rtl::OUStringToOString( str, osl_getThreadTextEncoding() ); + aString = rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); printf( "%s", aString.getStr() ); @@ -248,7 +247,7 @@ sal_Bool Initialize( void ) while ( (pCount-pBuffer < uBytesRead) && !testLineBreak(pCount,uBytesRead-(pCount-pBuffer), &cLineBrake)) pCount++; - dir[i]=rtl::OUString(pBegin, pCount-pBegin, osl_getThreadTextEncoding() ); + dir[i]=rtl::OUString(pBegin, pCount-pBegin, RTL_TEXTENCODING_ASCII_US); pCount+=cLineBrake; pBegin=pCount; @@ -1678,6 +1677,55 @@ void DirectoryItemTest( void ) printf( "\n" ); + //--------------------------------------------------- + // get DirectoryItem from a file-handle + //-------------------------------------------------- + + pFile=new File( file1 ); + + rc=pFile->open( OpenFlag_Read ); + if ( rc==FileBase::E_None ) + { + printf( "Get DirectoryItem from a File-Handle: "); + printFileName( file1 ); + printf( "\n" ); + + rc=DirectoryItem::get( *pFile , aItem ); + print_error( rtl::OString( "GetDirectoryItem" ), rc ); + + pStatus=new FileStatus( FileStatusMask_All ); + rc=aItem.getFileStatus( *pStatus ); + + if ( rc==FileBase::E_None ) + { + printf( "GetFileStatus: FileURL: "); + printFileName( pStatus->getFileURL() ); + printf( "\n"); + } + + delete pStatus; + + pFile->close(); + } + + delete pFile; + + printf( "\n" ); + + //--------------------------------------------------- + // get DirectoryItem from an empty file-handle + //-------------------------------------------------- + + pFile=new File( file1 ); + + printf( "Get DirectoryItem from an empty File-Handle\n" ); + rc=DirectoryItem::get( *pFile , aItem ); + print_error( rtl::OString( "GetDirectoryItem" ), rc ); + + delete pFile; + + printf( "\n" ); + //-------------------------------------------------- // GetNextItem from a directory //-------------------------------------------------- |