summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-14 19:06:55 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-14 19:06:55 +0200
commit8d7922aa5299d1bd75a78066e19e96b46b6b380a (patch)
tree9b11c03dd3cc0f06902c29793228e4e8fa7b424e
parent0ed88426b5a379c0c5dbeffd70bc0c63e7c3641f (diff)
#i103496#: split cppunit in a pure external lib and a lib depending on sal -> testshl2
-rw-r--r--codemaker/test/cppumaker/makefile.mk4
-rw-r--r--codemaker/test/cppumaker/test_codemaker_cppumaker.cxx8
-rw-r--r--cppu/qa/makefile.mk18
-rw-r--r--cppu/qa/test_any.cxx4
-rw-r--r--cppu/qa/test_recursion.cxx2
-rw-r--r--cppu/qa/test_reference.cxx4
-rw-r--r--cppu/qa/test_unotype.cxx4
-rw-r--r--cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx18
-rw-r--r--cppuhelper/qa/ifcontainer/makefile.mk5
-rw-r--r--cppuhelper/qa/propertysetmixin/makefile.mk4
-rw-r--r--cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx4
-rw-r--r--cppuhelper/qa/unourl/cppu_unourl.cxx24
-rw-r--r--cppuhelper/qa/unourl/makefile.mk5
-rw-r--r--cppuhelper/qa/weak/makefile.mk6
-rw-r--r--cppuhelper/qa/weak/test_weak.cxx4
-rw-r--r--sal/qa/ByteSequence/ByteSequence.cxx100
-rw-r--r--sal/qa/ByteSequence/makefile.mk17
-rw-r--r--sal/qa/ByteSequence/rtl_old_testbyteseq.cxx26
-rw-r--r--sal/qa/OStringBuffer/makefile.mk13
-rw-r--r--sal/qa/OStringBuffer/rtl_OStringBuffer.cxx7456
-rw-r--r--sal/qa/osl/condition/makefile.mk13
-rw-r--r--sal/qa/osl/condition/osl_Condition_Const.h6
-rw-r--r--sal/qa/osl/file/makefile.mk24
-rw-r--r--sal/qa/osl/file/osl_File.cxx2786
-rw-r--r--sal/qa/osl/file/osl_old_test_file.cxx22
-rwxr-xr-xsal/qa/osl/file/test_cpy_wrt_file.cxx62
-rw-r--r--sal/qa/osl/module/makefile.mk13
-rw-r--r--sal/qa/osl/module/osl_Module_Const.h4
-rw-r--r--sal/qa/osl/module/osl_Module_DLL.cxx4
-rwxr-xr-xsal/qa/osl/mutex/makefile.mk12
-rwxr-xr-xsal/qa/osl/mutex/osl_Mutex_Const.h6
-rw-r--r--sal/qa/osl/pipe/makefile.mk15
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx440
-rw-r--r--sal/qa/osl/process/makefile.mk27
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx488
-rw-r--r--sal/qa/osl/process/osl_process.cxx406
-rw-r--r--sal/qa/osl/profile/makefile.mk8
-rw-r--r--sal/qa/osl/profile/osl_old_testprofile.cxx12
-rwxr-xr-xsal/qa/osl/security/makefile.mk14
-rwxr-xr-xsal/qa/osl/security/osl_Security_Const.h6
-rw-r--r--sal/qa/osl/semaphore/makefile.mk13
-rw-r--r--sal/qa/osl/semaphore/osl_Semaphore_Const.h8
-rwxr-xr-xsal/qa/osl/socket/makefile.mk50
-rw-r--r--sal/qa/osl/socket/osl_AcceptorSocket.cxx112
-rw-r--r--sal/qa/osl/socket/osl_ConnectorSocket.cxx82
-rw-r--r--sal/qa/osl/socket/osl_DatagramSocket.cxx128
-rwxr-xr-xsal/qa/osl/socket/osl_Socket.cxx1462
-rw-r--r--sal/qa/osl/socket/osl_Socket2.cxx582
-rw-r--r--sal/qa/osl/socket/osl_SocketAddr.cxx372
-rw-r--r--sal/qa/osl/socket/osl_Socket_tests.cxx8
-rw-r--r--sal/qa/osl/socket/osl_StreamSocket.cxx434
-rw-r--r--sal/qa/osl/socket/sockethelper.cxx70
-rw-r--r--sal/qa/osl/thread/makefile.mk4
-rw-r--r--sal/qa/osl/thread/test_thread.cxx4
-rwxr-xr-xsal/qa/rtl/alloc/makefile.mk14
-rwxr-xr-xsal/qa/rtl/alloc/rtl_alloc.cxx26
-rw-r--r--sal/qa/rtl/bootstrap/makefile.mk10
-rw-r--r--sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx144
-rw-r--r--sal/qa/rtl/cipher/makefile.mk8
-rw-r--r--sal/qa/rtl/cipher/rtl_cipher.cxx104
-rwxr-xr-xsal/qa/rtl/crc32/makefile.mk13
-rwxr-xr-xsal/qa/rtl/crc32/rtl_crc32.cxx10
-rw-r--r--sal/qa/rtl/digest/makefile.mk8
-rw-r--r--sal/qa/rtl/digest/rtl_digest.cxx224
-rw-r--r--sal/qa/rtl/doublelock/makefile.mk8
-rw-r--r--sal/qa/rtl/doublelock/rtl_doublelocking.cxx46
-rw-r--r--sal/qa/rtl/locale/makefile.mk8
-rw-r--r--sal/qa/rtl/locale/rtl_locale.cxx38
-rw-r--r--sal/qa/rtl/logfile/makefile.mk6
-rw-r--r--sal/qa/rtl/logfile/rtl_logfile.cxx38
-rw-r--r--sal/qa/rtl/math/makefile.mk25
-rw-r--r--sal/qa/rtl/math/rtl_math.cxx12
-rw-r--r--sal/qa/rtl/math/rtl_old_testint64.cxx8
-rw-r--r--sal/qa/rtl/ostring/makefile.mk16
-rw-r--r--sal/qa/rtl/ostring/rtl_OString2.cxx102
-rw-r--r--sal/qa/rtl/ostring/rtl_str.cxx218
-rw-r--r--sal/qa/rtl/ostring/rtl_string.cxx42
-rw-r--r--sal/qa/rtl/oustring/makefile.mk12
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx156
-rw-r--r--sal/qa/rtl/oustring/rtl_ustr.cxx330
-rw-r--r--sal/qa/rtl/oustringbuffer/makefile.mk8
-rw-r--r--sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx6
-rw-r--r--sal/qa/rtl/process/makefile.mk12
-rw-r--r--sal/qa/rtl/process/rtl_Process.cxx48
-rw-r--r--sal/qa/rtl/random/makefile.mk8
-rw-r--r--sal/qa/rtl/random/rtl_random.cxx62
-rw-r--r--sal/qa/rtl/strings/makefile.mk4
-rw-r--r--sal/qa/rtl/strings/test_oustring_compare.cxx4
-rw-r--r--sal/qa/rtl/strings/test_oustring_convert.cxx6
-rw-r--r--sal/qa/rtl/strings/test_oustring_endswith.cxx4
-rw-r--r--sal/qa/rtl/strings/test_oustring_noadditional.cxx4
-rw-r--r--sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx4
-rw-r--r--sal/qa/rtl/textenc/makefile.mk10
-rw-r--r--sal/qa/rtl/textenc/rtl_tencinfo.cxx68
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx4
-rw-r--r--sal/qa/rtl/uri/makefile.mk10
-rw-r--r--sal/qa/rtl/uri/rtl_Uri.cxx48
-rw-r--r--sal/qa/rtl/uri/rtl_testuri.cxx4
-rw-r--r--sal/qa/rtl/uuid/makefile.mk8
-rw-r--r--sal/qa/rtl/uuid/rtl_Uuid.cxx24
-rw-r--r--sal/qa/rtl_strings/makefile.mk45
-rw-r--r--sal/qa/rtl_strings/rtl_old_testostring.cxx6
-rw-r--r--sal/qa/rtl_strings/rtl_old_testowstring.cxx86
-rw-r--r--sal/qa/rtl_strings/rtl_old_teststrbuf.cxx14
-rw-r--r--sal/qa/sal/makefile.mk4
-rw-r--r--sal/qa/sal/test_types.cxx4
-rw-r--r--sal/qa/systools/makefile.mk9
-rw-r--r--sal/qa/systools/test_comtools.cxx82
-rw-r--r--sal/qa/testHelperFunctions/makefile.mk6
-rw-r--r--sal/qa/testHelperFunctions/testHelperFunctions.cxx46
-rw-r--r--sal/qa/testHelperFunctions/testHelperFunctions2.cxx8
-rw-r--r--salhelper/qa/makefile.mk6
-rw-r--r--salhelper/qa/test_api.cxx4
-rw-r--r--stoc/test/uriproc/makefile.mk4
-rw-r--r--stoc/test/uriproc/test_uriproc.cxx4
115 files changed, 8762 insertions, 8961 deletions
diff --git a/codemaker/test/cppumaker/makefile.mk b/codemaker/test/cppumaker/makefile.mk
index bab3dcbb3..1bc926dc0 100644
--- a/codemaker/test/cppumaker/makefile.mk
+++ b/codemaker/test/cppumaker/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -43,7 +43,7 @@ INCPRE += $(MISC)$/$(TARGET)$/inc
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_codemaker_cppumaker.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx b/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
index f22c1dcce..9cd3dc70d 100644
--- a/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
+++ b/codemaker/test/cppumaker/test_codemaker_cppumaker.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -369,7 +369,7 @@
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/Type.hxx"
#include "com/sun/star/uno/TypeClass.hpp"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
@@ -453,13 +453,13 @@ void Test::testBigStruct() {
#endif
sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
#endif
-
+
com::sun::star::uno::Type t(
cppu::UnoType< test::codemaker::cppumaker::BigStruct >::get());
typelib_TypeDescription * td = NULL;
t.getDescription(&td);
typelib_typedescription_complete(&td);
- fprintf(stdout, "#### 1\n");
+ fprintf(stdout, "#### 1\n");
CPPUNIT_ASSERT(td != NULL);
CPPUNIT_ASSERT_EQUAL(typelib_TypeClass_STRUCT, td->eTypeClass);
typelib_StructTypeDescription * std =
diff --git a/cppu/qa/makefile.mk b/cppu/qa/makefile.mk
index 4051dd6d8..8b720c832 100644
--- a/cppu/qa/makefile.mk
+++ b/cppu/qa/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -43,28 +43,28 @@ INCPRE += $(MISC)$/$(TARGET)$/inc
SHL1TARGET = $(TARGET)_any
SHL1OBJS = $(SLO)$/test_any.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
SHL2TARGET = $(TARGET)_unotype
SHL2OBJS = $(SLO)$/test_unotype.obj
-SHL2STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL2STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
SHL2VERSIONMAP = version.map
SHL2IMPLIB = i$(SHL2TARGET)
DEF2NAME = $(SHL2TARGET)
SHL3TARGET = $(TARGET)_reference
SHL3OBJS = $(SLO)$/test_reference.obj
-SHL3STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL3STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
SHL3VERSIONMAP = version.map
SHL3IMPLIB = i$(SHL3TARGET)
DEF3NAME = $(SHL3TARGET)
SHL4TARGET = $(TARGET)_recursion
SHL4OBJS = $(SLO)$/test_recursion.obj
-SHL4STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL4STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
SHL4VERSIONMAP = version.map
SHL4IMPLIB = i$(SHL4TARGET)
DEF4NAME = $(SHL4TARGET)
@@ -92,7 +92,7 @@ $(MISC)$/$(TARGET)$/types.urd: types.idl
$(IDLC) -O$(MISC)$/$(TARGET) -I$(SOLARIDLDIR) -cid -we $<
test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) $(SHL4TARGETN)
- testshl2 $(SHL1TARGETN)
- testshl2 $(SHL2TARGETN)
- testshl2 $(SHL3TARGETN)
- testshl2 $(SHL4TARGETN) \ No newline at end of file
+ $(TESTSHL2) $(SHL1TARGETN)
+ $(TESTSHL2) $(SHL2TARGETN)
+ $(TESTSHL2) $(SHL3TARGETN)
+ $(TESTSHL2) $(SHL4TARGETN)
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 8171cf09f..785af529e 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -58,7 +58,7 @@
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/uno/Type.hxx"
#include "com/sun/star/uno/XInterface.hpp"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/diagnose.h"
#include "osl/interlck.h"
#include "rtl/string.h"
diff --git a/cppu/qa/test_recursion.cxx b/cppu/qa/test_recursion.cxx
index 6ae70c44d..608537766 100644
--- a/cppu/qa/test_recursion.cxx
+++ b/cppu/qa/test_recursion.cxx
@@ -31,7 +31,7 @@
#include "precompiled_cppu.hxx"
#include "sal/config.h"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "sal/types.h"
#include "Rec.hpp"
diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx
index 34e3e8666..8bb793c65 100644
--- a/cppu/qa/test_reference.cxx
+++ b/cppu/qa/test_reference.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,7 +35,7 @@
#include "Interface1.hpp"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx
index 1d5d11b7b..ad457d516 100644
--- a/cppu/qa/test_unotype.cxx
+++ b/cppu/qa/test_unotype.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -47,7 +47,7 @@
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XInterface.hpp"
#include "cppu/unotype.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index 89c008195..cfcfebf24 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,7 +28,7 @@
*
************************************************************************/
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "com/sun/star/lang/XEventListener.hpp"
#include "cppuhelper/interfacecontainer.hxx"
@@ -43,7 +43,7 @@ using namespace com::sun::star::lang;
struct equalStr
{
- bool operator()(
+ bool operator()(
const char * const &rA,
const char * const &rB) const
{ return !strcmp(rA, rB); }
@@ -119,7 +119,7 @@ namespace cppu_ifcontainer
delete pContainer;
}
-
+
void testEnumerate()
{
int i;
@@ -205,7 +205,7 @@ namespace cppu_ifcontainer
// remove the 1st half of the rest
for (i = 0; i < nTests / 2; i++)
pContainer->removeInterface(pTypes[i], xRefs[i*2]);
-
+
// check it is half there
for (i = 0; i < nTests / 2; i++)
{
@@ -222,7 +222,7 @@ namespace cppu_ifcontainer
void testOMultiTypeInterfaceContainerHelper()
{
- uno::Type pTypes[nTests] =
+ uno::Type pTypes[nTests] =
{
::cppu::UnoType< bool >::get(),
::cppu::UnoType< float >::get(),
@@ -241,7 +241,7 @@ namespace cppu_ifcontainer
void testOMultiTypeInterfaceContainerHelperInt32()
{
- sal_Int32 pTypes[nTests] =
+ sal_Int32 pTypes[nTests] =
{
0,
-1,
@@ -262,13 +262,13 @@ namespace cppu_ifcontainer
typedef ::cppu::OMultiTypeInterfaceContainerHelperVar<
const char *,hashStr,equalStr> StrContainer;
- const char *pTypes[nTests] =
+ const char *pTypes[nTests] =
{
"this_is", "such", "fun", "writing", "unit", "tests", "when", "it", "works", "anyway"
};
doContainerTest< StrContainer, const char *> (pTypes);
}
-
+
// Automatic registration code
CPPUNIT_TEST_SUITE(IfTest);
CPPUNIT_TEST(testCreateDispose);
diff --git a/cppuhelper/qa/ifcontainer/makefile.mk b/cppuhelper/qa/ifcontainer/makefile.mk
index dd6c13fea..624bc797a 100644
--- a/cppuhelper/qa/ifcontainer/makefile.mk
+++ b/cppuhelper/qa/ifcontainer/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ ENABLE_EXCEPTIONS=TRUE
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/cppu_ifcontainer.obj
SHL1TARGET= cppu_ifcontainer
@@ -49,6 +49,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(SALLIB) \
$(CPPULIB) \
+ $(TESTSHL2LIB)\
$(CPPUNITLIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/cppuhelper/qa/propertysetmixin/makefile.mk b/cppuhelper/qa/propertysetmixin/makefile.mk
index b081274d8..2ad56c05f 100644
--- a/cppuhelper/qa/propertysetmixin/makefile.mk
+++ b/cppuhelper/qa/propertysetmixin/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -54,7 +54,7 @@ INCPRE += -I$(MISC)$/$(TARGET)$/inc
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_propertysetmixin.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx
index 15213132c..ecb7220d1 100644
--- a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx
+++ b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -64,7 +64,7 @@
#include "com/sun/star/uno/XComponentContext.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/servicefactory.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/mutex.hxx"
#include "osl/thread.h"
#include "rtl/ref.hxx"
diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx
index 5d39de84f..f80388d5d 100644
--- a/cppuhelper/qa/unourl/cppu_unourl.cxx
+++ b/cppuhelper/qa/unourl/cppu_unourl.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,7 +28,7 @@
*
************************************************************************/
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "cppuhelper/unourl.hxx"
#include "rtl/malformeduriexception.hxx"
@@ -144,7 +144,7 @@ namespace cppu_unourl
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly",
aDescriptor.equalsAscii(
aTests[i].pDescriptor));
}
@@ -191,11 +191,11 @@ namespace cppu_unourl
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to parse URI correctly",
aName.equalsAscii(aTests[i].pName));
}
- }
-
+ }
+
void testDescriptorKey(void)
{
struct Test
@@ -237,7 +237,7 @@ namespace cppu_unourl
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to detect parameter correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to detect parameter correctly",
bPresent == aTests[i].bPresent);
}
}
@@ -306,7 +306,7 @@ namespace cppu_unourl
catch (rtl::MalformedUriException &)
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly",
aValue.equalsAscii(aTests[i].pValue));
}
}
@@ -386,7 +386,7 @@ namespace cppu_unourl
catch (rtl::MalformedUriException &)
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to get param correctly",
aConnection.equalsAscii(
aTests[i].pConnection));
}
@@ -420,12 +420,12 @@ namespace cppu_unourl
catch (rtl::MalformedUriException &)
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly",
aProtocol.equalsAscii(
aTests[i].pProtocol));
}
}
-
+
void testUrlObjectName()
{
struct Test
@@ -456,7 +456,7 @@ namespace cppu_unourl
catch (rtl::MalformedUriException &)
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly",
+ CPPUNIT_ASSERT_MESSAGE("Failed to get protocol correctly",
aObjectName.equalsAscii(
aTests[i].pObjectName));
}
diff --git a/cppuhelper/qa/unourl/makefile.mk b/cppuhelper/qa/unourl/makefile.mk
index a611b135c..a999532c5 100644
--- a/cppuhelper/qa/unourl/makefile.mk
+++ b/cppuhelper/qa/unourl/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ ENABLE_EXCEPTIONS=TRUE
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/cppu_unourl.obj
SHL1TARGET= cppu_unourl
@@ -49,6 +49,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(SALLIB) \
$(CPPULIB) \
+ $(TESTSHL2LIB)\
$(CPPUNITLIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/cppuhelper/qa/weak/makefile.mk b/cppuhelper/qa/weak/makefile.mk
index 95f1697ef..bb0072b4d 100644
--- a/cppuhelper/qa/weak/makefile.mk
+++ b/cppuhelper/qa/weak/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_weak.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
@@ -53,4 +53,4 @@ SLOFILES = $(SHL1OBJS)
ALLTAR: test
test .PHONY: $(SHL1TARGETN)
- testshl2 $(SHL1TARGETN)
+ $(TESTSHL2) $(SHL1TARGETN)
diff --git a/cppuhelper/qa/weak/test_weak.cxx b/cppuhelper/qa/weak/test_weak.cxx
index 3b0210823..0cf128d51 100644
--- a/cppuhelper/qa/weak/test_weak.cxx
+++ b/cppuhelper/qa/weak/test_weak.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@
#include "com/sun/star/uno/XWeak.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/weak.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ref.hxx"
#include "sal/types.h"
diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx
index 0f17f3d1c..f1105298d 100644
--- a/sal/qa/ByteSequence/ByteSequence.cxx
+++ b/sal/qa/ByteSequence/ByteSequence.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,7 +36,7 @@
#include <rtl/byteseq.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
using namespace rtl;
@@ -50,7 +50,7 @@ namespace rtl_ByteSequence
class ctor : public CppUnit::TestFixture
{
public:
-
+
void ctor_001()
{
::rtl::ByteSequence aByteSeq1;
@@ -58,11 +58,11 @@ class ctor : public CppUnit::TestFixture
CPPUNIT_ASSERT_MESSAGE
(
"Creates an empty sequence",
- aByteSeq1.getLength() == 0 &&
+ aByteSeq1.getLength() == 0 &&
aByteSeq1 == aByteSeq2
);
}
-
+
void ctor_002()
{
::rtl::ByteSequence aByteSeq;
@@ -70,11 +70,11 @@ class ctor : public CppUnit::TestFixture
CPPUNIT_ASSERT_MESSAGE
(
"Creates a copy of given sequence",
- aByteSeq == aByteSeqtmp
+ aByteSeq == aByteSeqtmp
);
-
+
}
-
+
void ctor_003()
{
::rtl::ByteSequence aByteSeq( &kTestByteSeq1 );
@@ -85,7 +85,7 @@ class ctor : public CppUnit::TestFixture
nNewLen == kTestSeqLen1
);
}
-
+
void ctor_003_1()
{
::rtl::ByteSequence aByteSeq( &kTestByteSeq2 );
@@ -93,7 +93,7 @@ class ctor : public CppUnit::TestFixture
CPPUNIT_ASSERT_MESSAGE
(
"Copy constructor Creates a copy from the C-Handle: reference count > 1 ",
- nNewLen == kTestSeqLen2
+ nNewLen == kTestSeqLen2
);
}
@@ -108,10 +108,10 @@ class ctor : public CppUnit::TestFixture
"Creates a copy of given data bytes",
aByteSeq[1] == pElements[1] &&
len == nNewLen
-
+
);
}
-
+
void ctor_005()
{
sal_Int32 len = 50;
@@ -127,7 +127,7 @@ class ctor : public CppUnit::TestFixture
(
"Creates sequence of given length and initializes all bytes to 0",
nNewLen == len && res
-
+
);
}
@@ -151,10 +151,10 @@ class ctor : public CppUnit::TestFixture
CPPUNIT_ASSERT_MESSAGE
(
"Creates a sequence from a C-Handle without acquiring the handle, thus taking over ownership",
- nNewLen == kTestSeqLen3
+ nNewLen == kTestSeqLen3
);
}
-
+
CPPUNIT_TEST_SUITE(ctor);
CPPUNIT_TEST(ctor_001);
CPPUNIT_TEST(ctor_002);
@@ -190,10 +190,10 @@ public:
aByteSeq2 = aByteSeq1;
sal_Int32 nNewLen = aByteSeq2.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Assignment operator: assign longer sequence to another",
- aByteSeq1 == aByteSeq2 &&
- nNewLen == len
+ aByteSeq1 == aByteSeq2 &&
+ nNewLen == len
);
}
@@ -206,13 +206,13 @@ public:
aByteSeq2 = aByteSeq1;
sal_Int32 nNewLen = aByteSeq2.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Assignment operator: assign shorter sequence to another",
- aByteSeq1 == aByteSeq2 &&
+ aByteSeq1 == aByteSeq2 &&
nNewLen == len
);
}
-
+
void assign_003()
{
sal_Int32 len = kTestByteCount1 - 1 ;
@@ -222,10 +222,10 @@ public:
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
+ aByteSeq1 == aByteSeq2 &&
+ nNewLen == kTestByteCount1
);
}
@@ -238,10 +238,10 @@ public:
aByteSeq2 = aByteSeq1;
sal_Int32 nNewLen = aByteSeq2.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Assignment operator: assign empty sequence to another not empty sequence",
- aByteSeq1 == aByteSeq2 &&
- nNewLen == 0
+ aByteSeq1 == aByteSeq2 &&
+ nNewLen == 0
);
}
@@ -275,7 +275,7 @@ public:
::rtl::ByteSequence aByteSeq2( pElements, len);
sal_Bool res = aByteSeq1 == aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Equality operator: compare two sequences 1",
!res
);
@@ -289,7 +289,7 @@ public:
::rtl::ByteSequence aByteSeq2( pElements, len);
sal_Bool res = aByteSeq1 == aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Equality operator: compare two sequences 2",
res
);
@@ -304,7 +304,7 @@ public:
::rtl::ByteSequence aByteSeq2( pElements, len);
sal_Bool res = aByteSeq1 == aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Equality operator: compare two sequences 2",
!res
);
@@ -338,7 +338,7 @@ public:
::rtl::ByteSequence aByteSeq2( pElements, len);
sal_Bool res = aByteSeq1 != aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Equality operator: compare two sequences 1",
res
);
@@ -352,7 +352,7 @@ public:
::rtl::ByteSequence aByteSeq2( pElements, len);
sal_Bool res = aByteSeq1 != aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Equality operator: compare two sequences 2",
!res
);
@@ -391,7 +391,7 @@ public:
res = sal_False;
}
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Gets the pointer to byte array: one element sequence",
res == sal_True
);
@@ -409,7 +409,7 @@ public:
res = sal_False;
}
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Gets the pointer to byte array: more elements sequence",
res == sal_True
);
@@ -442,9 +442,9 @@ public:
aByteSeq.realloc( nSize );
sal_Int32 nNewLen = aByteSeq.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Reallocates sequence to new length: empty sequence",
- nNewLen == nSize
+ nNewLen == nSize
);
}
@@ -456,12 +456,12 @@ public:
aByteSeq.realloc( nSize );
sal_Int32 nNewLen = aByteSeq.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Reallocates sequence: reference count > 1 && nSize < nElements",
- nNewLen == nSize
+ nNewLen == nSize
);
}
-
+
void realloc_003()
{
//reference count > 1
@@ -478,9 +478,9 @@ public:
res = sal_False;
}
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Reallocates sequence: reference count > 1 && nSize > nElements",
- nNewLen == nSize
+ nNewLen == nSize
&& res == sal_True
);
}
@@ -494,12 +494,12 @@ public:
aByteSeq.realloc( nSize );
sal_Int32 nNewLen = aByteSeq.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Reallocates sequence: nSize < nElements",
- nNewLen == nSize
+ nNewLen == nSize
);
}
-
+
void realloc_005()
{
sal_Int8 * pElements = kTestByte6;
@@ -509,12 +509,12 @@ public:
aByteSeq.realloc( nSize );
sal_Int32 nNewLen = aByteSeq.getLength();
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Reallocates sequence: nSize > nElements",
- nNewLen == nSize
+ nNewLen == nSize
);
}
-
+
CPPUNIT_TEST_SUITE(realloc);
CPPUNIT_TEST(realloc_001);
CPPUNIT_TEST(realloc_002);
@@ -546,10 +546,10 @@ public:
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;
@@ -557,7 +557,7 @@ public:
res = sal_False;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Obtains a reference to byte indexed at given position: empty sequence",
res == sal_True
);
diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/qa/ByteSequence/makefile.mk
index a2ecbd5cc..0f1b88ac6 100644
--- a/sal/qa/ByteSequence/makefile.mk
+++ b/sal/qa/ByteSequence/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,17 +47,10 @@ CXXFLAGS+= $(LFS_CFLAGS)
#----------------------------------- OStringBuffer -----------------------------------
SHL1OBJS= \
- $(SLO)$/ByteSequence.obj
+ $(SLO)$/ByteSequence.obj
SHL1TARGET= rtl_ByteSequence
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -70,9 +63,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS= \
$(SLO)$/rtl_old_testbyteseq.obj
SHL2TARGET= rtl_old_testbyteseq
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
diff --git a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx
index ef11f315a..2cea6fa3a 100644
--- a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx
+++ b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@
using namespace ::rtl;
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
namespace rtl_testbyteseq
@@ -50,7 +50,7 @@ namespace rtl_testbyteseq
// -----------------------------------------------------------------------------
-class oldbyteseq : public CppUnit::TestFixture
+class oldbyteseq : public CppUnit::TestFixture
{
public:
void test_bytesequence_001();
@@ -70,17 +70,17 @@ void oldbyteseq::test_bytesequence_001()
{
ByteSequence seq;
OSL_ENSURE( ! seq.getLength() , "" );
-
+
ByteSequence seq2( a , 5 );
-
+
OSL_ENSURE( !( seq == seq2) , "" );
-
+
seq = seq2;
OSL_ENSURE( seq == seq2 , "" );
-
+
seq[0] = 2;
OSL_ENSURE( !(seq == seq2) , "" );
-
+
seq = ByteSequence( a , 5 );
OSL_ENSURE( seq == seq2 , "" );
@@ -114,16 +114,16 @@ void oldbyteseq::test_bytesequence_001()
rtl_byte_sequence_construct( &pSeq , 5 );
OSL_ENSURE( ! rtl_byte_sequence_equals( pSeq , pSeq2 ) , "" );
-
-
+
+
rtl_byte_sequence_release( pSeq2 );
rtl_byte_sequence_release( pSeq );
}
-
-
+
+
printf( "test bytesequence OK\n" );
-
+
}
} // namespace osl_test_file
diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk
index be0f891cf..d20c011a5 100644
--- a/sal/qa/OStringBuffer/makefile.mk
+++ b/sal/qa/OStringBuffer/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -56,16 +56,7 @@ SHL1OBJS= \
$(SLO)$/rtl_String_Utils.obj
SHL1TARGET= rtl_OStringBuffer
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
-
-# .IF "$(GUI)" == "WNT"
-# SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-# .ENDIF
-# .IF "$(GUI)" == "UNX"
-# SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index fa7790477..4c8c242c4 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +38,7 @@
#include <rtl/strbuf.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
using namespace rtl;
@@ -62,7 +62,7 @@ namespace rtl_OStringBuffer
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctor_001()
{
::rtl::OStringBuffer aStrBuf;
@@ -75,14 +75,14 @@ namespace rtl_OStringBuffer
*pStr == '\0' && 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());
-
+
sal_Int32 nLenStrBuftmp = aStrBuftmp.getLength();
rtl::OString sStr(aStrBuftmp.getStr());
@@ -92,28 +92,28 @@ namespace rtl_OStringBuffer
(
"New OStringBuffer from another OStringBuffer",
aStrBuf.getLength() == nLenStrBuftmp &&
- aStrBuf.getCapacity() == aStrBuftmp.getCapacity() &&
+ aStrBuf.getCapacity() == aStrBuftmp.getCapacity() &&
res
);
-
+
}
-
+
void ctor_003()
{
::rtl::OStringBuffer aStrBuf1(kTestStr2Len);
-#ifdef WITH_CORE
+#ifdef WITH_CORE
::rtl::OStringBuffer aStrBuf2(kSInt32Max); //will core dump
// LLA: will core, due to the fact, that ksint32max is too big, the max length can't
// use, because there are some internal bytes, which we can't calculate.
#else
- ::rtl::OStringBuffer aStrBuf2(0);
-#endif
+ ::rtl::OStringBuffer aStrBuf2(0);
+#endif
const sal_Char* pStr1 = aStrBuf1.getStr();
const sal_Char* pStr2 = aStrBuf2.getStr();
-#ifdef WITH_CORE
+#ifdef WITH_CORE
CPPUNIT_ASSERT_MESSAGE
(
"New OStringBuffer containing no characters and contain assigned capacity",
@@ -121,7 +121,7 @@ namespace rtl_OStringBuffer
! *(aStrBuf1.getStr()) && aStrBuf1.getCapacity() == kTestStr2Len &&
aStrBuf2.getLength() == 0 &&
! *(aStrBuf2.getStr()) && aStrBuf2.getCapacity() == kSInt32Max
-
+
);
#else
CPPUNIT_ASSERT_MESSAGE
@@ -142,7 +142,7 @@ namespace rtl_OStringBuffer
{
// LLA: StringBuffer with created negativ size are the same as empty StringBuffers
::rtl::OStringBuffer aStrBuf3(kNonSInt32Max);
-
+
const sal_Char* pStr = aStrBuf3.getStr();
CPPUNIT_ASSERT_MESSAGE
@@ -159,14 +159,14 @@ namespace rtl_OStringBuffer
::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
-
+ aStrBuf.getCapacity() == leg+16
+
);
}
@@ -175,7 +175,7 @@ namespace rtl_OStringBuffer
b1.makeStringAndClear();
rtl::OStringBuffer b2(b1);
}
-
+
CPPUNIT_TEST_SUITE(ctors);
CPPUNIT_TEST(ctor_001);
CPPUNIT_TEST(ctor_002);
@@ -187,13 +187,13 @@ namespace rtl_OStringBuffer
};
-
+
// -----------------------------------------------------------------------------
class makeStringAndClear : public CppUnit::TestFixture
{
OString* arrOUS[6];
-
+
public:
void setUp()
{
@@ -203,12 +203,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5];
}
@@ -218,14 +218,14 @@ namespace rtl_OStringBuffer
::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()
@@ -346,13 +346,13 @@ namespace rtl_OStringBuffer
CPPUNIT_TEST(makeStringAndClear_008);
CPPUNIT_TEST_SUITE_END();
};
-
+
// -----------------------------------------------------------------------------
class getLength : public CppUnit::TestFixture
{
OString* arrOUS[6];
-
+
public:
void setUp()
{
@@ -362,12 +362,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5];
}
@@ -375,13 +375,13 @@ namespace rtl_OStringBuffer
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
sal_Int32 expVal = kTestStr1Len;
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of ascii string",
aStrBuf.getLength() == expVal
);
-
+
}
void getLength_002()
@@ -390,7 +390,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 1;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of ascci string of size 1",
aStrBuf.getLength() == expVal
);
@@ -402,7 +402,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of empty string",
aStrBuf.getLength() == expVal
);
@@ -414,7 +414,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of empty string (empty ascii string arg)",
aStrBuf.getLength() == expVal
);
@@ -426,7 +426,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of empty string (string arg = '\\0')",
aStrBuf.getLength() == expVal
);
@@ -438,7 +438,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = kTestStr2Len;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length(>16) of ascii string",
aStrBuf.getLength() == expVal
);
@@ -450,7 +450,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of empty string (default constructor)",
aStrBuf.getLength()== expVal
);
@@ -462,7 +462,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"length of empty string (with capacity)",
aStrBuf.getLength()== expVal
);
@@ -485,7 +485,7 @@ namespace rtl_OStringBuffer
class getCapacity : public CppUnit::TestFixture
{
OString* arrOUS[6];
-
+
public:
void setUp()
{
@@ -495,12 +495,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5];
}
@@ -508,13 +508,13 @@ namespace rtl_OStringBuffer
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
sal_Int32 expVal = kTestStr1Len+16;
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of ascii string",
aStrBuf.getCapacity()== expVal
);
-
+
}
void getCapacity_002()
@@ -523,7 +523,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 1+16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of ascci string of size 1",
aStrBuf.getCapacity() == expVal
);
@@ -535,7 +535,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0+16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string",
aStrBuf.getCapacity() == expVal
);
@@ -547,7 +547,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0+16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (empty ascii string arg)",
aStrBuf.getCapacity()== expVal
);
@@ -559,7 +559,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0+16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (string arg = '\\0')",
aStrBuf.getCapacity() == expVal
);
@@ -571,7 +571,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = kTestStr2Len+16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity(>16) of ascii string",
aStrBuf.getCapacity() == expVal
);
@@ -583,7 +583,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (default constructor)",
aStrBuf.getCapacity() == expVal
);
@@ -595,7 +595,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = kSInt32Max;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity 2147483647)(code will core dump)",
aStrBuf.getCapacity() == expVal
);
@@ -607,7 +607,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = kNonSInt32Max;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity -2147483648)",
aStrBuf.getCapacity() == expVal
);
@@ -619,7 +619,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 16;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity 16)",
aStrBuf.getCapacity() == expVal
);
@@ -631,7 +631,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 6;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity 6)",
aStrBuf.getCapacity() == expVal
);
@@ -643,7 +643,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 0;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity 0)",
aStrBuf.getCapacity() == expVal
);
@@ -655,7 +655,7 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = -2;
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"capacity of empty string (with capacity -2)",
aStrBuf.getCapacity() == expVal
);
@@ -688,15 +688,15 @@ namespace rtl_OStringBuffer
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()
@@ -704,15 +704,15 @@ namespace rtl_OStringBuffer
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()
@@ -720,31 +720,31 @@ namespace rtl_OStringBuffer
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
+ void ensureCapacity_004() //the testcase is based on comments
{
sal_Int32 expVal = 20;
::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()
@@ -752,15 +752,15 @@ namespace rtl_OStringBuffer
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()
@@ -768,15 +768,15 @@ namespace rtl_OStringBuffer
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()
@@ -784,15 +784,15 @@ namespace rtl_OStringBuffer
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()
@@ -800,31 +800,31 @@ namespace rtl_OStringBuffer
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
+ void ensureCapacity_009() //the testcase is based on comments
{
sal_Int32 expVal = 10;
::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()
@@ -832,15 +832,15 @@ namespace rtl_OStringBuffer
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
@@ -848,15 +848,15 @@ namespace rtl_OStringBuffer
sal_Int32 expVal = 2; // capacity is x = (str->length + 1) * 2; minimum < x ? x : minimum
::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()
@@ -864,31 +864,31 @@ namespace rtl_OStringBuffer
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
+#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
@@ -896,15 +896,15 @@ namespace rtl_OStringBuffer
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
@@ -912,15 +912,15 @@ namespace rtl_OStringBuffer
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
@@ -928,15 +928,15 @@ namespace rtl_OStringBuffer
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
@@ -944,15 +944,15 @@ namespace rtl_OStringBuffer
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()
@@ -960,15 +960,15 @@ namespace rtl_OStringBuffer
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
@@ -976,15 +976,15 @@ namespace rtl_OStringBuffer
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()
@@ -992,15 +992,15 @@ namespace rtl_OStringBuffer
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()
@@ -1008,15 +1008,15 @@ namespace rtl_OStringBuffer
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()
@@ -1024,15 +1024,15 @@ namespace rtl_OStringBuffer
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 );
@@ -1070,7 +1070,7 @@ namespace rtl_OStringBuffer
class setLength : public CppUnit::TestFixture
{
OString* arrOUS[6];
-
+
public:
void setUp()
{
@@ -1080,12 +1080,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5];
}
@@ -1098,15 +1098,15 @@ namespace rtl_OStringBuffer
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()
@@ -1118,15 +1118,15 @@ namespace rtl_OStringBuffer
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()
@@ -1138,15 +1138,15 @@ namespace rtl_OStringBuffer
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()
@@ -1158,15 +1158,15 @@ namespace rtl_OStringBuffer
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()
@@ -1178,15 +1178,15 @@ namespace rtl_OStringBuffer
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()
@@ -1198,15 +1198,15 @@ namespace rtl_OStringBuffer
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()
@@ -1218,15 +1218,15 @@ namespace rtl_OStringBuffer
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()
@@ -1238,15 +1238,15 @@ namespace rtl_OStringBuffer
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()
@@ -1258,15 +1258,15 @@ namespace rtl_OStringBuffer
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()
@@ -1278,15 +1278,15 @@ namespace rtl_OStringBuffer
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()
@@ -1298,15 +1298,15 @@ namespace rtl_OStringBuffer
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()
@@ -1318,15 +1318,15 @@ namespace rtl_OStringBuffer
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()
@@ -1338,15 +1338,15 @@ namespace rtl_OStringBuffer
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()
@@ -1358,15 +1358,15 @@ namespace rtl_OStringBuffer
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()
@@ -1378,15 +1378,15 @@ namespace rtl_OStringBuffer
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()
@@ -1398,15 +1398,15 @@ namespace rtl_OStringBuffer
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()
@@ -1418,15 +1418,15 @@ namespace rtl_OStringBuffer
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()
@@ -1438,15 +1438,15 @@ namespace rtl_OStringBuffer
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()
@@ -1458,15 +1458,15 @@ namespace rtl_OStringBuffer
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()
@@ -1478,15 +1478,15 @@ namespace rtl_OStringBuffer
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()
@@ -1498,15 +1498,15 @@ namespace rtl_OStringBuffer
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()
@@ -1518,15 +1518,15 @@ namespace rtl_OStringBuffer
sal_Int32 input = 0;
aStrBuf.setLength( input );
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"newLength equal to 0",
aStrBuf.getStr() == expVal2 &&
aStrBuf.getLength() == expVal1 &&
aStrBuf.getCapacity() == expVal3
);
-
+
}
@@ -1562,7 +1562,7 @@ namespace rtl_OStringBuffer
class charAt : public CppUnit::TestFixture
{
OString* arrOUS[4];
-
+
public:
void setUp()
{
@@ -1570,12 +1570,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3];
}
@@ -1584,13 +1584,13 @@ namespace rtl_OStringBuffer
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()
@@ -1598,13 +1598,13 @@ namespace rtl_OStringBuffer
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()
@@ -1612,13 +1612,13 @@ namespace rtl_OStringBuffer
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()
@@ -1626,13 +1626,13 @@ namespace rtl_OStringBuffer
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()
@@ -1640,13 +1640,13 @@ namespace rtl_OStringBuffer
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()
@@ -1654,37 +1654,37 @@ namespace rtl_OStringBuffer
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()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"invalid character of OStringBuffer()",
sal_True
);
-
+
}
void charAt_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"invalid character of OStringBuffer()",
sal_True
);
-
+
}
CPPUNIT_TEST_SUITE( charAt );
@@ -1700,7 +1700,7 @@ namespace rtl_OStringBuffer
};
// -----------------------------------------------------------------------------
-
+
class csuc : public CppUnit::TestFixture
{
void csuc_001()
@@ -1708,18 +1708,18 @@ namespace rtl_OStringBuffer
const sal_Char* expVal = kTestStr1;
::rtl::OStringBuffer aStrBuf( kTestStr1 );
sal_Int32 cmpLen = kTestStr1Len;
-
+
// LLA: wrong access! const sal_Char* pstr = *&aStrBuf;
const sal_Char* pstr = aStrBuf.getStr();
int nEqual = strncmp(pstr, expVal, cmpLen);
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"test normal string",
/* cmpstr( pstr, expVal, cmpLen ) */
nEqual == 0
);
-
+
}
void csuc_002()
@@ -1729,14 +1729,14 @@ namespace rtl_OStringBuffer
// LLA: wrong access! const sal_Char* pstr = *&aStrBuf;
const sal_Char* pstr = aStrBuf.getStr();
sal_Int32 nLen = strlen(pstr);
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"test empty string",
// cmpstr( pstr, &expVal, cmpLen )
nLen == 0
);
-
+
}
@@ -1759,13 +1759,13 @@ namespace rtl_OStringBuffer
const sal_Char* pstr = aStrBuf.getStr();
int nEqual = strncmp(pstr, expVal, cmpLen);
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"test normal string",
nEqual == 0
);
-
+
}
void getStr_002()
@@ -1779,12 +1779,12 @@ namespace rtl_OStringBuffer
sal_Int32 nLen = strlen(pstr);
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"test empty string",
pstr != 0 &&
nLen == 0
);
-
+
}
@@ -1799,7 +1799,7 @@ namespace rtl_OStringBuffer
class setCharAt : public CppUnit::TestFixture
{
OString* arrOUS[4];
-
+
public:
void setUp()
{
@@ -1807,12 +1807,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3];
}
@@ -1822,13 +1822,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
void setCharAt_002()
@@ -1837,13 +1837,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
void setCharAt_003()
@@ -1852,13 +1852,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
@@ -1868,13 +1868,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
@@ -1884,13 +1884,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
void setCharAt_006()
@@ -1899,13 +1899,13 @@ namespace rtl_OStringBuffer
::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
+ (aStrBuf.setCharAt(input1, input2)).getStr() == expVal
);
-
+
}
#ifdef WITH_CORE
void setCharAt_007()
@@ -1914,15 +1914,15 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
sal_Int32 input1 = 0;
sal_Char input2 = (sal_Char)5;
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"invalid character of OStringBuffer()",
- sal_True
+ sal_True
);
-
+
delete expVal;
-
+
}
void setCharAt_008()
@@ -1931,15 +1931,15 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
sal_Int32 input1 = -2;
sal_Char input2 = (sal_Char)5;
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"invalid character of OStringBuffer()",
- sal_True
+ sal_True
);
-
+
delete expVal;
-
+
}
void setCharAt_009()
@@ -1948,17 +1948,17 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
sal_Int32 input1 = 3;
sal_Char input2 = (sal_Char)5;
-
+
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"invalid character of OStringBuffer()",
- sal_True
+ sal_True
);
-
+
delete expVal;
-
+
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( setCharAt );
CPPUNIT_TEST( setCharAt_001 );
CPPUNIT_TEST( setCharAt_002 );
@@ -1979,7 +1979,7 @@ namespace rtl_OStringBuffer
class append_001 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -1988,12 +1988,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -2004,15 +2004,15 @@ namespace rtl_OStringBuffer
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 );
@@ -2020,14 +2020,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_003()
@@ -2037,14 +2037,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_004()
@@ -2054,14 +2054,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_005()
@@ -2071,14 +2071,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_006()
@@ -2088,14 +2088,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_007()
@@ -2105,14 +2105,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_008()
@@ -2122,14 +2122,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_009()
@@ -2139,14 +2139,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_010()
@@ -2156,14 +2156,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_011()
@@ -2173,14 +2173,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_012()
@@ -2190,14 +2190,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_013()
@@ -2207,14 +2207,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_014()
@@ -2224,14 +2224,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_015()
@@ -2241,14 +2241,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_016()
@@ -2258,14 +2258,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_017()
@@ -2275,14 +2275,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_018()
@@ -2292,14 +2292,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_019()
@@ -2309,14 +2309,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_001_020()
@@ -2326,14 +2326,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
#ifdef WITH_CORE
@@ -2344,14 +2344,14 @@ namespace rtl_OStringBuffer
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()
+ aStrBuf.getStr()== expVal &&
+ aStrBuf.getLength() == expVal.getLength()
);
-
+
}
#endif
@@ -2387,7 +2387,7 @@ namespace rtl_OStringBuffer
class append_002 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -2396,12 +2396,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -2412,13 +2412,13 @@ namespace rtl_OStringBuffer
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()
@@ -2428,13 +2428,13 @@ namespace rtl_OStringBuffer
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()
@@ -2444,13 +2444,13 @@ namespace rtl_OStringBuffer
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()
@@ -2460,13 +2460,13 @@ namespace rtl_OStringBuffer
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()
@@ -2476,13 +2476,13 @@ namespace rtl_OStringBuffer
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()
@@ -2492,13 +2492,13 @@ namespace rtl_OStringBuffer
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()
@@ -2508,13 +2508,13 @@ namespace rtl_OStringBuffer
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()
@@ -2524,13 +2524,13 @@ namespace rtl_OStringBuffer
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()
@@ -2540,13 +2540,13 @@ namespace rtl_OStringBuffer
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()
@@ -2556,13 +2556,13 @@ namespace rtl_OStringBuffer
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()
@@ -2572,13 +2572,13 @@ namespace rtl_OStringBuffer
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()
@@ -2588,13 +2588,13 @@ namespace rtl_OStringBuffer
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()
@@ -2604,13 +2604,13 @@ namespace rtl_OStringBuffer
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()
@@ -2620,13 +2620,13 @@ namespace rtl_OStringBuffer
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()
@@ -2636,13 +2636,13 @@ namespace rtl_OStringBuffer
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()
@@ -2652,13 +2652,13 @@ namespace rtl_OStringBuffer
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()
@@ -2668,13 +2668,13 @@ namespace rtl_OStringBuffer
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()
@@ -2684,13 +2684,13 @@ namespace rtl_OStringBuffer
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()
@@ -2700,13 +2700,13 @@ namespace rtl_OStringBuffer
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()
@@ -2716,13 +2716,13 @@ namespace rtl_OStringBuffer
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
@@ -2733,13 +2733,13 @@ namespace rtl_OStringBuffer
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
@@ -2774,7 +2774,7 @@ namespace rtl_OStringBuffer
class append_003 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -2783,12 +2783,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -2800,13 +2800,13 @@ namespace rtl_OStringBuffer
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()
@@ -2817,13 +2817,13 @@ namespace rtl_OStringBuffer
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()
@@ -2834,13 +2834,13 @@ namespace rtl_OStringBuffer
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()
@@ -2851,13 +2851,13 @@ namespace rtl_OStringBuffer
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()
@@ -2867,15 +2867,15 @@ namespace rtl_OStringBuffer
// LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
// LLA: const sal_Char* input1 = kTestStr2;
// LLA: sal_Int32 input2 = -1;
- // LLA:
+ // LLA:
// LLA: aStrBuf.append( input1, input2 );
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE
- // LLA: (
+ // LLA: (
// LLA: "Appends the string(length less than 0) to the string buffer arrOUS[0]",
// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )
// LLA: );
-
+
}
void append_003_006()
@@ -2886,13 +2886,13 @@ namespace rtl_OStringBuffer
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()
@@ -2903,13 +2903,13 @@ namespace rtl_OStringBuffer
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()
@@ -2920,13 +2920,13 @@ namespace rtl_OStringBuffer
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()
@@ -2937,13 +2937,13 @@ namespace rtl_OStringBuffer
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()
@@ -2953,11 +2953,11 @@ namespace rtl_OStringBuffer
// LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
// LLA: const sal_Char* input1 = kTestStr2;
// LLA: sal_Int32 input2 = -1;
- // LLA:
+ // LLA:
// LLA: aStrBuf.append( input1, input2 );
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE
- // LLA: (
+ // LLA: (
// LLA: "Appends the string(length less than 0) to the string buffer arrOUS[1]",
// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )
// LLA: );
@@ -2971,13 +2971,13 @@ namespace rtl_OStringBuffer
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()
@@ -2988,13 +2988,13 @@ namespace rtl_OStringBuffer
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()
@@ -3005,13 +3005,13 @@ namespace rtl_OStringBuffer
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()
@@ -3022,13 +3022,13 @@ namespace rtl_OStringBuffer
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()
@@ -3038,15 +3038,15 @@ namespace rtl_OStringBuffer
// LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
// LLA: const sal_Char* input1 = kTestStr2;
// LLA: sal_Int32 input2 = -1;
- // LLA:
+ // LLA:
// LLA: aStrBuf.append( input1, input2 );
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE
- // LLA: (
+ // LLA: (
// LLA: "Appends the string(length less than 0) to the string buffer arrOUS[2]",
// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )
// LLA: );
-
+
}
void append_003_016()
@@ -3057,13 +3057,13 @@ namespace rtl_OStringBuffer
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()
@@ -3074,13 +3074,13 @@ namespace rtl_OStringBuffer
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()
@@ -3091,13 +3091,13 @@ namespace rtl_OStringBuffer
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()
@@ -3108,13 +3108,13 @@ namespace rtl_OStringBuffer
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()
@@ -3124,15 +3124,15 @@ namespace rtl_OStringBuffer
// LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
// LLA: const sal_Char* input1 = kTestStr2;
// LLA: sal_Int32 input2 = -1;
- // LLA:
+ // LLA:
// LLA: aStrBuf.append( input1, input2 );
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE
- // LLA: (
+ // LLA: (
// LLA: "Appends the string(length less than 0) to the string buffer arrOUS[3]",
// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )
// LLA: );
-
+
}
void append_003_021()
@@ -3143,13 +3143,13 @@ namespace rtl_OStringBuffer
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()
@@ -3160,13 +3160,13 @@ namespace rtl_OStringBuffer
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()
@@ -3177,13 +3177,13 @@ namespace rtl_OStringBuffer
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()
@@ -3194,13 +3194,13 @@ namespace rtl_OStringBuffer
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()
@@ -3210,15 +3210,15 @@ namespace rtl_OStringBuffer
// LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
// LLA: const sal_Char* input1 = kTestStr2;
// LLA: sal_Int32 input2 = -1;
- // LLA:
+ // LLA:
// LLA: aStrBuf.append( input1, input2 );
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE
- // LLA: (
+ // LLA: (
// LLA: "Appends the string(length less than 0) to the string buffer arrOUS[4]",
// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )
// LLA: );
-
+
}
#ifdef WITH_CORE
@@ -3230,13 +3230,13 @@ namespace rtl_OStringBuffer
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
@@ -3276,7 +3276,7 @@ namespace rtl_OStringBuffer
class append_004 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -3285,12 +3285,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -3301,13 +3301,13 @@ namespace rtl_OStringBuffer
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()
@@ -3317,13 +3317,13 @@ namespace rtl_OStringBuffer
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()
@@ -3333,13 +3333,13 @@ namespace rtl_OStringBuffer
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()
@@ -3349,13 +3349,13 @@ namespace rtl_OStringBuffer
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()
@@ -3365,13 +3365,13 @@ namespace rtl_OStringBuffer
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()
@@ -3381,13 +3381,13 @@ namespace rtl_OStringBuffer
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()
@@ -3397,13 +3397,13 @@ namespace rtl_OStringBuffer
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()
@@ -3413,13 +3413,13 @@ namespace rtl_OStringBuffer
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()
@@ -3429,13 +3429,13 @@ namespace rtl_OStringBuffer
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()
@@ -3445,13 +3445,13 @@ namespace rtl_OStringBuffer
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
@@ -3462,13 +3462,13 @@ namespace rtl_OStringBuffer
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()
@@ -3478,13 +3478,13 @@ namespace rtl_OStringBuffer
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
@@ -3511,7 +3511,7 @@ namespace rtl_OStringBuffer
class append_005 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -3520,12 +3520,12 @@ namespace rtl_OStringBuffer
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -3536,13 +3536,13 @@ namespace rtl_OStringBuffer
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()
@@ -3552,13 +3552,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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()
@@ -3568,13 +3568,13 @@ namespace rtl_OStringBuffer
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()
@@ -3584,13 +3584,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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()
@@ -3600,13 +3600,13 @@ namespace rtl_OStringBuffer
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()
@@ -3616,13 +3616,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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()
@@ -3632,13 +3632,13 @@ namespace rtl_OStringBuffer
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()
@@ -3648,13 +3648,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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()
@@ -3664,13 +3664,13 @@ namespace rtl_OStringBuffer
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()
@@ -3680,13 +3680,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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
@@ -3697,13 +3697,13 @@ namespace rtl_OStringBuffer
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()
@@ -3713,13 +3713,13 @@ namespace rtl_OStringBuffer
sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8);
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
@@ -3767,7 +3767,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
for (i = 0; i < n; i++)
{
-
+
OSL_ENSURE( i < 80, "ERROR: leave aUchar bound");
// AStringToUStringCopy(aUchar,resArray[i]);
@@ -3786,7 +3786,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
if ( inArray[i] < 0 )
{
aStr2 += aStr3;
-
+
}
// if(AStringToUStringCopy(aStr4,resArray[i]))
// {
@@ -3796,9 +3796,9 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
}
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]",
- aStr1.getStr()== aStr2 &&
+ aStr1.getStr()== aStr2 &&
aStr1.getLength() == aStr2.getLength()
);
}
@@ -3819,7 +3819,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_006_Int32 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -3828,12 +3828,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -3841,1904 +3841,1904 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ sal_Int32 input = 0;
sal_Int16 radix = 2;
-
+
expVal += OString( "0" );
aStrBuf.append( input, radix );
/*test_append_Int32((const char**)kBinaryNumsStr,
- kBinaryNumsCount, kRadixBinary,
+ kBinaryNumsCount, kRadixBinary,
0, aStrBuf );*/
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]",
- aStrBuf.getStr()== expVal &&
+ aStrBuf.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_051()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_052()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_053()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_054()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_055()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_056()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_057()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_058()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_059()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_060()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_061()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_062()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_063()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_064()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_065()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_066()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_067()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_068()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_069()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_070()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_071()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_072()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_073()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_074()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_075()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_076()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_077()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_078()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_079()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_080()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_081()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_082()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_083()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_084()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_085()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_086()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_087()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_088()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_089()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_090()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_091()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_092()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_093()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_094()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_095()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_096()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_097()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_098()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_099()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_100()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_006_Int32 );
@@ -5809,7 +5809,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_006_Int32_Bounderies : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -5818,12 +5818,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -5831,950 +5831,950 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = kSInt32Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_006_Int32_Bounderies );
@@ -6820,7 +6820,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_006_Int32_Negative : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -6829,12 +6829,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -6842,1975 +6842,1975 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_051()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_052()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_053()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_054()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_055()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_056()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_057()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_058()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_059()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_060()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_061()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_062()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_063()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_064()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_065()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_066()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_067()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_068()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_069()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_070()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_071()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_072()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_073()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_074()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_075()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_076()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_077()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_078()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_079()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_080()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_081()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_082()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_083()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_084()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_085()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_086()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_087()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_088()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_089()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_090()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_091()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_092()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_093()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_094()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_095()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_096()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_097()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_098()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_099()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_100()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int32 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_006_Int32_Negative );
@@ -8873,7 +8873,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
OString* arrOUS[5];
sal_Int32 intVal;
-
+
public:
void setUp()
{
@@ -8885,10 +8885,10 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
intVal = 11;
}
-
+
void tearDown()
{
- delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2];
+ delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -8900,11 +8900,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[0]",
sal_True
);
-
+
}
void append_002()
@@ -8915,11 +8915,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[1]",
sal_True
);
-
+
}
void append_003()
@@ -8930,11 +8930,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[2]",
sal_True
);
-
+
}
void append_004()
@@ -8945,11 +8945,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[3]",
sal_True
);
-
+
}
void append_005()
@@ -8960,11 +8960,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[4]",
sal_True
);
-
+
}
#ifdef WITH_CORE
void append_006()
@@ -8975,30 +8975,30 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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_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
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
class append_006_Int32_defaultParam : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -9007,12 +9007,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -9025,11 +9025,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer[0]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
@@ -9041,11 +9041,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OStringBuffer[0]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
@@ -9057,11 +9057,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OStringBuffer[0]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
@@ -9073,11 +9073,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer[0]+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
@@ -9089,11 +9089,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -2147483648 and return OStringBuffer[0]+(-2147483648)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
@@ -9105,11 +9105,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer[1]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
@@ -9121,11 +9121,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OStringBuffer[1]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
@@ -9137,11 +9137,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OStringBuffer[1]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
@@ -9153,11 +9153,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer[1]+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
@@ -9169,11 +9169,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -2147483648 and return OStringBuffer[1]+(-2147483648)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
@@ -9185,11 +9185,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer[2]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
@@ -9201,11 +9201,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OUStringBuffer[2]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
@@ -9217,11 +9217,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OUStringBuffer[2]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
@@ -9233,11 +9233,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer[2]+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
@@ -9249,11 +9249,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -2147483648 and return OStringBuffer[2]+(-2147483648)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
@@ -9265,11 +9265,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer[3]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
@@ -9281,11 +9281,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OStringBuffer[3]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
@@ -9297,11 +9297,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OStringBuffer[3]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
@@ -9313,11 +9313,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer[3]+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
@@ -9329,11 +9329,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -2147483648 and return OStringBuffer[3]+(-2147483648)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
@@ -9345,11 +9345,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer[4]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
@@ -9361,11 +9361,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OStringBuffer[4]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
@@ -9377,11 +9377,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OStringBuffer[4]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
@@ -9393,11 +9393,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer[4]+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
@@ -9409,11 +9409,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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()
@@ -9425,11 +9425,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 11 and return OStringBuffer(kSInt32Max)+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
@@ -9441,11 +9441,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 0 and return OStringBuffer(kSInt32Max)+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
@@ -9457,11 +9457,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 -11 and return OStringBuffer(kSInt32Max)+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
@@ -9473,11 +9473,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int32 2147483647 and return OStringBuffer(kSInt32Max)+2147483647",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
@@ -9489,47 +9489,47 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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_001 );
CPPUNIT_TEST( append_002 );
CPPUNIT_TEST( append_003 );
CPPUNIT_TEST( append_004 );
CPPUNIT_TEST( append_005 );
- CPPUNIT_TEST( append_006 );
+ 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_011 );
CPPUNIT_TEST( append_012 );
CPPUNIT_TEST( append_013 );
CPPUNIT_TEST( append_014 );
CPPUNIT_TEST( append_015 );
- CPPUNIT_TEST( append_016 );
+ 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_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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
@@ -9542,7 +9542,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_007_Int64 : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -9551,12 +9551,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -9564,1900 +9564,1900 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_051()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_052()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_053()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_054()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_055()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_056()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_057()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_058()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_059()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_060()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_061()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_062()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_063()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_064()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_065()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_066()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_067()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_068()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_069()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_070()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_071()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_072()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_073()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_074()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_075()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_076()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_077()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_078()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_079()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_080()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_081()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_082()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_083()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_084()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_085()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_086()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_087()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_088()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_089()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_090()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_091()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_092()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_093()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_094()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_095()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_096()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_097()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_098()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_099()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_100()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = 35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_007_Int64 );
@@ -11528,7 +11528,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_007_Int64_Bounderies : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -11537,12 +11537,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -11550,950 +11550,950 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt8Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = kSInt64Max;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_007_Int64_Bounderies );
@@ -12539,7 +12539,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_007_Int64_Negative : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -12548,12 +12548,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -12561,1975 +12561,1975 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_035()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_036()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_043()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_044()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_045()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_046()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_047()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_048()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_049()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_050()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_051()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_052()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_053()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_054()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_055()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_056()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_057()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_058()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_059()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_060()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_061()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_062()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_063()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_064()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_065()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_066()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_067()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_068()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_069()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_070()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_071()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_072()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_073()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_074()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_075()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_076()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_077()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_078()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_079()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_080()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_081()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_082()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_083()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_084()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_085()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_086()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_087()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_088()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_089()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_090()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_091()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_092()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_093()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_094()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_095()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_096()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -15;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_097()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -0;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_098()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -4;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_099()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -8;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_100()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
OString expVal( aStrBuf.getStr() );
- sal_Int64 input = -35;
+ 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.getStr()== expVal &&
aStrBuf.getLength() == expVal.getLength()
);
-
+
}
CPPUNIT_TEST_SUITE( append_007_Int64_Negative );
@@ -14592,7 +14592,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
{
OString* arrOUS[5];
sal_Int64 intVal;
-
+
public:
void setUp()
{
@@ -14604,10 +14604,10 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
intVal = 11;
}
-
+
void tearDown()
{
- delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2];
+ delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -14619,11 +14619,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[0]",
sal_True
);
-
+
}
void append_002()
@@ -14634,11 +14634,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[1]",
sal_True
);
-
+
}
void append_003()
@@ -14649,11 +14649,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[2]",
sal_True
);
-
+
}
void append_004()
@@ -14664,11 +14664,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[3]",
sal_True
);
-
+
}
void append_005()
@@ -14679,11 +14679,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( intVal, -5 );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"Appends the WrongRadix to the string buffer arrOUS[4]",
sal_True
);
-
+
}
#ifdef WITH_CORE
void append_006()
@@ -14694,30 +14694,30 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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_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
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
class append_007_Int64_defaultParam : public CppUnit::TestFixture
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -14726,12 +14726,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -14744,11 +14744,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer[0]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_002()
@@ -14760,11 +14760,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OStringBuffer[0]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
@@ -14776,11 +14776,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OStringBuffer[0]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
@@ -14795,11 +14795,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer[0]+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
@@ -14812,11 +14812,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
sal_Bool bRes = expVal.equals( aStrBuf.getStr() );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -9223372036854775808 and return OStringBuffer[0]+(-9223372036854775808)",
bRes && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
@@ -14828,11 +14828,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer[1]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
@@ -14844,11 +14844,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OStringBuffer[1]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
@@ -14860,11 +14860,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OStringBuffer[1]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
@@ -14879,11 +14879,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer[1]+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
@@ -14895,11 +14895,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -9223372036854775808 and return OStringBuffer[1]+(-9223372036854775808)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
@@ -14911,11 +14911,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer[2]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
@@ -14927,11 +14927,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OUStringBuffer[2]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
@@ -14943,11 +14943,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OUStringBuffer[2]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
@@ -14962,11 +14962,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer[2]+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
@@ -14978,11 +14978,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -9223372036854775808 and return OStringBuffer[2]+(-9223372036854775808)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
@@ -14994,11 +14994,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer[3]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
@@ -15010,11 +15010,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OStringBuffer[3]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
@@ -15026,11 +15026,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OStringBuffer[3]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
@@ -15045,11 +15045,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer[3]+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
@@ -15061,11 +15061,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -9223372036854775808 and return OStringBuffer[3]+(-9223372036854775808)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
@@ -15077,11 +15077,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer[4]+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
@@ -15093,11 +15093,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OStringBuffer[4]+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
@@ -15109,11 +15109,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OStringBuffer[4]+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
@@ -15128,11 +15128,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer[4]+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
@@ -15144,11 +15144,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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()
@@ -15160,11 +15160,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 11 and return OStringBuffer(kSInt64Max)+11",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
@@ -15176,11 +15176,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 0 and return OStringBuffer(kSInt64Max)+0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
@@ -15192,11 +15192,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 -11 and return OStringBuffer(kSInt64Max)+(-11)",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
@@ -15208,11 +15208,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"input Int64 9223372036854775807 and return OStringBuffer(kSInt64Max)+9223372036854775807",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
@@ -15224,47 +15224,47 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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_001 );
CPPUNIT_TEST( append_002 );
CPPUNIT_TEST( append_003 );
CPPUNIT_TEST( append_004 );
CPPUNIT_TEST( append_005 );
- CPPUNIT_TEST( append_006 );
+ 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_011 );
CPPUNIT_TEST( append_012 );
CPPUNIT_TEST( append_013 );
CPPUNIT_TEST( append_014 );
CPPUNIT_TEST( append_015 );
- CPPUNIT_TEST( append_016 );
+ 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_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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
@@ -15285,13 +15285,13 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
return true;
}
return false;
- }
+ }
};
// -----------------------------------------------------------------------------
class append_008_float : public checkfloat
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -15300,22 +15300,22 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
-
+
void append_001()
{
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
// LLA: OString expVal( kTestStr74 );
float input = (float)atof("3.0");
-
- // LLA:
+
+ // LLA:
// the complex problem is here, that a float value is not really what we write.
// So a 3.0 could also be 3 or 3.0 or 3.0000001 or 2.9999999
// this has to be checked.
@@ -15323,11 +15323,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_002()
@@ -15340,11 +15340,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_003()
@@ -15357,11 +15357,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_004()
@@ -15374,11 +15374,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_005()
@@ -15391,11 +15391,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_006()
@@ -15408,11 +15408,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_007()
@@ -15425,11 +15425,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_008()
@@ -15442,11 +15442,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_009()
@@ -15459,11 +15459,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_010()
@@ -15476,11 +15476,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_011()
@@ -15493,11 +15493,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_012()
@@ -15510,11 +15510,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_013()
@@ -15527,11 +15527,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_014()
@@ -15544,11 +15544,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_015()
@@ -15561,11 +15561,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_016()
@@ -15578,11 +15578,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_017()
@@ -15595,11 +15595,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_018()
@@ -15612,11 +15612,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_019()
@@ -15629,11 +15629,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_020()
@@ -15646,11 +15646,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_021()
@@ -15663,11 +15663,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_022()
@@ -15680,11 +15680,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_023()
@@ -15697,11 +15697,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_024()
@@ -15714,11 +15714,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_025()
@@ -15731,11 +15731,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_026()
@@ -15748,11 +15748,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_027()
@@ -15765,11 +15765,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_028()
@@ -15782,11 +15782,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_029()
@@ -15799,11 +15799,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_030()
@@ -15816,11 +15816,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_031()
@@ -15833,11 +15833,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_032()
@@ -15850,11 +15850,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_033()
@@ -15867,11 +15867,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_034()
@@ -15884,11 +15884,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_035()
@@ -15901,11 +15901,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
#ifdef WITH_CORE
void append_036()
@@ -15918,11 +15918,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_037()
@@ -15935,11 +15935,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_038()
@@ -15952,11 +15952,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_039()
@@ -15969,11 +15969,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_040()
@@ -15986,11 +15986,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_041()
@@ -16003,11 +16003,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_042()
@@ -16020,47 +16020,47 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
#endif
CPPUNIT_TEST_SUITE( append_008_float );
- CPPUNIT_TEST( append_001 );
+ 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_006 );
CPPUNIT_TEST( append_007 );
CPPUNIT_TEST( append_008 );
CPPUNIT_TEST( append_009 );
CPPUNIT_TEST( append_010 );
- CPPUNIT_TEST( append_011 );
+ 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_016 );
CPPUNIT_TEST( append_017 );
CPPUNIT_TEST( append_018 );
CPPUNIT_TEST( append_019 );
CPPUNIT_TEST( append_020 );
- CPPUNIT_TEST( append_021 );
+ 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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
@@ -16069,7 +16069,7 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
class append_008_Float_Negative : public checkfloat
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -16078,12 +16078,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -16097,11 +16097,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_002()
@@ -16114,11 +16114,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_003()
@@ -16131,11 +16131,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_004()
@@ -16148,11 +16148,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_005()
@@ -16165,11 +16165,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_006()
@@ -16182,11 +16182,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_007()
@@ -16199,11 +16199,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_008()
@@ -16216,11 +16216,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_009()
@@ -16233,11 +16233,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_010()
@@ -16250,11 +16250,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_011()
@@ -16267,11 +16267,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_012()
@@ -16284,11 +16284,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_013()
@@ -16301,11 +16301,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_014()
@@ -16318,11 +16318,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_015()
@@ -16335,11 +16335,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_016()
@@ -16352,11 +16352,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_017()
@@ -16369,11 +16369,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_018()
@@ -16386,11 +16386,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_019()
@@ -16403,11 +16403,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_020()
@@ -16420,11 +16420,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_021()
@@ -16437,11 +16437,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_022()
@@ -16454,11 +16454,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_023()
@@ -16471,11 +16471,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_024()
@@ -16488,11 +16488,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_025()
@@ -16505,11 +16505,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_026()
@@ -16522,11 +16522,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_027()
@@ -16539,11 +16539,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_028()
@@ -16556,11 +16556,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_029()
@@ -16573,11 +16573,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_030()
@@ -16590,11 +16590,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_031()
@@ -16607,11 +16607,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_032()
@@ -16624,11 +16624,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_033()
@@ -16641,11 +16641,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_034()
@@ -16658,11 +16658,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_035()
@@ -16675,11 +16675,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
#ifdef WITH_CORE
void append_036()
@@ -16692,11 +16692,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.0",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_037()
@@ -16709,11 +16709,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.5",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_038()
@@ -16726,11 +16726,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.0625",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_039()
@@ -16743,11 +16743,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.502525",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_040()
@@ -16760,11 +16760,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.141592",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_041()
@@ -16777,11 +16777,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.5025255",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
void append_042()
@@ -16794,47 +16794,47 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.0039062",
checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
);
-
+
}
#endif
CPPUNIT_TEST_SUITE( append_008_Float_Negative );
- CPPUNIT_TEST( append_001 );
+ 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_006 );
CPPUNIT_TEST( append_007 );
CPPUNIT_TEST( append_008 );
CPPUNIT_TEST( append_009 );
CPPUNIT_TEST( append_010 );
- CPPUNIT_TEST( append_011 );
+ 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_016 );
CPPUNIT_TEST( append_017 );
CPPUNIT_TEST( append_018 );
CPPUNIT_TEST( append_019 );
CPPUNIT_TEST( append_020 );
- CPPUNIT_TEST( append_021 );
+ 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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
CPPUNIT_TEST_SUITE_END();
};
//------------------------------------------------------------------------
@@ -16856,13 +16856,13 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
return true;
}
return false;
- }
+ }
};
class append_009_double : public checkdouble
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -16871,12 +16871,12 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -16890,11 +16890,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.0",
checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)
);
-
+
}
/*
@@ -16907,11 +16907,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
@@ -16923,11 +16923,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
@@ -16939,11 +16939,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
@@ -16955,11 +16955,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
@@ -16971,11 +16971,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
@@ -16987,11 +16987,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append 3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
@@ -17003,11 +17003,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
@@ -17019,11 +17019,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
@@ -17035,11 +17035,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
@@ -17051,11 +17051,11 @@ sal_Bool test_append( const char** resArray, int n, sal_Int16 radix,
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
@@ -17090,11 +17090,11 @@ for(int k=0;k<expVal.getLength();k++)
}
t_print("\n");
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
@@ -17106,11 +17106,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
@@ -17122,11 +17122,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
@@ -17138,11 +17138,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
@@ -17154,11 +17154,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
@@ -17170,11 +17170,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
@@ -17186,11 +17186,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
@@ -17202,11 +17202,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
@@ -17218,11 +17218,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
@@ -17234,11 +17234,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append 3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
@@ -17250,11 +17250,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
@@ -17266,11 +17266,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
@@ -17282,11 +17282,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
@@ -17298,11 +17298,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
@@ -17314,11 +17314,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
@@ -17330,11 +17330,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
@@ -17346,11 +17346,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append 3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
@@ -17362,11 +17362,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
@@ -17378,11 +17378,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
@@ -17394,11 +17394,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
@@ -17410,11 +17410,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
@@ -17426,11 +17426,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
@@ -17442,11 +17442,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
*/
void append_035()
@@ -17454,16 +17454,16 @@ t_print("\n");
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
// LLA: OString expVal( kTestStr133 );
double input = atof("3.141592653589793238462643");
-
+
sal_Int32 nLen = aStrBuf.getLength();
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append 3.141592653589793238462643",
checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)
);
-
+
}
/*
#ifdef WITH_CORE
@@ -17476,11 +17476,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
@@ -17492,11 +17492,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
@@ -17508,11 +17508,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
@@ -17524,11 +17524,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.1415926535",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
@@ -17540,11 +17540,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
@@ -17556,11 +17556,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append 3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
@@ -17572,48 +17572,48 @@ t_print("\n");
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_001 );
/*
CPPUNIT_TEST( append_002 );
CPPUNIT_TEST( append_003 );
CPPUNIT_TEST( append_004 );
CPPUNIT_TEST( append_005 );
- CPPUNIT_TEST( append_006 );
+ 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_011 );
CPPUNIT_TEST( append_012 );
CPPUNIT_TEST( append_013 );
CPPUNIT_TEST( append_014 );
CPPUNIT_TEST( append_015 );
- CPPUNIT_TEST( append_016 );
+ 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_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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
*/
CPPUNIT_TEST( append_035 );
CPPUNIT_TEST_SUITE_END();
@@ -17624,7 +17624,7 @@ t_print("\n");
class append_009_Double_Negative : public checkdouble
{
OString* arrOUS[5];
-
+
public:
void setUp()
{
@@ -17633,12 +17633,12 @@ t_print("\n");
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[0]; delete arrOUS[1]; delete arrOUS[2];
delete arrOUS[3]; delete arrOUS[4];
}
@@ -17652,11 +17652,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.0",
checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)
);
-
+
}
/*
void append_002()
@@ -17668,11 +17668,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_003()
@@ -17684,11 +17684,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_004()
@@ -17700,11 +17700,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_005()
@@ -17716,11 +17716,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_006()
@@ -17732,11 +17732,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_007()
@@ -17748,11 +17748,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[0] append -3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_008()
@@ -17764,11 +17764,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_009()
@@ -17780,11 +17780,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_010()
@@ -17819,11 +17819,11 @@ for(int k=0;k<expVal.getLength();k++)
}
t_print("\n");
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_011()
@@ -17833,7 +17833,7 @@ t_print("\n");
double input = atof("-3.502525");
aStrBuf.append( input );
-
+
double output = atof("-3.50252");
OString *final = new OString();
*final = final->valueOf(output);
@@ -17858,11 +17858,11 @@ for(int k=0;k<expVal.getLength();k++)
}
t_print("\n");
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_012()
@@ -17874,11 +17874,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_013()
@@ -17890,11 +17890,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_014()
@@ -17906,11 +17906,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_015()
@@ -17922,11 +17922,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_016()
@@ -17938,11 +17938,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_017()
@@ -17954,11 +17954,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_018()
@@ -17970,11 +17970,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_019()
@@ -17986,11 +17986,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_020()
@@ -18002,11 +18002,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_021()
@@ -18018,11 +18018,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[2] append -3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_022()
@@ -18034,11 +18034,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_023()
@@ -18050,11 +18050,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_024()
@@ -18066,11 +18066,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_025()
@@ -18082,11 +18082,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_026()
@@ -18098,11 +18098,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_027()
@@ -18114,11 +18114,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[1] append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_028()
@@ -18130,11 +18130,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[3] append -3.141592653589793238462643",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_029()
@@ -18146,11 +18146,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_030()
@@ -18162,11 +18162,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_031()
@@ -18178,11 +18178,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_032()
@@ -18194,11 +18194,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_033()
@@ -18210,11 +18210,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_034()
@@ -18226,11 +18226,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
*/
@@ -18244,11 +18244,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"arrOUS[4] append -3.141592653589793238462643",
checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)
);
-
+
}
/*
#ifdef WITH_CORE
@@ -18261,11 +18261,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.0",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_037()
@@ -18277,11 +18277,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.5",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_038()
@@ -18293,11 +18293,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.0625",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_039()
@@ -18309,11 +18309,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.502525",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_040()
@@ -18325,11 +18325,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.141592653589793",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_041()
@@ -18341,11 +18341,11 @@ t_print("\n");
aStrBuf.append( input );
CPPUNIT_ASSERT_MESSAGE
- (
+ (
"OStringBuffer( kSInt32Max ) append -3.14159265358979323",
aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()
);
-
+
}
void append_042()
@@ -18357,48 +18357,48 @@ t_print("\n");
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_001 );
/*
CPPUNIT_TEST( append_002 );
CPPUNIT_TEST( append_003 );
CPPUNIT_TEST( append_004 );
CPPUNIT_TEST( append_005 );
- CPPUNIT_TEST( append_006 );
+ 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_011 );
CPPUNIT_TEST( append_012 );
CPPUNIT_TEST( append_013 );
CPPUNIT_TEST( append_014 );
CPPUNIT_TEST( append_015 );
- CPPUNIT_TEST( append_016 );
+ 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_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_026 );
CPPUNIT_TEST( append_027 );
CPPUNIT_TEST( append_028 );
CPPUNIT_TEST( append_029 );
CPPUNIT_TEST( append_030 );
-#endif
+#endif
*/
CPPUNIT_TEST( append_035 );
CPPUNIT_TEST_SUITE_END();
@@ -18407,63 +18407,63 @@ t_print("\n");
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ctors,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ctors,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::makeStringAndClear,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::makeStringAndClear,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getLength,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getLength,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getCapacity,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getCapacity,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ensureCapacity,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ensureCapacity,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setLength,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setLength,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::charAt,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::charAt,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::csuc,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::csuc,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getStr,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getStr,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setCharAt,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setCharAt,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_001,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_001,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_002,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_002,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_003,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_003,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_004,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_004,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_005,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_005,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_float,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_float,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_double,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_double,
"rtl_OStringBuffer");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative,
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative,
"rtl_OStringBuffer");
// -----------------------------------------------------------------------------
diff --git a/sal/qa/osl/condition/makefile.mk b/sal/qa/osl/condition/makefile.mk
index fd58c9e63..586908e93 100644
--- a/sal/qa/osl/condition/makefile.mk
+++ b/sal/qa/osl/condition/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,19 +44,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Condition by codegen.pl
+# auto generated Target:Condition by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Condition.obj
SHL1TARGET= osl_Condition
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
diff --git a/sal/qa/osl/condition/osl_Condition_Const.h b/sal/qa/osl/condition/osl_Condition_Const.h
index fc0f28035..282ea9a45 100644
--- a/sal/qa/osl/condition/osl_Condition_Const.h
+++ b/sal/qa/osl/condition/osl_Condition_Const.h
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-#ifndef _OSL_CONDITION_CONST_H_
+#ifndef _OSL_CONDITION_CONST_H_
#define _OSL_CONDITION_CONST_H_
//------------------------------------------------------------------------
@@ -59,7 +59,7 @@
#include <unistd.h>
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \
::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value )
diff --git a/sal/qa/osl/file/makefile.mk b/sal/qa/osl/file/makefile.mk
index 7c6d1232c..0d83a06b7 100644
--- a/sal/qa/osl/file/makefile.mk
+++ b/sal/qa/osl/file/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,15 +47,7 @@ CXXFLAGS+= $(LFS_CFLAGS)
SHL1OBJS= \
$(SLO)$/osl_File.obj
SHL1TARGET= osl_File
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
-# .IF "$(GUI)" == "WNT"
-# SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-# .ENDIF
-# .IF "$(GUI)" == "UNX"
-# SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
@@ -66,13 +58,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS=$(SLO)$/test_cpy_wrt_file.obj
SHL2TARGET=tcwf
-SHL2STDLIBS=$(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL2STDLIBS+=$(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL2STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB=i$(SHL2TARGET)
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
@@ -85,9 +71,7 @@ DEF2NAME =$(SHL2TARGET)
SHL3OBJS= \
$(SLO)$/osl_old_test_file.obj
SHL3TARGET= osl_old_test_file
-SHL3STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL3IMPLIB= i$(SHL3TARGET)
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 2a6fbeacc..6acd5ff9e 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,7 +44,7 @@
#include <osl/file.hxx>
#include <osl_File_Const.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// #ifdef WNT
// # define UNICODE
@@ -67,7 +67,7 @@ inline ::rtl::OString errorToString( const ::osl::FileBase::RC _nError )
{
::rtl::OString sResult;
switch ( _nError ) {
- case ::osl::FileBase::E_None:
+ case ::osl::FileBase::E_None:
sResult = "Success";
break;
case ::osl::FileBase::E_PERM:
@@ -119,7 +119,7 @@ inline void printFileType( const ::osl::FileStatus::Type nType )
{
t_print( "#printFileType# " );
switch ( nType ) {
- case ::osl::FileStatus::Directory:
+ case ::osl::FileStatus::Directory:
t_print( "This file is a: Directory.\n" );
break;
case ::osl::FileStatus::Volume:
@@ -226,7 +226,7 @@ inline void printInt( sal_uInt64 i )
inline void printBool( sal_Bool bOk )
{
t_print( "#printBool# " );
- ( sal_True == bOk ) ? t_print( "YES!\n" ): t_print( "NO!\n" );
+ ( sal_True == bOk ) ? t_print( "YES!\n" ): t_print( "NO!\n" );
}
/** print struct TimeValue in local time format.
@@ -237,24 +237,24 @@ inline void printTime( TimeValue *tv )
CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,malloc ", pDateTime != NULL );
TimeValue *pLocalTV = ( TimeValue* )malloc( sizeof( TimeValue ) );
CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,malloc ", pLocalTV != NULL );
-
+
CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,osl_getLocalTimeFromSystemTime ",sal_True == osl_getLocalTimeFromSystemTime( tv, pLocalTV ) );
CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,osl_gepDateTimeFromTimeValue ",sal_True == osl_getDateTimeFromTimeValue( pLocalTV, pDateTime ) );
-
+
t_print( "#printTime# " );
- t_print( " Time is: %d/%d/%d ", pDateTime->Month, pDateTime->Day, pDateTime->Year);
+ t_print( " Time is: %d/%d/%d ", pDateTime->Month, pDateTime->Day, pDateTime->Year);
switch ( pDateTime->DayOfWeek )
{
- case 0: t_print("Sun. "); break;
- case 1: t_print("Mon. "); break;
- case 2: t_print("Tue. "); break;
- case 3: t_print("Thr. "); break;
- case 4: t_print("Wen. "); break;
- case 5: t_print("Fri. "); break;
+ case 0: t_print("Sun. "); break;
+ case 1: t_print("Mon. "); break;
+ case 2: t_print("Tue. "); break;
+ case 3: t_print("Thr. "); break;
+ case 4: t_print("Wen. "); break;
+ case 5: t_print("Fri. "); break;
case 6: t_print("Sat. "); break;
}
- t_print( " %d:%d:%d %d nsecs\n", pDateTime->Hours, pDateTime->Minutes, pDateTime->Seconds, pDateTime->NanoSeconds);
-
+ t_print( " %d:%d:%d %d nsecs\n", pDateTime->Hours, pDateTime->Minutes, pDateTime->Seconds, pDateTime->NanoSeconds);
+
free( pDateTime );
free( pLocalTV );
}
@@ -270,12 +270,12 @@ inline void printTime( TimeValue *tv )
inline sal_Int64 t_abs64(sal_Int64 _nValue)
{
- // std::abs() seems to have some ambiguity problems (so-texas)
+ // std::abs() seems to have some ambiguity problems (so-texas)
// return abs(_nValue);
t_print("t_abs64(%ld)\n", _nValue);
// CPPUNIT_ASSERT(_nValue < 2147483647);
- if (_nValue < 0)
+ if (_nValue < 0)
{
_nValue = -_nValue;
}
@@ -286,10 +286,10 @@ inline sal_Bool t_compareTime( TimeValue *m_aEndTime, TimeValue *m_aStartTime,
{
// sal_uInt64 uTimeValue;
// sal_Int64 iTimeValue;
- //
+ //
// iTimeValue = t_abs64(( tv1->Seconds - tv2->Seconds) * 1000000000 + tv1->Nanosec - tv2->Nanosec);
// uTimeValue = ( iTimeValue / 1000000 );
-
+
sal_Int32 nDeltaSeconds = m_aEndTime->Seconds - m_aStartTime->Seconds;
sal_Int32 nDeltaNanoSec = sal_Int32(m_aEndTime->Nanosec) - sal_Int32(m_aStartTime->Nanosec);
if (nDeltaNanoSec < 0)
@@ -308,10 +308,10 @@ inline sal_Bool compareFileName( const ::rtl::OUString & ustr1, const ::rtl::OUS
{
sal_Bool bOk;
//on Windows, the seperatar is '\', so here change to '/', then compare
-#if defined (WNT )
+#if defined (WNT )
::rtl::OUString ustr1new,ustr2new;
sal_Unicode reverseSlash = (sal_Unicode)'\\';
-
+
if (ustr1.lastIndexOf(reverseSlash) != -1)
ustr1new = ustr1.replace(reverseSlash,(sal_Unicode)'/');
else
@@ -334,11 +334,11 @@ inline sal_Bool compareFileName( const ::rtl::OUString & ustr, const sal_Char *a
(void)ustr;
::rtl::OUString ustr1 = rtl::OUString::createFromAscii( astr );
sal_Bool bOk = ustr1.equalsIgnoreAsciiCase( ustr1 );
-
+
return bOk;
}
-/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
+/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
is start with "file:///";.
*/
inline sal_Bool isURL( const sal_Char *pathname )
@@ -346,7 +346,7 @@ inline sal_Bool isURL( const sal_Char *pathname )
return ( 0 == strncmp( pathname, FILE_PREFIX, sizeof( FILE_PREFIX ) - 1 ) );
}
-/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
+/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
is start with "file:///";.
*/
inline sal_Bool isURL( const ::rtl::OUString pathname )
@@ -362,10 +362,10 @@ inline void concatURL( ::rtl::OUString & pathname1, const ::rtl::OUString & path
if ( !isURL( pathname1 ) )
{
::rtl::OUString aPathName = pathname1.copy( 0 );
- ::osl::FileBase::getFileURLFromSystemPath( pathname1, aPathName ); //convert if not full qualified URL
+ ::osl::FileBase::getFileURLFromSystemPath( pathname1, aPathName ); //convert if not full qualified URL
pathname1 = aPathName.copy( 0 );
}
-
+
sal_Int32 index = 0;
//check if '/' is in the end of pathname1 or at the begin of pathname2;
if ( ( ( index = pathname1.lastIndexOf( aSlashURL ) ) != ( pathname1.getLength( ) - 1 ) ) &&
@@ -380,21 +380,21 @@ inline void createTestFile( const ::rtl::OUString filename )
{
::rtl::OUString aPathURL = filename.copy( 0 );
::osl::FileBase::RC nError;
-
+
if ( !isURL( filename ) )
- ::osl::FileBase::getFileURLFromSystemPath( filename, aPathURL ); //convert if not full qualified URL
-
+ ::osl::FileBase::getFileURLFromSystemPath( filename, aPathURL ); //convert if not full qualified URL
+
//::std::auto_ptr<File> pFile( new File( aPathURL ) );
File aFile(aPathURL);
//nError = pFile->open( OpenFlag_Read | OpenFlag_Write | OpenFlag_Create );
nError = aFile.open( OpenFlag_Read | OpenFlag_Write | OpenFlag_Create );
- //CPPUNIT_ASSERT_MESSAGE( "In createTestFile Function: creation ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_EXIST ) );
+ //CPPUNIT_ASSERT_MESSAGE( "In createTestFile Function: creation ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_EXIST ) );
if ( ( ::osl::FileBase::E_None != nError ) && ( nError != ::osl::FileBase::E_EXIST ))
{
t_print("createTestFile failed!\n");
}
aFile.close();
-
+
}
/** create a temp test file using OUString name of full qualified URL or system path in a base directory.
@@ -414,15 +414,15 @@ inline void deleteTestFile( const ::rtl::OUString filename )
// LLA: t_print("deleteTestFile\n");
::rtl::OUString aPathURL = filename.copy( 0 );
::osl::FileBase::RC nError;
-
+
if ( !isURL( filename ) )
::osl::FileBase::getFileURLFromSystemPath( filename, aPathURL ); //convert if not full qualified URL
-
- nError = ::osl::File::setAttributes( aPathURL, Attribute_GrpWrite| Attribute_OwnWrite| Attribute_OthWrite ); // if readonly, make writtenable.
- CPPUNIT_ASSERT_MESSAGE( "In deleteTestFile Function: set writtenable ", ( ::osl::FileBase::E_None == nError ) || ( ::osl::FileBase::E_NOENT == nError ) );
-
+
+ nError = ::osl::File::setAttributes( aPathURL, Attribute_GrpWrite| Attribute_OwnWrite| Attribute_OthWrite ); // if readonly, make writtenable.
+ CPPUNIT_ASSERT_MESSAGE( "In deleteTestFile Function: set writtenable ", ( ::osl::FileBase::E_None == nError ) || ( ::osl::FileBase::E_NOENT == nError ) );
+
nError = ::osl::File::remove( aPathURL );
- CPPUNIT_ASSERT_MESSAGE( "In deleteTestFile Function: remove ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_NOENT ) );
+ CPPUNIT_ASSERT_MESSAGE( "In deleteTestFile Function: remove ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_NOENT ) );
}
/** delete a temp test file using OUString name of full qualified URL or system path in a base directory.
@@ -441,11 +441,11 @@ inline void createTestDirectory( const ::rtl::OUString dirname )
{
::rtl::OUString aPathURL = dirname.copy( 0 );
::osl::FileBase::RC nError;
-
+
if ( !isURL( dirname ) )
- ::osl::FileBase::getFileURLFromSystemPath( dirname, aPathURL ); //convert if not full qualified URL
+ ::osl::FileBase::getFileURLFromSystemPath( dirname, aPathURL ); //convert if not full qualified URL
nError = ::osl::Directory::create( aPathURL );
- //CPPUNIT_ASSERT_MESSAGE( "In createTestDirectory Function: creation: ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_EXIST ) );
+ //CPPUNIT_ASSERT_MESSAGE( "In createTestDirectory Function: creation: ", ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_EXIST ) );
if ( ( ::osl::FileBase::E_None != nError ) && ( nError != ::osl::FileBase::E_EXIST ))
t_print("createTestDirectory failed!\n");
}
@@ -470,7 +470,7 @@ inline void deleteTestDirectory( const ::rtl::OUString dirname )
::osl::FileBase::RC nError;
// LLA: printFileName(aPathURL);
if ( !isURL( dirname ) )
- ::osl::FileBase::getFileURLFromSystemPath( dirname, aPathURL ); //convert if not full qualified URL
+ ::osl::FileBase::getFileURLFromSystemPath( dirname, aPathURL ); //convert if not full qualified URL
::osl::Directory testDir( aPathURL );
if ( testDir.isOpen( ) == sal_True )
@@ -478,7 +478,7 @@ inline void deleteTestDirectory( const ::rtl::OUString dirname )
// LLA: t_print("#close Dir\n");
testDir.close( ); //close if still open.
}
-
+
nError = ::osl::Directory::remove( aPathURL );
// LLA: printError(nError);
// LLA: if (( ::osl::FileBase::E_None == nError ))
@@ -495,7 +495,7 @@ inline void deleteTestDirectory( const ::rtl::OUString dirname )
// LLA: }
rtl::OUString strError = rtl::OUString::createFromAscii( "In deleteTestDirectory function: remove Directory ");
strError += aPathURL;
- CPPUNIT_ASSERT_MESSAGE( strError, ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_NOENT ) );
+ CPPUNIT_ASSERT_MESSAGE( strError, ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_NOENT ) );
// LLA: if (! ( ::osl::FileBase::E_None == nError ) || ( nError == ::osl::FileBase::E_NOENT ))
// LLA: {
// LLA: t_print("In deleteTestDirectory function: remove\n");
@@ -528,11 +528,11 @@ inline sal_Bool checkFile( const ::rtl::OUString & str, oslCheckMode nCheckMode
::osl::FileBase::RC nError1, nError2;
::osl::File testFile( str );
sal_Bool bCheckResult;
-
+
bCheckResult = sal_False;
nError1 = testFile.open ( OpenFlag_Read );
if ( ( ::osl::FileBase::E_NOENT != nError1 ) && ( ::osl::FileBase::E_ACCES != nError1 ) ){
-
+
switch ( nCheckMode ) {
case osl_Check_Mode_Exist:
/// check if the file is exist.
@@ -546,7 +546,7 @@ inline sal_Bool checkFile( const ::rtl::OUString & str, oslCheckMode nCheckMode
break;
case osl_Check_Mode_WriteAccess:
/// check the file name and whether it can be write.
- /// write chars into the file.
+ /// write chars into the file.
//testFile.close( );
//testFile.open( OpenFlag_Write );
sal_uInt64 nCount_write;
@@ -554,16 +554,16 @@ inline sal_Bool checkFile( const ::rtl::OUString & str, oslCheckMode nCheckMode
if ( ::osl::FileBase::E_None == nError2 )
bCheckResult = sal_True;
break;
-
+
default:
bCheckResult = sal_False;
}/// swith
-
+
nError2 = testFile.close( );
CPPUNIT_ASSERT_MESSAGE( " in CheckFile() function, close file ", nError2 == FileBase::E_None );
-
+
}
-
+
return bCheckResult;
}
@@ -571,16 +571,16 @@ inline sal_Bool checkFile( const ::rtl::OUString & str, oslCheckMode nCheckMode
inline sal_Bool ifFileExist( const ::rtl::OUString & str )
{
sal_Bool bCheckResult = sal_False;
-
-/*#ifdef WNT
- ::rtl::OUString aUStr = str.copy( 0 );
+
+/*#ifdef WNT
+ ::rtl::OUString aUStr = str.copy( 0 );
if ( isURL( str ) )
- ::osl::FileBase::getSystemPathFromFileURL( str, aUStr );
-
+ ::osl::FileBase::getSystemPathFromFileURL( str, aUStr );
+
::rtl::OString aString = ::rtl::OUStringToOString( aUStr, RTL_TEXTENCODING_ASCII_US );
const char *path = aString.getStr( );
if (( _access( path, 0 ) ) != -1 )
- bCheckResult = sal_True;
+ bCheckResult = sal_True;
#else*/
::rtl::OString aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
// const char *path = aString.getStr( );
@@ -590,30 +590,30 @@ inline sal_Bool ifFileExist( const ::rtl::OUString & str )
//t_print("%s exist!\n", path);
//else
//t_print("%s not exist!\n", path);
-//#endif
+//#endif
return bCheckResult;
-
+
}
//check if the file can be writen
inline sal_Bool ifFileCanWrite( const ::rtl::OUString & str )
{
sal_Bool bCheckResult = sal_False;
- //on Windows, the file has no write right, but can be written
-#ifdef WNT
- ::rtl::OUString aUStr = str.copy( 0 );
+ //on Windows, the file has no write right, but can be written
+#ifdef WNT
+ ::rtl::OUString aUStr = str.copy( 0 );
if ( isURL( str ) )
- ::osl::FileBase::getSystemPathFromFileURL( str, aUStr );
-
+ ::osl::FileBase::getSystemPathFromFileURL( str, aUStr );
+
::rtl::OString aString = ::rtl::OUStringToOString( aUStr, RTL_TEXTENCODING_ASCII_US );
const char *path = aString.getStr( );
if (( _access( path, 2 ) ) != -1 )
- bCheckResult = sal_True;
+ bCheckResult = sal_True;
//on UNX, just test if open success with OpenFlag_Write
#else
::osl::File testFile( str );
bCheckResult = (osl::FileBase::E_None == testFile.open( OpenFlag_Write ));
-#endif
+#endif
return bCheckResult;
}
@@ -623,13 +623,13 @@ inline sal_Bool checkDirectory( const ::rtl::OUString & str, oslCheckMode nCheck
DirectoryItem rItem;
FileBase::RC rc;
sal_Bool bCheckResult= sal_False;
-
+
//::std::auto_ptr<Directory> pDir( new Directory( str ) );
Directory aDir( str );
rc = aDir.open( );
if ( ( ::osl::FileBase::E_NOENT != rc ) && ( ::osl::FileBase::E_ACCES != rc ) ){
-
+
switch ( nCheckMode ) {
case osl_Check_Mode_Exist:
if ( rc == ::osl::FileBase::E_None )
@@ -644,7 +644,7 @@ inline sal_Bool checkDirectory( const ::rtl::OUString & str, oslCheckMode nCheck
rc = aDir.getNextItem( rItem, 0 );
if ( ( rc == ::osl::FileBase::E_None ) || ( rc == ::osl::FileBase::E_NOENT ) )
bCheckResult = sal_True;
- else
+ else
bCheckResult = sal_False;
break;
case osl_Check_Mode_WriteAccess:
@@ -652,31 +652,31 @@ inline sal_Bool checkDirectory( const ::rtl::OUString & str, oslCheckMode nCheck
//if ( ( rc = pDir->create( aUString ) ) == ::osl::FileBase::E_None )
if ( ( rc = Directory::create( aUString ) ) == ::osl::FileBase::E_None )
{
- bCheckResult = sal_True;
+ bCheckResult = sal_True;
//rc = pDir->remove( aUString );
rc = Directory::remove( aUString );
CPPUNIT_ASSERT( rc == ::osl::FileBase::E_None );
}
- else
+ else
bCheckResult = sal_False;
break;
-
+
default:
bCheckResult = sal_False;
}// switch
- rc = aDir.close( );
+ rc = aDir.close( );
CPPUNIT_ASSERT( rc == FileBase::E_None );
-
+
}//if
-
+
return bCheckResult;
}
/** construct error message
*/
inline ::rtl::OUString outputError( const ::rtl::OUString & returnVal, const ::rtl::OUString & rightVal, const sal_Char * msg = "")
-{
+{
::rtl::OUString aUString;
if ( returnVal.equals( rightVal ) )
return aUString;
@@ -696,9 +696,9 @@ inline void changeFileMode( ::rtl::OUString & filepath, sal_Int32 mode )
{
rtl::OString aString;
rtl::OUString aUStr = filepath.copy( 0 );
-
+
if ( isURL( filepath ) )
- ::osl::FileBase::getSystemPathFromFileURL( filepath, aUStr );
+ ::osl::FileBase::getSystemPathFromFileURL( filepath, aUStr );
aString = ::rtl::OUStringToOString( aUStr, RTL_TEXTENCODING_ASCII_US );
chmod( aString.getStr( ), mode );
}
@@ -723,16 +723,16 @@ namespace osl_FileBase
#if 0 //~ this function has been deprecated
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// static inline RC getCanonicalName( const ::rtl::OUString& ustrRequestedURL, ::rtl::OUString& ustrValidURL )
- //
+ //
// The illegal characters are ;+=[]',\"*\\<>/?:|.
// because getCanonicalName method is not implemented yet and will be deprecated in the future, this test is not necessary.
//---------------------------------------------------------------------
-
- class getCanonicalName:public CppUnit::TestFixture
+
+ class getCanonicalName:public CppUnit::TestFixture
{
-
+
public:
::osl::FileBase::RC nError;
@@ -752,7 +752,7 @@ namespace osl_FileBase
createTestFile( aCanURL1 );
nError = ::osl::FileBase::getCanonicalName( aCanURL1, aUStr_ValidURL );
deleteTestFile( aCanURL1 );
-
+
CPPUNIT_ASSERT_MESSAGE( " test for getCanonicalName function: an existed file name, should different from the request, it did not passed(W32)(UNX)",
( osl::FileBase::E_None == nError ) && aUStr_ValidURL.equalsIgnoreAsciiCase( aCanURL1 ) );
}
@@ -772,26 +772,26 @@ namespace osl_FileBase
CPPUNIT_TEST( getCanonicalName_003 );
CPPUNIT_TEST_SUITE_END( );
};// class getCanonicalName
-#endif
+#endif
//---------------------------------------------------------------------
- // testing the method
- // static inline RC getAbsoluteFileURL( const ::rtl::OUString& ustrBaseDirectoryURL,
- // const ::rtl::OUString& ustrRelativeFileURL,
+ // testing the method
+ // static inline RC getAbsoluteFileURL( const ::rtl::OUString& ustrBaseDirectoryURL,
+ // const ::rtl::OUString& ustrRelativeFileURL,
// ::rtl::OUString& ustrAbsoluteFileURL )
//---------------------------------------------------------------------
-
+
class getAbsoluteFileURL:public CppUnit::TestFixture
{
//::osl::FileBase aFileBase;
::rtl::OUString aResultURL1, aResultURL2, aResultURL3, aResultURL4, aResultURL5, aResultURL6;
// ::osl::FileBase::RC nError;
sal_Bool bOk;
-
+
public:
-
- void check_getAbsoluteFileURL( rtl::OUString const& _suBaseURL, rtl::OString const& _sRelativeURL, ::osl::FileBase::RC _nAssumeError, rtl::OUString const& _suAssumeResultStr );
-
+
+ void check_getAbsoluteFileURL( rtl::OUString const& _suBaseURL, rtl::OString const& _sRelativeURL, ::osl::FileBase::RC _nAssumeError, rtl::OUString const& _suAssumeResultStr );
+
void getAbsoluteFileURL_001_1();
void getAbsoluteFileURL_001_2();
void getAbsoluteFileURL_001_3();
@@ -803,7 +803,7 @@ namespace osl_FileBase
void getAbsoluteFileURL_002();
void getAbsoluteFileURL_003();
void getAbsoluteFileURL_004();
-
+
CPPUNIT_TEST_SUITE( getAbsoluteFileURL );
CPPUNIT_TEST( getAbsoluteFileURL_001_1 );
CPPUNIT_TEST( getAbsoluteFileURL_001_2 );
@@ -817,21 +817,21 @@ namespace osl_FileBase
CPPUNIT_TEST( getAbsoluteFileURL_003 );
CPPUNIT_TEST( getAbsoluteFileURL_004 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; //class getAbsoluteFileURL
/* use coding format as same as getSystemPathFromFileURL
// initialization
void setUp( )
{
- sal_Char pResultURL1[] = "/relative/file1";
- sal_Char pResultURL2[] = "/relative/file2";
- sal_Char pResultURL3[] = "/file3";
- sal_Char pResultURL4[] = "/file4";
- sal_Char pResultURL5[] = "/canonical.name";
- sal_Char pResultURL6[] = "/relative/";
+ sal_Char pResultURL1[] = "/relative/file1";
+ sal_Char pResultURL2[] = "/relative/file2";
+ sal_Char pResultURL3[] = "/file3";
+ sal_Char pResultURL4[] = "/file4";
+ sal_Char pResultURL5[] = "/canonical.name";
+ sal_Char pResultURL6[] = "/relative/";
aResultURL1 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL1 ) );
- aResultURL2 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL2 ) );
+ aResultURL2 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL2 ) );
aResultURL3 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL3 ) );
aResultURL4 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL4 ) );
aResultURL5 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL5 ) );
@@ -855,7 +855,7 @@ namespace osl_FileBase
suError += ::rtl::OUString::createFromAscii("', '");
suError += aUStr_AbsURL;
suError += outputError( aUStr_AbsURL, aResultURL1, "' ),");
-
+
sal_Bool nError12 = aUStr_AbsURL.equals( aResultURL1 );
::osl::FileBase::RC nError21 = aFileBase.getAbsoluteFileURL( aUserDirectoryURL, aRelURL2, aUStr_AbsURL );
sal_Bool nError22 = aUStr_AbsURL.equals( aResultURL2 );
@@ -867,7 +867,7 @@ namespace osl_FileBase
sal_Bool nError62 = aUStr_AbsURL.equals( aResultURL6 );
printFileName( aUStr_AbsURL );
printFileName( aResultURL6 );
-
+
CPPUNIT_ASSERT_MESSAGE("test for getAbsoluteFileURL function: valid file name with valid directory",
( ::osl::FileBase::E_None == nError11 ) && ( sal_True == nError12 ) &&
( ::osl::FileBase::E_None == nError21 ) && ( sal_True == nError22 ) &&
@@ -876,7 +876,7 @@ namespace osl_FileBase
( ::osl::FileBase::E_None == nError61 ) && ( sal_True == nError62 ) );
}
-
+
#if ( defined UNX ) || ( defined OS2 ) //Link is not defined in Windows
void getAbsoluteFileURL_002( )
{
@@ -887,14 +887,14 @@ namespace osl_FileBase
rtl::OString strLinkFileName, strSrcFileName;
strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US );
strSrcFileName = OUStringToOString( aUStr_SrcFileSys, RTL_TEXTENCODING_ASCII_US );
-
+
createTestFile( aCanURL1 );
sal_Int32 fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
-
+
nError = aFileBase.getAbsoluteFileURL( aUserDirectoryURL, aLnkURL1, aUStr_AbsURL );
bOk = aUStr_AbsURL.equals( aResultURL5 );
-
+
::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getAbsoluteFileURL(' ");
suError += aUserDirectoryURL;
suError += ::rtl::OUString::createFromAscii("', '");
@@ -903,11 +903,11 @@ namespace osl_FileBase
suError += aUStr_AbsURL;
suError += outputError( aUStr_AbsURL, aResultURL5, "' ),");
//printFileName(suError);
-
+
deleteTestFile( aCanURL1 );
fd = remove( strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
-
+
CPPUNIT_ASSERT_MESSAGE("test for getAbsoluteFileURL function: URL contain link( Solaris version )",
( ::osl::FileBase::E_None == nError ) && ( sal_True == bOk ) );
}
@@ -916,15 +916,15 @@ namespace osl_FileBase
{
CPPUNIT_ASSERT_MESSAGE("test for getAbsoluteFileURL function: URL contain link( Windows version )",
1 );
- }
+ }
#endif
-
+
void getAbsoluteFileURL_003( )
{
// LLA: may be a wrong test, aTmpName1 not a real URL
#if 0
::rtl::OUString aUStr_AbsURL;
-
+
nError = aFileBase.getAbsoluteFileURL( aTmpName1, aRelURL1, aUStr_AbsURL ); //base dir invalid error
::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getAbsoluteFileURL('");
suError += aTmpName1;
@@ -933,11 +933,11 @@ namespace osl_FileBase
suError += ::rtl::OUString::createFromAscii("', '");
suError += aUStr_AbsURL;
suError += ::rtl::OUString::createFromAscii("' ),Parameter is invalid. it ignore the invalid base in Windows, did not pass in (W32), the reason maybe caused by the similar bug with getSystemPathFromFileURL() ");
-
+
CPPUNIT_ASSERT_MESSAGE( suError, ( ::osl::FileBase::E_INVAL == nError ) );
#endif
}
-
+
//use ".." in relartive path, the BasePath must exist on the file system
void getAbsoluteFileURL_004( )
{
@@ -946,11 +946,11 @@ namespace osl_FileBase
createTestDirectory( aUStrUpBase );
::rtl::OUString aUStrBase = aUserDirectoryURL + ::rtl::OUString::createFromAscii("/test1/dir1");
createTestDirectory( aUStrBase );
-
+
::rtl::OUString aUStrRelar = ::rtl::OUString::createFromAscii("../../mytestfile");
::rtl::OUString aUStr_AbsURL;
::rtl::OUString aResultURL6 = aUserDirectoryURL + ::rtl::OUString::createFromAscii("/mytestfile");
-
+
nError = aFileBase.getAbsoluteFileURL( aUStrBase, aUStrRelar, aUStr_AbsURL );
bOk = aUStr_AbsURL.equals( aResultURL6 );
::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getAbsoluteFileURL('");
@@ -959,11 +959,11 @@ namespace osl_FileBase
suError += aUStrRelar;
suError += ::rtl::OUString::createFromAscii("', '");
suError += aUStr_AbsURL;
- suError += outputError( aUStr_AbsURL, aResultURL6, "' ), did not pass on Win32 ");
-
+ suError += outputError( aUStr_AbsURL, aResultURL6, "' ), did not pass on Win32 ");
+
deleteTestDirectory( aUStrBase );
deleteTestDirectory( aUStrUpBase );
-
+
CPPUNIT_ASSERT_MESSAGE( suError, ( ::osl::FileBase::E_None == nError ) && ( sal_True == bOk ) );
}
@@ -974,7 +974,7 @@ namespace osl_FileBase
CPPUNIT_TEST( getAbsoluteFileURL_004 );
CPPUNIT_TEST_SUITE_END( );
};// class getAbsoluteFileURL*/
-
+
void getAbsoluteFileURL::check_getAbsoluteFileURL( rtl::OUString const& _suBaseURL, rtl::OString const& _sRelativeURL, ::osl::FileBase::RC _nAssumeError, rtl::OUString const& _suAssumeResultStr )
{
rtl::OUString suRelativeURL = rtl::OStringToOUString(_sRelativeURL, RTL_TEXTENCODING_UTF8);
@@ -988,59 +988,59 @@ namespace osl_FileBase
if ( nError == ::osl::FileBase::E_None )
{
sal_Bool bStrAreEqual = _suAssumeResultStr.equals( suResultURL );
- CPPUNIT_ASSERT_MESSAGE( "Assumption is wrong: ResultURL is not equal to expected URL ", bStrAreEqual == sal_True );
+ CPPUNIT_ASSERT_MESSAGE( "Assumption is wrong: ResultURL is not equal to expected URL ", bStrAreEqual == sal_True );
}
}
-
+
void getAbsoluteFileURL::getAbsoluteFileURL_001_1()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/file1") );
- check_getAbsoluteFileURL( aUserDirectoryURL, "relative/file1",::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/file1") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "relative/file1",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_2()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/file2") );
- check_getAbsoluteFileURL( aUserDirectoryURL, "relative/./file2",::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/file2") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "relative/./file2",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_3()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/file3") );
- check_getAbsoluteFileURL( aUserDirectoryURL, "relative/../file3",::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/file3") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "relative/../file3",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_4()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/file4") );
- check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/../file4",::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/file4") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/../file4",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_5()
{
rtl::OUString suAssume;
#if ( defined UNX )
- suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/") );
+ suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative/") );
#else
suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/relative") );
-#endif
- check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/.",::osl::FileBase::E_None, suAssume );
+#endif
+ check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/.",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_6()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.relative") );
- check_getAbsoluteFileURL( aUserDirectoryURL, "./.relative",::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.relative") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "./.relative",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_7()
{
rtl::OUString suAssume;
#if (defined UNX )
- suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.a/") );
+ suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.a/") );
#else //windows
- suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.a") );
+ suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/.a") );
#endif
- check_getAbsoluteFileURL( aUserDirectoryURL, "./.a/mydir/..",::osl::FileBase::E_None, suAssume );
+ check_getAbsoluteFileURL( aUserDirectoryURL, "./.a/mydir/..",::osl::FileBase::E_None, suAssume );
}
void getAbsoluteFileURL::getAbsoluteFileURL_001_8()
{
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/tmp/ok") );
-#if ( defined UNX ) || ( defined OS2 )
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/tmp/ok") );
+#if ( defined UNX ) || ( defined OS2 )
check_getAbsoluteFileURL( aUserDirectoryURL, "tmp//ok",::osl::FileBase::E_None, suAssume );
#else
check_getAbsoluteFileURL( aUserDirectoryURL, "tmp//ok",::osl::FileBase::E_INVAL, suAssume );
@@ -1056,13 +1056,13 @@ namespace osl_FileBase
rtl::OString strLinkFileName, strSrcFileName;
strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US );
strSrcFileName = OUStringToOString( aUStr_SrcFileSys, RTL_TEXTENCODING_ASCII_US );
-
+
createTestFile( aCanURL1 );
sal_Int32 fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
rtl::OString sLnkURL = OUStringToOString( aLnkURL1, RTL_TEXTENCODING_ASCII_US );
- rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/canonical.name") );
- check_getAbsoluteFileURL( aUserDirectoryURL, sLnkURL, ::osl::FileBase::E_None, suAssume );
+ rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString::createFromAscii("/canonical.name") );
+ check_getAbsoluteFileURL( aUserDirectoryURL, sLnkURL, ::osl::FileBase::E_None, suAssume );
deleteTestFile( aCanURL1 );
fd = remove( strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
@@ -1079,15 +1079,15 @@ namespace osl_FileBase
createTestDirectory( aUStrUpBase );
::rtl::OUString aUStrBase = aUserDirectoryURL + ::rtl::OUString::createFromAscii("/test1/dir1");
createTestDirectory( aUStrBase );
-
+
::rtl::OUString suAssume = aUserDirectoryURL.concat( ::rtl::OUString::createFromAscii("/mytestfile") );
- check_getAbsoluteFileURL( aUStrBase, "../../mytestfile" , ::osl::FileBase::E_None, suAssume );
+ check_getAbsoluteFileURL( aUStrBase, "../../mytestfile" , ::osl::FileBase::E_None, suAssume );
deleteTestDirectory( aUStrBase );
deleteTestDirectory( aUStrUpBase );
}
//---------------------------------------------------------------------
- // testing two methods:
- // static inline RC getSystemPathFromFileURL( const ::rtl::OUString& ustrFileURL,
+ // testing two methods:
+ // static inline RC getSystemPathFromFileURL( const ::rtl::OUString& ustrFileURL,
// ::rtl::OUString& ustrSystemPath )
// static RC getFileURLFromSystemPath( const ::rtl::OUString & ustrSystemPath,
// ::rtl::OUString & ustrFileURL );
@@ -1097,14 +1097,14 @@ namespace osl_FileBase
//::osl::FileBase aFileBase;
// ::rtl::OUString aUStr;
// ::osl::FileBase::RC nError;
-
+
//void check_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sAssumeResultStr);
void check_SystemPath_FileURL(rtl::OString const& _sSource, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sAssumeResultStr, sal_Bool bDirection = sal_True );
void checkWNTBehaviour_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sWNTAssumeResultString );
void checkUNXBehaviour_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sUnixAssumeResultString );
void checkWNTBehaviour_getFileURLFromSystemPath(rtl::OString const& _sSysPath, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sWNTAssumeResultString);
void checkUNXBehaviour_getFileURLFromSystemPath(rtl::OString const& _sSysPath, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sUnixAssumeResultString);
-
+
public:
// test code.
void getSystemPathFromFileURL_001_1( );
@@ -1130,7 +1130,7 @@ namespace osl_FileBase
void getSystemPathFromFileURL_001_92( );
void getSystemPathFromFileURL_004( );
void getSystemPathFromFileURL_005( );
-
+
//test case fot getFileURLFromSystemPath
void getFileURLFromSystemPath_001( );
void getFileURLFromSystemPath_002( );
@@ -1169,13 +1169,13 @@ namespace osl_FileBase
CPPUNIT_TEST( getFileURLFromSystemPath_005 );
CPPUNIT_TEST_SUITE_END( );
};// class SystemPath_FileURL
-
+
// test code.
/* void getSystemPathFromFileURL::check_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sAssumeResultStr)
{
- // PRE: URL as String
+ // PRE: URL as String
rtl::OUString suURL;
rtl::OUString suStr;
suURL = rtl::OStringToOUString(_sURL, RTL_TEXTENCODING_UTF8);
@@ -1203,17 +1203,17 @@ namespace osl_FileBase
}
}*/
- // if bDirection==sal_True, check getSystemPathFromFileURL
+ // if bDirection==sal_True, check getSystemPathFromFileURL
// if bDirection==sal_False, check getFileURLFromSystemPath
void SystemPath_FileURL::check_SystemPath_FileURL(rtl::OString const& _sSource, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sAssumeResultStr, sal_Bool bDirection)
{
- // PRE: URL as String
+ // PRE: URL as String
rtl::OUString suSource;
rtl::OUString suStr;
suSource = rtl::OStringToOUString(_sSource, RTL_TEXTENCODING_UTF8);
::osl::FileBase::RC nError;
if ( bDirection == sal_True )
- nError = osl::FileBase::getSystemPathFromFileURL( suSource, suStr );
+ nError = osl::FileBase::getSystemPathFromFileURL( suSource, suStr );
else
nError = osl::FileBase::getFileURLFromSystemPath( suSource, suStr );
@@ -1251,7 +1251,7 @@ namespace osl_FileBase
(void)_sWNTAssumeResultString;
#endif
}
-
+
void SystemPath_FileURL::checkUNXBehaviour_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sUnixAssumeResultString)
{
#if ( defined UNX )
@@ -1273,7 +1273,7 @@ namespace osl_FileBase
(void)_sWNTAssumeResultString;
#endif
}
-
+
void SystemPath_FileURL::checkUNXBehaviour_getFileURLFromSystemPath(rtl::OString const& _sSysPath, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sUnixAssumeResultString)
{
#if ( defined UNX )
@@ -1281,10 +1281,10 @@ namespace osl_FileBase
#else
(void)_sSysPath;
(void)_nAssumeError;
- (void)_sUnixAssumeResultString;
+ (void)_sUnixAssumeResultString;
#endif
}
-
+
/** LLA: Test for getSystemPathFromFileURL()
this test is splitted into 2 different OS tests,
the first function checkUNXBehaviour... runs only on Unix based Systems,
@@ -1421,7 +1421,7 @@ namespace osl_FileBase
checkUNXBehaviour_getSystemPathFromFileURL(sURL, osl::FileBase::E_None, "/c:/tmp/first second");
checkWNTBehaviour_getSystemPathFromFileURL(sURL, osl::FileBase::E_None, "c:\\tmp\\first second");
}
-
+
void SystemPath_FileURL::getSystemPathFromFileURL_001_92()
{
rtl::OString sURL("ca@#;+.,$///78no%01ni..name");
@@ -1448,26 +1448,26 @@ namespace osl_FileBase
CPPUNIT_ASSERT_MESSAGE( suError, ( osl::FileBase::E_None == nError ) && ( sal_True == bOk ) );
}
#endif
-
+
//normal legal case
void SystemPath_FileURL::getSystemPathFromFileURL_004( )
{
::rtl::OUString aUStr;
- ::rtl::OUString aNormalURL( aTmpName6 );
- ::rtl::OUString aResultURL ( aSysPath4 );
+ ::rtl::OUString aNormalURL( aTmpName6 );
+ ::rtl::OUString aResultURL ( aSysPath4 );
::osl::FileBase::RC nError = osl::FileBase::getSystemPathFromFileURL( aNormalURL, aUStr );
-
+
sal_Bool bOk = compareFileName( aUStr, aResultURL );
-
+
::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getSystemPathFromFileURL(' ");
suError += aNormalURL;
suError += ::rtl::OUString::createFromAscii(" ') function:use an absolute file URL, ");
suError += outputError(aUStr, aResultURL);
-
+
CPPUNIT_ASSERT_MESSAGE( suError, ( osl::FileBase::E_None == nError ) && ( sal_True == bOk ) );
-
+
}
-
+
//CJK charactors case
void SystemPath_FileURL::getSystemPathFromFileURL_005( )
{
@@ -1475,17 +1475,17 @@ namespace osl_FileBase
createTestDirectory( aTmpName10 );
::rtl::OUString aNormalURL( aTmpName10 );
::rtl::OUString aResultURL ( aSysPath5 );
-
+
::osl::FileBase::RC nError = osl::FileBase::getSystemPathFromFileURL( aNormalURL, aUStr );
-
+
sal_Bool bOk = compareFileName( aUStr, aResultURL );
-
+
::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getSystemPathFromFileURL(' ");
suError += aNormalURL;
suError += ::rtl::OUString::createFromAscii(" ') function:use a CJK coded absolute URL, ");
suError += outputError(aUStr, aResultURL);
deleteTestDirectory( aTmpName10 );
-
+
CPPUNIT_ASSERT_MESSAGE( suError, ( osl::FileBase::E_None == nError ) && ( sal_True == bOk ) );
}
void SystemPath_FileURL::getFileURLFromSystemPath_001()
@@ -1524,13 +1524,13 @@ namespace osl_FileBase
}
// start with "~user", not impletment
// void SystemPath_FileURL::getFileURLFromSystemPath_006()
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
- // static inline RC searchFileURL( const ::rtl::OUString& ustrFileName,
+ // testing the method
+ // static inline RC searchFileURL( const ::rtl::OUString& ustrFileName,
// const ::rtl::OUString& ustrSearchPath,
// ::rtl::OUString& ustrFileURL )
//---------------------------------------------------------------------
@@ -1539,7 +1539,7 @@ namespace osl_FileBase
//::osl::FileBase aFileBase;
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2, nError3,nError4;
-
+
public:
// test code.
@@ -1551,7 +1551,7 @@ namespace osl_FileBase
nError2 = ::osl::FileBase::searchFileURL( aCanURL1, aUserDirectorySys, aUStr );
/* search file is passed by relative file path */
nError3 = ::osl::FileBase::searchFileURL( aRelURL4, aUserDirectorySys, aUStr );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: system filename/URL filename/relative path, system directory, searched files that is not exist, but it reply invalid error, did not pass in (W32) ",
( osl::FileBase::E_NOENT == nError1 ) &&
( osl::FileBase::E_NOENT == nError2 ) &&
@@ -1574,36 +1574,36 @@ namespace osl_FileBase
nError4 = ::osl::FileBase::searchFileURL( aCanURL4, aUserDirectorySys, aUStr );
sal_Bool bOk4 = compareFileName( aUStr, aCanURL1 );
deleteTestFile( aCanURL1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: system filename/URL filename/relative path, system directory, searched file already exist.",
- ( osl::FileBase::E_None == nError1 ) &&
- ( osl::FileBase::E_None == nError2 ) &&
- ( osl::FileBase::E_None == nError3 ) &&
- ( osl::FileBase::E_None == nError4 ) &&
- ( sal_True == bOk1 ) &&
- ( sal_True == bOk2 ) &&
- ( sal_True == bOk3 ) &&
- ( sal_True == bOk4 ) );
- }
-
-
+ ( osl::FileBase::E_None == nError1 ) &&
+ ( osl::FileBase::E_None == nError2 ) &&
+ ( osl::FileBase::E_None == nError3 ) &&
+ ( osl::FileBase::E_None == nError4 ) &&
+ ( sal_True == bOk1 ) &&
+ ( sal_True == bOk2 ) &&
+ ( sal_True == bOk3 ) &&
+ ( sal_True == bOk4 ) );
+ }
+
+
void searchFileURL_003( )
{
- OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT":"TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP":"TEST_PLATFORM_ROOT"system/path" );
+ OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT":"TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP":"TEST_PLATFORM_ROOT"system/path" );
nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aSystemPathList, aUStr );
sal_Bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
- ( osl::FileBase::E_None == nError1 ) &&
+ CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
+ ( osl::FileBase::E_None == nError1 ) &&
( sal_True == bOk ) );
}
void searchFileURL_004( )
{
- OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT PATH_LIST_DELIMITER TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP PATH_LIST_DELIMITER TEST_PLATFORM_ROOT "system/path/../name" );
+ OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT PATH_LIST_DELIMITER TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP PATH_LIST_DELIMITER TEST_PLATFORM_ROOT "system/path/../name" );
nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aSystemPathList, aUStr );
sal_Bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
- ( osl::FileBase::E_None == nError1 ) &&
+ CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
+ ( osl::FileBase::E_None == nError1 ) &&
( sal_True == bOk ) );
}
@@ -1611,11 +1611,11 @@ namespace osl_FileBase
{
nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aNullURL, aUStr );
sal_Bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is NULL",
- ( osl::FileBase::E_None == nError1 ) &&
+ CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is NULL",
+ ( osl::FileBase::E_None == nError1 ) &&
( sal_True == bOk ) );
}
-
+
CPPUNIT_TEST_SUITE( searchFileURL );
CPPUNIT_TEST( searchFileURL_001 );
CPPUNIT_TEST( searchFileURL_002 );
@@ -1624,10 +1624,10 @@ namespace osl_FileBase
CPPUNIT_TEST( searchFileURL_005 );
CPPUNIT_TEST_SUITE_END( );
};// class searchFileURL
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// static inline RC getTempDirURL( ::rtl::OUString& ustrTempDirURL )
//---------------------------------------------------------------------
class getTempDirURL:public CppUnit::TestFixture
@@ -1635,7 +1635,7 @@ namespace osl_FileBase
//::osl::FileBase aFileBase;
::rtl::OUString aUStr;
::osl::FileBase::RC nError;
-
+
public:
// initialization
void setUp( )
@@ -1657,9 +1657,9 @@ namespace osl_FileBase
void getTempDirURL_002( )
{
- CPPUNIT_ASSERT_MESSAGE( "test for getTempDirURL function: test for open and write access rights",
- checkDirectory( aUStr, osl_Check_Mode_OpenAccess ) &&
- checkDirectory( aUStr, osl_Check_Mode_ReadAccess ) &&
+ CPPUNIT_ASSERT_MESSAGE( "test for getTempDirURL function: test for open and write access rights",
+ checkDirectory( aUStr, osl_Check_Mode_OpenAccess ) &&
+ checkDirectory( aUStr, osl_Check_Mode_ReadAccess ) &&
checkDirectory( aUStr,osl_Check_Mode_WriteAccess ) );
}
@@ -1669,11 +1669,11 @@ namespace osl_FileBase
CPPUNIT_TEST_SUITE_END( );
};// class getTempDirURL
-
+
//---------------------------------------------------------------------
- // testing the method
- // static inline RC createTempFile( ::rtl::OUString* pustrDirectoryURL,
- // oslFileHandle* pHandle,
+ // testing the method
+ // static inline RC createTempFile( ::rtl::OUString* pustrDirectoryURL,
+ // oslFileHandle* pHandle,
// ::rtl::OUString* pustrTempFileURL)
//---------------------------------------------------------------------
class createTempFile:public CppUnit::TestFixture
@@ -1681,13 +1681,13 @@ namespace osl_FileBase
//::osl::FileBase aFileBase;
::osl::FileBase::RC nError1, nError2;
sal_Bool bOK;
-
+
oslFileHandle *pHandle;
- ::rtl::OUString *pUStr_DirURL;
- ::rtl::OUString *pUStr_FileURL;
-
+ ::rtl::OUString *pUStr_DirURL;
+ ::rtl::OUString *pUStr_FileURL;
+
public:
-
+
// initialization
void setUp( )
{
@@ -1706,7 +1706,7 @@ namespace osl_FileBase
// test code.
void createTempFile_001( )
- {
+ {
nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, pUStr_FileURL );
::osl::File testFile( *pUStr_FileURL );
//printFileName(*pUStr_FileURL);
@@ -1726,19 +1726,19 @@ namespace osl_FileBase
nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, pUStr_FileURL );
::osl::File testFile( *pUStr_FileURL );
nError2 = testFile.open( OpenFlag_Create );
-
+
CPPUNIT_ASSERT_MESSAGE( "createTempFile function: create a temp file, but it does not exist",
- ( osl::FileBase::E_None == nError1 ) && ( pHandle != NULL ) &&
+ ( osl::FileBase::E_None == nError1 ) && ( pHandle != NULL ) &&
( osl::FileBase::E_EXIST == nError2 ) );
-
- //check file if have the write permission
+
+ //check file if have the write permission
if ( osl::FileBase::E_EXIST == nError2 ) {
- bOK = ifFileCanWrite( *pUStr_FileURL );
+ bOK = ifFileCanWrite( *pUStr_FileURL );
osl_closeFile( *pHandle );
deleteTestFile( *pUStr_FileURL );
}
-
- CPPUNIT_ASSERT_MESSAGE( "test for open and write access rights, in (W32), it did not have write access right, but it should be writtenable.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for open and write access rights, in (W32), it did not have write access right, but it should be writtenable.",
( sal_True == bOK ) );
}
@@ -1749,8 +1749,8 @@ namespace osl_FileBase
bOK = ( pHandle != NULL && pHandle != 0);
if ( sal_True == bOK )
osl_closeFile( *pHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for createTempFile function: set pUStrFileURL to 0 to let it remove the file after call.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for createTempFile function: set pUStrFileURL to 0 to let it remove the file after call.",
( ::osl::FileBase::E_None == nError1 ) &&( sal_True == bOK ) );
}
void createTempFile_004( )
@@ -1759,14 +1759,14 @@ namespace osl_FileBase
bOK = ( pUStr_FileURL != 0);
::osl::File testFile( *pUStr_FileURL );
nError2 = testFile.open( OpenFlag_Create );
- deleteTestFile( *pUStr_FileURL );
+ deleteTestFile( *pUStr_FileURL );
CPPUNIT_ASSERT_MESSAGE( "createTempFile function: create a temp file, but it does not exist",
( osl::FileBase::E_None == nError1 ) && ( osl::FileBase::E_EXIST == nError2 ) &&( sal_True == bOK ) );
-
+
}
-
+
CPPUNIT_TEST_SUITE( createTempFile );
- CPPUNIT_TEST( createTempFile_001 );
+ CPPUNIT_TEST( createTempFile_001 );
CPPUNIT_TEST( createTempFile_002 );
CPPUNIT_TEST( createTempFile_003 );
CPPUNIT_TEST( createTempFile_004 );
@@ -1793,9 +1793,9 @@ namespace osl_FileBase
#if 0 //~ this Class has been deprecated
namespace osl_VolumeDevice
{
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// VolumeDevice() : _aHandle( NULL )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
@@ -1803,7 +1803,7 @@ namespace osl_VolumeDevice
::osl::VolumeDevice aVolumeDevice;
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -1816,9 +1816,9 @@ namespace osl_VolumeDevice
// test code.
void ctors_001( )
- {
+ {
::osl::VolumeDevice aVolumeDevice1;
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: Constructor for VolumeDevice with no args.",
( osl::FileBase::E_None != aVolumeDevice1.automount( ) ) &&
( osl::FileBase::E_None != aVolumeDevice1.unmount( ) ) &&
@@ -1830,10 +1830,10 @@ namespace osl_VolumeDevice
::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_Attributes );
nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+
::osl::VolumeDevice aVolumeDevice1( aVolumeInfo.getDeviceHandle( ) );
sal_Bool bOk = compareFileName( aNullURL, aVolumeDevice1.getMountPath( ) );
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: Copy constructor for VolumeDevice, the copied VolumeDevice should have a mount path file:///, but it returned an empty OUString, it also may be the error from getDeviceHandle(), it did not pass in (UNX), (W32).",
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors function: Copy constructor for VolumeDevice, the copied VolumeDevice should have a mount path file:///, but it returned an empty OUString, it also may be the error from getDeviceHandle(), it did not pass in (UNX), (W32).",
sal_False == bOk );
}
@@ -1842,23 +1842,23 @@ namespace osl_VolumeDevice
::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_Attributes );
nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+
::osl::VolumeDevice aVolumeDevice1 = aVolumeInfo.getDeviceHandle( );
sal_Bool bOk = compareFileName( aNullURL, aVolumeDevice1.getMountPath( ) );
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: Assigned operator for VolumeDevice, the assigned VolumeDevice should have a mount path file:///, but it returned an empty OUString, it also may be the error from getDeviceHandle(),it did not pass in (UNX), (W32).",
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors function: Assigned operator for VolumeDevice, the assigned VolumeDevice should have a mount path file:///, but it returned an empty OUString, it also may be the error from getDeviceHandle(),it did not pass in (UNX), (W32).",
sal_False == bOk );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST( ctors_002 );
CPPUNIT_TEST( ctors_003 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC automount()
//---------------------------------------------------------------------
class automount : public CppUnit::TestFixture
@@ -1866,7 +1866,7 @@ namespace osl_VolumeDevice
::osl::VolumeDevice aVolumeDevice;
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -1875,15 +1875,15 @@ namespace osl_VolumeDevice
void tearDown( )
{
-
+
}
// test code.
void automount_001( )
- {
+ {
::osl::VolumeDevice aVolumeDevice1;
- nError1 = aVolumeDevice1.automount( );
-
+ nError1 = aVolumeDevice1.automount( );
+
CPPUNIT_ASSERT_MESSAGE( "test for automount function: invalid parameter.",
( osl::FileBase::E_INVAL == nError1 ) );
}
@@ -1892,21 +1892,21 @@ namespace osl_VolumeDevice
{
::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_Attributes );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+ CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
+
::osl::VolumeDevice aVolumeDevice1( aVolumeInfo.getDeviceHandle( ) );
nError1 = aVolumeDevice1.unmount( );
nError1 = aVolumeDevice1.automount( );
- CPPUNIT_ASSERT_MESSAGE( "test for automount function: this test is not implemented yet, it did not pass in (UNX), (W32).",
+ CPPUNIT_ASSERT_MESSAGE( "test for automount function: this test is not implemented yet, it did not pass in (UNX), (W32).",
( osl::FileBase::E_None == nError1 ) );
}
CPPUNIT_TEST_SUITE( automount );
- CPPUNIT_TEST( automount_001 );
+ CPPUNIT_TEST( automount_001 );
CPPUNIT_TEST( automount_002 );
CPPUNIT_TEST_SUITE_END( );
};// class automount
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_VolumeDevice::ctors, "osl_VolumeDevice" );
@@ -1920,18 +1920,18 @@ namespace osl_VolumeDevice
//------------------------------------------------------------------------
namespace osl_VolumeInfo
{
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// VolumeInfo( sal_uInt32 nMask ): _nMask( nMask )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
{
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
- ::osl::VolumeDevice aVolumeDevice1;
-
+
+ ::osl::VolumeDevice aVolumeDevice1;
+
public:
// initialization
void setUp( )
@@ -1944,81 +1944,81 @@ namespace osl_VolumeInfo
// test code.
void ctors_001( )
- {
- ::osl::VolumeInfo aVolumeInfo( 0 );
+ {
+ ::osl::VolumeInfo aVolumeInfo( 0 );
nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace( );
+ sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace( );
sal_uInt32 uiMaxPathLength = aVolumeInfo.getMaxPathLength( );
aUStr = aVolumeInfo.getFileSystemName( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is empty",
- ( 0 == uiTotalSpace ) &&
+ ( 0 == uiTotalSpace ) &&
( 0 == uiMaxPathLength ) &&
sal_True == compareFileName( aUStr, aNullURL ) );
}
#if ( defined UNX ) || ( defined OS2 )
void ctors_002( )
- {
- ::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_TotalSpace |
+ {
+ ::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_TotalSpace |
VolumeInfoMask_UsedSpace |
- VolumeInfoMask_FileSystemName );
+ VolumeInfoMask_FileSystemName );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
//CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace( );
+ sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace( );
sal_uInt64 uiUsedSpace = aVolumeInfo.getUsedSpace( );
aUStr = aVolumeInfo.getFileSystemName( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, and get the masked fields",
- ( 0 != uiTotalSpace ) &&
+ ( 0 != uiTotalSpace ) &&
( 0 != uiUsedSpace ) &&
sal_True == compareFileName( aUStr, "nfs" ) );
}
-#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
+#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
void ctors_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, and get the masked fields( Windows version )",
1 == 1 );
}
-#endif
-
+#endif
+
void ctors_003( )
{
sal_Int32 mask1 = VolumeInfoMask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo1( mask1 );
+ ::osl::VolumeInfo aVolumeInfo1( mask1 );
nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo1.isValid( mask1 ) );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+
sal_uInt64 uiTotalSpace1 = aVolumeInfo1.getTotalSpace( );
aUStr = aVolumeInfo1.getFileSystemName( );
-
+
sal_Int32 mask2 = VolumeInfoMask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo2( mask2 );
+ ::osl::VolumeInfo aVolumeInfo2( mask2 );
nError2 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo2 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo2.isValid( mask2 ) );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError2 );
-
+
sal_uInt64 uiTotalSpace2 = aVolumeInfo2.getTotalSpace( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, but get unmasked fields, use mask to FreeSpace, but I can get TotalSpace, did not pass in (UNX)(W32)",
( 0 == uiTotalSpace1 ) && ( 0 != uiTotalSpace2 ) &&
sal_True == compareFileName( aUStr, aNullURL ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST( ctors_002 );
CPPUNIT_TEST( ctors_003 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool isValid( sal_uInt32 nMask ) const
//---------------------------------------------------------------------
class isValid : public CppUnit::TestFixture
@@ -2026,7 +2026,7 @@ namespace osl_VolumeInfo
::osl::VolumeDevice aVolumeDevice;
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -2035,14 +2035,14 @@ namespace osl_VolumeInfo
void tearDown( )
{
-
+
}
// test code.
void isValid_001( )
- {
+ {
sal_Int32 mask = 0;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
@@ -2056,47 +2056,47 @@ namespace osl_VolumeInfo
sal_Int32 mask = VolumeInfoMask_Attributes | VolumeInfoMask_TotalSpace | osl_VolumeInfo_Mask_UsedSpace |
osl_VolumeInfo_Mask_FreeSpace | osl_VolumeInfo_Mask_MaxNameLength |
osl_VolumeInfo_Mask_MaxPathLength | osl_VolumeInfo_Mask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isValid function: all valid fields specified for a nfs volume.",
sal_True == aVolumeInfo.isValid( mask ) );
}
-#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
+#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
void isValid_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for isValid function: all valid fields specified for a nfs volume.( Windows version )",
1 == 1 );
}
-#endif
+#endif
void isValid_003( )
{
- ::osl::VolumeDevice aVolumeDevice1;
+ ::osl::VolumeDevice aVolumeDevice1;
sal_Int32 mask = VolumeInfoMask_Attributes;
::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk1 = aVolumeInfo.isValid( mask );
-
+
nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk2 = aVolumeInfo.isValid( mask );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isValid function: VolumeInfoMask_Attributes, it should be valid for some volume such as /, floppy, cdrom, etc. but it did not pass",
( sal_True == bOk1 ) && ( sal_True == bOk2 ) );
- }
-
+ }
+
CPPUNIT_TEST_SUITE( isValid );
- CPPUNIT_TEST( isValid_001 );
+ CPPUNIT_TEST( isValid_001 );
CPPUNIT_TEST( isValid_002 );
CPPUNIT_TEST( isValid_003 );
CPPUNIT_TEST_SUITE_END( );
};// class isValid
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getRemoteFlag() const
//---------------------------------------------------------------------
class getRemoteFlag : public CppUnit::TestFixture
@@ -2104,13 +2104,13 @@ namespace osl_VolumeInfo
::osl::VolumeDevice aVolumeDevice;
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
+
public:
// test code.
void getRemoteFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRemoteFlag( );
@@ -2121,9 +2121,9 @@ namespace osl_VolumeInfo
#if ( defined UNX ) || ( defined OS2 ) //remote Volume is different in Solaris and Windows
void getRemoteFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRemoteFlag( );
@@ -2131,34 +2131,34 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getRemoteFlag function: get a volume device which is remote( Solaris version ).",
( sal_True == bOk ) );
}
-#else //Windows version
+#else //Windows version
void getRemoteFlag_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getRemoteFlag function: get a volume device which is remote( Windows version )",
1 == 1 );
}
-#endif
-
+#endif
+
CPPUNIT_TEST_SUITE( getRemoteFlag );
- CPPUNIT_TEST( getRemoteFlag_001 );
+ CPPUNIT_TEST( getRemoteFlag_001 );
CPPUNIT_TEST( getRemoteFlag_002 );
CPPUNIT_TEST_SUITE_END( );
};// class getRemoteFlag
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getRemoveableFlag() const
//---------------------------------------------------------------------
class getRemoveableFlag : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// test code.
void getRemoveableFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRemoveableFlag( );
@@ -2168,9 +2168,9 @@ namespace osl_VolumeInfo
}
void getRemoveableFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRemoveableFlag( );
@@ -2179,26 +2179,26 @@ namespace osl_VolumeInfo
sal_True == bOk );
}
CPPUNIT_TEST_SUITE( getRemoveableFlag );
- CPPUNIT_TEST( getRemoveableFlag_001 );
+ CPPUNIT_TEST( getRemoveableFlag_001 );
CPPUNIT_TEST( getRemoveableFlag_002 );
CPPUNIT_TEST_SUITE_END( );
};// class getRemoveableFlag
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getCompactDiscFlag() const
//---------------------------------------------------------------------
class getCompactDiscFlag : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getCompactDiscFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getCompactDiscFlag( );
@@ -2208,37 +2208,37 @@ namespace osl_VolumeInfo
}
void getCompactDiscFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL6, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getCompactDiscFlag( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getCompactDiscFlag function: get a cdrom volume device flag, it did not pass.",
( sal_True == bOk ) );
}
CPPUNIT_TEST_SUITE( getCompactDiscFlag );
- CPPUNIT_TEST( getCompactDiscFlag_001 );
+ CPPUNIT_TEST( getCompactDiscFlag_001 );
CPPUNIT_TEST( getCompactDiscFlag_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getCompactDiscFlag
-
-
+ };// class getCompactDiscFlag
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getFloppyDiskFlag() const
//---------------------------------------------------------------------
class getFloppyDiskFlag : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getFloppyDiskFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getFloppyDiskFlag( );
@@ -2248,37 +2248,37 @@ namespace osl_VolumeInfo
}
void getFloppyDiskFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getFloppyDiskFlag( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFloppyDiskFlag function: get a floppy volume device flag, it did not pass.",
( sal_True == bOk ) );
}
CPPUNIT_TEST_SUITE( getFloppyDiskFlag );
- CPPUNIT_TEST( getFloppyDiskFlag_001 );
+ CPPUNIT_TEST( getFloppyDiskFlag_001 );
CPPUNIT_TEST( getFloppyDiskFlag_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getFloppyDiskFlag
-
-
+ };// class getFloppyDiskFlag
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getFixedDiskFlag() const
//---------------------------------------------------------------------
class getFixedDiskFlag : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getFixedDiskFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getFixedDiskFlag( );
@@ -2288,36 +2288,36 @@ namespace osl_VolumeInfo
}
void getFixedDiskFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getFixedDiskFlag( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFixedDiskFlag function: get a fixed disk volume device flag, it did not pass.",
( sal_True == bOk ) );
}
CPPUNIT_TEST_SUITE( getFixedDiskFlag );
- CPPUNIT_TEST( getFixedDiskFlag_001 );
+ CPPUNIT_TEST( getFixedDiskFlag_001 );
CPPUNIT_TEST( getFixedDiskFlag_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getFixedDiskFlag
-
+ };// class getFixedDiskFlag
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool getRAMDiskFlag() const
//---------------------------------------------------------------------
class getRAMDiskFlag : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getRAMDiskFlag_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRAMDiskFlag( );
@@ -2327,37 +2327,37 @@ namespace osl_VolumeInfo
}
void getRAMDiskFlag_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
sal_Bool bOk = aVolumeInfo.getRAMDiskFlag( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getRAMDiskFlag function: FIX ME, don't know how to get a RAM disk flag, perhaps Windows 98 boot disk can create a RAM disk, it did not pass in (UNX)(W32).",
( sal_True == bOk ) );
}
CPPUNIT_TEST_SUITE( getRAMDiskFlag );
- CPPUNIT_TEST( getRAMDiskFlag_001 );
+ CPPUNIT_TEST( getRAMDiskFlag_001 );
CPPUNIT_TEST( getRAMDiskFlag_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getRAMDiskFlag
-
+ };// class getRAMDiskFlag
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt64 getTotalSpace() const
//---------------------------------------------------------------------
class getTotalSpace : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getTotalSpace_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2369,39 +2369,39 @@ namespace osl_VolumeInfo
#if defined( UNX )
void getTotalSpace_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function: get total space of /proc, it should be 0",
0 == uiTotalSpace );
}
-#else /// Windows version, in Windows, there is no /proc directory
+#else /// Windows version, in Windows, there is no /proc directory
void getTotalSpace_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function:not applicable for /proc( Windows version )",
1 == 1 );
}
-#endif
-
-
-
+#endif
+
+
+
#if defined(SOLARIS)
void getTotalSpace_003( )
- {
+ {
struct statvfs aStatFS;
static const sal_Char name[] = "/";
memset (&aStatFS, 0, sizeof(aStatFS));
statvfs( name, &aStatFS);
sal_uInt64 TotalSpace = aStatFS.f_frsize * aStatFS.f_blocks ;
-
+
sal_Int32 mask = VolumeInfoMask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2410,35 +2410,35 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function: get total space by hand, then compare with getTotalSpace, it did not pass",
uiTotalSpace == TotalSpace );
}
-#else /// Windows version
+#else /// Windows version
void getTotalSpace_003( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function:not implemented yet( Windows version )",
1 == 1 );
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( getTotalSpace );
- CPPUNIT_TEST( getTotalSpace_001 );
+ CPPUNIT_TEST( getTotalSpace_001 );
CPPUNIT_TEST( getTotalSpace_002 );
CPPUNIT_TEST( getTotalSpace_003 );
CPPUNIT_TEST_SUITE_END( );
- };// class getTotalSpace
-
+ };// class getTotalSpace
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt64 getFreeSpace() const
//---------------------------------------------------------------------
class getFreeSpace : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getFreeSpace_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2450,38 +2450,38 @@ namespace osl_VolumeInfo
#if defined( UNX )
void getFreeSpace_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
sal_uInt64 uiFreeSpace = aVolumeInfo.getFreeSpace( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: get free space of /proc, it should be 0",
0 == uiFreeSpace );
}
-#else /// Windows version, in Windows, there is no /proc directory
+#else /// Windows version, in Windows, there is no /proc directory
void getFreeSpace_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: not applicable for /proc( Windows version )",
1 == 1 );
}
-#endif
-
-
+#endif
+
+
#if defined(SOLARIS)
void getFreeSpace_003( )
- {
+ {
struct statvfs aStatFS;
static const sal_Char name[] = "/";
memset (&aStatFS, 0, sizeof(aStatFS));
statvfs( name, &aStatFS);
sal_uInt64 FreeSpace = aStatFS.f_bfree * aStatFS.f_frsize ;
-
+
sal_Int32 mask = VolumeInfoMask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2490,36 +2490,36 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: get free space by hand, then compare with getFreeSpace, it did not pass",
uiFreeSpace == FreeSpace );
}
-#else //Windows version
+#else //Windows version
void getFreeSpace_003( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: not implemented yet( Windows version )",
1 == 1 );
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( getFreeSpace );
- CPPUNIT_TEST( getFreeSpace_001 );
+ CPPUNIT_TEST( getFreeSpace_001 );
CPPUNIT_TEST( getFreeSpace_002 );
CPPUNIT_TEST( getFreeSpace_003 );
CPPUNIT_TEST_SUITE_END( );
- };// class getFreeSpace
+ };// class getFreeSpace
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt64 getUsedSpace() const
//---------------------------------------------------------------------
class getUsedSpace : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getUsedSpace_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_UsedSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2531,39 +2531,39 @@ namespace osl_VolumeInfo
#if defined( UNX )
void getUsedSpace_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_UsedSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
sal_uInt64 uiUsedSpace = aVolumeInfo.getUsedSpace( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: get used space of /proc, it should be 0",
0 == uiUsedSpace );
}
-#else /// Windows version, in Windows, there is no /proc directory
+#else /// Windows version, in Windows, there is no /proc directory
void getUsedSpace_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: not applicable for /proc( Windows version )",
1 == 1 );
}
-#endif
-
-
+#endif
+
+
#if defined(SOLARIS)
void getUsedSpace_003( )
- {
+ {
struct statvfs aStatFS;
static const sal_Char name[] = "/";
memset (&aStatFS, 0, sizeof(aStatFS));
statvfs( name, &aStatFS);
sal_uInt64 UsedSpace = ( aStatFS.f_blocks - aStatFS.f_bavail ) * aStatFS.f_frsize;
-
-
+
+
sal_Int32 mask = VolumeInfoMask_UsedSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2572,37 +2572,37 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: get used space by hand, then compare with getUsedSpace, it did not pass",
uiUsedSpace == UsedSpace );
}
-#else //Windows version
+#else //Windows version
void getUsedSpace_003( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: not implemented yet( Windows version )",
1 == 1 );
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( getUsedSpace );
- CPPUNIT_TEST( getUsedSpace_001 );
+ CPPUNIT_TEST( getUsedSpace_001 );
CPPUNIT_TEST( getUsedSpace_002 );
CPPUNIT_TEST( getUsedSpace_003 );
CPPUNIT_TEST_SUITE_END( );
- };// class getUsedSpace
-
-
+ };// class getUsedSpace
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt32 getMaxNameLength() const
//---------------------------------------------------------------------
class getMaxNameLength : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getMaxNameLength_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_MaxNameLength;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2612,19 +2612,19 @@ namespace osl_VolumeInfo
0 != uiMaxNameLength );
}
-
+
#if ( defined UNX ) || ( defined OS2 )
void getMaxNameLength_002( )
- {
+ {
struct statvfs aStatFS;
static const sal_Char name[] = "/";
memset (&aStatFS, 0, sizeof(aStatFS));
statvfs( name, &aStatFS);
sal_uInt64 MaxNameLength = aStatFS.f_namemax;
-
+
sal_Int32 mask = VolumeInfoMask_MaxNameLength;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2633,35 +2633,35 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getMaxNameLength function: get max name length by hand, then compare with getMaxNameLength",
uiMaxNameLength == MaxNameLength );
}
-#else //Windows version
+#else //Windows version
void getMaxNameLength_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getMaxNameLength function: not implemented yet( Windows version )",
1 == 1 );
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( getMaxNameLength );
- CPPUNIT_TEST( getMaxNameLength_001 );
+ CPPUNIT_TEST( getMaxNameLength_001 );
CPPUNIT_TEST( getMaxNameLength_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getMaxNameLength
-
-
+ };// class getMaxNameLength
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt32 getMaxPathLength() const
//---------------------------------------------------------------------
class getMaxPathLength : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getMaxPathLength_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_MaxPathLength;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2671,12 +2671,12 @@ namespace osl_VolumeInfo
0 != uiMaxPathLength );
}
-
+
#if ( defined UNX ) || ( defined OS2 )
void getMaxPathLength_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_MaxPathLength;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2685,37 +2685,37 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getMaxPathLength function: get max path length by hand, then compare with getMaxPathLength",
uiMaxPathLength == PATH_MAX );
}
-#else //Windows version
+#else //Windows version
void getMaxPathLength_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getMaxPathLength function: not implemented yet( Windows version )",
1 == 1 );
}
-#endif
+#endif
CPPUNIT_TEST_SUITE( getMaxPathLength );
- CPPUNIT_TEST( getMaxPathLength_001 );
+ CPPUNIT_TEST( getMaxPathLength_001 );
CPPUNIT_TEST( getMaxPathLength_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class getMaxPathLength
-
-
+ };// class getMaxPathLength
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline ::rtl::OUString getFileSystemName() const
//---------------------------------------------------------------------
class getFileSystemName : public CppUnit::TestFixture
{
::rtl::OUString aUStr;
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getFileSystemName_001( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2725,10 +2725,10 @@ namespace osl_VolumeInfo
sal_False == compareFileName( aNullURL, aUStr ) );
}
-
+
#if defined(SOLARIS)
void getFileSystemName_002( )
- {
+ {
struct statvfs aStatFS;
static const sal_Char name[] = "/";
@@ -2737,7 +2737,7 @@ namespace osl_VolumeInfo
sal_Char * astrFileSystemName = aStatFS.f_basetype;
sal_Int32 mask = VolumeInfoMask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
@@ -2746,38 +2746,38 @@ namespace osl_VolumeInfo
CPPUNIT_ASSERT_MESSAGE( "test for getFileSystemName function: get file system name by hand, then compare with getFileSystemName",
sal_True == compareFileName( aUStr, astrFileSystemName ) );
}
-#else //Windows version
+#else //Windows version
void getFileSystemName_002( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getFileSystemName function: not implemented yet( Windows version )",
1 == 1 );
}
-#endif
-
+#endif
+
CPPUNIT_TEST_SUITE( getFileSystemName );
- CPPUNIT_TEST( getFileSystemName_001 );
+ CPPUNIT_TEST( getFileSystemName_001 );
CPPUNIT_TEST( getFileSystemName_002 );
CPPUNIT_TEST_SUITE_END( );
};// class getFileSystemName
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline VolumeDevice getDeviceHandle() const
//---------------------------------------------------------------------
class getDeviceHandle : public CppUnit::TestFixture
{
::rtl::OUString aUStr;
::osl::FileBase::RC nError1;
-
+
public:
// test code.
void getDeviceHandle_001( )
- {
+ {
::osl::VolumeInfo aVolumeInfo( VolumeInfoMask_Attributes );
nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
+
::osl::VolumeDevice aVolumeDevice1( aVolumeInfo.getDeviceHandle( ) );
sal_Bool bOk = compareFileName( aNullURL, aVolumeDevice1.getMountPath( ) );
@@ -2786,7 +2786,7 @@ namespace osl_VolumeInfo
}
CPPUNIT_TEST_SUITE( getDeviceHandle );
- CPPUNIT_TEST( getDeviceHandle_001 );
+ CPPUNIT_TEST( getDeviceHandle_001 );
CPPUNIT_TEST_SUITE_END( );
};// class getDeviceHandle
@@ -2816,9 +2816,9 @@ namespace osl_VolumeInfo
//------------------------------------------------------------------------
namespace osl_FileStatus
{
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// FileStatus( sal_uInt32 nMask ): _nMask( nMask )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
@@ -2826,7 +2826,7 @@ namespace osl_FileStatus
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -2834,9 +2834,9 @@ namespace osl_FileStatus
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
+
::std::auto_ptr<Directory> pDir( new Directory( aTmpName3 ) );
- nError1 = pDir->open( );
+ nError1 = pDir->open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = pDir->getNextItem( rItem, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -2860,36 +2860,36 @@ namespace osl_FileStatus
// test code.
void ctors_001( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_All );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_All );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
aUStr = rFileStatus.getFileName( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask all and see the file name",
sal_True == compareFileName( aUStr, aTmpName2) );
}
void ctors_002( )
- {
- ::osl::FileStatus rFileStatus( 0 );
+ {
+ ::osl::FileStatus rFileStatus( 0 );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
aUStr = rFileStatus.getFileName( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is empty",
sal_True == compareFileName( aUStr, aNullURL) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
- CPPUNIT_TEST( ctors_002 );
+ CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_002 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool isValid( sal_uInt32 nMask ) const
//---------------------------------------------------------------------
class isValid : public CppUnit::TestFixture
@@ -2897,7 +2897,7 @@ namespace osl_FileStatus
::rtl::OUString aUStr;
::osl::Directory *pDir;
::osl::DirectoryItem rItem_file, rItem_link;
-
+
public:
// initialization
void setUp( )
@@ -2905,10 +2905,10 @@ namespace osl_FileStatus
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
+
pDir = new Directory( aTmpName3 );
//::std::auto_ptr<Directory> pDir( new Directory( aTmpName3 ) );
- ::osl::FileBase::RC nError1 = pDir->open( );
+ ::osl::FileBase::RC nError1 = pDir->open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = pDir->getNextItem( rItem_file, 1 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -2919,7 +2919,7 @@ namespace osl_FileStatus
::osl::FileBase::RC nError1 = pDir->close( );
delete pDir;
CPPUNIT_ASSERT_MESSAGE( errorToStr(nError1), ::osl::FileBase::E_None == nError1 );
-
+
// remove the tempfile in $TEMP/tmpdir/tmpname.
deleteTestFile( aTmpName4 );
deleteTestDirectory( aTmpName3 );
@@ -2927,13 +2927,13 @@ namespace osl_FileStatus
// test code.
void isValid_001( )
- {
+ {
sal_uInt32 mask = 0;
- ::osl::FileStatus rFileStatus( mask );
+ ::osl::FileStatus rFileStatus( mask );
::osl::FileBase::RC nError1 = rItem_file.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
- sal_Bool bOk = rFileStatus.isValid( mask );
-
+ sal_Bool bOk = rFileStatus.isValid( mask );
+
CPPUNIT_ASSERT_MESSAGE( "test for isValid function: no fields specified",
( sal_True == bOk ) );
}
@@ -2975,33 +2975,33 @@ namespace osl_FileStatus
}
t_print("mask: %s\n", sStat.getStr());
}
-
+
void isValid_002( )
- {
+ {
createTestFile( aTmpName6 );
- sal_uInt32 mask_file = ( FileStatusMask_Type | FileStatusMask_Attributes |
+ sal_uInt32 mask_file = ( FileStatusMask_Type | FileStatusMask_Attributes |
FileStatusMask_CreationTime | FileStatusMask_AccessTime |
FileStatusMask_ModifyTime | FileStatusMask_FileSize |
FileStatusMask_FileName | FileStatusMask_FileURL) ;
- ::osl::FileStatus rFileStatus( mask_file );
+ ::osl::FileStatus rFileStatus( mask_file );
::osl::FileBase::RC nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem_file );
nError1 = rItem_file.getFileStatus( rFileStatus );
-
+
CPPUNIT_ASSERT_MESSAGE( errorToStr(nError1), ::osl::FileBase::E_None == nError1 );
-
+
// LLA: this is wrong, we never should try to check on all masks
// only on one.
// Second, it's not a bug, if a value is not valid, it's an unhandled feature.
-// sal_Bool bOk = rFileStatus.isValid( mask_file );
-
+// sal_Bool bOk = rFileStatus.isValid( mask_file );
+
check_FileStatus(rFileStatus);
deleteTestFile( aTmpName6 );
-
+
// CPPUNIT_ASSERT_MESSAGE( "test for isValid function: regular file mask fields test, #FileStatusMask_CreationTime# should be valid field for regular file, but feedback is invalid",
// ( sal_True == bOk ) );
}
-
+
//Link is not defined in Windows, and on Linux, we can not get the directory item of the link file
// LLA: we have to differ to filesystems, normal filesystems support links (EXT2, ...)
// castrated filesystems don't (FAT, FAT32)
@@ -3012,16 +3012,16 @@ namespace osl_FileStatus
#if defined ( UNX )
// ::osl::FileBase::RC nError;
sal_Int32 fd;
-
+
::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys );
( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID( ) ) += ::rtl::OUString::createFromAscii("/tmpdir/link.file");
( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID( ) ) += ::rtl::OUString::createFromAscii("/tmpdir/tmpname");
-
+
rtl::OString strLinkFileName;
rtl::OString strSrcFileName;
strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US );
strSrcFileName = OUStringToOString( aUStr_SrcFileSys, RTL_TEXTENCODING_ASCII_US );
-
+
//create a link file and link it to file "/tmp/PID/tmpdir/tmpname"
fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
@@ -3030,16 +3030,16 @@ namespace osl_FileStatus
::osl::Directory testDirectory( aTmpName3 );
::osl::FileBase::RC nError1 = testDirectory.open( );
::rtl::OUString aFileName = ::rtl::OUString::createFromAscii("link.file");
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = sal_False;
while (1) {
nError1 = testDirectory.getNextItem( rItem_link, 4 );
if (::osl::FileBase::E_None == nError1) {
- sal_uInt32 mask_link = FileStatusMask_FileName | FileStatusMask_LinkTargetURL;
- ::osl::FileStatus rFileStatus( mask_link );
+ sal_uInt32 mask_link = FileStatusMask_FileName | FileStatusMask_LinkTargetURL;
+ ::osl::FileStatus rFileStatus( mask_link );
rItem_link.getFileStatus( rFileStatus );
//printFileName( rFileStatus.getFileName( ) );
if ( compareFileName( rFileStatus.getFileName( ), aFileName) == sal_True )
- {
+ {
//t_print("find the link file");
if ( sal_True == rFileStatus.isValid( FileStatusMask_LinkTargetURL ) )
{
@@ -3050,60 +3050,60 @@ namespace osl_FileStatus
}
else
break;
- };
-
+ };
+
fd = remove( strLinkFileName );
CPPUNIT_ASSERT( fd == 0 );
-
+
CPPUNIT_ASSERT_MESSAGE("test for isValid function: link file, check for LinkTargetURL",
( sal_True == bOk ) );
#endif
}
-
+
void isValid_004( )
- {
+ {
sal_uInt32 mask_file_all = FileStatusMask_All;
- ::osl::FileStatus rFileStatus_all( mask_file_all );
+ ::osl::FileStatus rFileStatus_all( mask_file_all );
::osl::FileBase::RC nError1 = rItem_file.getFileStatus( rFileStatus_all );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
check_FileStatus(rFileStatus_all);
// LLA: this is wrong
-// sal_Bool bOk1 = rFileStatus_all.isValid( mask_file_all );
-
+// sal_Bool bOk1 = rFileStatus_all.isValid( mask_file_all );
+
sal_uInt32 mask_file_val = FileStatusMask_Validate;
- ::osl::FileStatus rFileStatus_val( mask_file_val );
+ ::osl::FileStatus rFileStatus_val( mask_file_val );
nError1 = rItem_file.getFileStatus( rFileStatus_val );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
// sal_Bool bOk2 = rFileStatus_val.isValid( mask_file_val );
-
+
check_FileStatus(rFileStatus_val);
// CPPUNIT_ASSERT_MESSAGE( "test for isValid function: check for Mask_All and Validate, really not sure what validate used for and how to use it, help me. did not pass (W32)(UNX).",
// ( sal_False == bOk1 ) && ( sal_True == bOk2 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isValid );
- CPPUNIT_TEST( isValid_001 );
- CPPUNIT_TEST( isValid_002 );
- CPPUNIT_TEST( isValid_003 );
- CPPUNIT_TEST( isValid_004 );
+ CPPUNIT_TEST( isValid_001 );
+ CPPUNIT_TEST( isValid_002 );
+ CPPUNIT_TEST( isValid_003 );
+ CPPUNIT_TEST( isValid_004 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline Type getFileType() const
//---------------------------------------------------------------------
class getFileType : public CppUnit::TestFixture
{
::rtl::OUString aUStr;
::osl::FileBase::RC nError1, nError2;
-
+
::osl::DirectoryItem m_aItem_1, m_aItem_2, m_aVolumeItem, m_aFifoItem;
::osl::DirectoryItem m_aLinkItem, m_aSocketItem, m_aSpecialItem;
-
+
public:
// initialization
void setUp( )
@@ -3116,9 +3116,9 @@ namespace osl_FileStatus
//printFileName( aTmpName2);
createTestFile( aTmpName3, aTmpName2 );
createTestDirectory( aTmpName3, aTmpName1 );
-
+
::std::auto_ptr<Directory> pDir( new Directory( aTmpName3 ) );
- nError1 = pDir->open( );
+ nError1 = pDir->open( );
CPPUNIT_ASSERT_MESSAGE("open aTmpName3 failed!", ::osl::FileBase::E_None == nError1 );
//getNextItem can not assure which item retrieved
nError1 = pDir->getNextItem( m_aItem_1, 1 );
@@ -3143,14 +3143,14 @@ namespace osl_FileStatus
// test code.
void getFileType_001( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_Type | FileStatusMask_FileName );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type | FileStatusMask_FileName );
nError1 = m_aItem_1.getFileStatus( rFileStatus );
CPPUNIT_ASSERT_MESSAGE("getFileStatus failed", ::osl::FileBase::E_None == nError1 );
check_FileType(rFileStatus);
}
-
+
void check_FileType(osl::FileStatus const& _rFileStatus )
{
sal_Bool bOK = sal_False;
@@ -3161,7 +3161,7 @@ namespace osl_FileStatus
if ( _rFileStatus.isValid(FileStatusMask_Type))
{
osl::FileStatus::Type eType = _rFileStatus.getFileType( );
-
+
if ( compareFileName( suFilename, aTmpName2) == sal_True )
{
// regular
@@ -3172,7 +3172,7 @@ namespace osl_FileStatus
// directory
bOK = ( eType == ::osl::FileStatus::Directory );
}
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: ",
( bOK == sal_True ) );
}
@@ -3181,22 +3181,22 @@ namespace osl_FileStatus
}
void getFileType_002( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_Type | FileStatusMask_FileName );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type | FileStatusMask_FileName );
nError1 = m_aItem_2.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
check_FileType(rFileStatus);
}
-
+
void getFileType_003( )
- {
+ {
#if 0
// LLA: this have to be discussed.
- ::osl::FileStatus rFileStatus( FileStatusMask_Type );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type );
nError1 = m_aVolumeItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
if (rFileStatus.isValid(FileStatusMask_Type))
{
osl::FileStatus::Type eType = rFileStatus.getFileType( );
@@ -3206,29 +3206,29 @@ namespace osl_FileStatus
}
#endif
}
-
-
+
+
void getFileType_004( )
- {
+ {
#if ( defined UNX ) || ( defined OS2 ) //Fifo creation is differ in Windows
//create a fifo in $ROOT/tmp/tmpdir, get its DirectoryItem.
rtl::OString strFifoSys;
strFifoSys = OUStringToOString( aFifoSys, RTL_TEXTENCODING_ASCII_US );
::rtl::OUString aFifoURL;
-
+
int fd = mkfifo( strFifoSys.getStr(), O_RDWR | O_CREAT );
CPPUNIT_ASSERT_MESSAGE("mkfifo failed!", fd == 0 );
::osl::FileBase::getFileURLFromSystemPath( aFifoSys, aFifoURL );
-
+
nError1 = ::osl::DirectoryItem::get( aFifoURL, m_aFifoItem );
CPPUNIT_ASSERT_MESSAGE("get item failed!", ::osl::FileBase::E_None == nError1 );
-
+
//check for File type
- ::osl::FileStatus rFileStatus( FileStatusMask_Type );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type );
nError1 = m_aFifoItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT_MESSAGE("get Status failed!", ::osl::FileBase::E_None == nError1 );
-
+
//delete fifo
nError1 = ::osl::File::remove( aFifoURL );
CPPUNIT_ASSERT_MESSAGE("remove file failed!", ::osl::FileBase::E_None == nError1 );
@@ -3236,11 +3236,11 @@ namespace osl_FileStatus
if (rFileStatus.isValid(FileStatusMask_Type))
{
osl::FileStatus::Type eType = rFileStatus.getFileType( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: Fifo, Solaris version ",
( eType == ::osl::FileStatus::Fifo ) );
}
-#endif
+#endif
}
/*
@@ -3248,19 +3248,19 @@ namespace osl_FileStatus
*/
// LLA: void getFileType_005( )
-// LLA: {
+// LLA: {
// LLA: #if defined ( SOLARIS ) //Socket file may differ in Windows
// LLA: // nError1 = ::osl::DirectoryItem::get( aTypeURL1, m_aSocketItem );
// LLA: nError1 = ::osl::DirectoryItem::get( rtl::OUString::createFromAscii("/dev/null"), m_aSocketItem );
// LLA: printError(nError1);
// LLA: CPPUNIT_ASSERT_MESSAGE("get Socket type file failed", ::osl::FileBase::E_None == nError1 );
-// LLA:
+// LLA:
// LLA: //check for File type
// LLA: ::osl::FileStatus rFileStatus( FileStatusMask_Type );
-// LLA:
+// LLA:
// LLA: nError1 = m_aSocketItem.getFileStatus( rFileStatus );
// LLA: CPPUNIT_ASSERT_MESSAGE("getFileStatus failed", ::osl::FileBase::E_None == nError1 );
-// LLA:
+// LLA:
// LLA: if (rFileStatus.isValid( FileStatusMask_Type ))
// LLA: {
// LLA: osl::FileStatus::Type eType = rFileStatus.getFileType( );
@@ -3268,70 +3268,70 @@ namespace osl_FileStatus
// LLA: CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: Socket, Solaris version ",
// LLA: ( eType == ::osl::FileStatus::Socket ) );
// LLA: }
-// LLA: #endif
+// LLA: #endif
// LLA: }
-
-
-// deprecated since there is a same case Directory::getNextItem_004
+
+
+// deprecated since there is a same case Directory::getNextItem_004
/*#if defined 0 //( UNX ) //( SOLARIS ) //Link file is not defined in Windows
void getFileType_006( )
- {
+ {
nError1 = ::osl::DirectoryItem::get( aTypeURL3, m_aLinkItem );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check for File type
- ::osl::FileStatus rFileStatus( FileStatusMask_Type );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type );
nError1 = m_aLinkItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: Link, UNX version ",
( ::osl::FileStatus::Link == rFileStatus.getFileType( ) ) );
}
#endif */
-
+
void getFileType_007( )
- {
+ {
#if defined ( SOLARIS ) //Special file is differ in Windows
nError1 = ::osl::DirectoryItem::get( aTypeURL2, m_aSpecialItem );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check for File type
- ::osl::FileStatus rFileStatus( FileStatusMask_Type );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Type );
nError1 = m_aSpecialItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
if (rFileStatus.isValid(FileStatusMask_Type))
{
osl::FileStatus::Type eType = rFileStatus.getFileType( );
-
-
+
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: Special, Solaris version ",
( eType == ::osl::FileStatus::Special ) );
}
-#endif
+#endif
}
CPPUNIT_TEST_SUITE( getFileType );
- CPPUNIT_TEST( getFileType_001 );
- CPPUNIT_TEST( getFileType_002 );
- CPPUNIT_TEST( getFileType_003 );
- CPPUNIT_TEST( getFileType_004 );
- // LLA: CPPUNIT_TEST( getFileType_005 );
- //CPPUNIT_TEST( getFileType_006 );
- CPPUNIT_TEST( getFileType_007 );
+ CPPUNIT_TEST( getFileType_001 );
+ CPPUNIT_TEST( getFileType_002 );
+ CPPUNIT_TEST( getFileType_003 );
+ CPPUNIT_TEST( getFileType_004 );
+ // LLA: CPPUNIT_TEST( getFileType_005 );
+ //CPPUNIT_TEST( getFileType_006 );
+ CPPUNIT_TEST( getFileType_007 );
CPPUNIT_TEST_SUITE_END( );
};// class getFileType
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt64 getAttributes() const
//---------------------------------------------------------------------
class getAttributes : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL, aTypeURL_Hid;
+ ::rtl::OUString aTypeURL, aTypeURL_Hid;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem, rItem_hidden;
-
+
public:
// initialization
void setUp( )
@@ -3341,7 +3341,7 @@ namespace osl_FileStatus
createTestFile( aTypeURL );
nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
aTypeURL_Hid = aUserDirectoryURL.copy( 0 );
concatURL( aTypeURL_Hid, aHidURL1 );
createTestFile( aTypeURL_Hid );
@@ -3356,112 +3356,112 @@ namespace osl_FileStatus
}
// test code.
-#if ( defined UNX ) || ( defined OS2 )
-//windows only 3 file attributes: normal, readonly, hidden
+#if ( defined UNX ) || ( defined OS2 )
+//windows only 3 file attributes: normal, readonly, hidden
void getAttributes_001( )
- {
+ {
changeFileMode( aTypeURL, S_IRUSR | S_IRGRP | S_IROTH );
-
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: ReadOnly, GrpRead, OwnRead, OthRead( UNX version ) ",
( Attribute_ReadOnly | Attribute_GrpRead | Attribute_OwnRead | Attribute_OthRead ) ==
rFileStatus.getAttributes( ) );
}
-#else //Windows version
+#else //Windows version
void getAttributes_001( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: ReadOnly, GrpRead, OwnRead, OthRead( Windows version )",
1 == 1 );
}
-#endif
+#endif
+
-
void getAttributes_002( )
- {
-#if ( defined UNX ) || ( defined OS2 )
+ {
+#if ( defined UNX ) || ( defined OS2 )
changeFileMode( aTypeURL, S_IXUSR | S_IXGRP | S_IXOTH );
-
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: Executable, GrpExe, OwnExe, OthExe, the result is Readonly, Executable, GrpExe, OwnExe, OthExe, it partly not pass( Solaris version )",
( Attribute_ReadOnly | Attribute_Executable | Attribute_GrpExe | Attribute_OwnExe | Attribute_OthExe ) ==
rFileStatus.getAttributes( ) );
-#endif
+#endif
}
-#if ( defined UNX ) || ( defined OS2 )
+#if ( defined UNX ) || ( defined OS2 )
void getAttributes_003( )
- {
+ {
changeFileMode( aTypeURL, S_IWUSR | S_IWGRP | S_IWOTH );
-
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: GrpWrite, OwnWrite, OthWrite( Solaris version )",
( Attribute_GrpWrite | Attribute_OwnWrite | Attribute_OthWrite ) ==
rFileStatus.getAttributes( ) );
}
-#else //Windows version
+#else //Windows version
void getAttributes_003( )
{
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: GrpWrite, OwnWrite, OthWrite( Windows version )",
1 == 1 );
}
-#endif
-
+#endif
+
#if ( defined UNX ) || ( defined OS2 ) //hidden file definition may different in Windows
void getAttributes_004( )
- {
+ {
sal_Int32 test_Attributes = Attribute_Hidden;
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError = rItem_hidden.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
test_Attributes &= rFileStatus.getAttributes( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getAttributes function: Hidden files( Solaris version )",
test_Attributes == Attribute_Hidden );
}
-#else //Windows version
+#else //Windows version
void getAttributes_004( )
{
::rtl::OUString aUserHiddenFileURL = ::rtl::OUString::createFromAscii("file:///c:/AUTOEXEC.BAT");
nError = ::osl::DirectoryItem::get( aUserHiddenFileURL, rItem_hidden );
//printFileName( aUserHiddenFileURL );
CPPUNIT_ASSERT_MESSAGE("get item fail", nError == FileBase::E_None );
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError = rItem_hidden.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "Hidden files(Windows version), please check if hidden file c:/AUTOEXEC.BAT exists ",
(rFileStatus.getAttributes( ) & Attribute_Hidden)!= 0 );
}
-#endif
-
+#endif
+
CPPUNIT_TEST_SUITE( getAttributes );
- CPPUNIT_TEST( getAttributes_001 );
- CPPUNIT_TEST( getAttributes_002 );
- CPPUNIT_TEST( getAttributes_003 );
- CPPUNIT_TEST( getAttributes_004 );
+ CPPUNIT_TEST( getAttributes_001 );
+ CPPUNIT_TEST( getAttributes_002 );
+ CPPUNIT_TEST( getAttributes_003 );
+ CPPUNIT_TEST( getAttributes_004 );
CPPUNIT_TEST_SUITE_END( );
};// class getAttributes
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline TimeValue getAccessTime() const
//---------------------------------------------------------------------
class getAccessTime : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -3471,7 +3471,7 @@ namespace osl_FileStatus
createTestFile( aTypeURL );
nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
}
void tearDown( )
@@ -3481,23 +3481,23 @@ namespace osl_FileStatus
// test code.
void getAccessTime_001( )
- {
+ {
TimeValue *pTV_current = NULL;
CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
TimeValue *pTV_access = NULL;
CPPUNIT_ASSERT( ( pTV_access = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
-
- ::osl::FileStatus rFileStatus( FileStatusMask_AccessTime );
+
+ ::osl::FileStatus rFileStatus( FileStatusMask_AccessTime );
nError = rItem.getFileStatus( rFileStatus );
sal_Bool bOk = osl_getSystemTime( pTV_current );
CPPUNIT_ASSERT( sal_True == bOk && nError == FileBase::E_None );
-
+
*pTV_access = rFileStatus.getAccessTime( );
-
- sal_Bool bOK = t_compareTime( pTV_access, pTV_current, delta );
+
+ sal_Bool bOK = t_compareTime( pTV_access, pTV_current, delta );
free( pTV_current );
free( pTV_access );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getAccessTime function: This test turns out that UNX pricision is no more than 1 sec, don't know how to test this function, in Windows test, it lost hour min sec, only have date time. ",
sal_True == bOK );
}
@@ -3506,22 +3506,22 @@ namespace osl_FileStatus
CPPUNIT_TEST( getAccessTime_001 );
CPPUNIT_TEST_SUITE_END( );
};// class getAccessTime
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline TimeValue getModifyTime() const
//---------------------------------------------------------------------
class getModifyTime : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
-
+
// test code.
void getModifyTime_001( )
- {
+ {
TimeValue *pTV_current = NULL;
CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
@@ -3529,18 +3529,18 @@ namespace osl_FileStatus
aTypeURL = aUserDirectoryURL.copy( 0 );
concatURL( aTypeURL, aTmpName2 );
createTestFile( aTypeURL );
-
+
//get current time
sal_Bool bOk = osl_getSystemTime( pTV_current );
CPPUNIT_ASSERT( sal_True == bOk );
-
+
//get instance item and filestatus
nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
CPPUNIT_ASSERT( nError == FileBase::E_None );
- ::osl::FileStatus rFileStatus( FileStatusMask_ModifyTime );
+ ::osl::FileStatus rFileStatus( FileStatusMask_ModifyTime );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
//get modify time
TimeValue *pTV_modify = NULL;
CPPUNIT_ASSERT( ( pTV_modify = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
@@ -3550,7 +3550,7 @@ namespace osl_FileStatus
//delete file
deleteTestFile( aTypeURL );
free( pTV_current );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getModifyTime function: This test turns out that UNX pricision is no more than 1 sec, don't know how to improve this function. ",
sal_True == bOK );
}
@@ -3559,18 +3559,18 @@ namespace osl_FileStatus
CPPUNIT_TEST( getModifyTime_001 );
CPPUNIT_TEST_SUITE_END( );
};// class getModifyTime
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_uInt64 getFileSize() const
//---------------------------------------------------------------------
class getFileSize : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -3578,7 +3578,7 @@ namespace osl_FileStatus
aTypeURL = aUserDirectoryURL.copy( 0 );
concatURL( aTypeURL, aTmpName2 );
createTestFile( aTypeURL );
- nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
+ nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
CPPUNIT_ASSERT( nError == FileBase::E_None );
}
@@ -3589,32 +3589,32 @@ namespace osl_FileStatus
// test code.
void getFileSize_001( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_FileSize );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileSize );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
sal_uInt64 uFileSize = rFileStatus.getFileSize( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileSize function: empty file ",
0 == uFileSize );
}
void getFileSize_002( )
- {
+ {
::osl::File testfile( aTypeURL );
nError = testfile.open( OpenFlag_Write | OpenFlag_Read );
- CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError );
+ CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError );
nError = testfile.setSize( TEST_FILE_SIZE );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError );
-
- nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
+
+ nError = ::osl::DirectoryItem::get( aTypeURL, rItem );
CPPUNIT_ASSERT( nError == FileBase::E_None );
- ::osl::FileStatus rFileStatus( FileStatusMask_FileSize );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileSize );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
sal_uInt64 uFileSize = rFileStatus.getFileSize( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileSize function: file with size of TEST_FILE_SIZE, did not pass in (W32). ",
TEST_FILE_SIZE == uFileSize );
}
@@ -3625,15 +3625,15 @@ namespace osl_FileStatus
};// class getFileSize
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline ::rtl::OUString getFileName() const
//---------------------------------------------------------------------
class getFileName : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -3652,13 +3652,13 @@ namespace osl_FileStatus
// test code.
void getFileName_001( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
::rtl::OUString aFileName = rFileStatus.getFileName( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileName function: name compare with specify",
sal_True == compareFileName( aFileName, aTmpName2 ) );
}
@@ -3669,15 +3669,15 @@ namespace osl_FileStatus
};// class getFileName
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline ::rtl::OUString getFileURL() const
//---------------------------------------------------------------------
class getFileURL : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -3689,18 +3689,18 @@ namespace osl_FileStatus
void tearDown( )
{
- deleteTestFile( aTmpName6 );
+ deleteTestFile( aTmpName6 );
}
// test code.
void getFileURL_001( )
- {
- ::osl::FileStatus rFileStatus( FileStatusMask_FileURL );
+ {
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileURL );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError == FileBase::E_None );
-
+
::rtl::OUString aFileURL = rFileStatus.getFileURL( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileURL function: ",
sal_True == compareFileName( aFileURL, aTmpName6 ) );
}
@@ -3716,10 +3716,10 @@ namespace osl_FileStatus
//---------------------------------------------------------------------
class getLinkTargetURL : public CppUnit::TestFixture
{
- ::rtl::OUString aTypeURL;
+ ::rtl::OUString aTypeURL;
::osl::FileBase::RC nError;
::osl::DirectoryItem rItem;
-
+
public:
// test code.
// initialization
@@ -3737,12 +3737,12 @@ namespace osl_FileStatus
#if ( defined UNX ) || ( defined OS2 ) //Link file is not define in Windows
void getLinkTargetURL_001( )
- {
+ {
//create a link file;
::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys );
( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID( ) ) += ::rtl::OUString::createFromAscii("/link.file");
( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID( ) ) += ::rtl::OUString::createFromAscii("/tmpname");
-
+
rtl::OString strLinkFileName, strSrcFileName;
strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US );
strSrcFileName = OUStringToOString( aUStr_SrcFileSys, RTL_TEXTENCODING_ASCII_US );
@@ -3750,26 +3750,26 @@ namespace osl_FileStatus
sal_Int32 fd;
fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() );
CPPUNIT_ASSERT_MESSAGE( "in creating link file", fd == 0 );
-
+
//get linkTarget URL
nError = ::osl::DirectoryItem::get( aLnkURL1, rItem );
CPPUNIT_ASSERT_MESSAGE( "in getting link file item", nError == FileBase::E_None );
- ::osl::FileStatus rFileStatus( FileStatusMask_LinkTargetURL );
+ ::osl::FileStatus rFileStatus( FileStatusMask_LinkTargetURL );
nError = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT_MESSAGE( "in getting link file status", nError == FileBase::E_None );
::rtl::OUString aFileURL = rFileStatus.getLinkTargetURL( );
-
+
//remove link file
fd = remove( strLinkFileName.getStr() );
CPPUNIT_ASSERT_MESSAGE( "in deleting link file", fd == 0 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getLinkTargetURL function: Solaris version, creat a file, and a link file link to it, get its LinkTargetURL and compare",
sal_True == compareFileName( aFileURL, aTypeURL ) );
}
#else
void getLinkTargetURL_001( )
- {
+ {
CPPUNIT_ASSERT_MESSAGE( "test for getLinkTargetURL function: Windows version, not tested",
1 );
}
@@ -3779,7 +3779,7 @@ namespace osl_FileStatus
CPPUNIT_TEST( getLinkTargetURL_001 );
CPPUNIT_TEST_SUITE_END( );
};// class getLinkTargetURL
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileStatus::ctors, "osl_FileStatus" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileStatus::isValid, "osl_FileStatus" );
@@ -3801,16 +3801,16 @@ namespace osl_FileStatus
namespace osl_File
{
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// File( const ::rtl::OUString& ustrFileURL )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
{
// ::osl::FileBase::RC nError1;
-
+
public:
// initialization
- void setUp( )
+ void setUp( )
{
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
@@ -3826,9 +3826,9 @@ namespace osl_File
// test code.
void ctors_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
-
+
::osl::FileBase::RC nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
::osl::FileBase::RC nError2 = testFile.close( );
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: initialize a File and test its open and close",
@@ -3836,33 +3836,33 @@ namespace osl_File
}
void ctors_002( )
- {
+ {
::osl::File testFile( aTmpName5 );
sal_Char buffer[30] = "Test for File constructor";
sal_uInt64 nCount;
-
+
::osl::FileBase::RC nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
::osl::FileBase::RC nError2 = testFile.write( buffer, 30, nCount );
testFile.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: test relative file URL, this test show that relative file URL is also acceptable",
( ::osl::FileBase::E_None == nError1 ) && ( ::osl::FileBase::E_None == nError2 ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
- CPPUNIT_TEST( ctors_002 );
+ CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_002 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC open( sal_uInt32 uFlags )
//---------------------------------------------------------------------
class open : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2, nError3;
-
+
public:
// initialization
void setUp( )
@@ -3881,109 +3881,109 @@ namespace osl_File
// test code.
void open_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
nError2 = testFile.close( );
CPPUNIT_ASSERT_MESSAGE("close error", ::osl::FileBase::E_None == nError2 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a regular file",
::osl::FileBase::E_None == nError1 );
}
void open_002( )
- {
+ {
::osl::File testFile( aTmpName3 );
-
+
nError1 = testFile.open( OpenFlag_Read );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a directory",
( File::E_INVAL == nError1 ) || ( File::E_ACCES == nError1 ) );
}
-
+
void open_003( )
- {
+ {
::osl::File testFile( aCanURL1 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a non-exist file",
File::E_NOENT == nError1 );
}
void open_004( )
- {
+ {
::rtl::OUString aTestFile( aRootURL );
concatURL( aTestFile, aTmpName2 );
::osl::File testFile( aTestFile );
-
+
nError1 = testFile.open( OpenFlag_Create );
sal_Bool bOK = ( File::E_ACCES == nError1 );
-#if defined (WNT )
+#if defined (WNT )
bOK = sal_True; /// in Windows, you can create file in c:/ any way.
testFile.close( );
deleteTestFile( aTestFile);
#endif
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: create an illegal file",
bOK == sal_True );
}
void open_005( )
- {
+ {
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Create );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: create an exist file",
File::E_EXIST == nError1 );
}
void open_006( )
- {
+ {
::osl::File testFile( aCanURL1 );
sal_Char buffer_write[30] = "Test for File open";
sal_Char buffer_read[30];
sal_uInt64 nCount_write, nCount_read;
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write | OpenFlag_Create );
nError2 = testFile.write( buffer_write, 30, nCount_write );
::osl::FileBase::RC nError4 = testFile.setPos( Pos_Absolut, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError4 );
nError3 = testFile.read( buffer_read, 10, nCount_read );
-
+
::osl::FileBase::RC nError5 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError5 );
::osl::FileBase::RC nError6 = testFile.remove( aCanURL1 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError6 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: test for OpenFlag_Read,OpenFlag_Write and OpenFlag_Create",
- ( ::osl::FileBase::E_None == nError1 ) &&
+ ( ::osl::FileBase::E_None == nError1 ) &&
( ::osl::FileBase::E_None == nError2 ) &&
( ::osl::FileBase::E_None == nError3 ) &&
( 30 == nCount_write ) &&
( 10 == nCount_read ) );
}
-
+
CPPUNIT_TEST_SUITE( open );
- CPPUNIT_TEST( open_001 );
- CPPUNIT_TEST( open_002 );
- CPPUNIT_TEST( open_003 );
- CPPUNIT_TEST( open_004 );
- CPPUNIT_TEST( open_005 );
- CPPUNIT_TEST( open_006 );
+ CPPUNIT_TEST( open_001 );
+ CPPUNIT_TEST( open_002 );
+ CPPUNIT_TEST( open_003 );
+ CPPUNIT_TEST( open_004 );
+ CPPUNIT_TEST( open_005 );
+ CPPUNIT_TEST( open_006 );
CPPUNIT_TEST_SUITE_END( );
};// class open
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC close()
//---------------------------------------------------------------------
class close : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2, nError3;
-
+
public:
// initialization
void setUp( )
@@ -4002,50 +4002,50 @@ namespace osl_File
// test code.
void close_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError2 = testFile.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for close function: close a regular file",
::osl::FileBase::E_None == nError2 );
}
-
+
void close_002( )
- {
+ {
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError2 = testFile.close( );
-
+
nError3 = testFile.setPos( Pos_Absolut, 0 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for close function: manipulate a file after it has been closed",
( ::osl::FileBase::E_None == nError2 ) &&
( ::osl::FileBase::E_None != nError3 ) );
}
-
+
CPPUNIT_TEST_SUITE( close );
- CPPUNIT_TEST( close_001 );
- CPPUNIT_TEST( close_002 );
+ CPPUNIT_TEST( close_001 );
+ CPPUNIT_TEST( close_002 );
CPPUNIT_TEST_SUITE_END( );
};// class close
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC setPos( sal_uInt32 uHow, sal_Int64 uPos )
//---------------------------------------------------------------------
class setPos : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4053,10 +4053,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4074,10 +4074,10 @@ namespace osl_File
// test code.
void setPos_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_Char buffer_read[2];
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.setPos( Pos_Absolut, 26 );
@@ -4086,16 +4086,16 @@ namespace osl_File
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_Absolut, set the position to 26, test if the 26th char in file is correct",
buffer_read[0] == pBuffer_Char[26] );
}
-
+
void setPos_002( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_Char buffer_read[2];
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.setPos( Pos_Absolut, sizeof( pBuffer_Char ) - 2 );
@@ -4106,49 +4106,49 @@ namespace osl_File
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_Current, set the position to end, test if the ( end -1 ) char in file is correct",
buffer_read[0] == pBuffer_Char[sizeof( pBuffer_Char ) - 2] );
}
-
+
void setPos_003( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_Char buffer_read[2];
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
//the file size is smaller than 100
nError1 = testFile.setPos( Pos_End, -100 );
CPPUNIT_ASSERT_MESSAGE( "should return error", ::osl::FileBase::E_INVAL == nError1 );
-
+
nError1 = testFile.setPos( Pos_End, -53 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.read( buffer_read, 1, nCount_read );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_End, set the position to end, test if the first char in file is correct",
buffer_read[0] == pBuffer_Char[0] );
}
-
+
CPPUNIT_TEST_SUITE( setPos );
- CPPUNIT_TEST( setPos_001 );
- CPPUNIT_TEST( setPos_002 );
- CPPUNIT_TEST( setPos_003 );
+ CPPUNIT_TEST( setPos_001 );
+ CPPUNIT_TEST( setPos_002 );
+ CPPUNIT_TEST( setPos_003 );
CPPUNIT_TEST_SUITE_END( );
};// class setPos
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC getPos( sal_uInt64& uPos )
//---------------------------------------------------------------------
class getPos : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4156,10 +4156,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4177,43 +4177,43 @@ namespace osl_File
// test code.
void getPos_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_uInt64 nFilePointer;
-
+
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_INVAL == nError1 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.setPos( Pos_Absolut, 26 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getPos function: set the position to 26, get position and check if it is right",
26 == nFilePointer );
}
-
+
CPPUNIT_TEST_SUITE( getPos );
- CPPUNIT_TEST( getPos_001 );
+ CPPUNIT_TEST( getPos_001 );
CPPUNIT_TEST_SUITE_END( );
};// class getPos
-
-
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC isEndOfFile( sal_Bool *pIsEOF )
//---------------------------------------------------------------------
class isEndOfFile : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4221,10 +4221,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4242,37 +4242,37 @@ namespace osl_File
// test code.
void isEndOfFile_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_Bool bEOF = sal_False;
sal_Bool *pEOF = &bEOF;
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.setPos( Pos_End, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.isEndOfFile( pEOF );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isEndOfFile function: set the position to end, check if reach end",
sal_True == *pEOF );
}
-
+
void isEndOfFile_002( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_Bool bEOF = sal_False;
sal_Bool *pEOF = &bEOF;
sal_uInt64 nFilePointer = 0;
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.setPos( Pos_Absolut, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
*pEOF = sal_False;
@@ -4282,32 +4282,32 @@ namespace osl_File
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.setPos( Pos_Current, 1 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
- }
+ }
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isEndOfFile function: use isEndOfFile to move pointer step by step",
sizeof( pBuffer_Char ) + 1 == nFilePointer );
}
CPPUNIT_TEST_SUITE( isEndOfFile );
- CPPUNIT_TEST( isEndOfFile_001 );
- CPPUNIT_TEST( isEndOfFile_002 );
+ CPPUNIT_TEST( isEndOfFile_001 );
+ CPPUNIT_TEST( isEndOfFile_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class isEndOfFile
-
-
+ };// class isEndOfFile
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC setSize( sal_uInt64 uSize )
//---------------------------------------------------------------------
class setSize : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4315,10 +4315,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4336,105 +4336,105 @@ namespace osl_File
// test code.
void setSize_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
// sal_Bool bEOF = sal_False;
// sal_Bool *pEOF = &bEOF;
sal_uInt64 nFilePointer;
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//enlarge the file to size of 100;
nError1 = testFile.setSize( 100 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//get the file size;
nError1 = testFile.setPos( Pos_End, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setSize function: enlarge the file ",
100 == nFilePointer );
}
-
+
void setSize_002( )
- {
+ {
::osl::File testFile( aTmpName4 );
// sal_Bool bEOF = sal_False;
// sal_Bool *pEOF = &bEOF;
sal_uInt64 nFilePointer;
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//enlarge the file to size of 100;
nError1 = testFile.setSize( 10 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//get the file size;
nError1 = testFile.setPos( Pos_End, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setSize function: truncate the file ",
10 == nFilePointer );
}
/* void setSize_003( )
- {
+ {
::osl::File testFile( aTmpName4 );
// sal_Bool bEOF = sal_False;
// sal_Bool *pEOF = &bEOF;
sal_uInt64 nFilePointer;
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//enlarge the file to size of 100;
nError1 = testFile.setSize( 10 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//get the file size;
nError1 = testFile.setPos( Pos_End, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setSize function: truncate the file ",
10 == nFilePointer );
}
*/
-
+
CPPUNIT_TEST_SUITE( setSize );
- CPPUNIT_TEST( setSize_001 );
- CPPUNIT_TEST( setSize_002 );
+ CPPUNIT_TEST( setSize_001 );
+ CPPUNIT_TEST( setSize_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class setSize
-
-
+ };// class setSize
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC read( void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64& rBytesRead )
//---------------------------------------------------------------------
class read : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4442,10 +4442,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4463,66 +4463,66 @@ namespace osl_File
// test code.
void read_001( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_uInt64 nFilePointer;
sal_Char buffer_read[10];
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.read( buffer_read, 10, nCount_read );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for read function: read whole content in the file to a buffer",
( 10 == nFilePointer ) && ( 0 == strncmp( buffer_read, pBuffer_Char, 10 ) ) );
}
-
+
void read_002( )
- {
+ {
::osl::File testFile( aTmpName4 );
sal_uInt64 nFilePointer;
sal_Char buffer_read[26];
-
-
+
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.setPos( Pos_Absolut, 26 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.read( buffer_read, 26, nCount_read );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for read function: read from a special positon in the file",
( 52 == nFilePointer ) && ( 26 == nCount_read ) && ( 0 == strncmp( buffer_read, &pBuffer_Char[26], 26 ) ) );
}
-
+
CPPUNIT_TEST_SUITE( read );
- CPPUNIT_TEST( read_001 );
- CPPUNIT_TEST( read_002 );
+ CPPUNIT_TEST( read_001 );
+ CPPUNIT_TEST( read_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class read
-
+ };// class read
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten)
//---------------------------------------------------------------------
class write : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4539,15 +4539,15 @@ namespace osl_File
// test code.
void write_001( )
- {
+ {
::osl::File testFile( aTmpName6 );
sal_uInt64 nFilePointer;
sal_Char buffer_read[10];
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
- //write chars into the file.
+
+ //write chars into the file.
nError1 = testFile.write( pBuffer_Char, 10, nCount_write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
//get the current pointer;
@@ -4558,54 +4558,54 @@ namespace osl_File
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.read( buffer_read, 10, nCount_read );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for write function: read whole content in the file to a buffer. Note, buffer size can not smaller than the read size",
( 10 == nFilePointer ) &&
( 0 == strncmp( buffer_read, pBuffer_Char, 10 ) ) &&
( 10 == nCount_write ) );
}
-
+
CPPUNIT_TEST_SUITE( write );
- CPPUNIT_TEST( write_001 );
+ CPPUNIT_TEST( write_001 );
CPPUNIT_TEST_SUITE_END( );
- };// class write
-
+ };// class write
+
//---------------------------------------------------------------------
- // testing the method
- // inline RC readLine( ::rtl::ByteSequence& aSeq )
+ // testing the method
+ // inline RC readLine( ::rtl::ByteSequence& aSeq )
//---------------------------------------------------------------------
class readLine : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
::rtl::ByteSequence aSequence;
-
+
public:
// initialization
void setUp( )
{
// create a tempfile in $TEMP/tmpname.
createTestFile( aTmpName6 );
-
- //write some strings into the file.
+
+ //write some strings into the file.
::osl::File testFile( aTmpName6 );
sal_Char ppStrSeq[3][27] = { "abcde\n",
"1234567890\n",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
};
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
for ( int nCount = 0; nCount < 3; nCount++ )
{
nError1 = testFile.write( ppStrSeq[nCount], strlen( ppStrSeq[nCount] ), nCount_write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
}
-
+
nError1 = testFile.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
}
@@ -4618,25 +4618,25 @@ namespace osl_File
// test code.
void readLine_001( )
- {
+ {
::osl::File testFile( aTmpName6 );
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.readLine( aSequence );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for readLine function: read the first line of the file.",
( ::osl::FileBase::E_None == nError1 ) &&
( 0 == strncmp( ( const char * )aSequence.getArray( ), pBuffer_Char, 5 ) ) );
}
-
+
void readLine_002( )
- {
+ {
::osl::File testFile( aTmpName6 );
sal_Bool bEOF = sal_False;
sal_Bool *pEOF = &bEOF;
-
+
nError1 = testFile.open( OpenFlag_Read | OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
for ( int nCount = 0; nCount < 3; nCount++ )
@@ -4652,20 +4652,20 @@ namespace osl_File
( 0 == strncmp( ( const char * )aSequence.getArray( ), &pBuffer_Char[26], 26 ) ) );
}
CPPUNIT_TEST_SUITE( readLine );
- CPPUNIT_TEST( readLine_001 );
- CPPUNIT_TEST( readLine_002 );
+ CPPUNIT_TEST( readLine_001 );
+ CPPUNIT_TEST( readLine_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class readLine
-
+ };// class readLine
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC copy( const ::rtl::OUString& ustrSourceFileURL, const ::rtl::OUString& ustrDestFileURL )
//---------------------------------------------------------------------
class copy : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4673,10 +4673,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4694,55 +4694,55 @@ namespace osl_File
// test code.
void copy_001( )
- {
+ {
::osl::File testFile( aTmpName6 );
-
+
//copy $TEMP/tmpdir/tmpname to $TEMP/tmpname.
nError1 = ::osl::File::copy( aTmpName4, aTmpName6 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
//check
nError1 = testFile.open( OpenFlag_Create );
deleteTestFile( aTmpName6 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy function: copy file to upper directory",
::osl::FileBase::E_EXIST == nError1 );
}
-
+
void copy_002( )
- {
+ {
//copy $TEMP/tmpdir/tmpname to $TEMP/tmpdir.
nError1 = ::osl::File::copy( aTmpName4, aTmpName3 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy function: use directory as destination",
( ::osl::FileBase::E_ISDIR == nError1 ) ||( ::osl::FileBase::E_ACCES == nError1 ) );
}
-
+
void copy_003( )
- {
+ {
//copy $TEMP/tmpdir/tmpname to $ROOT/tmpname.
nError1 = ::osl::File::copy( aTmpName4, aTmpName7 );
-#if defined (WNT )
- nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
+#if defined (WNT )
+ nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
deleteTestFile( aTmpName7);
#endif
CPPUNIT_ASSERT_MESSAGE( "test for copy function: copy to an illigal place",
::osl::FileBase::E_ACCES == nError1 );
}
-
+
void copy_004( )
- {
+ {
//copy $TEMP/tmpname to $TEMP/tmpdir/tmpname.
nError1 = ::osl::File::copy( aTmpName6, aTmpName4 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy function: copy a not exist file",
::osl::FileBase::E_NOENT == nError1 );
}
-
+
void copy_005( )
- {
+ {
//copy $TEMP/tmpname to $TEMP/system.path using system path.
nError1 = ::osl::File::copy( aTmpName6, aSysPath1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy function: copy a file using system file path",
::osl::FileBase::E_INVAL == nError1 );
}
@@ -4757,7 +4757,7 @@ namespace osl_File
//copy to new path
nError1 = ::osl::File::copy( aTmpName6, aTmpName4 );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
-
+
//check if is the new file
File newFile( aTmpName4 );
newFile.open( OpenFlag_Write | OpenFlag_Read );
@@ -4768,38 +4768,38 @@ namespace osl_File
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
newFile.close( );
deleteTestFile( aTmpName6 );
- CPPUNIT_ASSERT_MESSAGE( "test for copy function: the dest file exist",
+ CPPUNIT_ASSERT_MESSAGE( "test for copy function: the dest file exist",
nFilePointer == 200 );
}
//copyLink has not been impletmented yet
void copy_007( )
{
#if ( defined UNX )
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy function: source file is link file",
::osl::FileBase::E_INVAL == nError1 );
#endif
}
-
+
CPPUNIT_TEST_SUITE( copy );
- CPPUNIT_TEST( copy_001 );
- CPPUNIT_TEST( copy_002 );
- CPPUNIT_TEST( copy_003 );
- CPPUNIT_TEST( copy_004 );
- CPPUNIT_TEST( copy_005 );
+ CPPUNIT_TEST( copy_001 );
+ CPPUNIT_TEST( copy_002 );
+ CPPUNIT_TEST( copy_003 );
+ CPPUNIT_TEST( copy_004 );
+ CPPUNIT_TEST( copy_005 );
CPPUNIT_TEST( copy_006 );
CPPUNIT_TEST_SUITE_END( );
- };// class copy
-
+ };// class copy
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC move( const ::rtl::OUString& ustrSourceFileURL, const ::rtl::OUString& ustrDestFileURL )
//---------------------------------------------------------------------
class move : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4807,10 +4807,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4828,7 +4828,7 @@ namespace osl_File
// test code.
void move_001( )
- {
+ {
//rename $TEMP/tmpdir/tmpname to $TEMP/canonical.name.
nError1 = ::osl::File::move( aTmpName4, aCanURL1 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -4840,56 +4840,56 @@ namespace osl_File
CPPUNIT_ASSERT_MESSAGE( "test for move function: rename file to another directory",
::osl::FileBase::E_EXIST == nError2 );
}
-
+
void move_002( )
- {
+ {
//move $TEMP/tmpdir/tmpname to $TEMP/tmpdir.
nError1 = ::osl::File::move( aTmpName4, aTmpName3 );
//returned ::osl::FileBase::E_ACCES on WNT
CPPUNIT_ASSERT_MESSAGE( "test for move function: use directory as destination",
( ::osl::FileBase::E_ACCES == nError1 || ::osl::FileBase::E_ISDIR == nError1 ) ||( ::osl::FileBase::E_EXIST == nError1 ) );
}
-
+
void move_003( )
- {
+ {
//move $TEMP/tmpdir/tmpname to $ROOT/tmpname.
nError1 = ::osl::File::move( aTmpName4, aTmpName7 );
-#if defined (WNT )
- nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
+#if defined (WNT )
+ nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
deleteTestFile( aTmpName7);
#endif
-
+
CPPUNIT_ASSERT_MESSAGE( "test for move function: move to an illigal place",
::osl::FileBase::E_ACCES == nError1 );
}
-
+
void move_004( )
- {
+ {
//move $TEMP/tmpname to $TEMP/tmpdir/tmpname.
nError1 = ::osl::File::move( aTmpName6, aTmpName4 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for move function: move a not exist file",
::osl::FileBase::E_NOENT == nError1 );
}
-
+
void move_005( )
- {
+ {
//move $TEMP/tmpname to $TEMP/system.path using system path.
nError1 = ::osl::File::move( aTmpName6, aSysPath1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for move function: move a file using system file",
::osl::FileBase::E_INVAL == nError1 );
}
-
+
void move_006( )
- {
+ {
//move directory $TEMP/tmpname to $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName6 );
nError1 = ::osl::File::move( aTmpName6, aTmpName4 );
//move file $TEMP/tmpdir/tmpname to $TEMP/tmpname
nError2 = ::osl::File::move( aTmpName4, aTmpName6 );
deleteTestDirectory( aTmpName6 );
-#if defined ( WNT )
+#if defined ( WNT )
deleteTestDirectory( aTmpName4 );// in Windows, it can be moved!!!!! this is only for not influence the following test.
deleteTestFile( aTmpName6 );
nError1 = ::osl::FileBase::E_NOTDIR;
@@ -4898,9 +4898,9 @@ namespace osl_File
CPPUNIT_ASSERT_MESSAGE( "test for move function: move a directory to an exist file with same name, did not pass in (W32)",
::osl::FileBase::E_NOTDIR == nError1 && ::osl::FileBase::E_ISDIR == nError2 );
}
-
+
void move_007( )
- {
+ {
//create directory $TEMP/tmpname.
createTestDirectory( aTmpName6 );
//move directory $TEMP/tmpdir to $TEMP/tmpname/tmpdir
@@ -4909,9 +4909,9 @@ namespace osl_File
nError2 = ::osl::Directory::create( aTmpName8 );
::osl::File::move( aTmpName8, aTmpName3 );
deleteTestDirectory( aTmpName6 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for move function: move a directory to an exist file with same name",
- (::osl::FileBase::E_None == nError1 ) &&
+ (::osl::FileBase::E_None == nError1 ) &&
(::osl::FileBase::E_EXIST == nError2 ) );
}
// oldpath and newpath are not on the same filesystem.EXDEV,no such error no on Solaris, only on linux
@@ -4921,7 +4921,7 @@ namespace osl_File
::osl::FileBase::E_None == nError1 );
}
//bugid# 115420, after the bug fix, add the case
- void move_009( )
+ void move_009( )
{
//create directory $TEMP/tmpname.
createTestDirectory( aTmpName6 );
@@ -4938,30 +4938,30 @@ namespace osl_File
CPPUNIT_ASSERT_MESSAGE( "test for move function: move a directory to it's subdirectory",
::osl::FileBase::E_None != nError1 );
}
-
+
CPPUNIT_TEST_SUITE( move );
- CPPUNIT_TEST( move_001 );
- CPPUNIT_TEST( move_002 );
- CPPUNIT_TEST( move_003 );
- CPPUNIT_TEST( move_004 );
- CPPUNIT_TEST( move_005 );
- CPPUNIT_TEST( move_006 );
- CPPUNIT_TEST( move_007 );
- // CPPUNIT_TEST( move_008 );
- //CPPUNIT_TEST( move_009 );
+ CPPUNIT_TEST( move_001 );
+ CPPUNIT_TEST( move_002 );
+ CPPUNIT_TEST( move_003 );
+ CPPUNIT_TEST( move_004 );
+ CPPUNIT_TEST( move_005 );
+ CPPUNIT_TEST( move_006 );
+ CPPUNIT_TEST( move_007 );
+ // CPPUNIT_TEST( move_008 );
+ //CPPUNIT_TEST( move_009 );
CPPUNIT_TEST_SUITE_END( );
- };// class move
-
-
+ };// class move
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC remove( const ::rtl::OUString& ustrFileURL )
//---------------------------------------------------------------------
class remove : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
sal_uInt64 nCount_write, nCount_read;
-
+
public:
// initialization
void setUp( )
@@ -4969,10 +4969,10 @@ namespace osl_File
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
-
- //write chars into the file.
+
+ //write chars into the file.
::osl::File testFile( aTmpName4 );
-
+
nError1 = testFile.open( OpenFlag_Write );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.write( pBuffer_Char, sizeof( pBuffer_Char ), nCount_write );
@@ -4990,7 +4990,7 @@ namespace osl_File
// test code.
void remove_001( )
- {
+ {
//remove $TEMP/tmpdir/tmpname.
nError1 = ::osl::File::remove( aTmpName4 );
//check
@@ -5001,52 +5001,52 @@ namespace osl_File
( ::osl::FileBase::E_None == nError1 ) &&
( ::osl::FileBase::E_EXIST != nError2 ) );
}
-
+
void remove_002( )
- {
+ {
//remove $TEMP/tmpname.
nError1 = ::osl::File::remove( aTmpName6 );
CPPUNIT_ASSERT_MESSAGE( "test for remove function: remove a file not exist",
( ::osl::FileBase::E_NOENT == nError1 ) );
}
-
+
void remove_003( )
- {
+ {
//remove $TEMP/system/path.
nError1 = ::osl::File::remove( aSysPath2 );
CPPUNIT_ASSERT_MESSAGE( "test for remove function: removing a file not using full qualified URL",
( ::osl::FileBase::E_INVAL == nError1 ) );
}
-
+
void remove_004( )
- {
+ {
//remove $TEMP/tmpdir.
nError1 = ::osl::File::remove( aTmpName3 );
CPPUNIT_ASSERT_MESSAGE( "test for remove function: remove a directory",
( ::osl::FileBase::E_ISDIR == nError1 ) || ( ::osl::FileBase::E_ACCES == nError1 ));
}
-
+
CPPUNIT_TEST_SUITE( remove );
- CPPUNIT_TEST( remove_001 );
- CPPUNIT_TEST( remove_002 );
- CPPUNIT_TEST( remove_003 );
- CPPUNIT_TEST( remove_004 );
+ CPPUNIT_TEST( remove_001 );
+ CPPUNIT_TEST( remove_002 );
+ CPPUNIT_TEST( remove_003 );
+ CPPUNIT_TEST( remove_004 );
CPPUNIT_TEST_SUITE_END( );
- };// class remove
-
-
+ };// class remove
+
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC setAttributes( const ::rtl::OUString& ustrFileURL, sal_uInt64 uAttributes )
//---------------------------------------------------------------------
class setAttributes : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem, rItem_hidden;
-
+
public:
// initialization
void setUp( )
@@ -5063,7 +5063,7 @@ namespace osl_File
// test code.
void setAttributes_001( )
- {
+ {
//on windows, only can set 2 attributes: Attribute_ReadOnly, Attribute_HIDDEN
#ifdef UNX
//set the file to readonly
@@ -5072,21 +5072,21 @@ namespace osl_File
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( nError1 == FileBase::E_None);
//get the file attributes
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
CPPUNIT_ASSERT_MESSAGE( "test for setAttributes function: set file attributes and get it to verify.",
( Attribute_ReadOnly | Attribute_GrpRead | Attribute_OwnRead | Attribute_OthRead ) ==
rFileStatus.getAttributes( ) );
-#else
+#else
//please see GetFileAttributes
nError2 = ::osl::File::setAttributes( aTmpName6, Attribute_ReadOnly );
CPPUNIT_ASSERT( nError2 == FileBase::E_None);
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( nError1 == FileBase::E_None);
//get the file attributes
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
//here the file has 2 Attributes: FILE_ATTRIBUTE_READONLY and FILE_ATTRIBUTE_NORMAL,
@@ -5099,11 +5099,11 @@ namespace osl_File
t_print("has readonly attribute");
*/
CPPUNIT_ASSERT_MESSAGE( "test for setAttributes function: set file attributes READONLY and get it to verify.",
- (Attribute_ReadOnly & rFileStatus.getAttributes( )) != 0 );
+ (Attribute_ReadOnly & rFileStatus.getAttributes( )) != 0 );
#endif
}
void setAttributes_002( )
- {
+ {
//on UNX, can not set hidden attribute to file, rename file can set the attribute
#ifdef WNT
//set the file to hidden
@@ -5113,7 +5113,7 @@ namespace osl_File
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( nError1 == FileBase::E_None);
//get the file attributes
- ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
+ ::osl::FileStatus rFileStatus( FileStatusMask_Attributes );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
@@ -5121,18 +5121,18 @@ namespace osl_File
(Attribute_Hidden & rFileStatus.getAttributes( )) != 0 );
#endif
}
-
+
CPPUNIT_TEST_SUITE( setAttributes );
- CPPUNIT_TEST( setAttributes_001 );
- CPPUNIT_TEST( setAttributes_002 );
+ CPPUNIT_TEST( setAttributes_001 );
+ CPPUNIT_TEST( setAttributes_002 );
CPPUNIT_TEST_SUITE_END( );
- };// class setAttributes
-
-
+ };// class setAttributes
+
+
//---------------------------------------------------------------------
- // testing the method
- // inline static RC setTime(
- // const ::rtl::OUString& ustrFileURL,
+ // testing the method
+ // inline static RC setTime(
+ // const ::rtl::OUString& ustrFileURL,
// const TimeValue& rCreationTime,
// const TimeValue& rLastAccessTime,
// const TimeValue& rLastWriteTime )
@@ -5141,7 +5141,7 @@ namespace osl_File
{
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -5158,7 +5158,7 @@ namespace osl_File
// test code.
void setTime_001( )
- {
+ {
TimeValue *pTV_current = NULL;
CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
TimeValue *pTV_creation = NULL;
@@ -5167,7 +5167,7 @@ namespace osl_File
CPPUNIT_ASSERT( ( pTV_access = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
TimeValue *pTV_modify = NULL;
CPPUNIT_ASSERT( ( pTV_modify = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
-
+
//get current time
sal_Bool bOk = osl_getSystemTime( pTV_current );
CPPUNIT_ASSERT( sal_True == bOk );
@@ -5175,31 +5175,31 @@ namespace osl_File
//set the file time
nError2 = ::osl::File::setTime( aTmpName6, *pTV_current, *pTV_current, *pTV_current );
CPPUNIT_ASSERT_MESSAGE( errorToStr( nError2 ), nError2 == FileBase::E_None);
-
+
//get the file access time, creation time, modify time
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT_MESSAGE( errorToStr( nError1 ), nError1 == FileBase::E_None);
-
- ::osl::FileStatus rFileStatus( FileStatusMask_AccessTime );
+
+ ::osl::FileStatus rFileStatus( FileStatusMask_AccessTime );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT_MESSAGE( errorToStr( nError1 ),nError1 == FileBase::E_None );
*pTV_access = rFileStatus.getAccessTime( );
-
- ::osl::FileStatus rFileStatus1( FileStatusMask_CreationTime );
+
+ ::osl::FileStatus rFileStatus1( FileStatusMask_CreationTime );
nError1 = rItem.getFileStatus( rFileStatus1 );
CPPUNIT_ASSERT_MESSAGE( errorToStr( nError1 ), nError1 == FileBase::E_None );
*pTV_creation = rFileStatus1.getCreationTime( );
-
- ::osl::FileStatus rFileStatus2( FileStatusMask_ModifyTime );
+
+ ::osl::FileStatus rFileStatus2( FileStatusMask_ModifyTime );
nError1 = rItem.getFileStatus( rFileStatus2 );
CPPUNIT_ASSERT_MESSAGE( errorToStr( nError1 ), nError1 == FileBase::E_None );
*pTV_modify = rFileStatus2.getModifyTime( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for setTime function: set access time then get it. time precision is still a problem for it cut off the nanosec.",
- sal_True == t_compareTime( pTV_access, pTV_current, delta ) );
-#if defined ( WNT )
- //Unfortunately there is no way to get the creation time of a file under Unix (its a Windows only feature).
- //That means the flag osl_FileStatus_Mask_CreationTime should be deprecated under Unix.
+ sal_True == t_compareTime( pTV_access, pTV_current, delta ) );
+#if defined ( WNT )
+ //Unfortunately there is no way to get the creation time of a file under Unix (its a Windows only feature).
+ //That means the flag osl_FileStatus_Mask_CreationTime should be deprecated under Unix.
CPPUNIT_ASSERT_MESSAGE( "test for setTime function: set creation time then get it. ",
sal_True == t_compareTime( pTV_creation, pTV_current, delta ) ) ;
#endif
@@ -5210,28 +5210,28 @@ namespace osl_File
free( pTV_access );
free( pTV_modify );
}
-
+
CPPUNIT_TEST_SUITE( setTime );
- CPPUNIT_TEST( setTime_001 );
+ CPPUNIT_TEST( setTime_001 );
CPPUNIT_TEST_SUITE_END( );
};// class setTime
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC sync()
//---------------------------------------------------------------------
class sync : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
{
// create a tempfile in $TEMP/tmpdir/tmpname.
createTestFile( aTmpName6 );
-
+
}
void tearDown( )
@@ -5242,41 +5242,41 @@ namespace osl_File
// test case: if The file is located on a read only file system.
void sync_001( )
- {
+ {
#ifdef UNX
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( nError1 == FileBase::E_None);
-
+
File tmp_file( aTmpName6 );
FileBase::RC err = tmp_file.open(osl_File_OpenFlag_Write );
-
+
CPPUNIT_ASSERT_MESSAGE("File open failed", err == FileBase::E_None);
-
+
char buffer[50000];
sal_uInt64 written = 0;
nError1 = tmp_file.write((void*)buffer, sizeof(buffer), written);
CPPUNIT_ASSERT_MESSAGE("write failed!", nError1 == FileBase::E_None);
-
+
//set the file to readonly
nError2 = ::osl::File::setAttributes( aTmpName6, Attribute_ReadOnly | Attribute_GrpRead | Attribute_OwnRead | Attribute_OthRead );
CPPUNIT_ASSERT( nError2 == FileBase::E_None);
nError2 = tmp_file.sync();
-
+
CPPUNIT_ASSERT_MESSAGE("can not sync to readonly file!", nError2 == FileBase::E_None);
-
- tmp_file.close();
-#endif
+
+ tmp_file.close();
+#endif
}
//test case:no enough space, how to create such case???see test_cpy_wrt_file.cxx::test_osl_writeFile
-
-
-
+
+
+
CPPUNIT_TEST_SUITE( sync );
- CPPUNIT_TEST( sync_001 );
+ CPPUNIT_TEST( sync_001 );
CPPUNIT_TEST_SUITE_END( );
};// class setTime
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_File::ctors, "osl_File" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_File::open, "osl_File" );
@@ -5296,7 +5296,7 @@ namespace osl_File
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_File::sync, "osl_File" );
}// namespace osl_File
-
+
//------------------------------------------------------------------------
// Beginning of the test cases for DirectoryItem class
@@ -5304,13 +5304,13 @@ namespace osl_File
namespace osl_DirectoryItem
{
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// DirectoryItem(): _pData( NULL )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5327,31 +5327,31 @@ namespace osl_DirectoryItem
// test code.
void ctors_001( )
- {
+ {
::osl::File testFile( aTmpName6 );
::osl::DirectoryItem rItem; //constructor
-
+
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: initialize a new instance of DirectoryItem and get an item to check.",
::osl::FileBase::E_None == nError1 );
}
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// DirectoryItem( const DirectoryItem& rItem ): _pData( rItem._pData)
//---------------------------------------------------------------------
class copy_assin_Ctors : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5368,52 +5368,52 @@ namespace osl_DirectoryItem
// test code.
void copy_assin_Ctors_001( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( FileBase::E_None == nError1 );
-
+
::osl::DirectoryItem copyItem( rItem ); //copy constructor
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError1 = copyItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy_assin_Ctors function: use copy constructor to get an item and check filename.",
( sal_True == compareFileName( rFileStatus.getFileName( ), aTmpName2 ) ) );
}
void copy_assin_Ctors_002( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( FileBase::E_None == nError1 );
-
- ::osl::DirectoryItem copyItem;
+
+ ::osl::DirectoryItem copyItem;
copyItem = rItem; //assinment operator
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError1 = copyItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for copy_assin_Ctors function: test assinment operator here since it is same as copy constructor in test way.",
( sal_True == compareFileName( rFileStatus.getFileName( ), aTmpName2 ) ) );
}
CPPUNIT_TEST_SUITE( copy_assin_Ctors );
- CPPUNIT_TEST( copy_assin_Ctors_001 );
- CPPUNIT_TEST( copy_assin_Ctors_002 );
+ CPPUNIT_TEST( copy_assin_Ctors_001 );
+ CPPUNIT_TEST( copy_assin_Ctors_002 );
CPPUNIT_TEST_SUITE_END( );
};// class copy_assin_Ctors
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool is()
//---------------------------------------------------------------------
class is : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5430,38 +5430,38 @@ namespace osl_DirectoryItem
// test code.
void is_001( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
-
+
CPPUNIT_ASSERT_MESSAGE( "test for is function: use an uninitialized instance.",
!rItem.is( ) );
}
void is_002( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
CPPUNIT_ASSERT( FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for is function: use an uninitialized instance.",
( sal_True == rItem.is( ) ) );
}
CPPUNIT_TEST_SUITE( is );
- CPPUNIT_TEST( is_001 );
- CPPUNIT_TEST( is_002 );
+ CPPUNIT_TEST( is_001 );
+ CPPUNIT_TEST( is_002 );
CPPUNIT_TEST_SUITE_END( );
};// class is
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// static inline RC get( const ::rtl::OUString& ustrFileURL, DirectoryItem& rItem )
//---------------------------------------------------------------------
class get : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5478,56 +5478,56 @@ namespace osl_DirectoryItem
// test code.
void get_001( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError2 = ::osl::DirectoryItem::get( aTmpName6, rItem );
-
+
//check the file name
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError1 = rItem.getFileStatus( rFileStatus );
CPPUNIT_ASSERT( nError1 == FileBase::E_None );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for get function: use copy constructor to get an item and check filename.",
( ::osl::FileBase::E_None == nError2 ) &&
( sal_True == compareFileName( rFileStatus.getFileName( ), aTmpName2 ) ) );
}
void get_002( )
- {
- ::osl::DirectoryItem rItem;
+ {
+ ::osl::DirectoryItem rItem;
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aSysPath1, rItem );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for get function: use a system name instead of a URL.",
FileBase::E_INVAL == nError1 );
}
-
+
void get_003( )
- {
- ::osl::DirectoryItem rItem;
+ {
+ ::osl::DirectoryItem rItem;
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName3, rItem );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for get function: use a non existed file URL.",
FileBase::E_NOENT == nError1 );
}
-
+
CPPUNIT_TEST_SUITE( get );
- CPPUNIT_TEST( get_001 );
- CPPUNIT_TEST( get_002 );
- CPPUNIT_TEST( get_003 );
+ CPPUNIT_TEST( get_001 );
+ CPPUNIT_TEST( get_002 );
+ CPPUNIT_TEST( get_003 );
CPPUNIT_TEST_SUITE_END( );
};// class get
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC getFileStatus( FileStatus& rStatus )
//---------------------------------------------------------------------
class getFileStatus : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5546,68 +5546,68 @@ namespace osl_DirectoryItem
// test code.
void getFileStatus_001( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName4, rItem );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check the file name
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError2 = rItem.getFileStatus( rFileStatus );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileStatus function: get file status and check filename",
( ::osl::FileBase::E_None == nError2 ) &&
( sal_True == compareFileName( rFileStatus.getFileName( ), aTmpName2 ) ) );
}
void getFileStatus_002( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem );
-
+
//check the file name
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError2 = rItem.getFileStatus( rFileStatus );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileStatus function: file not existed",
( ::osl::FileBase::E_INVAL == nError2 ) );
}
-
+
void getFileStatus_003( )
- {
+ {
::osl::DirectoryItem rItem; //constructor
//get the DirectoryItem.
nError1 = ::osl::DirectoryItem::get( aTmpName3, rItem );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check the file name
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError2 = rItem.getFileStatus( rFileStatus );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getFileStatus function: get directory information",
( ::osl::FileBase::E_None == nError2 ) &&
( sal_True == compareFileName( rFileStatus.getFileName( ), aTmpName1 ) ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( getFileStatus );
- CPPUNIT_TEST( getFileStatus_001 );
- CPPUNIT_TEST( getFileStatus_002 );
- CPPUNIT_TEST( getFileStatus_003 );
+ CPPUNIT_TEST( getFileStatus_001 );
+ CPPUNIT_TEST( getFileStatus_002 );
+ CPPUNIT_TEST( getFileStatus_003 );
CPPUNIT_TEST_SUITE_END( );
- };// class getFileStatus
-
-
-
+ };// class getFileStatus
+
+
+
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::ctors, "osl_DirectoryItem" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::copy_assin_Ctors, "osl_DirectoryItem" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::is, "osl_DirectoryItem" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::get, "osl_DirectoryItem" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::getFileStatus, "osl_DirectoryItem" );
}// namespace osl_DirectoryItem
-
+
//------------------------------------------------------------------------
// Beginning of the test cases for Directory class
@@ -5615,13 +5615,13 @@ namespace osl_DirectoryItem
namespace osl_Directory
{
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// Directory( const ::rtl::OUString& strPath ): _pData( 0 ), _aPath( strPath )
//---------------------------------------------------------------------
class ctors : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5641,51 +5641,51 @@ namespace osl_Directory
// test code.
void ctors_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
//close a directory
nError2 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError2 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: create an instance and check open and close",
( ::osl::FileBase::E_None == nError1 ) &&
( ::osl::FileBase::E_None == nError2 ) );
}
void ctors_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName9 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
//close a directory
nError2 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError2 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for ctors function: relative URL, :-), it is also worked",
( ::osl::FileBase::E_None == nError1 ) &&
( ::osl::FileBase::E_None == nError2 ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
- CPPUNIT_TEST( ctors_002 );
+ CPPUNIT_TEST( ctors_001 );
+ CPPUNIT_TEST( ctors_002 );
CPPUNIT_TEST_SUITE_END( );
};// class ctors
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC open()
//---------------------------------------------------------------------
class open : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5704,16 +5704,16 @@ namespace osl_Directory
// test code.
void open_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
//check if directory is opened.
sal_Bool bOk = testDirectory.isOpen( );
//close a directory
nError2 = testDirectory.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a directory and check for open",
( sal_True == bOk ) &&
( ::osl::FileBase::E_None == nError1 ) &&
@@ -5721,9 +5721,9 @@ namespace osl_Directory
}
void open_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName6 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
if ( ::osl::FileBase::E_None == nError1 )
@@ -5731,15 +5731,15 @@ namespace osl_Directory
nError2 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError2 );
}
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a file that is not existed",
( ::osl::FileBase::E_NOENT == nError1 ) );
}
-
+
void open_003( )
- {
+ {
::osl::Directory testDirectory( aUserDirectorySys ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
if ( ::osl::FileBase::E_None == nError1 )
@@ -5747,15 +5747,15 @@ namespace osl_Directory
nError2 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError2 );
}
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: using system path",
( ::osl::FileBase::E_INVAL == nError1 ) );
}
-
+
void open_004( )
- {
+ {
::osl::Directory testDirectory( aTmpName4 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
if ( ::osl::FileBase::E_None == nError1 )
@@ -5763,27 +5763,27 @@ namespace osl_Directory
nError2 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError2 );
}
-
+
CPPUNIT_ASSERT_MESSAGE( "test for open function: open a file instead of a directory",
( ::osl::FileBase::E_NOTDIR == nError1 ) || ( ::osl::FileBase::E_ACCES ) );
}
-
+
CPPUNIT_TEST_SUITE( open );
- CPPUNIT_TEST( open_001 );
- CPPUNIT_TEST( open_002 );
- CPPUNIT_TEST( open_003 );
- CPPUNIT_TEST( open_004 );
+ CPPUNIT_TEST( open_001 );
+ CPPUNIT_TEST( open_002 );
+ CPPUNIT_TEST( open_003 );
+ CPPUNIT_TEST( open_004 );
CPPUNIT_TEST_SUITE_END( );
};// class open
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline sal_Bool isOpen() { return _pData != NULL; };
//---------------------------------------------------------------------
class isOpen : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5802,45 +5802,45 @@ namespace osl_Directory
// test code.
void isOpen_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
//check if directory is opened.
sal_Bool bOk = testDirectory.isOpen( );
//close a directory
nError2 = testDirectory.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isOpen function: open a directory and check for open",
( sal_True == bOk ) );
}
-
+
void isOpen_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//check if directory is opened.
sal_Bool bOk = testDirectory.isOpen( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isOpen function: do not open a directory and check for open",
!( sal_True == bOk ) );
}
-
+
CPPUNIT_TEST_SUITE( isOpen );
- CPPUNIT_TEST( isOpen_001 );
- CPPUNIT_TEST( isOpen_002 );
+ CPPUNIT_TEST( isOpen_001 );
+ CPPUNIT_TEST( isOpen_002 );
CPPUNIT_TEST_SUITE_END( );
};// class isOpen
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC close()
//---------------------------------------------------------------------
class close : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// initialization
void setUp( )
@@ -5857,47 +5857,47 @@ namespace osl_Directory
// test code.
void close_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
//close a directory
nError2 = testDirectory.close( );
//check if directory is opened.
sal_Bool bOk = testDirectory.isOpen( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isOpen function: close a directory and check for open",
!( sal_True == bOk ) );
}
-
+
void close_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//close a directory
nError1 = testDirectory.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isOpen function: close a not opened directory",
( ::osl::FileBase::E_BADF == nError1 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( close );
- CPPUNIT_TEST( close_001 );
- CPPUNIT_TEST( close_002 );
+ CPPUNIT_TEST( close_001 );
+ CPPUNIT_TEST( close_002 );
CPPUNIT_TEST_SUITE_END( );
};// class close
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC reset()
//---------------------------------------------------------------------
class reset : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -5922,9 +5922,9 @@ namespace osl_Directory
// test code.
void reset_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -5934,80 +5934,80 @@ namespace osl_Directory
//get second Item
//mindy: nError1 = testDirectory.getNextItem( rItem, 0 );
//mindy: CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//reset enumeration
nError2 = testDirectory.reset( );
//get reseted Item, if reset does not work, getNextItem() should return the second Item (aTmpName1)
nError1 = testDirectory.getNextItem( rItem, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check the file name
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
nError1 = rItem.getFileStatus( rFileStatus );
//close a directory
nError1 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
sal_Bool bOK1,bOK2;
bOK1 = compareFileName( rFileStatus.getFileName( ), aTmpName2 );
bOK2 = compareFileName( rFileStatus.getFileName( ), aHidURL1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for reset function: get two directory item, reset it, then get again, check the filename",
( ::osl::FileBase::E_None == nError2 ) &&
( sal_True == bOK1 || bOK2 ) );
}
-
+
void reset_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName6 ); //constructor
-
+
//close a directory
nError1 = testDirectory.reset( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for reset function: reset a non existed directory",
( ::osl::FileBase::E_NOENT == nError1 ) );
}
-
-
+
+
void reset_003( )
- {
+ {
::osl::Directory testDirectory( aTmpName4 ); //constructor
-
+
//close a directory
nError1 = testDirectory.reset( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for reset function: reset a file instead of a directory",
( ::osl::FileBase::E_NOTDIR == nError1 ) || ( ::osl::FileBase::E_NOENT == nError1 ) );
}
-
+
void reset_004( )
- {
+ {
::osl::Directory testDirectory( aUserDirectorySys ); //constructor
-
+
//close a directory
nError1 = testDirectory.reset( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for reset function: use a system path",
( ::osl::FileBase::E_INVAL == nError1 ) );
}
-
+
CPPUNIT_TEST_SUITE( reset );
- CPPUNIT_TEST( reset_001 );
- CPPUNIT_TEST( reset_002 );
- CPPUNIT_TEST( reset_003 );
- CPPUNIT_TEST( reset_004 );
+ CPPUNIT_TEST( reset_001 );
+ CPPUNIT_TEST( reset_002 );
+ CPPUNIT_TEST( reset_003 );
+ CPPUNIT_TEST( reset_004 );
CPPUNIT_TEST_SUITE_END( );
};// class reset
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline RC getNextItem( DirectoryItem& rItem, sal_uInt32 nHint = 0 )
//---------------------------------------------------------------------
class getNextItem : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
::osl::DirectoryItem rItem;
-
+
public:
// initialization
void setUp( )
@@ -6018,7 +6018,7 @@ namespace osl_Directory
createTestFile( aTmpName3, aTmpName2 );
createTestFile( aTmpName3, aTmpName1 );
createTestFile( aTmpName3, aHidURL1 );
-
+
}
void tearDown( )
@@ -6033,19 +6033,19 @@ namespace osl_Directory
// test code.
void getNextItem_001( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
//check the file name
- ::rtl::OUString strFilename;
+ ::rtl::OUString strFilename;
sal_Bool bOk1 = sal_False;
sal_Bool bOk2 = sal_False;
sal_Bool bOk3 = sal_False;
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName );
for ( int nCount = 0; nCount < 3; nCount++ )
{
//get three Items
@@ -6061,49 +6061,49 @@ namespace osl_Directory
break;
case 2: bOk3 = compareFileName( rFileStatus.getFileName( ), aHidURL1) || compareFileName( rFileStatus.getFileName( ), aTmpName2 );
}
- }
-
+ }
+
//close a directory
nError1 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getNextItem function: retrive three items and check their names.",
( sal_True == bOk1 ) && ( sal_True == bOk2 ) && ( sal_True == bOk3 ) );
}
-
+
void getNextItem_002( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
nError1 = testDirectory.getNextItem( rItem );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getNextItem function: retrive an item in a directory which is not opened, also test for nHint's default value.",
( ::osl::FileBase::E_INVAL == nError1 ) );
}
-
+
void getNextItem_003( )
- {
+ {
::osl::Directory testDirectory( aTmpName3 ); //constructor
-
+
//open a directory
nError1 = testDirectory.open( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
for ( int nCount = 0; nCount < 4; nCount++ )
{
nError2 = testDirectory.getNextItem( rItem, 3 );
}
-
+
//close a directory
nError1 = testDirectory.close( );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for getNextItem function: retrive 4 times in a directory which contain only 3 files.",
( ::osl::FileBase::E_NOENT == nError2 ) );
}
-
+
void getNextItem_004( )
- {
- //create a link file(can not on Windows), then check if getNextItem can get it.
+ {
+ //create a link file(can not on Windows), then check if getNextItem can get it.
#ifdef UNX
sal_Bool bOK = sal_False;
::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys );
@@ -6112,23 +6112,23 @@ namespace osl_Directory
rtl::OString strLinkFileName, strSrcFileName;
strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US );
strSrcFileName = OUStringToOString( aUStr_SrcFileSys, RTL_TEXTENCODING_ASCII_US );
-
+
//create a link file and link it to file "/tmp/PID/tmpdir/tmpname"
sal_Int32 fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() );
CPPUNIT_ASSERT( fd == 0 );
::osl::Directory testDirectory( aTmpName3 );
-
+
//open a directory
nError1 = testDirectory.open( );
::rtl::OUString aFileName = ::rtl::OUString::createFromAscii("link.file");
-
+
while (1) {
nError1 = testDirectory.getNextItem( rItem, 4 );
if (::osl::FileBase::E_None == nError1) {
- ::osl::FileStatus rFileStatus( FileStatusMask_FileName | FileStatusMask_Type );
+ ::osl::FileStatus rFileStatus( FileStatusMask_FileName | FileStatusMask_Type );
rItem.getFileStatus( rFileStatus );
if ( compareFileName( rFileStatus.getFileName( ), aFileName) == sal_True )
- {
+ {
if ( FileStatus::Link == rFileStatus.getFileType( ))
{
bOK = sal_True;
@@ -6138,44 +6138,44 @@ namespace osl_Directory
}
else
break;
- };
+ };
fd = std::remove( strLinkFileName.getStr() );
- CPPUNIT_ASSERT_MESSAGE( "remove link file failed", fd == 0 );
+ CPPUNIT_ASSERT_MESSAGE( "remove link file failed", fd == 0 );
CPPUNIT_ASSERT_MESSAGE( "test for getNextItem function: check if can retrieve the link file name",
( bOK == sal_True ) );
#endif
}
-
+
CPPUNIT_TEST_SUITE( getNextItem );
- CPPUNIT_TEST( getNextItem_001 );
- CPPUNIT_TEST( getNextItem_002 );
- CPPUNIT_TEST( getNextItem_003 );
- CPPUNIT_TEST( getNextItem_004 );
+ CPPUNIT_TEST( getNextItem_001 );
+ CPPUNIT_TEST( getNextItem_002 );
+ CPPUNIT_TEST( getNextItem_003 );
+ CPPUNIT_TEST( getNextItem_004 );
CPPUNIT_TEST_SUITE_END( );
};// class getNextItem
-
+
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC getVolumeInfo( const ::rtl::OUString& ustrDirectoryURL, VolumeInfo& rInfo )
//---------------------------------------------------------------------
class getVolumeInfo : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// test code.
void checkValidMask(osl::VolumeInfo const& _aVolumeInfo, sal_Int32 _nMask)
{
if (_nMask == VolumeInfoMask_FileSystemName)
- {
+ {
//get file system name
::rtl::OUString aFileSysName( aNullURL );
aFileSysName = _aVolumeInfo.getFileSystemName( );
sal_Bool bRes2 = compareFileName( aFileSysName, aNullURL );
CPPUNIT_ASSERT_MESSAGE( "test for getVolumeInfo function: getVolumeInfo of root directory.",
- ( osl::FileBase::E_None == nError1 ) &&
+ ( osl::FileBase::E_None == nError1 ) &&
( sal_False == bRes2 ) );
}
if (_nMask == VolumeInfoMask_Attributes)
@@ -6242,71 +6242,71 @@ namespace osl_Directory
checkValidMask(aVolumeInfo, _nMask);
}
}
-
-
+
+
void getVolumeInfo_001_1( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FileSystemName;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_2( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_Attributes;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_3( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_TotalSpace;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_4( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_UsedSpace;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_5( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FreeSpace;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_6( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_MaxNameLength;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_7( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_MaxPathLength;
checkVolumeInfo(mask);
}
void getVolumeInfo_001_8( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FileSystemCaseHandling;
checkVolumeInfo(mask);
}
-
+
void getVolumeInfo_002( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
//call getVolumeInfo here
// LLA: rtl::OUString aRootSysURL;
// LLA: nError1 = osl::File::getFileURLFromSystemPath(aRootSys, aRootSysURL);
- // LLA:
+ // LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE( "can't convert root path to file url",
// LLA: ( osl::FileBase::E_NONE == nError1 ) );
-
+
nError1 = ::osl::Directory::getVolumeInfo( aRootSys, aVolumeInfo );
CPPUNIT_ASSERT_MESSAGE( "test for getVolumeInfo function: use system path as parameter.",
( osl::FileBase::E_INVAL == nError1 ) );
}
-
+
void getVolumeInfo_003( )
- {
+ {
sal_Int32 mask = VolumeInfoMask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
+ ::osl::VolumeInfo aVolumeInfo( mask );
//call getVolumeInfo here
nError1 = ::osl::Directory::getVolumeInfo( aTmpName3, aVolumeInfo );
@@ -6316,105 +6316,105 @@ namespace osl_Directory
( osl::FileBase::E_NOENT == nError1 ) );
#endif
}
-
+
CPPUNIT_TEST_SUITE( getVolumeInfo );
- CPPUNIT_TEST( getVolumeInfo_001_1 );
- CPPUNIT_TEST( getVolumeInfo_001_2 );
- CPPUNIT_TEST( getVolumeInfo_001_3 );
- CPPUNIT_TEST( getVolumeInfo_001_4 );
- CPPUNIT_TEST( getVolumeInfo_001_5 );
- CPPUNIT_TEST( getVolumeInfo_001_6 );
- CPPUNIT_TEST( getVolumeInfo_001_7 );
+ CPPUNIT_TEST( getVolumeInfo_001_1 );
+ CPPUNIT_TEST( getVolumeInfo_001_2 );
+ CPPUNIT_TEST( getVolumeInfo_001_3 );
+ CPPUNIT_TEST( getVolumeInfo_001_4 );
+ CPPUNIT_TEST( getVolumeInfo_001_5 );
+ CPPUNIT_TEST( getVolumeInfo_001_6 );
+ CPPUNIT_TEST( getVolumeInfo_001_7 );
CPPUNIT_TEST( getVolumeInfo_001_8 );
- CPPUNIT_TEST( getVolumeInfo_002 );
- CPPUNIT_TEST( getVolumeInfo_003 );
+ CPPUNIT_TEST( getVolumeInfo_002 );
+ CPPUNIT_TEST( getVolumeInfo_003 );
CPPUNIT_TEST_SUITE_END( );
};// class getVolumeInfo
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC create( const ::rtl::OUString& ustrDirectoryURL )
//---------------------------------------------------------------------
class create : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// test code.
void create_001( )
- {
+ {
//create directory in $TEMP/tmpdir
nError1 = ::osl::Directory::create( aTmpName3 );
//check for existence
nError2 = ::osl::Directory::create( aTmpName3 );
- //remove it
+ //remove it
deleteTestDirectory( aTmpName3 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for create function: create a directory and check its existence.",
( osl::FileBase::E_None == nError1 ) &&
( osl::FileBase::E_EXIST== nError2 ) );
}
-
+
void create_002( )
- {
+ {
//create directory in /tmpname
nError1 = ::osl::Directory::create( aTmpName7 );
-#if defined (WNT )
+#if defined (WNT )
nError1 = osl::FileBase::E_ACCES; /// in Windows, you can create directory in c:/ any way.
deleteTestDirectory( aTmpName7 );
#endif
-
+
CPPUNIT_ASSERT_MESSAGE( "test for create function: create a directory in root for access test.",
( osl::FileBase::E_ACCES == nError1 ) );
}
-
+
void create_003( )
- {
+ {
//create directory in /tmpname
nError1 = ::osl::Directory::create( aSysPath1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for create function: create a directory using system path.",
( osl::FileBase::E_INVAL == nError1 ) );
}
-
+
CPPUNIT_TEST_SUITE( create );
- CPPUNIT_TEST( create_001 );
- CPPUNIT_TEST( create_002 );
- CPPUNIT_TEST( create_003 );
+ CPPUNIT_TEST( create_001 );
+ CPPUNIT_TEST( create_002 );
+ CPPUNIT_TEST( create_003 );
CPPUNIT_TEST_SUITE_END( );
};// class create
//---------------------------------------------------------------------
- // testing the method
+ // testing the method
// inline static RC remove( const ::rtl::OUString& ustrDirectoryURL )
//---------------------------------------------------------------------
class remove : public CppUnit::TestFixture
{
::osl::FileBase::RC nError1, nError2;
-
+
public:
// test code.
void remove_001( )
- {
+ {
//create directory in $TEMP/tmpdir
nError1 = ::osl::Directory::create( aTmpName3 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
- //remove it
+ //remove it
nError1 = ::osl::Directory::remove( aTmpName3 );
//check for existence
::osl::Directory rDirectory( aTmpName3 );
nError2 = rDirectory.open( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for remove function: remove a directory and check its existence.",
( osl::FileBase::E_None == nError1 ) &&
( osl::FileBase::E_NOENT == nError2 ) );
}
-
+
void remove_002( )
- {
+ {
//create directory in $TEMP/tmpdir
nError1 = ::osl::Directory::create( aTmpName3 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -6425,34 +6425,34 @@ namespace osl_Directory
nError2 = rDirectory.open( );
if ( osl::FileBase::E_NOENT != nError2 )
::osl::Directory::remove( aTmpName3 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for remove function: remove a directory by its system path, and check its existence.",
( osl::FileBase::E_INVAL == nError1 ) );
}
-
+
void remove_003( )
- {
+ {
//try to remove a non-existed directory
nError1 = ::osl::Directory::remove( aTmpName6 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for remove function: try to remove a non-existed directory.",
( osl::FileBase::E_NOENT == nError1 ) );
}
-
+
void remove_004( )
- {
+ {
createTestFile( aTmpName6 );
- sal_Bool bExist = ifFileExist( aTmpName6 );
+ sal_Bool bExist = ifFileExist( aTmpName6 );
//try to remove file.
nError1 = ::osl::Directory::remove( aTmpName6 );
deleteTestFile( aTmpName6 );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for remove function: try to remove a file but not directory.",
bExist == sal_True &&(( osl::FileBase::E_NOTDIR == nError1 ) || ( osl::FileBase::E_NOENT == nError1 )) );
}
-
+
void remove_005( )
- {
+ {
createTestDirectory( aTmpName3 );
createTestFile( aTmpName4 );
nError1 = ::osl::Directory::remove( aTmpName3 );
@@ -6464,24 +6464,24 @@ namespace osl_Directory
//EEXIST The directory contains entries other than those for "." and "..".
t_print("#Solaris test\n");
CPPUNIT_ASSERT_MESSAGE( suError, ( osl::FileBase::E_EXIST == nError1 ) );
-#else
+#else
CPPUNIT_ASSERT_MESSAGE( suError, ( osl::FileBase::E_NOTEMPTY == nError1 ) );
#endif
}
CPPUNIT_TEST_SUITE( remove );
- CPPUNIT_TEST( remove_001 );
- CPPUNIT_TEST( remove_002 );
- CPPUNIT_TEST( remove_003 );
- CPPUNIT_TEST( remove_004 );
- CPPUNIT_TEST( remove_005 );
+ CPPUNIT_TEST( remove_001 );
+ CPPUNIT_TEST( remove_002 );
+ CPPUNIT_TEST( remove_003 );
+ CPPUNIT_TEST( remove_004 );
+ CPPUNIT_TEST( remove_005 );
CPPUNIT_TEST_SUITE_END( );
};// class remove
//########################################
// TEST Directory::createPath
//########################################
-
+
#ifdef WNT
# define PATH_BUFFER_SIZE MAX_PATH
#else
@@ -6489,126 +6489,126 @@ namespace osl_Directory
#endif
char TEST_PATH_POSTFIX[] = "hello/world";
-
- //########################################
+
+ //########################################
OUString get_test_path()
{
OUString tmp;
FileBase::RC rc = FileBase::getTempDirURL(tmp);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "Test path creation failed",
+ "Test path creation failed",
rc == FileBase::E_None
- );
-
- OUStringBuffer b(tmp);
+ );
+
+ OUStringBuffer b(tmp);
if (tmp.lastIndexOf('/') != (tmp.getLength() - 1))
b.appendAscii("/");
-
+
b.appendAscii(TEST_PATH_POSTFIX);
-
+
return b.makeStringAndClear();
}
- //########################################
+ //########################################
void rm_test_path(const OUString& path)
{
- sal_Unicode buffer[PATH_BUFFER_SIZE];
+ sal_Unicode buffer[PATH_BUFFER_SIZE];
rtl_copyMemory(buffer, path.getStr(), (path.getLength() + 1) * sizeof(sal_Unicode));
-
+
sal_Int32 i = rtl_ustr_lastIndexOfChar(buffer, '/');
if (i == path.getLength())
- buffer[i] = 0;
-
- Directory::remove(buffer);
-
+ buffer[i] = 0;
+
+ Directory::remove(buffer);
+
i = rtl_ustr_lastIndexOfChar(buffer, '/');
buffer[i] = 0;
- Directory::remove(buffer);
+ Directory::remove(buffer);
}
-
- //########################################
+
+ //########################################
class DirCreatedObserver : public DirectoryCreationObserver
{
public:
DirCreatedObserver() : i(0)
{
}
-
+
virtual void DirectoryCreated(const rtl::OUString& /*aDirectoryUrl*/)
- {
+ {
i++;
};
-
+
int number_of_dirs_created() const
{
return i;
}
-
+
private:
int i;
};
- //########################################
+ //########################################
class createPath : public CppUnit::TestFixture
- {
+ {
public:
//##########################################
createPath()
{}
-
+
//##########################################
void with_relative_path()
{
FileBase::RC rc = Directory::createPath(
OUString::createFromAscii(TEST_PATH_POSTFIX));
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createDirectoryPath contract broken",
+ "osl_createDirectoryPath contract broken",
rc == FileBase::E_INVAL
);
}
-
+
//##########################################
void without_callback()
- {
+ {
OUString tp_url = get_test_path();
-
+
rm_test_path(tp_url);
-
+
FileBase::RC rc = Directory::createPath(tp_url);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createDirectoryPath failed",
+ "osl_createDirectoryPath failed",
rc == FileBase::E_None
- );
+ );
}
-
+
//##########################################
void with_callback()
{
OUString tp_url = get_test_path();
-
+
rm_test_path(tp_url);
-
+
DirCreatedObserver* observer = new DirCreatedObserver;
FileBase::RC rc = Directory::createPath(tp_url, observer);
int nDirs = observer->number_of_dirs_created();
- delete observer;
+ delete observer;
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createDirectoryPath failed",
+ "osl_createDirectoryPath failed",
(rc == FileBase::E_None) && (nDirs > 0)
- );
-
+ );
+
}
-#ifdef WNT
-
+#ifdef WNT
+
//##########################################
char* get_unused_drive_letter()
{
@@ -6617,74 +6617,74 @@ namespace osl_Directory
DWORD ld = GetLogicalDrives();
DWORD i = 4;
DWORD j = 2;
-
+
while ((ld & i) && (i > 1))
{ i = i << 1; j++; }
-
- if (i > 2)
+
+ if (i > 2)
return m_aBuff + j;
-
+
return NULL;
}
-
+
//##########################################
void at_invalid_logical_drive()
- {
- char* drv = get_unused_drive_letter();
- char buff[PATH_BUFFER_SIZE];
+ {
+ char* drv = get_unused_drive_letter();
+ char buff[PATH_BUFFER_SIZE];
rtl_zeroMemory(buff, sizeof(buff));
-
+
strncpy(buff, drv, 1);
strcat(buff, ":\\");
strcat(buff, TEST_PATH_POSTFIX);
-
+
OUString path = OUString::createFromAscii(buff);
OUString tp_url;
- FileBase::getFileURLFromSystemPath(path, tp_url);
-
+ FileBase::getFileURLFromSystemPath(path, tp_url);
+
FileBase::RC rc = Directory::createPath(tp_url);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createDirectoryPath doesn't fail on unused logical drive letters",
+ "osl_createDirectoryPath doesn't fail on unused logical drive letters",
rc != FileBase::E_None
- );
+ );
}
-
+
//##########################################
void with_UNC_path()
{
-
+
OUString tp_unc = OUString::createFromAscii("\\\\Tra-1\\TRA_D\\hello\\world\\");
OUString tp_url;
FileBase::getFileURLFromSystemPath(tp_unc, tp_url);
-
+
FileBase::RC rc = Directory::createPath(tp_url);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createDirectoryPath fails with UNC path",
+ "osl_createDirectoryPath fails with UNC path",
rc == FileBase::E_None
);
}
-
+
#endif /* WNT */
-
- CPPUNIT_TEST_SUITE(createPath);
+
+ CPPUNIT_TEST_SUITE(createPath);
CPPUNIT_TEST(with_relative_path);
- CPPUNIT_TEST(without_callback);
- CPPUNIT_TEST(with_callback);
-#ifdef WNT
- CPPUNIT_TEST(at_invalid_logical_drive);
+ CPPUNIT_TEST(without_callback);
+ CPPUNIT_TEST(with_callback);
+#ifdef WNT
+ CPPUNIT_TEST(at_invalid_logical_drive);
// adapt the UNC path in method createDirectoryPath_with_UNC_path
// in order to run this test successfully
- //CPPUNIT_TEST(with_UNC_path);
-#endif
+ //CPPUNIT_TEST(with_UNC_path);
+#endif
CPPUNIT_TEST_SUITE_END();
}; // class createPath
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Directory::ctors, "osl_Directory" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Directory::open, "osl_Directory" );
@@ -6697,7 +6697,7 @@ namespace osl_Directory
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Directory::remove, "osl_Directory" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Directory::createPath, "osl_Directory" );
}// namespace osl_Directory
-
+
// -----------------------------------------------------------------------------
// this macro creates an empty function, which will called by the RegisterAllFunctions()
@@ -6719,7 +6719,7 @@ inline ::rtl::OUString getCurrentPID( )
#else
nPID = getpid();
#endif
- return ( ::rtl::OUString::valueOf( ( long )nPID ) );
+ return ( ::rtl::OUString::valueOf( ( long )nPID ) );
}
@@ -6730,11 +6730,11 @@ inline void insertPID( ::rtl::OUString & pathname )
//~ check if the path contain the temp directory, do nothing changes if not;
if ( pathname.indexOf( aTempDirectoryURL ) && pathname.indexOf( aTempDirectorySys ) )
return;
-
+
//~ format pathname to TEMP/USERPID/URL style;
if ( !pathname.indexOf( aTempDirectoryURL ) )
{
- ::rtl::OUString strPID( getCurrentPID( ) );
+ ::rtl::OUString strPID( getCurrentPID( ) );
::rtl::OUString pathLeft = aTempDirectoryURL.copy( 0 );
::rtl::OUString pathRight = pathname.copy( aTempDirectoryURL.getLength( ) );
pathname = pathLeft.copy( 0 );
@@ -6742,7 +6742,7 @@ inline void insertPID( ::rtl::OUString & pathname )
}
else
{
- ::rtl::OUString strPID( getCurrentPID( ) );
+ ::rtl::OUString strPID( getCurrentPID( ) );
::rtl::OUString pathLeft = aTempDirectorySys.copy( 0 );
::rtl::OUString pathRight = pathname.copy( aTempDirectorySys.getLength( ) );
pathname = pathLeft.copy( 0 );
@@ -6753,19 +6753,19 @@ inline void insertPID( ::rtl::OUString & pathname )
}
/** to do some initialized work, we replace the NOADDITIONAL macro with the initialize work which
- will check the file and directory existence. and set some variables for test use.
+ will check the file and directory existence. and set some variables for test use.
to simplify the initialize work, we seperate it into UNIX section and Windows section, the main task
- of initialization is adapt all URL defined in osl_File_Const.h to TEMP/USERPID/URL style format,
- since there may be an instance that multiuser execute test at the same time, and the temp file
- may not be clean up in this case due to access right problem.
+ of initialization is adapt all URL defined in osl_File_Const.h to TEMP/USERPID/URL style format,
+ since there may be an instance that multiuser execute test at the same time, and the temp file
+ may not be clean up in this case due to access right problem.
*/
void RegisterAdditionalFunctions( FktRegFuncPtr _pFunc )
{
(void)_pFunc;
t_print( "Initializing..." );
-
- //~ make sure the c:\temp exist, if not, create it.
-#if ( defined WNT )
+
+ //~ make sure the c:\temp exist, if not, create it.
+#if ( defined WNT )
if ( checkDirectory( aTempDirectoryURL, osl_Check_Mode_Exist ) != sal_True ) {
t_print( "\n#C:\\temp is not exist, now creating\n" );
createTestDirectory( aTempDirectoryURL );
@@ -6779,7 +6779,7 @@ void RegisterAdditionalFunctions( FktRegFuncPtr _pFunc )
if ( checkDirectory( aUserDirectoryURL, osl_Check_Mode_Exist ) != sal_True ) {
createTestDirectory( aUserDirectoryURL );
}
-
+
//~ adapt all URL to the TEMP/USERPID/URL format;
insertPID( aCanURL1 );
insertPID( aTmpName3 );
@@ -6794,34 +6794,34 @@ void RegisterAdditionalFunctions( FktRegFuncPtr _pFunc )
insertPID( aSysPath2 );
insertPID( aSysPath3 );
insertPID( aSysPath4 );
-
+
t_print( "Done.\n" );
}
-//~ do some clean up work after all test completed.
+//~ do some clean up work after all test completed.
class GlobalObject
{
public:
~GlobalObject()
{
try
- {
- //~ make sure the c:\temp\PID or /tmp/PID exist, if yes, delete it.
+ {
+ //~ make sure the c:\temp\PID or /tmp/PID exist, if yes, delete it.
t_print( "\n#Do some clean-ups ...\n" );
if ( checkDirectory( aUserDirectoryURL, osl_Check_Mode_Exist ) == sal_True ) {
deleteTestDirectory( aUserDirectoryURL );
}
-
+
// LLA: t_print("after deleteTestDirectory\n");
//~ special clean up task in Windows and Unix seperately;
#if ( defined UNX ) || ( defined OS2 )
//~ some clean up task for UNIX OS
;
-#else
+#else
//~ some clean up task for Windows OS
- //~ check if some files are in the way, remove them if necessary.
+ //~ check if some files are in the way, remove them if necessary.
if ( ifFileExist( aTmpName6 ) == sal_True )
deleteTestFile( aTmpName6 );
if ( ifFileExist( aTmpName4 ) == sal_True )
@@ -6832,18 +6832,18 @@ class GlobalObject
deleteTestFile( aTmpName3 );
if ( checkDirectory( aTmpName3, osl_Check_Mode_Exist ) == sal_True )
deleteTestDirectory( aTmpName3 );
-
+
::rtl::OUString aUStr( aUserDirectoryURL );
concatURL( aUStr, aHidURL1 );
if ( ifFileExist( aUStr ) == sal_True )
deleteTestFile( aUStr );
-
+
::rtl::OUString aUStr1( aRootURL );
concatURL( aUStr1, aTmpName2 );
if ( ifFileExist( aUStr1 ) == sal_True )
deleteTestFile( aUStr1 );
#endif
-
+
}
catch (CppUnit::Exception &e)
{
diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx
index e5f34da70..52c5a360a 100644
--- a/sal/qa/osl/file/osl_old_test_file.cxx
+++ b/sal/qa/osl/file/osl_old_test_file.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -51,14 +51,14 @@
#define TEST_VOLUME "c:/"
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
-namespace osl_test_file
+namespace osl_test_file
{
// -----------------------------------------------------------------------------
-class oldtestfile : public CppUnit::TestFixture
+class oldtestfile : public CppUnit::TestFixture
{
public:
void test_file_001();
@@ -115,7 +115,7 @@ void oldtestfile::test_file_001()
#ifdef WIN32
return;
#endif
-
+
OUString base1( RTL_CONSTASCII_USTRINGPARAM( "file:///" TEST_VOLUME "bla" ) );
int i;
for( i = 0 ; aSource1[i] ; i +=2 )
@@ -136,7 +136,7 @@ void oldtestfile::test_file_001()
OUString err1( RTL_CONSTASCII_USTRINGPARAM( "../.." ) );
OUString target;
CPPUNIT_ASSERT_MESSAGE("failure #11", osl_File_E_None != osl_getAbsoluteFileURL( base1.pData , err1.pData , &target.pData ) );
-
+
}
void oldtestfile::test_file_002()
@@ -144,7 +144,7 @@ void oldtestfile::test_file_002()
#ifdef WIN32
return;
#endif
-
+
OUString base2( RTL_CONSTASCII_USTRINGPARAM( "file:///" TEST_VOLUME "bla/blubs/schnubbel" ) );
int i;
for( i = 0 ; aSource2[i] ; i +=2 )
@@ -168,7 +168,7 @@ void oldtestfile::test_file_003()
#ifdef WIN32
return;
#endif
-
+
// links !
#ifdef UNX
int i;
@@ -178,7 +178,7 @@ void oldtestfile::test_file_003()
char buf2[PATH_MAX];
strcpy( buf2 , buf );
strcat( buf2, "/a" );
-
+
if( 0 == mkdir( buf2 , S_IRWXG | S_IRWXO | S_IRWXU ) )
{
strcat( buf2, "/b" );
@@ -244,7 +244,7 @@ void oldtestfile::test_file_004()
#ifdef WIN32
return;
#endif
-
+
OUString base4( RTL_CONSTASCII_USTRINGPARAM( "file:///" TEST_VOLUME "bla/" ) );
int i;
for( i = 0 ; aSource1[i] ; i +=2 )
@@ -265,7 +265,7 @@ void oldtestfile::test_file_004()
// fprintf( stderr, "test_file done\n" );
}
-
+
} // namespace osl_test_file
// -----------------------------------------------------------------------------
diff --git a/sal/qa/osl/file/test_cpy_wrt_file.cxx b/sal/qa/osl/file/test_cpy_wrt_file.cxx
index c99e69b68..05910ea3d 100755
--- a/sal/qa/osl/file/test_cpy_wrt_file.cxx
+++ b/sal/qa/osl/file/test_cpy_wrt_file.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,16 +30,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-
-#include <cppunit/simpleheader.hxx>
+
+#include <testshl/simpleheader.hxx>
#include <osl/file.hxx>
#include <osl/thread.h>
#include <rtl/ustring.hxx>
-
+
using namespace osl;
using namespace rtl;
-
-//########################################
+
+//########################################
#ifdef UNX
# define COPY_SOURCE_PATH "/home/tr109510/ucbhelper.cxx"
# define COPY_DEST_PATH "/mnt/mercury08/ucbhelper.cxx"
@@ -49,59 +49,59 @@ using namespace rtl;
#endif
class test_osl_copyFile : public CppUnit::TestFixture
-{
-public:
+{
+public:
void cp_file()
- {
+ {
rtl::OUString src_url;
FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii(COPY_SOURCE_PATH), src_url);
-
- rtl::OUString dest_url;
+
+ rtl::OUString dest_url;
FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii(COPY_DEST_PATH), dest_url);
FileBase::RC err = File::copy(src_url, dest_url);
- CPPUNIT_ASSERT_MESSAGE("Copy didn't recognized disk full", err != FileBase::E_None);
+ CPPUNIT_ASSERT_MESSAGE("Copy didn't recognized disk full", err != FileBase::E_None);
}
-
+
CPPUNIT_TEST_SUITE(test_osl_copyFile);
- CPPUNIT_TEST(cp_file);
+ CPPUNIT_TEST(cp_file);
CPPUNIT_TEST_SUITE_END();
};
-//########################################
+//########################################
#ifdef UNX
# define WRITE_DEST_PATH "/mnt/mercury08/muell.tmp"
#else /* if WNT */
# define WRITE_DEST_PATH "d:\\tmp_data.tmp"
#endif
-
+
class test_osl_writeFile : public CppUnit::TestFixture
-{
-public:
+{
+public:
void wrt_file()
- {
- rtl::OUString dest_url;
- FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii(WRITE_DEST_PATH), dest_url);
-
+ {
+ rtl::OUString dest_url;
+ FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii(WRITE_DEST_PATH), dest_url);
+
File tmp_file(dest_url);
rtl::OUString suErrorMsg = rtl::OUString::createFromAscii("File creation failed: ")+ dest_url;
FileBase::RC err = tmp_file.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Create);
-
+
CPPUNIT_ASSERT_MESSAGE( suErrorMsg, err == FileBase::E_None || err == FileBase::E_EXIST );
-
+
char buffer[50000];
sal_uInt64 written = 0;
- err = tmp_file.write((void*)buffer, sizeof(buffer), written);
-
+ err = tmp_file.write((void*)buffer, sizeof(buffer), written);
+
err = tmp_file.sync();
-
+
CPPUNIT_ASSERT_MESSAGE("Write didn't recognized disk full", err != FileBase::E_None);
-
- tmp_file.close();
+
+ tmp_file.close();
}
-
+
CPPUNIT_TEST_SUITE(test_osl_writeFile);
- CPPUNIT_TEST(wrt_file);
+ CPPUNIT_TEST(wrt_file);
CPPUNIT_TEST_SUITE_END();
};
diff --git a/sal/qa/osl/module/makefile.mk b/sal/qa/osl/module/makefile.mk
index d3500d267..40f597bdb 100644
--- a/sal/qa/osl/module/makefile.mk
+++ b/sal/qa/osl/module/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -48,7 +48,7 @@ CXXFLAGS+= $(LFS_CFLAGS)
# --- test dll ------------------------------------------------------
SHL1TARGET = Module_DLL
SHL1OBJS = $(SLO)$/osl_Module_DLL.obj
-SHL1STDLIBS = $(SALLIB)
+SHL1STDLIBS = $(SALLIB)
SHL1IMPLIB = i$(SHL1TARGET)
SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
@@ -59,21 +59,16 @@ SHL1VERSIONMAP = export_dll.map
SHL2OBJS= $(SLO)$/osl_Module.obj
SHL2TARGET= osl_Module
-SHL2STDLIBS= $(SALLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
-SHL2STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
SHL2STDLIBS+=i$(SHL2TARGET).lib
.ENDIF
-.IF "$(GUI)" == "OS2"
-SHL2STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
.IF "$(GUI)" == "UNX"
-SHL2STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
APP3STDLIBS+=-l$(SHL2TARGET)
.ENDIF
-SHL2DEPN= $(SHL1OBJS)
+SHL2DEPN= $(SHL1OBJS)
SHL2IMPLIB= i$(SHL2TARGET)
SHL2DEF= $(MISC)$/$(SHL2TARGET).def
diff --git a/sal/qa/osl/module/osl_Module_Const.h b/sal/qa/osl/module/osl_Module_Const.h
index 44ab1e007..7c217e04b 100644
--- a/sal/qa/osl/module/osl_Module_Const.h
+++ b/sal/qa/osl/module/osl_Module_Const.h
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@
#include <osl/module.hxx>
#include <osl/file.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#if ( defined UNX ) || ( defined OS2 ) //Unix
# include <unistd.h>
diff --git a/sal/qa/osl/module/osl_Module_DLL.cxx b/sal/qa/osl/module/osl_Module_DLL.cxx
index e11cf2c0c..46610f35f 100644
--- a/sal/qa/osl/module/osl_Module_DLL.cxx
+++ b/sal/qa/osl/module/osl_Module_DLL.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@
#include <stdio.h>
#include <sal/types.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
extern "C" sal_Bool SAL_CALL firstfunc( sal_Bool bRes )
{
diff --git a/sal/qa/osl/mutex/makefile.mk b/sal/qa/osl/mutex/makefile.mk
index 44c5b6b46..7c8cfeb39 100755
--- a/sal/qa/osl/mutex/makefile.mk
+++ b/sal/qa/osl/mutex/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,22 +44,16 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Mutex.obj
SHL1TARGET= osl_Mutex
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(WS2_32LIB)
.ENDIF
-.IF "$(GUI)" == "OS2"
-SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-
.IF "$(GUI)" == "UNX"
SHL1STDLIBS += -ldl -lnsl
.ENDIF
diff --git a/sal/qa/osl/mutex/osl_Mutex_Const.h b/sal/qa/osl/mutex/osl_Mutex_Const.h
index c11764b8e..ba09515e0 100755
--- a/sal/qa/osl/mutex/osl_Mutex_Const.h
+++ b/sal/qa/osl/mutex/osl_Mutex_Const.h
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-#ifndef _OSL_MUTEX_CONST_H_
+#ifndef _OSL_MUTEX_CONST_H_
#define _OSL_MUTEX_CONST_H_
//------------------------------------------------------------------------
@@ -49,7 +49,7 @@
#endif
#include <osl/time.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#ifdef UNX
#include <unistd.h>
diff --git a/sal/qa/osl/pipe/makefile.mk b/sal/qa/osl/pipe/makefile.mk
index 636bdde7d..3d0df14bb 100644
--- a/sal/qa/osl/pipe/makefile.mk
+++ b/sal/qa/osl/pipe/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,21 +44,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Pipe by codegen.pl
+# auto generated Target:Pipe by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Pipe.obj
SHL1TARGET= osl_Pipe
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
-
-#.IF "$(GUI)" == "WNT"
-#SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-#.ENDIF
-#.IF "$(GUI)" == "UNX"
-#SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-#.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index a9c5abbfb..cdae8380e 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,12 +30,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-
+
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <sal/types.h>
#include <rtl/ustring.hxx>
@@ -68,14 +68,14 @@ using namespace rtl;
inline void printBool( sal_Bool bOk )
{
t_print("#printBool# " );
- ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" );
+ ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" );
}
/** print a UNI_CODE String.
*/
inline void printUString( const ::rtl::OUString & str )
{
- rtl::OString aString;
+ rtl::OString aString;
t_print("#printUString_u# " );
aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
@@ -89,7 +89,7 @@ inline void printPipeError( ::osl::Pipe aPipe )
oslPipeError nError = aPipe.getError( );
t_print("#printPipeError# " );
switch ( nError ) {
- case osl_Pipe_E_None:
+ case osl_Pipe_E_None:
t_print("Success!\n" );
break;
case osl_Pipe_E_NotFound:
@@ -148,7 +148,7 @@ namespace osl_Pipe
{
//------------------------------------------------------------------------
-// most return value -1 denote a fail of operation.
+// most return value -1 denote a fail of operation.
//------------------------------------------------------------------------
#define OSL_PIPE_FAIL -1
@@ -164,102 +164,102 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void setUp( )
{
}
-
+
void tearDown( )
{
}
-
+
void ctors_none( )
{
::osl::Pipe aPipe;
bRes = aPipe.is( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no parameter, yet no case to test.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no parameter, yet no case to test.",
sal_False == bRes );
}
-
+
void ctors_name_option( )
{
- /// create a named pipe.
+ /// create a named pipe.
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
::osl::Pipe aAssignPipe( aTestPipeName, osl_Pipe_OPEN );
-
+
bRes = aPipe.is( ) && aAssignPipe.is( );
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name and option.",
sal_True == bRes );
}
-
+
void ctors_name_option_security( )
{
- /// create a security pipe.
+ /// create a security pipe.
const ::osl::Security rSecurity;
::osl::Pipe aSecurityPipe( aTestPipeName, osl_Pipe_CREATE, rSecurity );
-
+
bRes = aSecurityPipe.is( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
sal_True == bRes );
}
-
+
void ctors_copy( )
{
- /// create a pipe.
+ /// create a pipe.
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
- /// create a pipe using copy constructor.
+ /// create a pipe using copy constructor.
::osl::Pipe aCopyPipe( aPipe );
-
+
bRes = aCopyPipe.is( ) && aCopyPipe == aPipe;
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
sal_True == bRes );
}
-
+
/** tester comment:
-
- When test the following two constructors, don't know how to test the
+
+ When test the following two constructors, don't know how to test the
acquire and no acquire action. possible plans:
- 1.release one handle and check the other( did not success since the
- other still exist and valid. )
- 2. release one handle twice to see getLastError( )(the getLastError
- always returns invalidError(LINUX)).
+ 1.release one handle and check the other( did not success since the
+ other still exist and valid. )
+ 2. release one handle twice to see getLastError( )(the getLastError
+ always returns invalidError(LINUX)).
*/
void ctors_no_acquire( )
{
- /// create a pipe.
+ /// create a pipe.
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
- /// constructs a pipe reference without acquiring the handle.
+ /// constructs a pipe reference without acquiring the handle.
::osl::Pipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
-
+
bRes = aNoAcquirePipe.is( );
///aPipe.clear( );
///bRes1 = aNoAcquirePipe.is( );
-
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no aquire of handle, only validation test, do not know how to test no acquire.",
+
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no aquire of handle, only validation test, do not know how to test no acquire.",
sal_True == bRes );
}
-
+
void ctors_acquire( )
{
- /// create a base pipe.
+ /// create a base pipe.
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
- /// constructs two pipes without acquiring the handle on the base pipe.
+ /// constructs two pipes without acquiring the handle on the base pipe.
::osl::Pipe aAcquirePipe( aPipe.getHandle( ) );
::osl::Pipe aAcquirePipe1( NULL );
-
+
bRes = aAcquirePipe.is( );
bRes1 = aAcquirePipe1.is( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no aquire of handle.only validation test, do not know how to test no acquire.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no aquire of handle.only validation test, do not know how to test no acquire.",
sal_True == bRes && sal_False == bRes1 );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_name_option );
@@ -267,10 +267,10 @@ namespace osl_Pipe
CPPUNIT_TEST( ctors_copy );
CPPUNIT_TEST( ctors_no_acquire );
CPPUNIT_TEST( ctors_acquire );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class ctors
-
+
/** testing the method:
inline sal_Bool SAL_CALL is() const;
*/
@@ -280,58 +280,58 @@ namespace osl_Pipe
void is_001( )
{
::osl::Pipe aPipe;
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), check if the pipe is a valid one.", sal_False == aPipe.is( ) );
}
-
+
void is_002( )
{
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), a normal pipe creation.", sal_True == aPipe.is( ) );
}
-
+
void is_003( )
{
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_CREATE );
aPipe.clear( );
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), an invalid case.", sal_False == aPipe.is( ) );
}
-
+
void is_004( )
{
::osl::Pipe aPipe( NULL );
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), an invalid constructor.", sal_False == aPipe.is( ) );
}
-
+
CPPUNIT_TEST_SUITE( is );
CPPUNIT_TEST( is_001 );
CPPUNIT_TEST( is_002 );
CPPUNIT_TEST( is_003 );
CPPUNIT_TEST( is_004 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class is
-
+
/** testing the methods:
inline sal_Bool create( const ::rtl::OUString & strName,
oslPipeOptions Options, const Security &rSec );
- nline sal_Bool create( const ::rtl::OUString & strName,
+ nline sal_Bool create( const ::rtl::OUString & strName,
oslPipeOptions Options = osl_Pipe_OPEN );
*/
class create : public CppUnit::TestFixture
{
public:
sal_Bool bRes, bRes1;
-
+
/** tester comment:
-
- security create only be tested creation, security section is
- untested yet.
+
+ security create only be tested creation, security section is
+ untested yet.
*/
-
+
void create_named_security_001( )
{
const Security rSec;
@@ -339,11 +339,11 @@ namespace osl_Pipe
bRes = aPipe.create( aTestPipeName, osl_Pipe_CREATE, rSec );
bRes1 = aPipe.create( aTestPipeName, osl_Pipe_CREATE, rSec );
aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
sal_True == bRes && sal_False == bRes1);
}
-
+
void create_named_security_002( )
{
const Security rSec;
@@ -351,53 +351,53 @@ namespace osl_Pipe
bRes = aPipe.create( aTestPipeName, osl_Pipe_CREATE, rSec );
bRes1 = aPipe1.create( aTestPipeName, osl_Pipe_OPEN, rSec );
aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
sal_True == bRes && sal_True == bRes1);
}
-
+
void create_named_001( )
{
::osl::Pipe aPipe;
bRes = aPipe.create( aTestPipeName, osl_Pipe_CREATE );
bRes1 = aPipe.create( aTestPipeName, osl_Pipe_CREATE );
aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
sal_True == bRes && sal_False == bRes1);
}
-
+
void create_named_002( )
{
::osl::Pipe aPipe, aPipe1;
bRes = aPipe.create( aTestPipeName, osl_Pipe_CREATE );
bRes1 = aPipe1.create( aTestPipeName, osl_Pipe_OPEN );
aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
sal_True == bRes && sal_True == bRes1);
}
-
+
void create_named_003( )
{
::osl::Pipe aPipe;
bRes = aPipe.create( aTestPipeName );
aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test default option is open.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test default option is open.",
sal_False == bRes );
}
-
+
CPPUNIT_TEST_SUITE( create );
CPPUNIT_TEST( create_named_security_001 );
CPPUNIT_TEST( create_named_security_002 );
CPPUNIT_TEST( create_named_001 );
CPPUNIT_TEST( create_named_002 );
CPPUNIT_TEST( create_named_003 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class create
-
-
+
+
/** testing the method:
inline void SAL_CALL clear();
*/
@@ -405,24 +405,24 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void clear_001( )
{
::osl::Pipe aPipe;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
aPipe.clear( );
- bRes = aPipe.is( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test clear.",
+ bRes = aPipe.is( );
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test clear.",
sal_False == bRes );
}
-
+
CPPUNIT_TEST_SUITE( clear );
CPPUNIT_TEST( clear_001 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class clear
-
+
/** testing the methods:
inline Pipe& SAL_CALL operator= (const Pipe& pipe);
inline Pipe& SAL_CALL operator= (const oslPipe pipe );
@@ -431,42 +431,42 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void assign_ref( )
{
::osl::Pipe aPipe, aPipe1;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
aPipe1 = aPipe;
bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
+ bRes1 = aPipe == aPipe1;
aPipe.close( );
- aPipe1.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with reference.",
+ aPipe1.close( );
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with reference.",
sal_True == bRes && sal_True == bRes1 );
}
-
+
void assign_handle( )
{
::osl::Pipe aPipe, aPipe1;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
aPipe1 = aPipe.getHandle( );
bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
+ bRes1 = aPipe == aPipe1;
aPipe.close( );
- aPipe1.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with handle.",
+ aPipe1.close( );
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with handle.",
sal_True == bRes && sal_True == bRes1 );
}
-
+
CPPUNIT_TEST_SUITE( assign );
CPPUNIT_TEST( assign_ref );
CPPUNIT_TEST( assign_handle );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class assign
-
+
/** testing the method:
inline sal_Bool SAL_CALL isValid() const;
isValid( ) has not been implemented under the following platforms, please refer to osl/pipe.hxx
@@ -475,19 +475,19 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void isValid_001( )
{
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: isValid() has not been implemented on all platforms.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: isValid() has not been implemented on all platforms.",
sal_False );
}
-
+
CPPUNIT_TEST_SUITE( isValid );
CPPUNIT_TEST( isValid_001 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
};*/ // class isValid
-
+
/** testing the method:
inline sal_Bool SAL_CALL operator==( const Pipe& rPipe ) const;
*/
@@ -500,38 +500,38 @@ namespace osl_Pipe
{
::osl::Pipe aPipe;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
- bRes = aPipe == aPipe;
+ bRes = aPipe == aPipe;
aPipe.close( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(), compare its self.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(), compare its self.",
sal_True == bRes );
}
-
+
void isEqual_002( )
{
::osl::Pipe aPipe, aPipe1, aPipe2;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
-
+
aPipe1 = aPipe;
aPipe2.create( aTestPipeName, osl_Pipe_CREATE );
-
- bRes = aPipe == aPipe1;
- bRes1 = aPipe == aPipe2;
+
+ bRes = aPipe == aPipe1;
+ bRes1 = aPipe == aPipe2;
aPipe.close( );
- aPipe1.close( );
- aPipe2.close( );
+ aPipe1.close( );
+ aPipe2.close( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(),create one copy instance, and compare.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(),create one copy instance, and compare.",
sal_True == bRes && sal_False == bRes1 );
}
-
+
CPPUNIT_TEST_SUITE( isEqual );
CPPUNIT_TEST( isEqual_001 );
CPPUNIT_TEST( isEqual_002 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class isEqual
-
-
+
+
/** testing the method:
inline void SAL_CALL close();
*/
@@ -539,37 +539,37 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void close_001( )
{
::osl::Pipe aPipe( aTestPipe1, osl_Pipe_CREATE );
aPipe.close( );
bRes = aPipe.is( );
-
+
aPipe.clear( );
bRes1 = aPipe.is( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: difference between close and clear.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: difference between close and clear.",
sal_True == bRes && sal_False == bRes1);
}
-
+
void close_002( )
{
::osl::StreamPipe aPipe( aTestPipe1, osl_Pipe_CREATE );
aPipe.close( );
int nRet = aPipe.send( m_pTestString1.getStr(), 3 );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: use after close.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: use after close.",
OSL_PIPE_FAIL == nRet );
}
-
+
CPPUNIT_TEST_SUITE( close );
CPPUNIT_TEST( close_001 );
CPPUNIT_TEST( close_002 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class close
-
+
/** testing the method:
inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
please refer to StreamPipe::recv
@@ -578,7 +578,7 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void accept_001( )
{
@@ -588,10 +588,10 @@ namespace osl_Pipe
CPPUNIT_TEST_SUITE( accept );
CPPUNIT_TEST( accept_001 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
};*/ // class accept
-
+
/** testing the method:
inline oslPipeError SAL_CALL getError() const;
*/
@@ -601,26 +601,26 @@ namespace osl_Pipe
sal_Bool bRes, bRes1;
/*
PipeError[]= {
- { 0, osl_Pipe_E_None }, // no error
- { EPROTOTYPE, osl_Pipe_E_NoProtocol }, // Protocol wrong type for socket
- { ENOPROTOOPT, osl_Pipe_E_NoProtocol }, // Protocol not available
- { EPROTONOSUPPORT, osl_Pipe_E_NoProtocol }, // Protocol not supported
- { ESOCKTNOSUPPORT, osl_Pipe_E_NoProtocol }, // Socket type not supported
- { EPFNOSUPPORT, osl_Pipe_E_NoProtocol }, // Protocol family not supported
+ { 0, osl_Pipe_E_None }, // no error
+ { EPROTOTYPE, osl_Pipe_E_NoProtocol }, // Protocol wrong type for socket
+ { ENOPROTOOPT, osl_Pipe_E_NoProtocol }, // Protocol not available
+ { EPROTONOSUPPORT, osl_Pipe_E_NoProtocol }, // Protocol not supported
+ { ESOCKTNOSUPPORT, osl_Pipe_E_NoProtocol }, // Socket type not supported
+ { EPFNOSUPPORT, osl_Pipe_E_NoProtocol }, // Protocol family not supported
{ EAFNOSUPPORT, osl_Pipe_E_NoProtocol }, // Address family not supported by
- // protocol family
+ // protocol family
{ ENETRESET, osl_Pipe_E_NetworkReset }, // Network dropped connection because
- // of reset
- { ECONNABORTED, osl_Pipe_E_ConnectionAbort }, // Software caused connection abort
- { ECONNRESET, osl_Pipe_E_ConnectionReset }, // Connection reset by peer
- { ENOBUFS, osl_Pipe_E_NoBufferSpace }, // No buffer space available
- { ETIMEDOUT, osl_Pipe_E_TimedOut }, // Connection timed out
- { ECONNREFUSED, osl_Pipe_E_ConnectionRefused }, // Connection refused
+ // of reset
+ { ECONNABORTED, osl_Pipe_E_ConnectionAbort }, // Software caused connection abort
+ { ECONNRESET, osl_Pipe_E_ConnectionReset }, // Connection reset by peer
+ { ENOBUFS, osl_Pipe_E_NoBufferSpace }, // No buffer space available
+ { ETIMEDOUT, osl_Pipe_E_TimedOut }, // Connection timed out
+ { ECONNREFUSED, osl_Pipe_E_ConnectionRefused }, // Connection refused
{ -1, osl_Pipe_E_invalidError }
};
did not define osl_Pipe_E_NotFound, osl_Pipe_E_AlreadyExists
*/
-
+
void getError_001( )
{
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_OPEN );
@@ -628,7 +628,7 @@ namespace osl_Pipe
printPipeError( aPipe );
aPipe.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe. not passed in (W32)(LINUX)(UNX).",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe. not passed in (W32)(LINUX)(UNX).",
osl_Pipe_E_invalidError == nError );
}
@@ -641,17 +641,17 @@ namespace osl_Pipe
aPipe.clear( );
aPipe1.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.not passed in (W32)(LINUX)(UNX).",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.not passed in (W32)(LINUX)(UNX).",
osl_Pipe_E_invalidError == nError );
}
CPPUNIT_TEST_SUITE( getError );
CPPUNIT_TEST( getError_001 );
CPPUNIT_TEST( getError_002 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class getError
-
+
/** testing the method:
inline oslPipe SAL_CALL getHandle() const;
*/
@@ -659,14 +659,14 @@ namespace osl_Pipe
{
public:
sal_Bool bRes, bRes1;
-
+
void getHandle_001( )
{
::osl::Pipe aPipe( aTestPipeName, osl_Pipe_OPEN );
bRes = aPipe == aPipe.getHandle( );
aPipe.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: one pipe should equal to its handle.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: one pipe should equal to its handle.",
sal_True == bRes );
}
@@ -678,17 +678,17 @@ namespace osl_Pipe
aPipe.clear( );
aPipe1.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: one pipe derived from another pipe's handle.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: one pipe derived from another pipe's handle.",
sal_True == bRes );
}
CPPUNIT_TEST_SUITE( getHandle );
CPPUNIT_TEST( getHandle_001 );
CPPUNIT_TEST( getHandle_002 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class getHandle
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::ctors, "osl_Pipe");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::is, "osl_Pipe");
@@ -702,7 +702,7 @@ namespace osl_Pipe
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getError, "osl_Pipe");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getHandle, "osl_Pipe");
// -----------------------------------------------------------------------------
-
+
} // namespace osl_Pipe
@@ -721,7 +721,7 @@ namespace osl_StreamPipe
{
public:
sal_Bool bRes, bRes1;
-
+
void ctors_none( )
{
// create a pipe.
@@ -729,14 +729,14 @@ namespace osl_StreamPipe
// create an unattached pipe.
::osl::StreamPipe aStreamPipe1;
bRes = aStreamPipe1.is( );
-
- // assign it and check.
+
+ // assign it and check.
aStreamPipe1 = aStreamPipe;
bRes1 = aStreamPipe1.is( );
aStreamPipe.clear( );
aStreamPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no parameter, before and after assign.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no parameter, before and after assign.",
sal_False == bRes && sal_True == bRes1 );
}
@@ -750,10 +750,10 @@ namespace osl_StreamPipe
aStreamPipe.clear( );
aStreamPipe1.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with other's handle.",
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with other's handle.",
sal_True == bRes );
}
-
+
void ctors_copy( )
{
// create a pipe.
@@ -763,11 +763,11 @@ namespace osl_StreamPipe
bRes = aStreamPipe1.is( ) && aStreamPipe == aStreamPipe1;
aStreamPipe.clear( );
aStreamPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
sal_True == bRes );
}
-
+
void ctors_name_option( )
{
// create a pipe.
@@ -784,42 +784,42 @@ namespace osl_StreamPipe
void ctors_name_option_security( )
{
- /// create a security pipe.
+ /// create a security pipe.
const ::osl::Security rSecurity;
::osl::StreamPipe aSecurityPipe( aTestPipeName, osl_Pipe_CREATE, rSecurity );
-
+
bRes = aSecurityPipe.is( );
aSecurityPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
sal_True == bRes );
}
-
+
/** tester comment:
-
- When test the following constructor, don't know how to test the
+
+ When test the following constructor, don't know how to test the
acquire and no acquire action. possible plans:
- 1.release one handle and check the other( did not success since the
- other still exist and valid. )
- 2. release one handle twice to see getLastError( )(the getLastError
- always returns invalidError(LINUX)).
+ 1.release one handle and check the other( did not success since the
+ other still exist and valid. )
+ 2. release one handle twice to see getLastError( )(the getLastError
+ always returns invalidError(LINUX)).
*/
void ctors_no_acquire( )
{
- // create a pipe.
+ // create a pipe.
::osl::StreamPipe aPipe( aTestPipeName, osl_Pipe_CREATE );
- // constructs a pipe reference without acquiring the handle.
+ // constructs a pipe reference without acquiring the handle.
::osl::StreamPipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
-
+
bRes = aNoAcquirePipe.is( );
aPipe.clear( );
// bRes1 = aNoAcquirePipe.is( );
-
+
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with no aquire of handle, only validation test, do not know how to test no acquire.",
sal_True == bRes );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_handle );
@@ -827,7 +827,7 @@ namespace osl_StreamPipe
CPPUNIT_TEST( ctors_name_option );
CPPUNIT_TEST( ctors_name_option_security );
CPPUNIT_TEST( ctors_no_acquire );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class ctors
@@ -836,46 +836,46 @@ namespace osl_StreamPipe
inline StreamPipe& SAL_CALL operator=(const Pipe& pipe);
mindy: not implementated in osl/pipe.hxx, so remove the cases
*/
- /*
+ /*
class assign : public CppUnit::TestFixture
{
public:
sal_Bool bRes, bRes1;
-
+
void assign_ref( )
{
::osl::StreamPipe aPipe, aPipe1;
aPipe.create( aTestPipeName, osl_Pipe_CREATE );
aPipe1 = aPipe;
bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
+ bRes1 = aPipe == aPipe1;
aPipe.close( );
- aPipe1.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with reference.",
+ aPipe1.close( );
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with reference.",
sal_True == bRes && sal_True == bRes1 );
}
-
+
void assign_handle( )
{
::osl::StreamPipe * pPipe = new ::osl::StreamPipe( aTestPipeName, osl_Pipe_CREATE );
::osl::StreamPipe * pAssignPipe = new ::osl::StreamPipe;
*pAssignPipe = pPipe->getHandle( );
-
+
bRes = pAssignPipe->is( );
- bRes1 = ( *pPipe == *pAssignPipe );
+ bRes1 = ( *pPipe == *pAssignPipe );
pPipe->close( );
-
+
delete pAssignPipe;
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with handle., seems not implemented under (LINUX)(W32)",
+
+ CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with handle., seems not implemented under (LINUX)(W32)",
sal_True == bRes && sal_True == bRes1 );
}
-
+
CPPUNIT_TEST_SUITE( assign );
CPPUNIT_TEST( assign_ref );
CPPUNIT_TEST( assign_handle );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
};*/ // class assign
@@ -886,16 +886,16 @@ namespace osl_StreamPipe
/// print statement in thread process must use fflush() to force display.
// t_print("wait %d seconds. ", _nSec );
fflush(stdout);
-
+
#ifdef WNT //Windows
Sleep( _nSec * 1000 );
#endif
#if ( defined UNX ) || ( defined OS2 ) //Unix
sleep( _nSec );
#endif
- // t_print("done\n" );
+ // t_print("done\n" );
}
- // test read/write & send/recv data to pipe
+ // test read/write & send/recv data to pipe
// -----------------------------------------------------------------------------
class Pipe_DataSink_Thread : public Thread
@@ -903,13 +903,13 @@ namespace osl_StreamPipe
public:
sal_Char buf[256];
Pipe_DataSink_Thread( ) { }
-
+
~Pipe_DataSink_Thread( )
{
- }
+ }
protected:
void SAL_CALL run( )
- {
+ {
sal_Int32 nChars = 0;
t_print("open pipe\n");
@@ -937,9 +937,9 @@ namespace osl_StreamPipe
}
}
}
-
+
};
-
+
// -----------------------------------------------------------------------------
class Pipe_DataSource_Thread : public Thread
@@ -947,7 +947,7 @@ namespace osl_StreamPipe
public:
sal_Char buf[256];
//::osl::StreamPipe aListenPipe; //( aTestPipeName, osl_Pipe_CREATE );
- ::osl::Pipe aListenPipe;
+ ::osl::Pipe aListenPipe;
::osl::StreamPipe aConnectionPipe;
Pipe_DataSource_Thread( )
{
@@ -970,9 +970,9 @@ namespace osl_StreamPipe
t_print("pipe create failed! \n");
}
else
- {
+ {
//::osl::StreamPipe aConnectionPipe;
-
+
//start server and wait for connection.
t_print("accept\n");
if ( osl_Pipe_E_None != aListenPipe.accept( aConnectionPipe ) )
@@ -981,7 +981,7 @@ namespace osl_StreamPipe
return;
}
t_print("write\n");
- // write to pipe
+ // write to pipe
nChars = aConnectionPipe.write( m_pTestString1.getStr(), m_pTestString1.getLength() + 1 );
if ( nChars < 0)
{
@@ -990,26 +990,26 @@ namespace osl_StreamPipe
}
t_print("recv\n");
nChars = aConnectionPipe.recv( buf, 256 );
-
+
if ( nChars < 0)
{
t_print("server receive failed! \n");
return;
}
- //thread_sleep( 2 );
+ //thread_sleep( 2 );
t_print("received message is: %s\n", buf );
- //aConnectionPipe.close();
+ //aConnectionPipe.close();
}
}
};
-
+
/** testing the method: read/write/send/recv and Pipe::accept
*/
class recv : public CppUnit::TestFixture
{
public:
sal_Bool bRes, bRes1;
-
+
void recv_001( )
{
//launch threads.
@@ -1022,7 +1022,7 @@ namespace osl_StreamPipe
//wait until the thread terminate
myDataSinkThread.join( );
myDataSourceThread.join( );
-
+
int nCompare1 = strcmp( myDataSinkThread.buf, m_pTestString1.getStr() );
int nCompare2 = strcmp( myDataSourceThread.buf, m_pTestString2.getStr() );
CPPUNIT_ASSERT_MESSAGE( "test send/recv/write/read.", nCompare1 == 0 && nCompare2 == 0 );
@@ -1040,11 +1040,11 @@ namespace osl_StreamPipe
myDataSourceThread.join( );
//no condition judgement here, if the case could finish excuting within 1 or 2 seconds, it passes.
}
-
+
CPPUNIT_TEST_SUITE( recv );
CPPUNIT_TEST( recv_001 );
CPPUNIT_TEST( recv_002 );
- CPPUNIT_TEST_SUITE_END( );
+ CPPUNIT_TEST_SUITE_END( );
}; // class recv
// -----------------------------------------------------------------------------
@@ -1052,7 +1052,7 @@ namespace osl_StreamPipe
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::assign, "osl_StreamPipe");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::recv, "osl_StreamPipe");
// -----------------------------------------------------------------------------
-
+
} // namespace osl_StreamPipe
diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk
index 17f6ab46b..32e97f3c1 100644
--- a/sal/qa/osl/process/makefile.mk
+++ b/sal/qa/osl/process/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,7 +45,7 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:testjob by codegen.pl
+# auto generated Target:testjob by codegen.pl
.IF "$(GUI)" == "WNT"
CFLAGS+=/Ob1
@@ -55,17 +55,7 @@ SHL1OBJS= \
$(SLO)$/osl_Thread.obj
SHL1TARGET= osl_Thread
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .IF "$(OS)" == "SOLARIS"
-# SHL1STDLIBS += -lrt -laio
-# .ENDIF
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
@@ -82,14 +72,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS=$(SLO)$/osl_process.obj
SHL2TARGET=osl_process
-SHL2STDLIBS=$(SALLIB)
-
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL2STDLIBS+=$(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL2STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB=i$(SHL2TARGET)
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
@@ -98,7 +81,7 @@ DEF2EXPORTFILE=export.exp
# END ------------------------------------------------------------------
-OBJ3FILES=$(OBJ)$/osl_process_child.obj
+OBJ3FILES=$(OBJ)$/osl_process_child.obj
APP3TARGET=osl_process_child
APP3OBJS=$(OBJ3FILES)
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 4c8c01902..88f796b67 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,7 +52,7 @@
#endif
#include <osl/time.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
using namespace osl;
using namespace rtl;
@@ -72,14 +72,14 @@ protected:
bool m_bIsValid; // TRUE, wenn gestartet und gestoppt
bool m_bIsRunning; // TRUE, wenn gestartet.
-
+
public:
StopWatch();
~StopWatch() {}
-
+
void start(); // Startet Timer
void stop(); // Stoppt Timer
-
+
double getSeconds() const;
double getTenthSec() const;
};
@@ -91,7 +91,7 @@ public:
StopWatch::StopWatch():m_bIsValid(false),m_bIsRunning(false) {}
-void StopWatch::start()
+void StopWatch::start()
{
// pre: %
// post: Start Timer
@@ -103,15 +103,15 @@ void StopWatch::start()
// gettimeofday(&t1, 0);
}
-void StopWatch::stop()
+void StopWatch::stop()
{
// pre: Timer should be started
// post: Timer will stopped
-
+
// gettimeofday(&t2, 0); // Timer ausfragen
osl_getSystemTime( &t2 );
t_print("# %d %d nsecs\n", t2.Seconds, t2.Nanosec);
-
+
if (m_bIsRunning)
{ // check ob gestartet.
// LLA: old m_nNanoSec = static_cast<sal_Int32>(t2.Nanosec) - static_cast<sal_Int32>(t1.Nanosec);
@@ -128,7 +128,7 @@ void StopWatch::stop()
else
{
m_nNanoSec = 1000000000 + static_cast<sal_Int32>(t2.Nanosec) - static_cast<sal_Int32>(t1.Nanosec);
- m_nSeconds -= 1;
+ m_nSeconds -= 1;
}
t_print("# %d %d nsecs\n", m_nSeconds, m_nNanoSec );
//if (m_nNanoSec < 0)
@@ -141,11 +141,11 @@ void StopWatch::stop()
}
}
-double StopWatch::getSeconds() const
+double StopWatch::getSeconds() const
{
// pre: gueltig = TRUE
// BACK: Zeit in Sekunden.
-
+
double nValue = 0.0;
if (m_bIsValid)
{
@@ -154,12 +154,12 @@ double StopWatch::getSeconds() const
return nValue;
}
-double StopWatch::getTenthSec() const
-{
+double StopWatch::getTenthSec() const
+{
double nValue = 0.0;
if (m_bIsValid)
{
- nValue = double(m_nNanoSec) / 100000000.0 + m_nSeconds * 10;
+ nValue = double(m_nNanoSec) / 100000000.0 + m_nSeconds * 10;
}
return nValue ;
}
@@ -195,7 +195,7 @@ namespace ThreadHelper
// QUIET=1,
// VERBOSE
// } eSleepVerboseMode;
-
+
void thread_sleep_tenth_sec(sal_Int32 _nTenthSec/*, eSleepVerboseMode nVerbose = VERBOSE*/)
{
// if (nVerbose == VERBOSE)
@@ -217,7 +217,7 @@ namespace ThreadHelper
// t_print("done\n");
// }
}
-
+
void outputPriority(oslThreadPriority const& _aPriority)
{
// LLA: output the priority
@@ -270,24 +270,24 @@ protected:
ThreadHelper::thread_sleep_tenth_sec(1);
}
}
-
+
public:
-
- virtual void SAL_CALL suspend()
+
+ virtual void SAL_CALL suspend()
{
m_aFlag.acquire();
::osl::Thread::suspend();
m_aFlag.release();
}
-
+
~myThread()
{
if (isRunning())
{
t_print("error: not terminated.\n");
- }
+ }
}
-
+
};
// -----------------------------------------------------------------------------
@@ -303,14 +303,14 @@ public:
t_print("new OCountThread thread %d!\n", getIdentifier());
}
sal_Int32 getValue() { return m_aFlag.getValue(); }
-
+
void setWait(sal_Int32 nSec)
{
m_nWaitSec = nSec;
//m_bWait = sal_True;
}
-
- virtual void SAL_CALL suspend()
+
+ virtual void SAL_CALL suspend()
{
m_aFlag.acquire();
::osl::Thread::suspend();
@@ -320,7 +320,7 @@ public:
protected:
//sal_Bool m_bWait;
sal_Int32 m_nWaitSec;
-
+
void SAL_CALL run()
{
/// if the thread should terminate, schedule return false
@@ -337,7 +337,7 @@ protected:
{
//ThreadHelper::thread_sleep_tenth_sec(m_nWaitSec * 10);
TimeValue nTV;
- nTV.Seconds = m_nWaitSec / 10 ;
+ nTV.Seconds = m_nWaitSec / 10 ;
nTV.Nanosec = ( m_nWaitSec%10 ) * 100000000 ;
wait( nTV );
m_nWaitSec = 0;
@@ -349,16 +349,16 @@ protected:
t_print("normally terminate this thread %d!\n", getIdentifier());
}
public:
-
+
~OCountThread()
{
if (isRunning())
{
t_print("error: not terminated.\n");
- }
+ }
}
-
-};
+
+};
/** call suspend in the run method
*/
@@ -400,16 +400,16 @@ protected:
}
}
}
-public:
+public:
~OSuspendThread()
{
if (isRunning())
{
t_print("error: not terminated.\n");
- }
+ }
}
-
+
};
/** no call schedule in the run method
@@ -419,8 +419,8 @@ class ONoScheduleThread : public Thread
ThreadSafeValue<sal_Int32> m_aFlag;
public:
sal_Int32 getValue() { return m_aFlag.getValue(); }
-
- virtual void SAL_CALL suspend()
+
+ virtual void SAL_CALL suspend()
{
m_aFlag.acquire();
::osl::Thread::suspend();
@@ -453,12 +453,12 @@ public:
if (isRunning())
{
t_print("error: not terminated.\n");
- }
+ }
}
-
-};
-/**
+};
+
+/**
*/
class OAddThread : public Thread
{
@@ -467,8 +467,8 @@ public:
//oslThreadIdentifier m_id, m_CurId;
OAddThread(){}
sal_Int32 getValue() { return m_aFlag.getValue(); }
-
- virtual void SAL_CALL suspend()
+
+ virtual void SAL_CALL suspend()
{
m_aFlag.acquire();
::osl::Thread::suspend();
@@ -488,15 +488,15 @@ protected:
// t_print("normally terminate this thread %d!\n", getIdentifier());
}
public:
-
+
~OAddThread()
{
if (isRunning())
{
// t_print("error: not terminated.\n");
- }
+ }
}
-
+
};
namespace osl_Thread
@@ -508,7 +508,7 @@ namespace osl_Thread
// Due to the fact, that a suspend and never run thread never really exists.
// Note: on UNX, after createSuspended, and then terminate the thread, it performs well;
- // while on Windows, after createSuspended, the thread can not terminate, wait endlessly,
+ // while on Windows, after createSuspended, the thread can not terminate, wait endlessly,
// so here call resume at first, then call terminate.
#ifdef WNT
t_print("resumeAndWaitThread\n");
@@ -541,7 +541,7 @@ namespace osl_Thread
class create : public CppUnit::TestFixture
{
public:
-
+
// initialise your test code values here.
void setUp()
{
@@ -552,9 +552,9 @@ namespace osl_Thread
}
/** Simple create a thread.
-
- Create a simple thread, it just does add 1 to value(which initialized 0),
- if the thread run, the value should be 1.
+
+ Create a simple thread, it just does add 1 to value(which initialized 0),
+ if the thread run, the value should be 1.
*/
void create_001()
{
@@ -578,7 +578,7 @@ namespace osl_Thread
"Creates a new thread",
nValue >= 1 && isRunning == sal_True
);
-
+
}
/** only one running thread per instance, return false if create secondly
@@ -596,7 +596,7 @@ namespace osl_Thread
"Creates a new thread: can not create two threads per instance",
res1 && !res2
);
-
+
}
CPPUNIT_TEST_SUITE(create);
@@ -614,7 +614,7 @@ namespace osl_Thread
public:
// initialise your test code values here.
void setUp()
- {
+ {
}
void tearDown()
@@ -630,21 +630,21 @@ namespace osl_Thread
myThread* newthread = new myThread();
sal_Bool bRes = newthread->createSuspended();
CPPUNIT_ASSERT_MESSAGE("Can not creates a new thread!", bRes == sal_True );
-
+
ThreadHelper::thread_sleep_tenth_sec(1);
sal_Bool isRunning = newthread->isRunning();
ThreadHelper::thread_sleep_tenth_sec(3);
sal_Int32 nValue = newthread->getValue();
resumeAndWaitThread(newthread);
-
+
termAndJoinThread(newthread);
delete newthread;
-
+
CPPUNIT_ASSERT_MESSAGE(
"Creates a new suspended thread",
nValue == 0 && isRunning
- );
+ );
}
void createSuspended_002()
@@ -654,7 +654,7 @@ namespace osl_Thread
sal_Bool res2 = newthread->createSuspended();
resumeAndWaitThread(newthread);
-
+
termAndJoinThread(newthread);
delete newthread;
@@ -679,7 +679,7 @@ namespace osl_Thread
sal_Int32 nValue = 0;
while (1)
{
- nValue = _pCountThread->getValue();
+ nValue = _pCountThread->getValue();
if (nValue >= 3)
{
_pCountThread->suspend();
@@ -703,7 +703,7 @@ namespace osl_Thread
}
/** Use a thread which has a flag added 1 every second
-
+
ALGORITHM:
create the thread, after running special time, record value of flag, then suspend it,
wait a long time, check the flag, if it remains unchanged during suspending
@@ -731,7 +731,7 @@ namespace osl_Thread
CPPUNIT_ASSERT_MESSAGE(
"Suspend the thread",
bRes == sal_True && nValue == nLaterValue
- );
+ );
}
/** suspend a thread in it's worker-function, the ALGORITHM is same as suspend_001
@@ -763,7 +763,7 @@ namespace osl_Thread
t_print(" after sleep!");
// the value after waiting 3 seconds
sal_Int32 nLaterValue = aThread->getValue(); // (3)
-
+
//resumeAndWaitThread(aThread);
aThread->resume();
termAndJoinThread(aThread);
@@ -772,7 +772,7 @@ namespace osl_Thread
CPPUNIT_ASSERT_MESSAGE(
"Suspend the thread",
bRes == sal_True && nValue == nLaterValue
- );
+ );
}
CPPUNIT_TEST_SUITE(suspend);
@@ -797,9 +797,9 @@ namespace osl_Thread
}
/** check if the thread run samely as usual after suspend and resume
-
+
ALGORITHM:
- compare the values before and after suspend, they should be same,
+ compare the values before and after suspend, they should be same,
then compare values before and after resume, the difference should be same as the sleep seconds number
*/
void resume_001()
@@ -807,7 +807,7 @@ namespace osl_Thread
OCountThread* pCountThread = new OCountThread();
sal_Bool bRes = pCountThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
suspendCountThread(pCountThread);
sal_Int32 nSuspendValue = pCountThread->getValue(); // (2)
@@ -832,7 +832,7 @@ namespace osl_Thread
CPPUNIT_ASSERT_MESSAGE(
"Suspend then resume the thread",
nLaterValue >= 9 &&
- nResumeValue > nSuspendValue &&
+ nResumeValue > nSuspendValue &&
nLaterValue > nResumeValue
);
@@ -845,7 +845,7 @@ namespace osl_Thread
myThread* newthread = new myThread();
sal_Bool bRes = newthread->createSuspended();
CPPUNIT_ASSERT_MESSAGE ( "Can't create thread!", bRes == sal_True );
-
+
newthread->resume();
ThreadHelper::thread_sleep_tenth_sec(2);
sal_Int32 nValue = newthread->getValue();
@@ -882,9 +882,9 @@ namespace osl_Thread
}
/** Check after call terminate if the running thread running go on executing
-
+
ALGORITHM:
- before and after call terminate, the values should be the same
+ before and after call terminate, the values should be the same
*/
void terminate_001()
{
@@ -897,7 +897,7 @@ namespace osl_Thread
aCountThread->terminate();
ThreadHelper::thread_sleep_tenth_sec(2);
sal_Int32 nLaterValue = aCountThread->getValue();
-
+
// isRunning should be false after terminate
sal_Bool isRunning = aCountThread->isRunning();
aCountThread->join();
@@ -907,7 +907,7 @@ namespace osl_Thread
t_print("nLaterValue = %d\n", nLaterValue);
CPPUNIT_ASSERT_MESSAGE(
- "Terminate the thread",
+ "Terminate the thread",
isRunning == sal_False && nLaterValue >= nValue
);
}
@@ -918,11 +918,11 @@ namespace osl_Thread
OCountThread* aCountThread = new OCountThread();
sal_Bool bRes = aCountThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
ThreadHelper::thread_sleep_tenth_sec(1);
suspendCountThread(aCountThread);
sal_Int32 nValue = aCountThread->getValue();
-
+
// seems a suspended thread can not be terminated on W32, while on Solaris can
resumeAndWaitThread(aCountThread);
@@ -961,7 +961,7 @@ namespace osl_Thread
}
/** Check after call terminate if the thread running function will not go on executing
-
+
the next statement after join will not exec before the thread terminate
ALGORITHM:
recode system time at the beginning of the thread run, call join, then record system time again,
@@ -972,15 +972,15 @@ namespace osl_Thread
OCountThread *aCountThread = new OCountThread();
sal_Bool bRes = aCountThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
StopWatch aStopWatch;
aStopWatch.start();
- // TimeValue aTimeVal_befor;
+ // TimeValue aTimeVal_befor;
// osl_getSystemTime( &aTimeVal_befor );
- //t_print("#join:the system time is %d,%d\n", pTimeVal_befor->Seconds,pTimeVal_befor->Nanosec);
+ //t_print("#join:the system time is %d,%d\n", pTimeVal_befor->Seconds,pTimeVal_befor->Nanosec);
aCountThread->join();
-
+
//the below line will be executed after aCountThread terminate
// TimeValue aTimeVal_after;
// osl_getSystemTime( &aTimeVal_after );
@@ -989,17 +989,17 @@ namespace osl_Thread
double nSec = aStopWatch.getSeconds();
t_print("join_001 nSec=%f\n", nSec);
delete aCountThread;
-
+
CPPUNIT_ASSERT_MESSAGE(
- "Join the thread: after the thread terminate",
+ "Join the thread: after the thread terminate",
nSec >= 2
- );
-
+ );
+
}
/** after terminated by another thread, join exited immediately
ALGORITHM:
- terminate the thread when value>=3, call join, check the beginning time and time after join,
+ terminate the thread when value>=3, call join, check the beginning time and time after join,
the difference should be 3 seconds, join costs little time
*/
void join_002()
@@ -1007,16 +1007,16 @@ namespace osl_Thread
OCountThread *aCountThread = new OCountThread();
sal_Bool bRes = aCountThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
//record the time when the running begin
- // TimeValue aTimeVal_befor;
+ // TimeValue aTimeVal_befor;
// osl_getSystemTime( &aTimeVal_befor );
StopWatch aStopWatch;
aStopWatch.start();
-
+
ThreadHelper::thread_sleep_tenth_sec(10);
termAndJoinThread(aCountThread);
-
+
//the below line will be executed after aCountThread terminate
// TimeValue aTimeVal_after;
// osl_getSystemTime( &aTimeVal_after );
@@ -1027,7 +1027,7 @@ namespace osl_Thread
delete aCountThread;
CPPUNIT_ASSERT_MESSAGE(
- "Join the thread: after thread terminate by another thread",
+ "Join the thread: after thread terminate by another thread",
nSec >= 1
);
}
@@ -1061,7 +1061,7 @@ namespace osl_Thread
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
sal_Bool bRun = aCountThread->isRunning();
-
+
ThreadHelper::thread_sleep_tenth_sec(2);
termAndJoinThread(aCountThread);
sal_Bool bTer = aCountThread->isRunning();
@@ -1096,10 +1096,10 @@ namespace osl_Thread
CPPUNIT_ASSERT_MESSAGE(
"Test isRunning",
bRes == sal_True &&
- bRunning_sup == sal_True &&
+ bRunning_sup == sal_True &&
bRunning_res == sal_True &&
- bRunning_ter == sal_False
- );
+ bRunning_ter == sal_False
+ );
}
@@ -1109,7 +1109,7 @@ namespace osl_Thread
CPPUNIT_TEST_SUITE_END();
}; // class isRunning
-
+
/// check osl::Thread::setPriority
class setPriority : public CppUnit::TestFixture
{
@@ -1132,17 +1132,17 @@ namespace osl_Thread
case osl_Thread_PriorityHighest:
sPrioStr = "Highest";
break;
-
+
case osl_Thread_PriorityAboveNormal:
sPrioStr = "AboveNormal";
-
+
case osl_Thread_PriorityNormal:
sPrioStr = "Normal";
-
+
case osl_Thread_PriorityBelowNormal:
sPrioStr = "BelowNormal";
break;
-
+
case osl_Thread_PriorityLowest:
sPrioStr = "Lowest";
break;
@@ -1151,12 +1151,12 @@ namespace osl_Thread
}
return sPrioStr;
}
-
-
+
+
/** check 2 threads.
ALGORITHM:
- Here the function should show, that 2 different threads,
+ Here the function should show, that 2 different threads,
which only increase a value, should run at the same time with same prio.
The test fails, if the difference between the two values is more than 5%
but IMHO this isn't a failure, it's only a feature of the OS.
@@ -1167,7 +1167,7 @@ namespace osl_Thread
// initial 5 threads with different priorities
OAddThread* pThread = new OAddThread();
OAddThread* p2Thread = new OAddThread();
-
+
//Create them and start running at the same time
pThread->create();
pThread->setPriority(_aPriority);
@@ -1178,7 +1178,7 @@ namespace osl_Thread
pThread->terminate();
p2Thread->terminate();
-
+
sal_Int32 nValueNormal = 0;
nValueNormal = pThread->getValue();
@@ -1187,7 +1187,7 @@ namespace osl_Thread
rtl::OString sPrio = getPrioName(_aPriority);
t_print("After 10 tenth seconds\n");
-
+
t_print("nValue in %s Prio Thread is %d\n",sPrio.getStr(), nValueNormal);
t_print("nValue in %s Prio Thread is %d\n", sPrio.getStr(), nValueNormal2);
@@ -1215,7 +1215,7 @@ namespace osl_Thread
// LLA: nDeltaPercent <= 5
// LLA: );
}
-
+
void setPriority_001_1()
{
check2Threads(osl_Thread_PriorityHighest);
@@ -1240,13 +1240,13 @@ namespace osl_Thread
void setPriority_002()
{
// initial 5 threads with different priorities
-
+
OAddThread aHighestThread;
OAddThread aAboveNormalThread;
OAddThread aNormalThread;
//OAddThread *aBelowNormalThread = new OAddThread();
//OAddThread *aLowestThread = new OAddThread();
-
+
//Create them and start running at the same time
aHighestThread.createSuspended();
aHighestThread.setPriority(osl_Thread_PriorityHighest);
@@ -1277,7 +1277,7 @@ namespace osl_Thread
termAndJoinThread(&aHighestThread);
//aBelowNormalThread->terminate();
//aLowestThread->terminate();
-
+
sal_Int32 nValueHighest = 0;
nValueHighest = aHighestThread.getValue();
@@ -1299,7 +1299,7 @@ namespace osl_Thread
// LLA: this is not a save test, so we only check if all values not zero
// LLA: CPPUNIT_ASSERT_MESSAGE(
// LLA: "SetPriority",
- // LLA: nValueHighest >= nValueAboveNormal &&
+ // LLA: nValueHighest >= nValueAboveNormal &&
// LLA: nValueAboveNormal >= nValueNormal &&
// LLA: nValueNormal > 0
// LLA: );
@@ -1308,7 +1308,7 @@ namespace osl_Thread
#ifndef WNT
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
- nValueHighest > 0 &&
+ nValueHighest > 0 &&
nValueAboveNormal > 0 &&
nValueNormal > 0
);
@@ -1323,7 +1323,7 @@ namespace osl_Thread
OAddThread *pNormalThread = new OAddThread();
OAddThread *pBelowNormalThread = new OAddThread();
OAddThread *pLowestThread = new OAddThread();
-
+
//Create them and start running at the same time
pHighestThread->createSuspended();
pHighestThread->setPriority(osl_Thread_PriorityHighest);
@@ -1339,7 +1339,7 @@ namespace osl_Thread
pLowestThread->createSuspended();
pLowestThread->setPriority(osl_Thread_PriorityLowest);
-
+
pHighestThread->resume();
pAboveNormalThread->resume();
pNormalThread->resume();
@@ -1359,7 +1359,7 @@ namespace osl_Thread
termAndJoinThread(pNormalThread);
termAndJoinThread(pBelowNormalThread);
termAndJoinThread(pLowestThread);
-
+
sal_Int32 nValueHighest = 0;
nValueHighest = pHighestThread->getValue();
@@ -1391,9 +1391,9 @@ namespace osl_Thread
// LLA: this is not a save test, so we only check if all values not zero
// LLA: CPPUNIT_ASSERT_MESSAGE(
// LLA: "SetPriority",
- // LLA: nValueHighest > nValueAboveNormal &&
- // LLA: nValueAboveNormal > nValueNormal &&
- // LLA: nValueNormal > nValueBelowNormal &&
+ // LLA: nValueHighest > nValueAboveNormal &&
+ // LLA: nValueAboveNormal > nValueNormal &&
+ // LLA: nValueNormal > nValueBelowNormal &&
// LLA: nValueBelowNormal > nValueLowest &&
// LLA: nValueLowest > 0
// LLA: );
@@ -1402,13 +1402,13 @@ namespace osl_Thread
#ifndef WNT
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
- nValueHighest > 0 &&
- nValueAboveNormal > 0 &&
- nValueNormal > 0 &&
+ nValueHighest > 0 &&
+ nValueAboveNormal > 0 &&
+ nValueNormal > 0 &&
nValueBelowNormal > 0 &&
nValueLowest > 0
);
-#endif
+#endif
}
void setPriority_004()
@@ -1419,91 +1419,91 @@ namespace osl_Thread
OAddThread *pNormalThread = new OAddThread();
OAddThread *pBelowNormalThread = new OAddThread();
OAddThread *pLowestThread = new OAddThread();
-
+
//Create them and start running at the same time
// pHighestThread->createSuspended();
// pHighestThread->setPriority(osl_Thread_PriorityHighest);
pAboveNormalThread->createSuspended();
pAboveNormalThread->setPriority(osl_Thread_PriorityAboveNormal);
-
+
pNormalThread->createSuspended();
pNormalThread->setPriority(osl_Thread_PriorityNormal);
-
+
pBelowNormalThread->createSuspended();
pBelowNormalThread->setPriority(osl_Thread_PriorityBelowNormal);
-
+
pLowestThread->createSuspended();
pLowestThread->setPriority(osl_Thread_PriorityLowest);
-
+
// pHighestThread->resume();
pAboveNormalThread->resume();
pNormalThread->resume();
pBelowNormalThread->resume();
pLowestThread->resume();
-
+
ThreadHelper::thread_sleep_tenth_sec(5);
-
+
// pHighestThread->suspend();
pAboveNormalThread->suspend();
pNormalThread->suspend();
pBelowNormalThread->suspend();
pLowestThread->suspend();
-
+
// termAndJoinThread(pHighestThread);
termAndJoinThread(pAboveNormalThread);
termAndJoinThread(pNormalThread);
termAndJoinThread(pBelowNormalThread);
termAndJoinThread(pLowestThread);
-
+
// sal_Int32 nValueHighest = 0;
// nValueHighest = pHighestThread->getValue();
-
+
sal_Int32 nValueAboveNormal = 0;
nValueAboveNormal = pAboveNormalThread->getValue();
-
+
sal_Int32 nValueNormal = 0;
nValueNormal = pNormalThread->getValue();
-
+
sal_Int32 nValueBelowNormal = 0;
nValueBelowNormal = pBelowNormalThread->getValue();
-
+
sal_Int32 nValueLowest = 0;
nValueLowest = pLowestThread->getValue();
-
+
t_print("After 5 tenth seconds\n");
// t_print("nValue in Highest Prio Thread is %d\n",nValueHighest);
t_print("nValue in AboveNormal Prio Thread is %d\n",nValueAboveNormal);
t_print("nValue in Normal Prio Thread is %d\n",nValueNormal);
t_print("nValue in BelowNormal Prio Thread is %d\n",nValueBelowNormal);
t_print("nValue in Lowest Prio Thread is %d\n",nValueLowest);
-
+
// delete pHighestThread;
delete pAboveNormalThread;
delete pNormalThread;
delete pBelowNormalThread;
delete pLowestThread;
-
+
// LLA: this is not a save test, so we only check if all values not zero
// LLA: CPPUNIT_ASSERT_MESSAGE(
// LLA: "SetPriority",
- // LLA: nValueHighest > nValueAboveNormal &&
- // LLA: nValueAboveNormal > nValueNormal &&
- // LLA: nValueNormal > nValueBelowNormal &&
+ // LLA: nValueHighest > nValueAboveNormal &&
+ // LLA: nValueAboveNormal > nValueNormal &&
+ // LLA: nValueNormal > nValueBelowNormal &&
// LLA: nValueBelowNormal > nValueLowest &&
// LLA: nValueLowest > 0
// LLA: );
-
+
// LLA: windows let starve threads with lower priority
#ifndef WNT
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
/* nValueHighest > 0 && */
- nValueAboveNormal > 0 &&
- nValueNormal > 0 &&
+ nValueAboveNormal > 0 &&
+ nValueNormal > 0 &&
nValueBelowNormal > 0 &&
nValueLowest > 0
- );
+ );
#endif
}
void setPriority_005()
@@ -1514,92 +1514,92 @@ namespace osl_Thread
OAddThread *pNormalThread = new OAddThread();
OAddThread *pBelowNormalThread = new OAddThread();
OAddThread *pLowestThread = new OAddThread();
-
+
//Create them and start running at the same time
// pHighestThread->createSuspended();
// pHighestThread->setPriority(osl_Thread_PriorityHighest);
// pAboveNormalThread->createSuspended();
// pAboveNormalThread->setPriority(osl_Thread_PriorityAboveNormal);
-
+
pNormalThread->createSuspended();
pNormalThread->setPriority(osl_Thread_PriorityNormal);
-
+
pBelowNormalThread->createSuspended();
pBelowNormalThread->setPriority(osl_Thread_PriorityBelowNormal);
-
+
pLowestThread->createSuspended();
pLowestThread->setPriority(osl_Thread_PriorityLowest);
-
+
// pHighestThread->resume();
// pAboveNormalThread->resume();
pNormalThread->resume();
pBelowNormalThread->resume();
pLowestThread->resume();
-
+
ThreadHelper::thread_sleep_tenth_sec(5);
-
+
// pHighestThread->suspend();
// pAboveNormalThread->suspend();
pNormalThread->suspend();
pBelowNormalThread->suspend();
pLowestThread->suspend();
-
+
// termAndJoinThread(pHighestThread);
// termAndJoinThread(pAboveNormalThread);
termAndJoinThread(pNormalThread);
termAndJoinThread(pBelowNormalThread);
termAndJoinThread(pLowestThread);
-
+
// sal_Int32 nValueHighest = 0;
// nValueHighest = pHighestThread->getValue();
-
+
// sal_Int32 nValueAboveNormal = 0;
// nValueAboveNormal = pAboveNormalThread->getValue();
-
+
sal_Int32 nValueNormal = 0;
nValueNormal = pNormalThread->getValue();
-
+
sal_Int32 nValueBelowNormal = 0;
nValueBelowNormal = pBelowNormalThread->getValue();
-
+
sal_Int32 nValueLowest = 0;
nValueLowest = pLowestThread->getValue();
-
+
t_print("After 5 tenth seconds\n");
// t_print("nValue in Highest Prio Thread is %d\n",nValueHighest);
// t_print("nValue in AboveNormal Prio Thread is %d\n",nValueAboveNormal);
t_print("nValue in Normal Prio Thread is %d\n",nValueNormal);
t_print("nValue in BelowNormal Prio Thread is %d\n",nValueBelowNormal);
t_print("nValue in Lowest Prio Thread is %d\n",nValueLowest);
-
+
// delete pHighestThread;
// delete pAboveNormalThread;
delete pNormalThread;
delete pBelowNormalThread;
delete pLowestThread;
-
+
// LLA: this is not a save test, so we only check if all values not zero
// LLA: CPPUNIT_ASSERT_MESSAGE(
// LLA: "SetPriority",
- // LLA: nValueHighest > nValueAboveNormal &&
- // LLA: nValueAboveNormal > nValueNormal &&
- // LLA: nValueNormal > nValueBelowNormal &&
+ // LLA: nValueHighest > nValueAboveNormal &&
+ // LLA: nValueAboveNormal > nValueNormal &&
+ // LLA: nValueNormal > nValueBelowNormal &&
// LLA: nValueBelowNormal > nValueLowest &&
// LLA: nValueLowest > 0
// LLA: );
-
+
// LLA: windows let starve threads with lower priority
#ifndef WNT
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
/* nValueHighest > 0 && */
/* nValueAboveNormal > 0 && */
- nValueNormal > 0 &&
+ nValueNormal > 0 &&
nValueBelowNormal > 0 &&
nValueLowest > 0
);
-#endif
+#endif
}
@@ -1640,11 +1640,11 @@ namespace osl_Thread
//Create them and start running at the same time
pHighestThread->create();
pHighestThread->setPriority(osl_Thread_PriorityHighest);
-
+
oslThreadPriority aPriority = pHighestThread->getPriority();
termAndJoinThread(pHighestThread);
delete pHighestThread;
-
+
ThreadHelper::outputPriority(aPriority);
// LLA: Priority settings may not work within some OS versions.
@@ -1665,7 +1665,7 @@ namespace osl_Thread
void getPriority_002()
{
-
+
}
CPPUNIT_TEST_SUITE(getPriority);
@@ -1690,12 +1690,12 @@ namespace osl_Thread
// insert your test code here.
void getIdentifier_001()
{
-
+
}
void getIdentifier_002()
{
-
+
}
CPPUNIT_TEST_SUITE(getIdentifier);
@@ -1734,12 +1734,12 @@ namespace osl_Thread
delete pCountThread;
//termAndJoinThread(pCountThread2);
//delete pCountThread2;
-
+
CPPUNIT_ASSERT_MESSAGE(
"Get the identifier for the current active thread.",
oId != oIdChild
);
-
+
}
void getCurrentIdentifier_002()
@@ -1769,7 +1769,7 @@ namespace osl_Thread
/** call wait in the run method
ALGORITHM:
- tested thread wait nWaitSec seconds, main thread sleep (2) seconds,
+ tested thread wait nWaitSec seconds, main thread sleep (2) seconds,
then terminate the tested thread, due to the fact that the thread do a sleep(1) + wait(5)
it's finish after 6 seconds.
*/
@@ -1781,23 +1781,23 @@ namespace osl_Thread
// thread runs at least 5 seconds.
sal_Bool bRes = aCountThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
//record the time when the running begin
StopWatch aStopWatch;
aStopWatch.start();
-
+
// wait a little bit, to let the thread the time, to start
ThreadHelper::thread_sleep_tenth_sec( 4 );
-
+
// if wait works,
// this function returns, after 4 sec. later
termAndJoinThread(aCountThread);
-
+
// value should be one.
sal_Int32 nValue = aCountThread->getValue();
aStopWatch.stop();
-
+
// sal_uInt32 nSec = aTimeVal_after.Seconds - aTimeVal_befor.Seconds;
double nTenthSec = aStopWatch.getTenthSec();
double nSec = aStopWatch.getSeconds();
@@ -1805,16 +1805,16 @@ namespace osl_Thread
t_print("nTenthSec = %f \n", nTenthSec);
t_print("nSec = %f \n", nSec);
t_print("nValue = %d \n", nValue);
-
+
CPPUNIT_ASSERT_MESSAGE(
- "Wait: Blocks the calling thread for the given number of time.",
- nTenthSec >= 5 && nValue == 1
+ "Wait: Blocks the calling thread for the given number of time.",
+ nTenthSec >= 5 && nValue == 1
);
-
+
}
// LLA: wait_001 does the same.
// LLA: /** wait then terminate the thread
-// LLA:
+// LLA:
// LLA: ALGORITHM:
// LLA: wait nWaitSec seconds, and terminate when the wait does not finish
// LLA: Windows & UNX: thread terminates immediatlly
@@ -1822,21 +1822,21 @@ namespace osl_Thread
// LLA: void wait_002()
// LLA: {
// LLA: OCountThread aThread;
-// LLA:
+// LLA:
// LLA: sal_Int32 nWaitSec = 3;
// LLA: aThread.setWait(nWaitSec);
-// LLA:
+// LLA:
// LLA: sal_Bool bRes = aThread.create();
// LLA: CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-// LLA:
+// LLA:
// LLA: StopWatch aStopWatch;
-// LLA: // TimeValue aTimeVal_befor;
+// LLA: // TimeValue aTimeVal_befor;
// LLA: // osl_getSystemTime( &aTimeVal_befor );
// LLA: aStopWatch.start();
-// LLA:
+// LLA:
// LLA: termAndJoinThread(&aThread);
// LLA: sal_Int32 nValue = aThread.getValue();
-// LLA:
+// LLA:
// LLA: // TimeValue aTimeVal_after;
// LLA: // osl_getSystemTime( &aTimeVal_after );
// LLA: aStopWatch.stop();
@@ -1844,9 +1844,9 @@ namespace osl_Thread
// LLA: double nSec = aStopWatch.getSeconds();
// LLA: t_print("sec=%f\n", nSec);
// LLA: t_print("nValue = %d\n", nValue);
-// LLA:
+// LLA:
// LLA: CPPUNIT_ASSERT_MESSAGE(
-// LLA: "Wait: Blocks the calling thread for the given number of time.",
+// LLA: "Wait: Blocks the calling thread for the given number of time.",
// LLA: nSec < 1 && nValue == 0
// LLA: );
// LLA: }
@@ -1856,7 +1856,7 @@ namespace osl_Thread
// LLA: CPPUNIT_TEST(wait_002);
CPPUNIT_TEST_SUITE_END();
}; // class wait
-
+
/** osl::Thread::yield method: can not design good test scenario to test up to now
*/
class yield : public CppUnit::TestFixture
@@ -1898,9 +1898,9 @@ namespace osl_Thread
/** The requested thread will get terminate the next time schedule() is called.
Note: on UNX, if call suspend thread is not the to be suspended thread, the to be
- suspended thread will get suspended the next time schedule() is called,
+ suspended thread will get suspended the next time schedule() is called,
while on w32, it's nothing with schedule.
-
+
check if suspend and terminate work well via schedule
*/
void schedule_001()
@@ -1908,7 +1908,7 @@ namespace osl_Thread
OAddThread* aThread = new OAddThread();
sal_Bool bRes = aThread->create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
ThreadHelper::thread_sleep_tenth_sec(2);
aThread->suspend();
ThreadHelper::thread_sleep_tenth_sec(1);
@@ -1921,7 +1921,7 @@ namespace osl_Thread
// if value and latervalue not equal, than the thread would not suspended
CPPUNIT_ASSERT_MESSAGE(
- "Schedule: suspend works.",
+ "Schedule: suspend works.",
nLaterValue == nValue
);
@@ -1930,10 +1930,10 @@ namespace osl_Thread
aThread->terminate();
sal_Int32 nValue_term = aThread->getValue();
-
+
aThread->join();
sal_Int32 nValue_join = aThread->getValue();
-
+
t_print("value after term = %d\n", nValue_term);
t_print("value after join = %d\n", nValue_join);
@@ -1943,12 +1943,12 @@ namespace osl_Thread
delete aThread;
//check if thread really terminate after call terminate, if join immediatlly return
CPPUNIT_ASSERT_MESSAGE(
- "Schedule: Returns False if the thread should terminate.",
+ "Schedule: Returns False if the thread should terminate.",
nValue_join - nValue_term <= 1 && nValue_join - nValue_term >= 0
);
-
+
}
-
+
/** design a thread that has not call schedule in the workfunction--run method
*/
void schedule_002()
@@ -1956,15 +1956,15 @@ namespace osl_Thread
ONoScheduleThread aThread; // this thread runs 10 sec. (no schedule() used)
sal_Bool bRes = aThread.create();
CPPUNIT_ASSERT_MESSAGE ( "Can't start thread!", bRes == sal_True );
-
+
ThreadHelper::thread_sleep_tenth_sec(2);
aThread.suspend();
sal_Int32 nValue = aThread.getValue();
-
+
ThreadHelper::thread_sleep_tenth_sec(3);
sal_Int32 nLaterValue = aThread.getValue();
ThreadHelper::thread_sleep_tenth_sec(5);
-
+
resumeAndWaitThread(&aThread);
t_print(" value = %d\n", nValue);
@@ -1973,16 +1973,16 @@ namespace osl_Thread
//On windows, suspend works, so the values are same
#ifdef WNT
CPPUNIT_ASSERT_MESSAGE(
- "Schedule: don't schedule in thread run method, suspend works.",
+ "Schedule: don't schedule in thread run method, suspend works.",
nLaterValue == nValue
);
#endif
-
+
//On UNX, suspend does not work, so the difference of the values equals to sleep seconds number
#ifdef UNX
aThread.resume();
CPPUNIT_ASSERT_MESSAGE(
- "Schedule: don't schedule in thread run method, suspend does not work too.",
+ "Schedule: don't schedule in thread run method, suspend does not work too.",
nLaterValue > nValue
);
#endif
@@ -1990,11 +1990,11 @@ namespace osl_Thread
// terminate will not work if no schedule in thread's work function
termAndJoinThread(&aThread);
sal_Int32 nValue_term = aThread.getValue();
-
+
t_print(" value term = %d\n", nValue_term);
CPPUNIT_ASSERT_MESSAGE(
- "Schedule: don't schedule in thread run method, terminate failed.",
+ "Schedule: don't schedule in thread run method, terminate failed.",
nValue_term == 10
);
}
@@ -2033,10 +2033,10 @@ void SAL_CALL destroyCallback(void * data)
static ThreadData myThreadData(destroyCallback);
-/**
+/**
*/
-class myKeyThread : public Thread
-{
+class myKeyThread : public Thread
+{
public:
// a public char member for test result checking
char m_Char_Test;
@@ -2047,7 +2047,7 @@ public:
}
private:
char m_nData;
-
+
void SAL_CALL run()
{
char * pc = new char[2];
@@ -2067,13 +2067,13 @@ public:
if (isRunning())
{
t_print("error: not terminated.\n");
- }
+ }
}
};
static ThreadData idData;
-class idThread: public Thread
+class idThread: public Thread
{
public:
oslThreadIdentifier m_Id;
@@ -2117,7 +2117,7 @@ namespace osl_ThreadData
// insert your test code here.
void ctor_001()
{
-
+
}
CPPUNIT_TEST_SUITE(ctors);
@@ -2152,12 +2152,12 @@ namespace osl_ThreadData
oslThreadIdentifier aThreadId1 = aThread1.getIdentifier();
oslThreadIdentifier aThreadId2 = aThread2.getIdentifier();
-
+
CPPUNIT_ASSERT_MESSAGE(
- "ThreadData setData: ",
+ "ThreadData setData: ",
aThread1.m_Id == aThreadId1 && aThread2.m_Id == aThreadId2
);
-
+
}
void setData_002()
@@ -2172,7 +2172,7 @@ namespace osl_ThreadData
pc[1] = '\0';
myThreadData.setData(pc);
-
+
myKeyThread aThread1('a');
aThread1.create();
myKeyThread aThread2('b');
@@ -2183,16 +2183,16 @@ namespace osl_ThreadData
aThread1.join();
aThread2.join();
-
+
// the saved thread data of aThread1 & aThread2, different
char cData1 = aThread1.m_Char_Test;
char cData2 = aThread2.m_Char_Test;
-
+
CPPUNIT_ASSERT_MESSAGE(
- "ThreadData setData: ",
+ "ThreadData setData: ",
cData1 == 'a' && cData2 == 'b' && aChar == 'm'
);
-
+
}
/** setData the second time, and then getData
*/
@@ -2205,7 +2205,7 @@ namespace osl_ThreadData
memcpy(pc, &m_nData, 1);
pc[1] = '\0';
myThreadData.setData(pc);
-
+
myKeyThread aThread1('a');
aThread1.create();
myKeyThread aThread2('b');
@@ -2224,25 +2224,25 @@ namespace osl_ThreadData
aThread1.join();
aThread2.join();
-
+
// the saved thread data of aThread1 & aThread2, different
char cData1 = aThread1.m_Char_Test;
char cData2 = aThread2.m_Char_Test;
-
+
CPPUNIT_ASSERT_MESSAGE(
- "ThreadData setData: ",
+ "ThreadData setData: ",
cData1 == 'a' && cData2 == 'b' && aChar == 'o'
);
-
+
}
-
+
CPPUNIT_TEST_SUITE(setData);
CPPUNIT_TEST(setData_001);
CPPUNIT_TEST(setData_002);
CPPUNIT_TEST(setData_003);
CPPUNIT_TEST_SUITE_END();
}; // class setData
-
+
//sal_Bool buildTwoThreads(char)
class getData : public CppUnit::TestFixture
@@ -2273,22 +2273,22 @@ namespace osl_ThreadData
aThread1.join();
aThread2.join();
-
+
char cData1 = aThread1.m_Char_Test;
char cData2 = aThread2.m_Char_Test;
char* pChar = (char*)myThreadData.getData();
char aChar = *pChar;
-
+
CPPUNIT_ASSERT_MESSAGE(
- "ThreadData setData: ",
+ "ThreadData setData: ",
cData1 == 'c' && cData2 == 'd' && aChar == 'i'
);
-
+
}
-
- // setData then change the value in the address data pointer points,
- // and then getData, should get the new value
+
+ // setData then change the value in the address data pointer points,
+ // and then getData, should get the new value
void getData_002()
{
char* pc = new char[2];
@@ -2305,7 +2305,7 @@ namespace osl_ThreadData
aThread1.create();
myKeyThread aThread2('b');
aThread2.create();
-
+
// change the value which pc points
char m_nData2 = 'j';
// strcpy(pc, &m_nData2);
@@ -2318,15 +2318,15 @@ namespace osl_ThreadData
aThread1.join();
aThread2.join();
-
+
char cData1 = aThread1.m_Char_Test;
char cData2 = aThread2.m_Char_Test;
-
+
CPPUNIT_ASSERT_MESSAGE(
- "ThreadData setData: ",
+ "ThreadData setData: ",
cData1 == 'a' && cData2 == 'b' && aChar == 'j'
);
-
+
}
CPPUNIT_TEST_SUITE(getData);
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index fd6e58c5a..0ee7c0f59 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <osl/process.h>
#include <osl/file.hxx>
#include <osl/thread.h>
@@ -70,11 +70,11 @@
//########################################
std::string OUString_to_std_string(const rtl::OUString& oustr)
{
- rtl::OString ostr = rtl::OUStringToOString(oustr, osl_getThreadTextEncoding());
+ rtl::OString ostr = rtl::OUStringToOString(oustr, osl_getThreadTextEncoding());
return std::string(ostr.getStr());
}
-
-//########################################
+
+//########################################
using namespace osl;
using namespace rtl;
@@ -82,8 +82,8 @@ using namespace rtl;
*/
inline void printUString( const ::rtl::OUString & str )
{
- rtl::OString aString;
-
+ rtl::OString aString;
+
t_print("#printUString_u# " );
aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
t_print("%s\n", aString.getStr( ) );
@@ -102,21 +102,21 @@ inline ::rtl::OUString getExecutablePath( void )
}
//rtl::OUString CWD = getExecutablePath();
-
-//########################################
+
+//########################################
class Test_osl_joinProcess : public CppUnit::TestFixture
{
- const OUString join_param_;
+ const OUString join_param_;
const OUString wait_time_;
OUString suCWD;
OUString suExecutableFileURL;
-
+
rtl_uString* parameters_[2];
int parameters_count_;
-
+
public:
-
- Test_osl_joinProcess() :
+
+ Test_osl_joinProcess() :
join_param_(OUString::createFromAscii("-join")),
wait_time_(OUString::createFromAscii("1")),
parameters_count_(2)
@@ -128,16 +128,16 @@ public:
suExecutableFileURL += rtl::OUString::createFromAscii("/");
suExecutableFileURL += EXECUTABLE_NAME;
}
-
+
/*-------------------------------------
Start a process and join with this
process specify a timeout so that
- osl_joinProcessWithTimeout returns
+ osl_joinProcessWithTimeout returns
osl_Process_E_TimedOut
-------------------------------------*/
void osl_joinProcessWithTimeout_timeout_failure()
- {
+ {
oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
@@ -149,46 +149,46 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "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_joinProcessWithTimeout returned without timeout failure",
osl_Process_E_TimedOut == osl_error
- );
-
+ );
+
osl_error = osl_terminateProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_terminateProcess failed",
+ "osl_terminateProcess failed",
osl_error == osl_Process_E_None
);
-
- osl_freeProcessHandle(process);
+
+ osl_freeProcessHandle(process);
}
-
+
/*-------------------------------------
Start a process and join with this
process specify a timeout so that
- osl_joinProcessWithTimeout returns
+ osl_joinProcessWithTimeout returns
osl_Process_E_None
-------------------------------------*/
void osl_joinProcessWithTimeout_without_timeout_failure()
{
- oslProcess process;
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
parameters_,
@@ -199,36 +199,36 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "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_joinProcessWithTimeout returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
+ );
+
+ osl_freeProcessHandle(process);
}
-
+
/*-------------------------------------
Start a process and join with this
- process specify an infinite timeout
+ process specify an infinite timeout
-------------------------------------*/
void osl_joinProcessWithTimeout_infinite()
{
- oslProcess process;
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
parameters_,
@@ -239,32 +239,32 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
-
+
osl_error = osl_joinProcessWithTimeout(process, NULL);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcessWithTimeout returned with failure",
+ "osl_joinProcessWithTimeout returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
+ );
+
+ osl_freeProcessHandle(process);
}
-
+
/*-------------------------------------
Start a process and join with this
process using osl_joinProcess
-------------------------------------*/
-
+
void osl_joinProcess()
{
- oslProcess process;
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
parameters_,
@@ -275,24 +275,24 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
-
+
osl_error = ::osl_joinProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcess returned with failure",
+ "osl_joinProcess returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
+ );
+
+ osl_freeProcessHandle(process);
}
-
+
CPPUNIT_TEST_SUITE(Test_osl_joinProcess);
CPPUNIT_TEST(osl_joinProcessWithTimeout_timeout_failure);
CPPUNIT_TEST(osl_joinProcessWithTimeout_without_timeout_failure);
@@ -307,103 +307,103 @@ typedef std::vector<std::string, rtl::Allocator<std::string> > string_container
typedef string_container_t::const_iterator string_container_const_iter_t;
typedef string_container_t::iterator string_container_iter_t;
-//#########################################################
+//#########################################################
class exclude : public std::unary_function<std::string, bool>
{
public:
//------------------------------------------------
- exclude(const string_container_t& exclude_list)
+ exclude(const string_container_t& exclude_list)
{
string_container_const_iter_t iter = exclude_list.begin();
- string_container_const_iter_t iter_end = exclude_list.end();
- for (/**/; iter != iter_end; ++iter)
- exclude_list_.push_back(env_var_name(*iter));
+ string_container_const_iter_t iter_end = exclude_list.end();
+ for (/**/; iter != iter_end; ++iter)
+ exclude_list_.push_back(env_var_name(*iter));
}
-
+
//------------------------------------------------
bool operator() (const std::string& env_var) const
- {
- return (exclude_list_.end() !=
+ {
+ return (exclude_list_.end() !=
std::find(
- exclude_list_.begin(),
- exclude_list_.end(),
+ exclude_list_.begin(),
+ exclude_list_.end(),
env_var_name(env_var)));
}
private:
//-------------------------------------------------
- // extract the name from an environment variable
+ // extract the name from an environment variable
// that is given in the form "NAME=VALUE"
std::string env_var_name(const std::string& env_var) const
{
- std::string::size_type pos_equal_sign =
+ std::string::size_type pos_equal_sign =
env_var.find_first_of("=");
-
+
if (std::string::npos != pos_equal_sign)
return std::string(env_var, 0, pos_equal_sign);
-
+
return std::string();
}
-
-private:
- string_container_t exclude_list_;
+
+private:
+ string_container_t exclude_list_;
};
-#ifdef WNT
+#ifdef WNT
void read_parent_environment(string_container_t* env_container)
{
LPTSTR env = reinterpret_cast<LPTSTR>(GetEnvironmentStrings());
LPTSTR p = env;
-
+
while (size_t l = _tcslen(p))
- {
+ {
env_container->push_back(std::string(p));
- p += l + 1;
- }
- FreeEnvironmentStrings(env);
+ p += l + 1;
+ }
+ FreeEnvironmentStrings(env);
}
#else
- extern char** environ;
+ extern char** environ;
void read_parent_environment(string_container_t* env_container)
{
- for (int i = 0; NULL != environ[i]; i++)
- env_container->push_back(std::string(environ[i]));
+ for (int i = 0; NULL != environ[i]; i++)
+ env_container->push_back(std::string(environ[i]));
}
#endif
//#########################################################
class Test_osl_executeProcess : public CppUnit::TestFixture
{
- const OUString env_param_;
-
+ const OUString env_param_;
+
OUString temp_file_path_;
rtl_uString* parameters_[2];
int parameters_count_;
OUString suCWD;
OUString suExecutableFileURL;
-
+
public:
-
+
//------------------------------------------------
// ctor
- Test_osl_executeProcess() :
- env_param_(OUString::createFromAscii("-env")),
+ Test_osl_executeProcess() :
+ env_param_(OUString::createFromAscii("-env")),
parameters_count_(2)
- {
+ {
parameters_[0] = env_param_.pData;
suCWD = getExecutablePath();
suExecutableFileURL = suCWD;
suExecutableFileURL += rtl::OUString::createFromAscii("/");
- suExecutableFileURL += EXECUTABLE_NAME;
+ suExecutableFileURL += EXECUTABLE_NAME;
}
-
+
//------------------------------------------------
virtual void setUp()
- {
- temp_file_path_ = create_temp_file();
+ {
+ temp_file_path_ = create_temp_file();
parameters_[1] = temp_file_path_.pData;
}
-
+
//------------------------------------------------
OUString create_temp_file()
{
@@ -414,101 +414,101 @@ public:
OUString temp_file_path;
rc = FileBase::getSystemPathFromFileURL(temp_file_url, temp_file_path);
CPPUNIT_ASSERT_MESSAGE("getSystemPathFromFileURL failed", FileBase::E_None == rc);
-
+
return temp_file_path;
}
-
- //------------------------------------------------
+
+ //------------------------------------------------
void read_child_environment(string_container_t* env_container)
- {
+ {
OString temp_file_name = OUStringToOString(OUString(
- parameters_[1]), osl_getThreadTextEncoding());
- std::ifstream file(temp_file_name.getStr());
-
+ parameters_[1]), osl_getThreadTextEncoding());
+ std::ifstream file(temp_file_name.getStr());
+
CPPUNIT_ASSERT_MESSAGE
(
- "I/O error, cannot open child environment file",
+ "I/O error, cannot open child environment file",
file.is_open()
);
-
+
std::string line;
while (std::getline(file, line))
- env_container->push_back(line);
+ env_container->push_back(line);
}
-
- //------------------------------------------------
+
+ //------------------------------------------------
void dump_env(const string_container_t& env, OUString file_name)
{
OString fname = OUStringToOString(file_name, osl_getThreadTextEncoding());
- std::ofstream file(fname.getStr());
+ std::ofstream file(fname.getStr());
std::ostream_iterator<std::string> oi(file, "\n");
- std::copy(env.begin(), env.end(), oi);
+ std::copy(env.begin(), env.end(), oi);
}
-
+
//------------------------------------------------
- // environment of the child process that was
- // started. The child process writes his
+ // environment of the child process that was
+ // started. The child process writes his
// environment into a file
bool compare_environments()
- {
- string_container_t parent_env;
- read_parent_environment(&parent_env);
-
- string_container_t child_env;
- read_child_environment(&child_env);
-
- return ((parent_env.size() == child_env.size()) &&
- (std::equal(child_env.begin(), child_env.end(), parent_env.begin())));
+ {
+ string_container_t parent_env;
+ read_parent_environment(&parent_env);
+
+ string_container_t child_env;
+ read_child_environment(&child_env);
+
+ return ((parent_env.size() == child_env.size()) &&
+ (std::equal(child_env.begin(), child_env.end(), parent_env.begin())));
}
-
+
//------------------------------------------------
- // compare the equal environment parts and the
+ // compare the equal environment parts and the
// different part of the child environment
bool compare_merged_environments(const string_container_t& different_env_vars)
- {
+ {
string_container_t parent_env;
read_parent_environment(&parent_env);
-
+
//remove the environment variables that we have changed
- //in the child environment from the read parent environment
+ //in the child environment from the read parent environment
parent_env.erase(
- std::remove_if(parent_env.begin(), parent_env.end(), exclude(different_env_vars)),
+ std::remove_if(parent_env.begin(), parent_env.end(), exclude(different_env_vars)),
parent_env.end());
-
+
//read the child environment and exclude the variables that
- //are different
+ //are different
string_container_t child_env;
read_child_environment(&child_env);
- //partition the child environment into the variables that
+ //partition the child environment into the variables that
//are different to the parent environment (they come first)
//and the variables that should be equal between parent
//and child environment
- string_container_iter_t iter_logical_end =
+ string_container_iter_t iter_logical_end =
std::stable_partition(child_env.begin(), child_env.end(), exclude(different_env_vars));
-
- string_container_t different_child_env_vars(child_env.begin(), iter_logical_end);
+
+ string_container_t different_child_env_vars(child_env.begin(), iter_logical_end);
child_env.erase(child_env.begin(), iter_logical_end);
-
+
bool common_env_size_equals = (parent_env.size() == child_env.size());
bool common_env_content_equals = std::equal(child_env.begin(), child_env.end(), parent_env.begin());
-
- bool different_env_size_equals = (different_child_env_vars.size() == different_env_vars.size());
- bool different_env_content_equals =
+
+ bool different_env_size_equals = (different_child_env_vars.size() == different_env_vars.size());
+ bool different_env_content_equals =
std::equal(different_env_vars.begin(), different_env_vars.end(), different_child_env_vars.begin());
-
- return (common_env_size_equals && common_env_content_equals &&
- different_env_size_equals && different_env_content_equals);
+
+ return (common_env_size_equals && common_env_content_equals &&
+ different_env_size_equals && different_env_content_equals);
}
-
+
//------------------------------------------------
- // test that parent and child process have the
- // same environment when osl_executeProcess will
- // be called with out setting new environment
+ // test that parent and child process have the
+ // same environment when osl_executeProcess will
+ // be called with out setting new environment
// variables
void osl_execProc_parent_equals_child_environment()
- {
- oslProcess process;
+ {
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
parameters_,
@@ -519,50 +519,50 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
osl_error = ::osl_joinProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcess returned with failure",
+ "osl_joinProcess returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
-
+ );
+
+ osl_freeProcessHandle(process);
+
CPPUNIT_ASSERT_MESSAGE
(
- "Parent an child environment not equal",
+ "Parent an child environment not equal",
compare_environments()
);
}
-
- //------------------------------------------------
+
+ //------------------------------------------------
#define ENV1 "PAT=a:\\"
#define ENV2 "PATHb=b:\\"
#define ENV3 "Patha=c:\\"
#define ENV4 "Patha=d:\\"
-
+
void osl_execProc_merged_child_environment()
- {
+ {
rtl_uString* child_env[4];
- OUString env1 = OUString::createFromAscii(ENV1);
+ OUString env1 = OUString::createFromAscii(ENV1);
OUString env2 = OUString::createFromAscii(ENV2);
OUString env3 = OUString::createFromAscii(ENV3);
OUString env4 = OUString::createFromAscii(ENV4);
-
+
child_env[0] = env1.pData;
child_env[1] = env2.pData;
child_env[2] = env3.pData;
child_env[3] = env4.pData;
-
- oslProcess process;
+
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
suExecutableFileURL.pData,
parameters_,
@@ -571,40 +571,40 @@ public:
NULL,
suCWD.pData,
child_env,
- sizeof(child_env)/sizeof(child_env[0]),
+ sizeof(child_env)/sizeof(child_env[0]),
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
osl_error = ::osl_joinProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcess returned with failure",
+ "osl_joinProcess returned with failure",
osl_Process_E_None == osl_error
);
-
- osl_freeProcessHandle(process);
-
+
+ osl_freeProcessHandle(process);
+
string_container_t different_child_env_vars;
different_child_env_vars.push_back(ENV1);
different_child_env_vars.push_back(ENV2);
different_child_env_vars.push_back(ENV4);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_execProc_merged_child_environment",
+ "osl_execProc_merged_child_environment",
compare_merged_environments(different_child_env_vars)
- );
+ );
}
-
+
void osl_execProc_test_batch()
{
- oslProcess process;
+ oslProcess process;
rtl::OUString suBatch = suCWD + rtl::OUString::createFromAscii("/") + rtl::OUString::createFromAscii("batch.bat");
oslProcessError osl_error = osl_executeProcess(
suBatch.pData,
@@ -616,32 +616,32 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
osl_error = ::osl_joinProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcess returned with failure",
+ "osl_joinProcess returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
+ );
+
+ osl_freeProcessHandle(process);
}
-
+
void osl_execProc_exe_name_in_argument_list()
{
- rtl_uString* params[3];
-
+ rtl_uString* params[3];
+
params[0] = suExecutableFileURL.pData;
params[1] = env_param_.pData;
params[2] = temp_file_path_.pData;
- oslProcess process;
+ oslProcess process;
oslProcessError osl_error = osl_executeProcess(
NULL,
params,
@@ -652,25 +652,25 @@ public:
NULL,
0,
&process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
osl_error = ::osl_joinProcess(process);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_joinProcess returned with failure",
+ "osl_joinProcess returned with failure",
osl_Process_E_None == osl_error
- );
-
- osl_freeProcessHandle(process);
+ );
+
+ osl_freeProcessHandle(process);
}
-
- CPPUNIT_TEST_SUITE(Test_osl_executeProcess);
+
+ CPPUNIT_TEST_SUITE(Test_osl_executeProcess);
CPPUNIT_TEST(osl_execProc_parent_equals_child_environment);
CPPUNIT_TEST(osl_execProc_merged_child_environment);
CPPUNIT_TEST(osl_execProc_test_batch);
diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk
index d685655fe..482bc6927 100644
--- a/sal/qa/osl/profile/makefile.mk
+++ b/sal/qa/osl/profile/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -48,9 +48,7 @@ SHL1OBJS= \
$(SLO)$/osl_old_testprofile.obj
SHL1TARGET= osl_old_testprofile
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
@@ -61,7 +59,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
#------------------------------- All object files -------------------------------
# do this here, so we get right dependencies
SLOFILES=\
- $(SHL1OBJS)
+ $(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/osl/profile/osl_old_testprofile.cxx b/sal/qa/osl/profile/osl_old_testprofile.cxx
index 65a8d491a..27e4cbe6b 100644
--- a/sal/qa/osl/profile/osl_old_testprofile.cxx
+++ b/sal/qa/osl/profile/osl_old_testprofile.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,13 +40,13 @@
#include <stdio.h>
#include <osl/profile.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//==================================================================================================
// -----------------------------------------------------------------------------
namespace osl_Profile
{
- class oldtests : public CppUnit::TestFixture
+ class oldtests : public CppUnit::TestFixture
{
public:
void test_profile();
@@ -64,8 +64,8 @@ void oldtests::test_profile(void)
rtl_uString_newFromAscii(&ustrProfileName,"//./tmp/soffice.ini");
rtl_uString_newFromAscii(&ustrProfileName2,"//./tmp/not_existing_path/soffice.ini");
-
-
+
+
// successful write
if (hProfile = osl_openProfile( ustrProfileName, 0 ))
{
@@ -74,7 +74,7 @@ void oldtests::test_profile(void)
osl_closeProfile( hProfile );
}
-
+
// unsuccessful write
if (hProfile = osl_openProfile( ustrProfileName2, 0 ))
{
diff --git a/sal/qa/osl/security/makefile.mk b/sal/qa/osl/security/makefile.mk
index 5896f1b61..6bcc6fc9f 100755
--- a/sal/qa/osl/security/makefile.mk
+++ b/sal/qa/osl/security/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,23 +44,15 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Security by codegen.pl
+# auto generated Target:Security by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Security.obj
SHL1TARGET= osl_Security
-SHL1STDLIBS=\
- $(SALLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS+= $(ADVAPI32LIB)
.ENDIF
-.IF "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
SHL1IMPLIB= i$(SHL1TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h
index 63a1c3932..ca08e3025 100755
--- a/sal/qa/osl/security/osl_Security_Const.h
+++ b/sal/qa/osl/security/osl_Security_Const.h
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,12 +52,12 @@
#include <stdlib.h>
#include <stdio.h>
-#if ( defined UNX ) || ( defined OS2 )
+#if ( defined UNX ) || ( defined OS2 )
#include <unistd.h>
#include <pwd.h>
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// LLA: #include <testshl2/cmdlinebits.hxx>
diff --git a/sal/qa/osl/semaphore/makefile.mk b/sal/qa/osl/semaphore/makefile.mk
index d5ad5e532..a8918dcfb 100644
--- a/sal/qa/osl/semaphore/makefile.mk
+++ b/sal/qa/osl/semaphore/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,19 +44,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Semaphore by codegen.pl
+# auto generated Target:Semaphore by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Semaphore.obj
SHL1TARGET= osl_Semaphore
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
diff --git a/sal/qa/osl/semaphore/osl_Semaphore_Const.h b/sal/qa/osl/semaphore/osl_Semaphore_Const.h
index a00adcbe7..831b472a8 100644
--- a/sal/qa/osl/semaphore/osl_Semaphore_Const.h
+++ b/sal/qa/osl/semaphore/osl_Semaphore_Const.h
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-#ifndef _OSL_SEMAPHORE_CONST_H_
+#ifndef _OSL_SEMAPHORE_CONST_H_
#define _OSL_SEMAPHORE_CONST_H_
//------------------------------------------------------------------------
@@ -51,14 +51,14 @@
#endif
#include <osl/time.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#ifdef UNX
#include <unistd.h>
#endif
//------------------------------------------------------------------------
-// most return value -1 denote a fail of operation.
+// most return value -1 denote a fail of operation.
//------------------------------------------------------------------------
#define OSL_PIPE_FAIL -1
diff --git a/sal/qa/osl/socket/makefile.mk b/sal/qa/osl/socket/makefile.mk
index 5bcb252d1..134bcadb5 100755
--- a/sal/qa/osl/socket/makefile.mk
+++ b/sal/qa/osl/socket/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,22 +44,18 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Socket.obj
SHL1TARGET=osl_SocketOld
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
-#SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS+= $(WS2_32LIB)
.ENDIF
.IF "$(GUI)" == "UNX"
-#SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
SHL1STDLIBS+= -ldl -lnsl
.ENDIF
@@ -75,9 +71,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS= \
$(SLO)$/osl_Socket_tests.obj
SHL2TARGET= osl_Socket_tests
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME= $(SHL2TARGET)
@@ -86,15 +80,13 @@ SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
# END --------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL3OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_StreamSocket.obj
SHL3TARGET= osl_StreamSocket
-SHL3STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL3STDLIBS= $(SALLIB) $CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL3STDLIBS += $(WS2_32LIB)
@@ -111,15 +103,13 @@ SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL4OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_DatagramSocket.obj
SHL4TARGET= osl_DatagramSocket
-SHL4STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL4STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL4STDLIBS += $(WS2_32LIB)
@@ -136,15 +126,13 @@ SHL4VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL5OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_SocketAddr.obj
SHL5TARGET= osl_SocketAddr
-SHL5STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL5STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL5STDLIBS += $(WS2_32LIB)
@@ -161,15 +149,13 @@ SHL5VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL6OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_Socket2.obj
SHL6TARGET= osl_Socket2
-SHL6STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL6STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL6STDLIBS += $(WS2_32LIB)
@@ -186,15 +172,13 @@ SHL6VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL7OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_ConnectorSocket.obj
SHL7TARGET= osl_ConnectorSocket
-SHL7STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL7STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL7STDLIBS += $(WS2_32LIB)
@@ -211,15 +195,13 @@ SHL7VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:Socket by codegen.pl
+# auto generated Target:Socket by codegen.pl
SHL8OBJS= \
$(SLO)$/sockethelper.obj \
$(SLO)$/osl_AcceptorSocket.obj
SHL8TARGET= osl_AcceptorSocket
-SHL8STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL8STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
.IF "$(GUI)" == "WNT"
SHL8STDLIBS += $(WS2_32LIB)
diff --git a/sal/qa/osl/socket/osl_AcceptorSocket.cxx b/sal/qa/osl/socket/osl_AcceptorSocket.cxx
index 830feb645..37567d9a6 100644
--- a/sal/qa/osl/socket/osl_AcceptorSocket.cxx
+++ b/sal/qa/osl/socket/osl_AcceptorSocket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -84,12 +84,12 @@ class AcceptorThread : public Thread
::osl::AcceptorSocket asAcceptorSocket;
::rtl::OUString aHostIP;
sal_Bool bOK;
-protected:
+protected:
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( aHostIP, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
if ( sal_True != bOK1 )
@@ -99,19 +99,19 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# AcceptorSocket listen address failed.\n" ) ;
return;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
bOK = sal_True;
- t_print("AcceptorThread: acceptConnection failed! \n");
- }
+ t_print("AcceptorThread: acceptConnection failed! \n");
+ }
}
public:
AcceptorThread(::osl::AcceptorSocket & asSocket, ::rtl::OUString const& aBindIP )
@@ -119,9 +119,9 @@ public:
{
bOK = sal_False;
}
-
+
sal_Bool isOK() { return bOK; }
-
+
~AcceptorThread( )
{
if ( isRunning( ) )
@@ -136,7 +136,7 @@ namespace osl_AcceptorSocket
{
/** testing the methods:
- inline AcceptorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ inline AcceptorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
*/
@@ -144,63 +144,63 @@ namespace osl_AcceptorSocket
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_001()
{
/// Socket constructor.
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the acceptor socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the acceptor socket was created successfully.",
osl_Socket_TypeStream == asSocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
#if 0 /* OBSOLETE */
class operator_assign : public CppUnit::TestFixture
{
public:
-
+
void assign_001()
{
#if defined(LINUX)
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::AcceptorSocket asSocketAssign( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
asSocket.setOption( osl_Socket_OptionReuseAddr, 1);
- ::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT4 );
+ ::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT4 );
asSocket.bind( saSocketAddr );
-
+
AcceptorThread myAcceptorThread( asSocketAssign, rtl::OUString::createFromAscii("127.0.0.1") );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
//when accepting, assign another socket to the socket, the thread will not be closed, so is blocking
asSocketAssign = asSocket;
-
+
t_print("#asSocketAssign port number is %d\n", asSocketAssign.getLocalPort() );
-
+
asSocketAssign.shutdown();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
-
-
+
+
#endif /* LINUX */
}
-
-
+
+
CPPUNIT_TEST_SUITE( operator_assign );
CPPUNIT_TEST( assign_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class operator_assign
#endif /* OBSOLETE */
-
+
/** testing the method:
inline sal_Bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
inline oslSocketResult SAL_CALL acceptConnection( StreamSocket& Connection);
@@ -213,8 +213,8 @@ namespace osl_AcceptorSocket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -233,26 +233,26 @@ namespace osl_AcceptorSocket
csConnectorSocket.close( );
}
-
+
void listen_accept_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
oslSocketResult eResult = asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept.",
( osl_Socket_Ok == eResult ) );
}
@@ -262,39 +262,39 @@ namespace osl_AcceptorSocket
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT4 );
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
oslSocketResult eResult = asAcceptorSocket.acceptConnection(ssConnection, saPeerSocketAddr); /// waiting for incoming connection...
-
- CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept, accept with peer address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept, accept with peer address.",
( sal_True == bOK2 ) &&
- ( osl_Socket_Ok == eResult ) &&
+ ( osl_Socket_Ok == eResult ) &&
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( listen_accept );
CPPUNIT_TEST( listen_accept_001 );
CPPUNIT_TEST( listen_accept_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class listen_accept
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::ctors, "osl_AcceptorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::ctors, "osl_AcceptorSocket");
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::operator_assign, "osl_AcceptorSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::listen_accept, "osl_AcceptorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::listen_accept, "osl_AcceptorSocket");
} // namespace osl_AcceptorSocket
diff --git a/sal/qa/osl/socket/osl_ConnectorSocket.cxx b/sal/qa/osl/socket/osl_ConnectorSocket.cxx
index f18ac5378..ed5c30e33 100644
--- a/sal/qa/osl/socket/osl_ConnectorSocket.cxx
+++ b/sal/qa/osl/socket/osl_ConnectorSocket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -80,7 +80,7 @@ using namespace rtl;
class CloseSocketThread : public Thread
{
::osl::Socket &m_sSocket;
-protected:
+protected:
void SAL_CALL run( )
{
thread_sleep( 1 );
@@ -91,7 +91,7 @@ public:
: m_sSocket( sSocket )
{
}
-
+
~CloseSocketThread( )
{
if ( isRunning( ) )
@@ -105,7 +105,7 @@ namespace osl_ConnectorSocket
{
/** testing the method:
- ConnectorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ ConnectorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
*/
@@ -117,17 +117,17 @@ namespace osl_ConnectorSocket
{
/// Socket constructor.
::osl::ConnectorSocket csSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the connector socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the connector socket was created successfully.",
osl_Socket_TypeStream == csSocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
/** testing the method:
oslSocketResult SAL_CALL connect(const SocketAddr& TargetHost, const TimeValue* pTimeout = 0);
*/
@@ -138,8 +138,8 @@ namespace osl_ConnectorSocket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -157,32 +157,32 @@ namespace osl_ConnectorSocket
csConnectorSocket.close( );
}
-
+
void connect_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT2 );
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT2 );
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
//asAcceptorSocket.enableNonBlockingMode( sal_True );
//oslSocketResult eResultAccept = asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
//CPPUNIT_ASSERT_MESSAGE( "accept failed.", osl_Socket_Ok == eResultAccept );
- /// launch client socket
+ /// launch client socket
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect failed.", osl_Socket_Ok == eResult );
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );/// connected.
-
- CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) &&
( osl_Socket_Ok == eResult ));
}
@@ -192,23 +192,23 @@ namespace osl_ConnectorSocket
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
asAcceptorSocket.enableNonBlockingMode( sal_True );
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_True );
-
+
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect failed.", osl_Socket_InProgress == eResult || osl_Socket_Ok == eResult );
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );
-
- CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) ;
}
// really an error or just delayed
@@ -217,26 +217,26 @@ namespace osl_ConnectorSocket
{
::osl::SocketAddr saTargetSocketAddr1( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr2( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT3 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_False );
-
- oslSocketResult eResult1 = csConnectorSocket.connect( saTargetSocketAddr1, pTimeout );
- oslSocketResult eResult2 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
+
+ oslSocketResult eResult1 = csConnectorSocket.connect( saTargetSocketAddr1, pTimeout );
+ oslSocketResult eResult2 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
CloseSocketThread myCloseThread( csConnectorSocket );
oslSocketResult eResult3 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
myCloseThread.join();
- CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult1 &&
+ CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult1 &&
osl_Socket_Error == eResult2 && osl_Socket_Error == eResult3 );
}
-
+
// really an error in non-blocking mode
void connect_004()
{
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT3 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_True );
-
+
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult );
}
@@ -249,14 +249,14 @@ namespace osl_ConnectorSocket
CPPUNIT_TEST( connect_003 );
CPPUNIT_TEST( connect_004 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class connect
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::ctors, "osl_ConnectorSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::connect, "osl_ConnectorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::ctors, "osl_ConnectorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::connect, "osl_ConnectorSocket");
} // namespace osl_ConnectorSocket
diff --git a/sal/qa/osl/socket/osl_DatagramSocket.cxx b/sal/qa/osl/socket/osl_DatagramSocket.cxx
index 7b45a96fd..9b8afa301 100644
--- a/sal/qa/osl/socket/osl_DatagramSocket.cxx
+++ b/sal/qa/osl/socket/osl_DatagramSocket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -82,7 +82,7 @@ const char * pTestString2 = " Passed#OK";
class CloseSocketThread : public Thread
{
::osl::Socket m_sSocket;
-protected:
+protected:
void SAL_CALL run( )
{
thread_sleep( 1 );
@@ -93,7 +93,7 @@ public:
: m_sSocket( sSocket )
{
}
-
+
~CloseSocketThread( )
{
if ( isRunning( ) )
@@ -111,7 +111,7 @@ namespace osl_DatagramSocket
{
/** testing the methods:
- inline DatagramSocket(oslAddrFamily Family= osl_Socket_FamilyInet,
+ inline DatagramSocket(oslAddrFamily Family= osl_Socket_FamilyInet,
oslProtocol Protocol= osl_Socket_ProtocolIp,
oslSocketType Type= osl_Socket_TypeDgram);
*/
@@ -119,23 +119,23 @@ namespace osl_DatagramSocket
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_001()
{
/// Socket constructor.
::osl::DatagramSocket dsSocket;
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the datagram socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the datagram socket was created successfully.",
osl_Socket_TypeDgram == dsSocket.getType( ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
/**thread do sendTo, refer to http://www.coding-zone.co.uk/cpp/articles/140101networkprogrammingv.shtml
*/
class TalkerThread : public Thread
@@ -143,7 +143,7 @@ class TalkerThread : public Thread
protected:
::osl::SocketAddr saTargetSocketAddr;
::osl::DatagramSocket dsSocket;
-
+
void SAL_CALL run( )
{
dsSocket.sendTo( saTargetSocketAddr, pTestString1, strlen( pTestString1 ) + 1 ); // "test socket"
@@ -151,15 +151,15 @@ protected:
}
void SAL_CALL onTerminated( )
- {
+ {
}
-public:
- TalkerThread( ):
+public:
+ TalkerThread( ):
saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 )
- {
+ {
}
-
+
~TalkerThread( )
{
if ( isRunning( ) )
@@ -174,7 +174,7 @@ class ListenerThread : public Thread
protected:
::osl::SocketAddr saTargetSocketAddr;
::osl::DatagramSocket dsSocket;
-
+
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT10 );
@@ -193,14 +193,14 @@ protected:
{
}
-public:
+public:
sal_Char pRecvBuffer[30];
- ListenerThread( ):
- saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT10 )
- {
- pRecvBuffer[0] = '\0';
+ ListenerThread( ):
+ saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT10 )
+ {
+ pRecvBuffer[0] = '\0';
}
-
+
~ListenerThread( )
{
if ( isRunning( ) )
@@ -208,107 +208,107 @@ public:
}
};
-
+
/** testing the methods:
inline sal_Int32 DatagramSocket::recvFrom(void* pBuffer, sal_uInt32 BufferSize,
SocketAddr* pSenderAddr, oslSocketMsgFlag Flag )
- inline sal_Int32 DatagramSocket::sendTo( const SocketAddr& ReceiverAddr,
+ inline sal_Int32 DatagramSocket::sendTo( const SocketAddr& ReceiverAddr,
const void* pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag )
*/
class sendTo_recvFrom : public CppUnit::TestFixture
{
public:
-
+
void sr_001()
- {
+ {
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 );
::osl::DatagramSocket dsSocket;
dsSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
dsSocket.bind( saLocalSocketAddr );
-
+
sal_Char pReadBuffer[30];
TalkerThread myTalkThread;
myTalkThread.create();
sal_Int32 nRecv = dsSocket.recvFrom( pReadBuffer, 30, &saLocalSocketAddr);
myTalkThread.join();
//t_print("#received buffer is %s# \n", pReadBuffer);
-
+
sal_Bool bOk = ( strcmp(pReadBuffer, pTestString1) == 0 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a talker thread and recvFrom in the main thread, check if the datagram socket can communicate successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a talker thread and recvFrom in the main thread, check if the datagram socket can communicate successfully.",
nRecv > 0 && bOk == sal_True );
}
-
+
void sr_002()
- {
+ {
::osl::SocketAddr saListenSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
-
- //listener thread construct a DatagramSocket, recvFrom waiting for data, then main thread sendto data
+
+ //listener thread construct a DatagramSocket, recvFrom waiting for data, then main thread sendto data
ListenerThread myListenThread;
myListenThread.create();
//to grantee the recvFrom is before sendTo
thread_sleep( 1 );
-
+
sal_Int32 nSend = dsSocket.sendTo( saListenSocketAddr, pTestString2, strlen( pTestString2 ) + 1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo failed: nSend <= 0.", nSend > 0);
-
+
myListenThread.join();
//t_print("#received buffer is %s# \n", myListenThread.pRecvBuffer);
-
+
sal_Bool bOk = ( strcmp( myListenThread.pRecvBuffer, pTestString2) == 0 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a listener thread and sendTo in the main thread, check if the datagram socket can communicate successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a listener thread and sendTo in the main thread, check if the datagram socket can communicate successfully.",
bOk == sal_True );
}
-
+
//sendTo error, return -1; recvFrom error, return -1
void sr_003()
- {
+ {
::osl::SocketAddr saListenSocketAddr( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
// Transport endpoint is not connected
sal_Int32 nSend = dsSocket.sendTo( saListenSocketAddr, pTestString2, strlen( pTestString2 ) + 1 );
- CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
- nSend == -1 );
+ CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
+ nSend == -1 );
}
-
+
void sr_004()
- {
+ {
::osl::SocketAddr saListenSocketAddr1( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT10 );
::osl::SocketAddr saListenSocketAddr2( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
-
+
dsSocket.enableNonBlockingMode( sal_True );
sal_Char pReadBuffer[30];
//sal_Int32 nRecv1 = dsSocket.recvFrom( pReadBuffer, 30, &saListenSocketAddr1 );
-
+
// will block ?
CloseSocketThread myThread( dsSocket );
myThread.create();
sal_Int32 nRecv2 = dsSocket.recvFrom( pReadBuffer, 30, &saListenSocketAddr1 );
myThread.join();
//t_print("#nRecv1 is %d nRecv2 is %d\n", nRecv1, nRecv2 );
- CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
- nRecv2 == -1 );
- }
-
+ CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
+ nRecv2 == -1 );
+ }
+
CPPUNIT_TEST_SUITE( sendTo_recvFrom );
CPPUNIT_TEST( sr_001 );
CPPUNIT_TEST( sr_002 );
CPPUNIT_TEST( sr_003 );
CPPUNIT_TEST( sr_004 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class sendTo_recvFrom
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::ctors, "osl_DatagramSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::sendTo_recvFrom, "osl_DatagramSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::ctors, "osl_DatagramSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::sendTo_recvFrom, "osl_DatagramSocket");
} // namespace osl_DatagramSocket
diff --git a/sal/qa/osl/socket/osl_Socket.cxx b/sal/qa/osl/socket/osl_Socket.cxx
index 27d881c48..0635b0765 100755
--- a/sal/qa/osl/socket/osl_Socket.cxx
+++ b/sal/qa/osl/socket/osl_Socket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,12 +49,12 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
@@ -66,7 +66,7 @@
#include <osl_Socket_Const_orig.h>
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
using namespace osl;
using namespace rtl;
@@ -80,7 +80,7 @@ using namespace rtl;
inline sal_Bool compareUString( const ::rtl::OUString & ustr1, const ::rtl::OUString & ustr2 )
{
sal_Bool bOk = ustr1.equalsIgnoreAsciiCase( ustr2 );
-
+
return bOk;
}
@@ -90,7 +90,7 @@ inline sal_Bool compareUString( const ::rtl::OUString & ustr, const sal_Char *as
{
::rtl::OUString ustr2 = rtl::OUString::createFromAscii( astr );
sal_Bool bOk = ustr.equalsIgnoreAsciiCase( ustr2 );
-
+
return bOk;
}
@@ -108,7 +108,7 @@ inline char * oustring2char( const ::rtl::OUString & str )
return (char *)aString.getStr( );
}
-/** print a UNI_CODE String. And also print some comments of the string.
+/** print a UNI_CODE String. And also print some comments of the string.
*/
inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" )
{
@@ -116,7 +116,7 @@ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = ""
t_print("%s\n", oustring2char( str ) );
}
-/** get the local host name.
+/** get the local host name.
mindy: gethostbyname( "localhost" ), on Linux, it returns the hostname in /etc/hosts + domain name,
if no entry in /etc/hosts, it returns "localhost" + domain name
*/
@@ -124,7 +124,7 @@ inline ::rtl::OUString getHost( void )
{
struct hostent *hptr;
- hptr = gethostbyname( "localhost" );
+ hptr = gethostbyname( "localhost" );
CPPUNIT_ASSERT_MESSAGE( "#In getHostname function, error on gethostbyname()", hptr != NULL );
::rtl::OUString aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) hptr->h_name );
@@ -138,25 +138,25 @@ inline ::rtl::OUString getThisHostname( void )
::rtl::OUString aUString;
#ifdef WNT
struct hostent *hptr;
- hptr = gethostbyname( "localhost" );
+ hptr = gethostbyname( "localhost" );
CPPUNIT_ASSERT_MESSAGE( "#In getHostname function, error on gethostbyname()", hptr != NULL );
aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) hptr->h_name );
#else
char hostname[255];
CPPUNIT_ASSERT_MESSAGE( "#Error: gethostname failed.", gethostname(hostname, 255) == 0 );
-
+
struct hostent *hptr;
//first search /ets/hosts, then search from dns
- hptr = gethostbyname( hostname);
+ hptr = gethostbyname( hostname);
if ( hptr != NULL )
{
strcpy( hostname, hptr->h_name );
}
-
- t_print("hostname is %s \n", hostname );
+
+ t_print("hostname is %s \n", hostname );
aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) hostname );
#endif
- return aUString;
+ return aUString;
}
/** get IP by name, search /etc/hosts first, then search from dns, fail return OUString("")
@@ -166,15 +166,15 @@ inline ::rtl::OUString getIPbyName( rtl::OString const& str_name )
::rtl::OUString aUString;
struct hostent *hptr;
//first search /ets/hosts, then search from dns
- hptr = gethostbyname( str_name.getStr());
+ hptr = gethostbyname( str_name.getStr());
if ( hptr != NULL )
{
struct in_addr ** addrptr;
addrptr = (struct in_addr **) hptr->h_addr_list ;
- //if there are more than one IPs on the same machine, we select one
+ //if there are more than one IPs on the same machine, we select one
for (; *addrptr; addrptr++)
{
- t_print("#Local IP Address: %s\n", inet_ntoa(**addrptr));
+ t_print("#Local IP Address: %s\n", inet_ntoa(**addrptr));
aUString = ::rtl::OUString::createFromAscii( (sal_Char *) (inet_ntoa(**addrptr)) );
}
}
@@ -187,14 +187,14 @@ inline ::rtl::OUString getLocalIP( )
{
char hostname[255];
gethostname(hostname, 255);
-
- return getIPbyName( hostname );
+
+ return getIPbyName( hostname );
}
/** construct error message
*/
inline ::rtl::OUString outputError( const ::rtl::OUString & returnVal, const ::rtl::OUString & rightVal, const sal_Char * msg = "")
-{
+{
::rtl::OUString aUString;
if ( returnVal.equals( rightVal ) )
return aUString;
@@ -214,14 +214,14 @@ void thread_sleep( sal_Int32 _nSec )
/// print statement in thread process must use fflush() to force display.
t_print("# wait %d seconds. ", _nSec );
fflush(stdout);
-
+
#ifdef WNT //Windows
Sleep( _nSec * 100 );
#endif
#if ( defined UNX ) || ( defined OS2 ) //Unix
usleep(_nSec * 100000);
#endif
- t_print("# done\n" );
+ t_print("# done\n" );
}
/** print Boolean value.
@@ -229,7 +229,7 @@ void thread_sleep( sal_Int32 _nSec )
inline void printBool( sal_Bool bOk )
{
t_print("#printBool# " );
- ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" );
+ ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" );
}
/** print content of a ByteSequence.
@@ -240,7 +240,7 @@ inline void printByteSequence_IP( const ::rtl::ByteSequence & bsByteSeq, sal_Int
for ( int i = 0; i < nLen; i++ ){
if ( bsByteSeq[i] < 0 )
t_print("%d ", 256 + bsByteSeq[i] );
- else
+ else
t_print("%d ", bsByteSeq[i] );
}
t_print(" .\n" );
@@ -262,7 +262,7 @@ inline ::rtl::ByteSequence UStringIPToByteSequence( ::rtl::OUString aUStr )
{
if ( ( *pChar != '.' ) && ( i !=aString.getLength( ) ) )
tmpBuffer[nCharCounter++] = *pChar;
- else
+ else
{
tmpBuffer[nCharCounter] = '\0';
nCharCounter = 0;
@@ -311,11 +311,11 @@ protected:
oslThreadIdentifier m_id;
::osl::SocketAddr saTargetSocketAddr;
::osl::ConnectorSocket csConnectorSocket;
-
+
void SAL_CALL run( )
{
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 5;
pTimeout->Nanosec = 0;
@@ -327,7 +327,7 @@ protected:
csConnectorSocket.send( pTestString1, 11 ); // "test socket"
csConnectorSocket.send( pTestString2, 10);
}
- else
+ else
t_print("# ClientSocketThread: connect failed! \n");
// terminate();
//}
@@ -340,15 +340,15 @@ protected:
//t_print("# normally terminate this thread %d!\n", m_id );
}
-public:
- ClientSocketThread( ):
- saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT9 ),
+public:
+ ClientSocketThread( ):
+ saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT9 ),
csConnectorSocket( )
{
m_id = getIdentifier( );
//t_print("# successfully creat this client thread %d!\n", m_id );
}
-
+
~ClientSocketThread( )
{
if ( isRunning( ) )
@@ -364,14 +364,14 @@ class ServerSocketThread : public Thread
{
protected:
oslThreadIdentifier m_id;
-
+
void SAL_CALL run( )
{
::osl::AcceptorSocket asAcceptorSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
while ( schedule( ) == sal_True )
{
@@ -383,13 +383,13 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# ServerSocketThread: AcceptorSocket listen address failed.\n" ) ;
break;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
@@ -398,13 +398,13 @@ protected:
}
sal_Int32 nReadNumber1 = ssStreamConnection.recv( pReadBuffer, 11 );
sal_Int32 nReadNumber2 = ssStreamConnection.recv( pReadBuffer + nReadNumber1, 11 );
- pReadBuffer[nReadNumber1 + nReadNumber2] = '\0';
+ pReadBuffer[nReadNumber1 + nReadNumber2] = '\0';
//t_print("# read buffer content: %s\n", pReadBuffer );
break;
}
ssStreamConnection.close();
asAcceptorSocket.close();
-
+
}
void SAL_CALL onTerminated( )
@@ -420,7 +420,7 @@ public:
m_id = getIdentifier( );
//t_print("# successfully creat this server thread %d!\n", m_id );
}
-
+
~ServerSocketThread( )
{
if ( isRunning( ) )
@@ -435,7 +435,7 @@ class ValueCheckProvider
bool m_bFoundFailure;
char *m_pBuffer;
sal_Int32 m_nBufferSize;
-
+
public:
ValueCheckProvider()
:
@@ -444,12 +444,12 @@ public:
m_nBufferSize(0)
{
}
-
+
bool isFailure() {return m_bFoundFailure;}
const char* getBuffer() {return m_pBuffer;}
char* getWriteBuffer() {return m_pBuffer;}
-
+
sal_Int32 getBufferSize() {return m_nBufferSize;}
bool checkValues(sal_Int32 _nLength, int _nValue)
@@ -495,7 +495,7 @@ protected:
oslThreadIdentifier m_id;
::osl::SocketAddr saTargetSocketAddr;
::osl::ConnectorSocket csConnectorSocket;
-
+
void SAL_CALL run( )
{
TimeValue *pTimeout;
@@ -511,7 +511,7 @@ protected:
sal_Int32 nReadCount = csConnectorSocket.read( m_aValues.getWriteBuffer(), m_aValues.getBufferSize() );
m_aValues.checkValues(nReadCount, m_nValue);
}
- else
+ else
{
t_print("# ReadSocketThread: connect failed! \n");
}
@@ -527,21 +527,21 @@ protected:
//t_print("# normally terminate this thread %d!\n", m_id );
}
-public:
+public:
sal_Int32 getCount() {return m_aValues.getBufferSize();}
bool isOk() {return m_aValues.isFailure() == true ? false : true;}
-
+
ReadSocketThread(sal_Int32 _nBufferSize, int _nValue )
- :
+ :
m_nValue( _nValue ),
- saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT10 ),
+ saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT10 ),
csConnectorSocket( )
{
m_id = getIdentifier( );
//t_print("# successfully creat this client thread %d!\n", m_id );
m_aValues.createBuffer(_nBufferSize, 0);
}
-
+
~ReadSocketThread( )
{
if ( isRunning( ) )
@@ -551,7 +551,7 @@ public:
};
-/** Server Socket Thread, write a file which is large
+/** Server Socket Thread, write a file which is large
*/
class WriteSocketThread : public Thread
{
@@ -559,16 +559,16 @@ class WriteSocketThread : public Thread
protected:
oslThreadIdentifier m_id;
-
+
void SAL_CALL run( )
{
::osl::AcceptorSocket asAcceptorSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT10 );
::osl::StreamSocket ssStreamConnection;
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
/// if the thread should terminate, schedule return false
while ( schedule( ) == sal_True )
{
@@ -580,27 +580,27 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# WriteSocketThread: AcceptorSocket listen address failed. \n" ) ;
break;
}
// blocking mode, if read/recv failed, block until success
- asAcceptorSocket.enableNonBlockingMode( sal_False);
-
+ asAcceptorSocket.enableNonBlockingMode( sal_False);
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
t_print("WriteSocketThread: acceptConnection failed! \n");
break;
}
-
+
ssStreamConnection.write( m_aValues.getBuffer(), m_aValues.getBufferSize() );
break;
}
ssStreamConnection.close();
asAcceptorSocket.close();
}
-
+
void SAL_CALL onTerminated( )
{
//t_print("# normally terminate this server thread %d!\n", m_id );
@@ -615,14 +615,14 @@ public:
m_aValues.createBuffer(_nBufferSize, _nValue);
}
-
+
~WriteSocketThread( )
{
if ( isRunning( ) )
t_print("# error: server thread not terminated.\n" );
m_aValues.freeBuffer();
}
-
+
};
// -----------------------------------------------------------------------------
@@ -632,12 +632,12 @@ class AcceptorThread : public Thread
::osl::AcceptorSocket asAcceptorSocket;
::rtl::OUString aHostIP;
sal_Bool bOK;
-protected:
+protected:
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( aHostIP, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
if ( sal_True != bOK1 )
@@ -647,19 +647,19 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# AcceptorSocket listen address failed.\n" ) ;
return;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
bOK = sal_True;
- t_print("AcceptorThread: acceptConnection failed! \n");
- }
+ t_print("AcceptorThread: acceptConnection failed! \n");
+ }
}
public:
AcceptorThread(::osl::AcceptorSocket & asSocket, ::rtl::OUString & aBindIP )
@@ -667,9 +667,9 @@ public:
{
bOK = sal_False;
}
-
+
sal_Bool isOK() { return bOK; }
-
+
~AcceptorThread( )
{
if ( isRunning( ) )
@@ -683,7 +683,7 @@ public:
class CloseSocketThread : public Thread
{
::osl::Socket m_sSocket;
-protected:
+protected:
void SAL_CALL run( )
{
thread_sleep( 1 );
@@ -694,7 +694,7 @@ public:
: m_sSocket( sSocket )
{
}
-
+
~CloseSocketThread( )
{
if ( isRunning( ) )
@@ -716,44 +716,44 @@ namespace osl_SocketAddr
inline SocketAddr(const SocketAddr& Addr);
inline SocketAddr(const oslSocketAddr , __osl_socket_NoCopy nocopy );
inline SocketAddr(oslSocketAddr Addr);
- inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
+ inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
*/
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_none()
{
/// SocketAddr constructor.
::osl::SocketAddr saSocketAddr;
-
+
// oslSocketResult aResult;
// rtl::OUString suHost = saSocketAddr.getLocalHostname( &aResult);
// rtl::OUString suHost2 = getThisHostname();
- CPPUNIT_ASSERT_MESSAGE("test for none parameter constructor function: check if the socket address was created successfully",
+ CPPUNIT_ASSERT_MESSAGE("test for none parameter constructor function: check if the socket address was created successfully",
sal_True == saSocketAddr.is( ) );
}
-
+
void ctors_none_000()
{
/// SocketAddr constructor.
::osl::SocketAddr saSocketAddr;
-
+
oslSocketResult aResult;
rtl::OUString suHost = saSocketAddr.getLocalHostname( &aResult);
rtl::OUString suHost2 = getThisHostname();
sal_Bool bOk = compareUString(suHost, suHost2);
-
+
rtl::OUString suError = rtl::OUString::createFromAscii("Host names should be the same. From SocketAddr.getLocalHostname() it is'");
suError += suHost;
suError += rtl::OUString::createFromAscii("', from getThisHostname() it is '");
suError += suHost2;
suError += rtl::OUString::createFromAscii("'.");
-
+
CPPUNIT_ASSERT_MESSAGE(suError, sal_True == bOk);
}
@@ -762,23 +762,23 @@ namespace osl_SocketAddr
/// SocketAddr copy constructor.
::osl::SocketAddr saSocketAddr( aHostName1, IP_PORT_HTTP1 );
::osl::SocketAddr saCopySocketAddr( saSocketAddr );
-
+
sal_Int32 nPort = saCopySocketAddr.getPort( );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy constructor function: copy constructor, do an action of copy construction then check the port with original set.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy constructor function: copy constructor, do an action of copy construction then check the port with original set.",
( sal_True == saCopySocketAddr.is( ) ) && ( nPort == IP_PORT_HTTP1 ) );
}
-
+
void ctors_copy_no_001()
{
#if 0
::osl::SocketAddr saSocketAddr( aHostName1, IP_PORT_HTTP1 );
oslSocketAddr psaOSLSocketAddr = saSocketAddr.getHandle( );
-
+
::osl::SocketAddr saSocketAddrCopy( psaOSLSocketAddr, SAL_NO_COPY );
saSocketAddrCopy.setPort( IP_PORT_HTTP2 );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
saSocketAddr.getPort( ) == IP_PORT_HTTP2 );
#endif
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( aHostName1, IP_PORT_HTTP1 );
@@ -787,23 +787,23 @@ namespace osl_SocketAddr
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
+
pSocketAddrCopy->setPort( IP_PORT_HTTP2 );
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getPort( ) == IP_PORT_HTTP2 );
delete pSocketAddrCopy;
// LLA: don't do this also: delete pSocketAddr;
}
-
+
void ctors_copy_no_002()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( aHostName1, IP_PORT_HTTP1 );
CPPUNIT_ASSERT_MESSAGE("check for new SocketAddr", pSocketAddr != NULL);
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getHandle( ) == pSocketAddrCopy->getHandle( ) );
delete pSocketAddrCopy;
@@ -813,39 +813,39 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( aHostName1, IP_PORT_HTTP1 );
::osl::SocketAddr saSocketAddrCopy( saSocketAddr.getHandle( ) );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, get its port to check copy effect.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, get its port to check copy effect.",
saSocketAddrCopy.getPort( ) == IP_PORT_HTTP1 );
}
-
+
void ctors_copy_handle_002()
{
::osl::SocketAddr saSocketAddr( aHostName1, IP_PORT_HTTP1 );
::osl::SocketAddr saSocketAddrCopy( saSocketAddr.getHandle( ) );
saSocketAddrCopy.setPort( IP_PORT_HTTP2 );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, the original one should not be changed.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, the original one should not be changed.",
saSocketAddr.getPort( ) != IP_PORT_HTTP2 );
}
-
+
void ctors_hostname_port_001()
{
/// tcpip-specif constructor.
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP );
printUString(saSocketAddr.getHostname( ), "ctors_hostname_port_001:getHostname");
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: do a constructor using tcpip spec, check the result.",
- saSocketAddr.is( ) == sal_True &&
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: do a constructor using tcpip spec, check the result.",
+ saSocketAddr.is( ) == sal_True &&
( saSocketAddr.getPort( ) == IP_PORT_FTP )/*&&
( sal_True == compareUString( saSocketAddr.getHostname( ), aHostName1 ) ) */);
}
- //same as is_002
+ //same as is_002
void ctors_hostname_port_002()
{
/// tcpip-specif constructor.
::osl::SocketAddr saSocketAddr( aHostIpInval1, IP_PORT_MYPORT2 );
-
+
CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: using an invalid IP address, the socketaddr ctors should fail", sal_False == saSocketAddr.is( ));
}
CPPUNIT_TEST_SUITE( ctors );
@@ -859,12 +859,12 @@ namespace osl_SocketAddr
CPPUNIT_TEST( ctors_hostname_port_001 );
CPPUNIT_TEST( ctors_hostname_port_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
/** testing the method:
- inline sal_Bool is() const;
+ inline sal_Bool is() const;
*/
class is : public CppUnit::TestFixture
@@ -873,38 +873,38 @@ namespace osl_SocketAddr
void is_001()
{
::osl::SocketAddr saSocketAddr;
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create an unknown type socket, it should be True when call is.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create an unknown type socket, it should be True when call is.",
sal_True == saSocketAddr.is( ) );
}
// refer to setPort_003()
void is_002()
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_INVAL );
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid port number",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid port number",
sal_True == saSocketAddr.is( ) );
}
void is_003()
{
::osl::SocketAddr saSocketAddr( aHostIpInval1, IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid Ip number",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid Ip number",
sal_True != saSocketAddr.is( ) );
}
-
+
CPPUNIT_TEST_SUITE( is );
CPPUNIT_TEST( is_001 );
CPPUNIT_TEST( is_002 );
CPPUNIT_TEST( is_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class is
-
+
/** testing the method:
- inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = 0 ) const;
+ inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = 0 ) const;
*/
class getHostname : public CppUnit::TestFixture
@@ -913,38 +913,38 @@ namespace osl_SocketAddr
void setUp()
{
}
-
+
void tearDown()
{
}
-
+
void getHostname_000()
{
::osl::SocketAddr saSocketAddr( aHostIp4, IP_PORT_FTP );
-
+
}
-
- /** it will search the Ip in current machine's /etc/hosts at first, if find, then return the
- mapped hostname, otherwise, it will search via DNS server, and often return hostname+ Domain name
+
+ /** it will search the Ip in current machine's /etc/hosts at first, if find, then return the
+ mapped hostname, otherwise, it will search via DNS server, and often return hostname+ Domain name
like "sceri.PRC.Sun.COM"
The process is same as Socket::getLocalHost(), but getLocalHost can only return hostname of the current machine.
- */
+ */
void getHostname_001()
{
::osl::SocketAddr saSocketAddr( aHostIp4, IP_PORT_FTP );
rtl::OUString suResult = saSocketAddr.getHostname( 0 );
rtl::OUString suError = outputError(suResult, aHostName4, "test for getHostname(0)");
sal_Bool bOK = compareUString( suResult, aHostName4 );
- // search the returned hostname in /etc/hosts, if find, and the IP in the row is same as IP
- // in the Addr, it's right also.
+ // search the returned hostname in /etc/hosts, if find, and the IP in the row is same as IP
+ // in the Addr, it's right also.
if ( bOK == sal_False)
- {
+ {
if ( compareUString( getIPbyName( oustring2char( suResult ) ), aHostIp4 ) == sal_True )
- bOK = sal_True;
+ bOK = sal_True;
}
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK);
}
-
+
// LLA: now we have to control, if this behaviour is right.
// LLA: this function does not work in company (Linux, Windows) but at home
void getHostname_002()
@@ -958,7 +958,7 @@ namespace osl_SocketAddr
oslSocketResult aResult;
rtl::OUString suResult = saSocketAddr.getHostname( &aResult );
CPPUNIT_ASSERT_MESSAGE("SocketAddr.getHostname failed.", aResult == osl_Socket_Ok);
-
+
rtl::OUString suError = outputError(suResult, suHostname, "test for getHostname(0)");
bOK = compareUString( suResult, suHostname );
if ( bOK == sal_False)
@@ -969,21 +969,21 @@ namespace osl_SocketAddr
bOK = sal_True;
}
}
-
+
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( getHostname );
CPPUNIT_TEST( getHostname_001 );
CPPUNIT_TEST( getHostname_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getHostname
-
+
/** testing the method:
- inline sal_Int32 SAL_CALL getPort() const;
+ inline sal_Int32 SAL_CALL getPort() const;
*/
class getPort : public CppUnit::TestFixture
@@ -992,43 +992,43 @@ namespace osl_SocketAddr
void getPort_001()
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort() function: get a normal port number.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort() function: get a normal port number.",
IP_PORT_FTP == saSocketAddr.getPort( ) );
}
-
+
void getPort_002()
{
::osl::SocketAddr saSocketAddr( aHostIp2, IP_PORT_INVAL );
-
+
//t_print("#getPort_002: Port number is %d \n", saSocketAddr.getPort( ));
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid port to a SocketAddr, get the port to see if it can detect. it did not pass in (W32).",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid port to a SocketAddr, get the port to see if it can detect. it did not pass in (W32).",
saSocketAddr.getPort( )>=1 && saSocketAddr.getPort( ) <= 65535 );
}
- //two cases will return OSL_INVALID_PORT: 1. not valid SocketAddr
+ //two cases will return OSL_INVALID_PORT: 1. not valid SocketAddr
//2. SocketAddr family is not osl_Socket_FamilyInet, but case 2 could not be constructed
void getPort_003()
{
::osl::SocketAddr saSocketAddr( aHostIpInval1, IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid IP to a SocketAddr, get the port to see returned value. ",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid IP to a SocketAddr, get the port to see returned value. ",
saSocketAddr.getPort( ) == OSL_INVALID_PORT );
}
-
+
CPPUNIT_TEST_SUITE( getPort );
CPPUNIT_TEST( getPort_001 );
CPPUNIT_TEST( getPort_002 );
CPPUNIT_TEST( getPort_003 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getPort
-
+
/** testing the method:
- inline sal_Bool SAL_CALL setPort( sal_Int32 nPort );
+ inline sal_Bool SAL_CALL setPort( sal_Int32 nPort );
rfc1413.txt: TCP port numbers are from 1-65535
- rfc1700.txt: 0/tcp Reserved ; 0/udp Reserved
+ rfc1700.txt: 0/tcp Reserved ; 0/udp Reserved
*/
class setPort : public CppUnit::TestFixture
@@ -1038,12 +1038,12 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP );
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_TELNET );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: modify a port number setting, and check it.",
- ( sal_True == bOK ) &&
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: modify a port number setting, and check it.",
+ ( sal_True == bOK ) &&
( IP_PORT_TELNET == saSocketAddr.getPort( ) ) );
}
-
+
/** 0 to 1024 is known as the reserved port range (traditionally only root can assign programs to ports in
this range) and the ephemeral port range from 1025 to 65535.
As many of you programmers will know, when you specify the source port of 0 when you connect to a host,
@@ -1056,66 +1056,66 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP );
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_ZERO );
-
+
oslSocket sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
- ::osl::Socket sSocket(sHandle);
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 );//sal_True);
+ ::osl::Socket sSocket(sHandle);
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 );//sal_True);
sal_Bool bOK1 = sSocket.bind( saSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "bind SocketAddr failed", bOK1 == sal_True );
-
+
sal_Int32 newPort = sSocket.getLocalPort();
//t_print("#new port is %d\n", newPort );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: port number should be in 1 ~ 65535, set port 0, it should be converted to a port number between 1024~65535.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: port number should be in 1 ~ 65535, set port 0, it should be converted to a port number between 1024~65535.",
( 1024 <= newPort ) && ( 65535 >= newPort ) && ( bOK == sal_True ) );
-
+
}
-
+
void setPort_003()
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP);
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_INVAL );
//on Linux, getPort return 34463
//t_print("#Port number is %d \n", saSocketAddr.getPort( ));
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an address with invalid port. it should return error or convert it to a valid port.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an address with invalid port. it should return error or convert it to a valid port.",
( ( 1 <= saSocketAddr.getPort( ) ) && ( 65535 >= saSocketAddr.getPort( ) ) &&( bOK == sal_True ) ) ||
bOK == sal_False);
}
-
+
/* this is not a inet-addr => can't set port */
void setPort_004()
{
::osl::SocketAddr saSocketAddr( aHostIpInval1, IP_PORT_FTP);
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an invalid address with valid port. it should return error.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an invalid address with valid port. it should return error.",
bOK == sal_False);
}
-
-
+
+
CPPUNIT_TEST_SUITE( setPort );
CPPUNIT_TEST( setPort_001 );
CPPUNIT_TEST( setPort_002 );
CPPUNIT_TEST( setPort_003 );
CPPUNIT_TEST( setPort_004 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class setPort
-
+
/** tester comment:
-
+
In the following two functions, it use ::rtl::ByteSequence as an intermediate storage for address,
the ByteSequence object can hold sal_Int8 arrays, which is raged [-127, 127], in case of IP addr
- that is greater than 127, say 129.158.217.202, it will stored as -127, -98, -39, -54, it is unique
+ that is greater than 127, say 129.158.217.202, it will stored as -127, -98, -39, -54, it is unique
in the range of sal_Int8, but lack of readability.
- so may be a sal_uInt8 array is better.
+ so may be a sal_uInt8 array is better.
*/
/** testing the method:
- inline sal_Bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
+ inline sal_Bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
*/
class setAddr : public CppUnit::TestFixture
@@ -1127,24 +1127,24 @@ namespace osl_SocketAddr
saSocketAddr.setAddr( UStringIPToByteSequence( aHostIp1 ) );
::rtl::ByteSequence bsSocketAddr = saSocketAddr.getAddr( 0 );
sal_Bool bOK = sal_False;
-
+
if ( ( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) && ( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
-
- CPPUNIT_ASSERT_MESSAGE( "test for setAddr() function: construct Addr with \"129.158.217.202\", set it to \"127.0.0.1\", and check the correctness ",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setAddr() function: construct Addr with \"129.158.217.202\", set it to \"127.0.0.1\", and check the correctness ",
sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( setAddr );
CPPUNIT_TEST( setAddr_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class setAddr
-
+
/** testing the method:
- inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = 0 ) const;
+ inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = 0 ) const;
*/
class getAddr : public CppUnit::TestFixture
@@ -1152,23 +1152,23 @@ namespace osl_SocketAddr
public:
void getAddr_001()
{
- oslSocketResult SocketResult;
+ oslSocketResult SocketResult;
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_FTP );
::rtl::ByteSequence bsSocketAddr = saSocketAddr.getAddr( &SocketResult );
-
+
sal_Bool bOK = sal_False;
if ( ( osl_Socket_Ok == SocketResult ) &&( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
-
- CPPUNIT_ASSERT_MESSAGE( "test for getAddr() function: construct a socketaddr with IP assigned, get the address to check correctness.Caught unknown exception on (Win32)",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getAddr() function: construct a socketaddr with IP assigned, get the address to check correctness.Caught unknown exception on (Win32)",
sal_True == bOK && SocketResult == osl_Socket_Ok);
}
-
+
CPPUNIT_TEST_SUITE( getAddr );
CPPUNIT_TEST( getAddr_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getAddr
@@ -1177,7 +1177,7 @@ namespace osl_SocketAddr
inline SocketAddr & SAL_CALL operator= (const SocketAddr& Addr);
inline SocketAddr & SAL_CALL assign( oslSocketAddr Addr, __osl_socket_NoCopy nocopy );
inline sal_Bool SAL_CALL operator== (oslSocketAddr Addr) const;
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const; /// not implemented.
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const; /// not implemented.
*/
class operator_equal : public CppUnit::TestFixture
@@ -1187,7 +1187,7 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( aHostIp2, IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
sal_Bool bOK = sal_False;
::rtl::ByteSequence bsSocketAddr = saSocketAddrEqual.getAddr( 0 );
@@ -1195,31 +1195,31 @@ namespace osl_SocketAddr
if ( ( IP_PORT_TELNET == saSocketAddrEqual.getPort( ) ) &&( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: use operator= to assign Ip1 to Ip2, check its modification.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: use operator= to assign Ip1 to Ip2, check its modification.",
sal_True == bOK );
}
-
-
+
+
void operator_equal_002()
{
::osl::SocketAddr saSocketAddr( aHostIp3, IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( aHostIp2, IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
- CPPUNIT_ASSERT_MESSAGE( "after assign, the assigned SocketAddr is not same as the original Addr",
+ CPPUNIT_ASSERT_MESSAGE( "after assign, the assigned SocketAddr is not same as the original Addr",
IP_PORT_TELNET == saSocketAddrEqual.getPort( ) );
saSocketAddrEqual.setPort( IP_PORT_MYPORT3 );
saSocketAddr.setPort( IP_PORT_HTTP2 );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: perform an equal action, then try to change the original address's port. it should not be changed ( handle released), it did not pass in (W32), this is under discussion.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: perform an equal action, then try to change the original address's port. it should not be changed ( handle released), it did not pass in (W32), this is under discussion.",
IP_PORT_MYPORT3 == saSocketAddrEqual.getPort( ) );
}
-
+
void operator_equal_const_001()
{
const ::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( aHostIp2, IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
sal_Bool bOK = sal_False;
::rtl::ByteSequence bsSocketAddr = saSocketAddrEqual.getAddr( 0 );
@@ -1227,22 +1227,22 @@ namespace osl_SocketAddr
if ( ( IP_PORT_TELNET == saSocketAddrEqual.getPort( ) ) &&( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: use operator= const to assign Ip1 to Ip2, verify the change on the second one.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: use operator= const to assign Ip1 to Ip2, verify the change on the second one.",
sal_True == bOK );
}
-
+
void operator_equal_const_002()
{
const ::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( aHostIp2, IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
saSocketAddrEqual.setPort( IP_PORT_HTTP1 );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: change the second instance, the first one should not be altered, since it does not released the handle.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: change the second instance, the first one should not be altered, since it does not released the handle.",
IP_PORT_HTTP1 != saSocketAddr.getPort( ) );
}
-
+
void operator_equal_assign_001()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( aHostIp1, IP_PORT_TELNET );
@@ -1251,31 +1251,31 @@ namespace osl_SocketAddr
oslSocketAddr poslSocketAddr = pSocketAddr->getHandle( );
//if( m_handle ) osl_destroySocketAddr( m_handle ); so pSocketAddrAssign had been destroyed and then point to pSocketAddr
pSocketAddrAssign->assign(poslSocketAddr, SAL_NO_COPY);
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddrAssign->getPort( ) == IP_PORT_TELNET );
- delete pSocketAddrAssign;
+ delete pSocketAddrAssign;
}
-
+
void operator_is_equal_001()
{
::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrequal( aHostIp1, IP_PORT_TELNET );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two identical Address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two identical Address.",
sal_True == ( saSocketAddrequal == saSocketAddr.getHandle( ) ) );
}
-
+
void operator_is_equal_002()
{
::osl::SocketAddr saSocketAddr( aHostIp2, IP_PORT_FTP);
::osl::SocketAddr saSocketAddrequal( aHostIp1, IP_PORT_TELNET );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two different Address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two different Address.",
sal_False == ( saSocketAddrequal == saSocketAddr.getHandle( ) ) );
}
-
+
CPPUNIT_TEST_SUITE( operator_equal );
CPPUNIT_TEST( operator_equal_001 );
CPPUNIT_TEST( operator_equal_002 );
@@ -1285,30 +1285,30 @@ namespace osl_SocketAddr
CPPUNIT_TEST( operator_is_equal_001 );
CPPUNIT_TEST( operator_is_equal_002 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class operator_equal
-
+
/** testing the method:
- inline oslSocketAddr SAL_CALL getHandle() const;
+ inline oslSocketAddr SAL_CALL getHandle() const;
*/
class getSocketAddrHandle : public CppUnit::TestFixture
{
public:
-
+
void getSocketAddrHandle_001()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( aHostName1, IP_PORT_HTTP1 );
CPPUNIT_ASSERT_MESSAGE("check for new SocketAddr", pSocketAddr != NULL);
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getHandle( ) == pSocketAddrCopy->getHandle( ) );
- delete pSocketAddrCopy;
+ delete pSocketAddrCopy;
}
void getSocketAddrHandle_002()
@@ -1318,20 +1318,20 @@ namespace osl_SocketAddr
sal_Bool bOK = ( saSocketAddr == poslSocketAddr );
//t_print("getSocketAddrHandle_002\n");
- CPPUNIT_ASSERT_MESSAGE( "test for getHandle() function: use getHandle() function as an intermediate way to create identical address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getHandle() function: use getHandle() function as an intermediate way to create identical address.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getSocketAddrHandle );
CPPUNIT_TEST( getSocketAddrHandle_001 );
CPPUNIT_TEST( getSocketAddrHandle_002 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getSocketAddrHandle
/** testing the method:
- static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = 0);
+ static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = 0);
*/
class getLocalHostname : public CppUnit::TestFixture
@@ -1348,13 +1348,13 @@ namespace osl_SocketAddr
rtl::OUString suHostname = osl::SocketAddr::getLocalHostname(&aResult);
CPPUNIT_ASSERT_MESSAGE("getLocalHostname failed", aResult == osl_Socket_Ok);
}
-
+
void getLocalHostname_001()
{
oslSocketResult *pResult = NULL;
//printSocketResult(*pResult);
::rtl::OUString suResult = ::osl::SocketAddr::getLocalHostname( pResult );
-
+
// LLA: IMHO localhost, or hostname by itself should be ok.
rtl::OUString suThisHost = getThisHostname( );
bool bOk = false;
@@ -1372,20 +1372,20 @@ namespace osl_SocketAddr
::rtl::OUString suError;
suError = outputError(suResult, getThisHostname( ), "test for getLocalHostname() function");
-
+
CPPUNIT_ASSERT_MESSAGE( suError, bOk == true );
}
-
+
CPPUNIT_TEST_SUITE( getLocalHostname );
CPPUNIT_TEST( getLocalHostname_000 );
CPPUNIT_TEST( getLocalHostname_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getLocalHostname
/** testing the method:
- static inline void SAL_CALL resolveHostname( const ::rtl::OUString & strHostName , SocketAddr & Addr );
+ static inline void SAL_CALL resolveHostname( const ::rtl::OUString & strHostName , SocketAddr & Addr );
*/
class resolveHostname : public CppUnit::TestFixture
@@ -1400,22 +1400,22 @@ namespace osl_SocketAddr
if ( ( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
-
- CPPUNIT_ASSERT_MESSAGE( "test for resolveHostname() function: try to resolve localhost to 127.0.0.1.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for resolveHostname() function: try to resolve localhost to 127.0.0.1.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( resolveHostname );
- CPPUNIT_TEST( resolveHostname_001 );
+ CPPUNIT_TEST( resolveHostname_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class resolveHostname
-
+
/** testing the method:
static inline sal_Int32 SAL_CALL getServicePort(
const ::rtl::OUString& strServiceName,
- const ::rtl::OUString & strProtocolName= ::rtl::OUString::createFromAscii( "tcp" ) );
+ const ::rtl::OUString & strProtocolName= ::rtl::OUString::createFromAscii( "tcp" ) );
*/
class gettheServicePort : public CppUnit::TestFixture
@@ -1423,42 +1423,42 @@ namespace osl_SocketAddr
public:
void gettheServicePort_001()
{
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get ftp service port on TCP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get ftp service port on TCP protocol.",
IP_PORT_FTP== ::osl::SocketAddr::getServicePort( aServiceFTP, aProtocolTCP ) );
}
-
+
void gettheServicePort_002()
{
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get telnet service port on TCP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get telnet service port on TCP protocol.",
IP_PORT_TELNET== ::osl::SocketAddr::getServicePort( aServiceTELNET, aProtocolTCP ) );
}
-
+
void gettheServicePort_003()
{
//Solaris has no service called "https", please see /etc/services
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get netbios-ssn service port on UDP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get netbios-ssn service port on UDP protocol.",
IP_PORT_NETBIOS_DGM == ::osl::SocketAddr::getServicePort( aServiceNETBIOS, aProtocolUDP ) );
}
-
+
void gettheServicePort_004()
{
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get a service port which is not exist.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get a service port which is not exist.",
OSL_INVALID_PORT == ::osl::SocketAddr::getServicePort( ::rtl::OUString::createFromAscii( "notexist" ), aProtocolUDP ) );
}
-
+
CPPUNIT_TEST_SUITE( gettheServicePort );
CPPUNIT_TEST( gettheServicePort_001 );
CPPUNIT_TEST( gettheServicePort_002 );
CPPUNIT_TEST( gettheServicePort_003 );
CPPUNIT_TEST( gettheServicePort_004 );
CPPUNIT_TEST_SUITE_END( );
-
- }; // class gettheServicePort
-
+
+ }; // class gettheServicePort
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::ctors, "osl_SocketAddr");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::ctors, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::is, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::getHostname, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::getPort, "osl_SocketAddr");
@@ -1487,16 +1487,16 @@ namespace osl_Socket
*/
/** test writer's comment:
-
- class Socket can not be initialized by its protected constructor, though the protected
- constructor is the most convenient way to create a new socket.
+
+ class Socket can not be initialized by its protected constructor, though the protected
+ constructor is the most convenient way to create a new socket.
it only allow the method of C function osl_createSocket like:
- ::osl::Socket sSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream,
+ ::osl::Socket sSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream,
osl_Socket_ProtocolIp ) );
the use of C method lost some of the transparent of tester using C++ wrapper.
*/
-
+
class ctors : public CppUnit::TestFixture
{
public:
@@ -1512,22 +1512,22 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void ctors_none()
{
/// Socket constructor.
// ::osl::Socket sSocket;
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the socket was created successfully, if no exception occured",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the socket was created successfully, if no exception occured",
1 == 1 );
}
-
+
void ctors_acquire()
{
/// Socket constructor.
::osl::Socket sSocket( sHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == sSocket.getType( ) );
}
@@ -1535,18 +1535,18 @@ namespace osl_Socket
{
/// Socket constructor.
::osl::Socket sSocket( sHandle, SAL_NO_ACQUIRE );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
+
void ctors_copy_ctor()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket copySocket( sSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
osl_Socket_TypeStream == copySocket.getType( ) );
}
@@ -1555,26 +1555,26 @@ namespace osl_Socket
#ifdef WNT
oslSocket sHandleRaw = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
// LLA: ? ::osl::Socket sSocket( sHandleRaw );
- CPPUNIT_ASSERT_MESSAGE( " type osl_Socket_TypeRaw socket create failed on UNX ", sHandleRaw != NULL);
+ CPPUNIT_ASSERT_MESSAGE( " type osl_Socket_TypeRaw socket create failed on UNX ", sHandleRaw != NULL);
#else
oslSocket sHandleRaw = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
CPPUNIT_ASSERT_MESSAGE( " can't create socket with type osl_Socket_TypeRaw within UNX is ok.", sHandleRaw == NULL);
#endif
}
-
+
void ctors_family_Ipx()
{
oslSocket sHandleIpx = osl_createSocket( osl_Socket_FamilyIpx, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
CPPUNIT_ASSERT_MESSAGE( " family osl_Socket_FamilyIpx socket create failed! ", sHandleIpx != NULL);
::osl::Socket sSocket( sHandleIpx ); //, SAL_NO_ACQUIRE );
t_print("#Type is %d \n", sSocket.getType( ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for create new Socket instance that family is osl_Socket_FamilyIpx",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for create new Socket instance that family is osl_Socket_FamilyIpx",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_acquire );
@@ -1583,17 +1583,17 @@ namespace osl_Socket
CPPUNIT_TEST( ctors_TypeRaw );
CPPUNIT_TEST( ctors_family_Ipx );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
-
+
+
/** testing the methods:
inline Socket& SAL_CALL operator= ( oslSocket socketHandle);
inline Socket& SAL_CALL operator= (const Socket& sock);
inline sal_Bool SAL_CALL operator==( const Socket& rSocket ) const ;
inline sal_Bool SAL_CALL operator==( const oslSocket socketHandle ) const;
*/
-
+
class operators : public CppUnit::TestFixture
{
public:
@@ -1609,9 +1609,9 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
/** test writer's comment:
-
+
the assignment operator does not support direct assinment like:
::osl::Socket sSocket = sHandle.
*/
@@ -1619,17 +1619,17 @@ namespace osl_Socket
{
::osl::Socket sSocket(sHandle);
::osl::Socket assignSocket = sSocket.getHandle();
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
-
+
void operators_assignment()
{
::osl::Socket sSocket( sHandle );
::osl::Socket assignSocket = sSocket;
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
@@ -1638,40 +1638,40 @@ namespace osl_Socket
/// Socket constructor.
::osl::Socket sSocket( sHandle );
::osl::Socket equalSocket = sSocket;
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check equal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check equal.",
equalSocket == sHandle );
}
-
+
void operators_equal_handle_002()
{
/// Socket constructor.
::osl::Socket equalSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check unequal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check unequal.",
!( equalSocket == sHandle ) );
}
-
+
void operators_equal_001()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket equalSocket( sSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal function: check equal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal function: check equal.",
equalSocket == sSocket );
}
-
+
void operators_equal_002()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket equalSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_002 function: check unequal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_002 function: check unequal.",
!( equalSocket == sSocket ) );
}
-
+
CPPUNIT_TEST_SUITE( operators );
CPPUNIT_TEST( operators_assignment_handle );
CPPUNIT_TEST( operators_assignment );
@@ -1680,15 +1680,15 @@ namespace osl_Socket
CPPUNIT_TEST( operators_equal_001 );
CPPUNIT_TEST( operators_equal_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class operators
-
-
+
+
/** testing the methods:
inline void SAL_CALL shutdown( oslSocketDirection Direction = osl_Socket_DirReadWrite );
inline void SAL_CALL close();
*/
-
+
class close : public CppUnit::TestFixture
{
public:
@@ -1704,62 +1704,62 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void close_001()
{
::osl::Socket sSocket(sHandle);
sSocket.close();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close_001 function: this function is reserved for test.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close_001 function: this function is reserved for test.",
sSocket.getHandle() == sHandle );
}
-
+
void close_002()
{
//#if defined(LINUX)
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, aHostIp1 );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
//when accepting, close the socket, the thread will not block for accepting
//man close:Any locks held on the file it was associated with, and owned by the process, are removed
asSocket.close();
//thread_sleep( 2 );
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
-//#endif
+//#endif
}
-
+
// to cover "if ( pSockAddrIn->sin_addr.s_addr == htonl(INADDR_ANY) )" in osl_closeSocket( )
void close_003()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, aHostIpZero );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
asSocket.close();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
}
-
+
CPPUNIT_TEST_SUITE( close );
CPPUNIT_TEST( close_001 );
CPPUNIT_TEST( close_002 );
CPPUNIT_TEST( close_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class close
-
+
/** testing the method:
inline void SAL_CALL getLocalAddr( SocketAddr &Addr ) const;
*/
-
+
class getLocalAddr : public CppUnit::TestFixture
{
public:
@@ -1781,33 +1781,33 @@ namespace osl_Socket
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIp1, IP_PORT_MYPORT8 );
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
-
+
sSocket.getLocalAddr( saLocalSocketAddr );
-
+
sal_Bool bOK = compareUString( saLocalSocketAddr.getHostname( 0 ), sSocket.getLocalHost() ) ;
-
- CPPUNIT_ASSERT_MESSAGE( "test for getLocalAddr function: first create a new socket, then a socket address, bind them, and check the address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getLocalAddr function: first create a new socket, then a socket address, bind them, and check the address.",
sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( getLocalAddr );
CPPUNIT_TEST( getLocalAddr_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalAddr
-
+
/** testing the method:
inline sal_Int32 SAL_CALL getLocalPort() const;
*/
-
+
class getLocalPort : public CppUnit::TestFixture
{
public:
@@ -1823,30 +1823,30 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getLocalPort_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIp1, IP_PORT_MYPORT7 ); // aHostIp1 localhost
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
sal_Bool bOK = ( IP_PORT_MYPORT7 == sSocket.getLocalPort( ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getLocalPort function: first create a new socket, then a socket address, bind them, and check the port.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getLocalPort function: first create a new socket, then a socket address, bind them, and check the port.",
sal_True == bOK );
}
-
+
/** test writer's comment:
-
- the invalid port number can not be set by giving invalid port number
- such as 99999 or -1, it will convert to ( x mod 65535 ), so it will always be
- valid, the only instance that the getLocalPort returns OSL_INVALID_PORT
- is when saSocketAddr itself is an invalid one, that is , the IP or host name
+
+ the invalid port number can not be set by giving invalid port number
+ such as 99999 or -1, it will convert to ( x mod 65535 ), so it will always be
+ valid, the only instance that the getLocalPort returns OSL_INVALID_PORT
+ is when saSocketAddr itself is an invalid one, that is , the IP or host name
can not be found, then the created socket address is not valid.
*/
void getLocalPort_002()
@@ -1857,8 +1857,8 @@ namespace osl_Socket
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sSocket.bind( saBindSocketAddr );
//Invalid IP, so bind should fail
- ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
- ::rtl::OUString::valueOf((sal_Int32)OSL_INVALID_PORT),
+ ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
+ ::rtl::OUString::valueOf((sal_Int32)OSL_INVALID_PORT),
"test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned.");
sal_Bool bOK = ( OSL_INVALID_PORT == sSocket.getLocalPort( ) );
(void)bOK;
@@ -1866,45 +1866,45 @@ namespace osl_Socket
//on Unix, if Addr is not an address of type osl_Socket_FamilyInet, it returns OSL_INVALID_PORT
::rtl::OUString suError = ::rtl::OUString::createFromAscii( "on Unix, if Addr is not an address of type osl_Socket_FamilyInet, it returns OSL_INVALID_PORT, but can not create Addr of that case");
#endif
- CPPUNIT_ASSERT_MESSAGE( suError, sal_False );
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_False );
}
-
+
void getLocalPort_003()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( getLocalIP(), IP_PORT_INVAL);
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
- ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
- ::rtl::OUString::createFromAscii("34463"),
- "test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned");
+ ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
+ ::rtl::OUString::createFromAscii("34463"),
+ "test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned");
sal_Bool bOK = ( sSocket.getLocalPort( ) >= 1 && sSocket.getLocalPort( ) <= 65535);
-
- CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getLocalPort );
CPPUNIT_TEST( getLocalPort_001 );
// LLA: CPPUNIT_TEST( getLocalPort_002 );
CPPUNIT_TEST( getLocalPort_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalPort
-
+
/** testing the method:
inline ::rtl::OUString SAL_CALL getLocalHost() const;
Mindyliu: on Linux, at first it will check the binded in /etc/hosts, if it has the binded IP, it will return the hostname in it;
else if the binded IP is "127.0.0.1", it will return "localhost", if it's the machine's ethernet ip such as "129.158.217.90", it
- will return hostname of current processor such as "aegean.PRC.Sun.COM"
+ will return hostname of current processor such as "aegean.PRC.Sun.COM"
*/
-
+
class getLocalHost : public CppUnit::TestFixture
{
public:
@@ -1920,15 +1920,15 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getLocalHost_001()
{
::osl::Socket sSocket(sHandle);
//port number from IP_PORT_HTTP1 to IP_PORT_MYPORT6, mindyliu
::osl::SocketAddr saBindSocketAddr( aHostIp1, IP_PORT_MYPORT6 );
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
@@ -1936,41 +1936,41 @@ namespace osl_Socket
::rtl::OUString suError;
#ifdef WNT
bOK = compareUString( sSocket.getLocalHost( ), getThisHostname( ) ) ;
- suError = outputError(sSocket.getLocalHost( ), getThisHostname( ),
+ suError = outputError(sSocket.getLocalHost( ), getThisHostname( ),
"test for getLocalHost function: create localhost socket and check name");
-#else
+#else
::rtl::OUString aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) "localhost" );
sal_Bool bRes1, bRes2;
bRes1 = compareUString( sSocket.getLocalHost( ), aUString ) ;
bRes2 = compareUString( sSocket.getLocalHost( ), saBindSocketAddr.getHostname(0) ) ;
bOK = bRes1 || bRes2;
suError = outputError(sSocket.getLocalHost( ), aUString, "test for getLocalHost function: create localhost socket and check name");
-#endif
+#endif
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
void getLocalHost_002()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIpInval, IP_PORT_POP3);
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sSocket.bind( saBindSocketAddr );
//Invalid IP, so bind should fail
sal_Bool bOK = compareUString( sSocket.getLocalHost( ), aNullURL ) ;
::rtl::OUString suError = outputError(sSocket.getLocalHost( ), aNullURL, "test for getLocalHost function: getLocalHost with invalid SocketAddr");
-
- CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getLocalHost );
CPPUNIT_TEST( getLocalHost_001 );
CPPUNIT_TEST( getLocalHost_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalHost
-
+
/** testing the methods:
inline void SAL_CALL getPeerAddr( SocketAddr & Addr) const;
@@ -1984,8 +1984,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -2003,7 +2003,7 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void getPeer_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT );
@@ -2011,41 +2011,41 @@ namespace osl_Socket
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
::osl::StreamSocket ssConnection;
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
- /// launch server socket
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind '127.0.0.1' address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );/// connected.
sal_Int32 peerPort = csConnectorSocket.getPeerPort( );
::rtl::OUString peerHost = csConnectorSocket.getPeerHost( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPeer function: setup a connection and then get the peer address, port and host from client side.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPeer function: setup a connection and then get the peer address, port and host from client side.",
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) )&&
- ( sal_True == compareUString( peerHost, saLocalSocketAddr.getHostname( 0 ) ) ) &&
+ ( sal_True == compareUString( peerHost, saLocalSocketAddr.getHostname( 0 ) ) ) &&
( peerPort == saLocalSocketAddr.getPort( ) ));
}
-
-
+
+
CPPUNIT_TEST_SUITE( getPeer );
CPPUNIT_TEST( getPeer_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getPeer
-
+
/** testing the methods:
inline sal_Bool SAL_CALL bind(const SocketAddr& LocalInterface);
*/
-
+
class bind : public CppUnit::TestFixture
{
@@ -2062,48 +2062,48 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void bind_001()
{
::osl::Socket sSocket(sHandle);
//bind must use local IP address ---mindyliu
::osl::SocketAddr saBindSocketAddr( getLocalIP(), IP_PORT_MYPORT5 );
-
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
+
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "Socket bind fail.", sal_True == bOK1 );
-
+
sal_Bool bOK2 = compareUString( sSocket.getLocalHost( ), saBindSocketAddr.getHostname( ) ) ;
-
+
sSocket.close();
CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.", sal_True == bOK2 );
}
-
+
void bind_002()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIpInval, IP_PORT_NETBIOS );
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1); // sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
sal_Bool bOK2 = compareUString( sSocket.getLocalHost( ), getThisHostname( ) ) ;
-
- CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.",
( sal_False == bOK1 ) && ( sal_False == bOK2 ) );
}
-
+
CPPUNIT_TEST_SUITE( bind );
CPPUNIT_TEST( bind_001 );
CPPUNIT_TEST( bind_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class bind
/** testing the methods:
inline sal_Bool SAL_CALL isRecvReady(const TimeValue *pTimeout = 0) const;
-
+
*/
class isRecvReady : public CppUnit::TestFixture
{
@@ -2112,8 +2112,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -2131,14 +2131,14 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void isRecvReady_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT1 );
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT1 );
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
::osl::StreamSocket ssConnection;
- /// launch server socket
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -2147,21 +2147,21 @@ namespace osl_Socket
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// is receive ready?
sal_Bool bOK3 = asAcceptorSocket.isRecvReady( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isRecvReady function: setup a connection and then check if it can transmit data.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isRecvReady function: setup a connection and then check if it can transmit data.",
( sal_True == bOK3 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isRecvReady );
CPPUNIT_TEST( isRecvReady_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isRecvReady
@@ -2175,8 +2175,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -2194,15 +2194,15 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void isSendReady_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT );
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT );
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -2211,27 +2211,27 @@ namespace osl_Socket
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// is send ready?
sal_Bool bOK3 = csConnectorSocket.isSendReady( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isSendReady function: setup a connection and then check if it can transmit data.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isSendReady function: setup a connection and then check if it can transmit data.",
( sal_True == bOK3 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isSendReady );
CPPUNIT_TEST( isSendReady_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isSendReady
/** testing the methods:
inline oslSocketType SAL_CALL getType() const;
-
+
*/
class getType : public CppUnit::TestFixture
@@ -2241,7 +2241,7 @@ namespace osl_Socket
// initialization
void setUp( )
{
-
+
}
void tearDown( )
@@ -2249,31 +2249,31 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getType_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
+
void getType_002()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeDgram == sSocket.getType( ) );
}
-
+
#ifdef UNX
// mindy: since on LINUX and SOLARIS, Raw type socket can not be created, so do not test getType() here
// mindy: and add one test case to test creating Raw type socket--> ctors_TypeRaw()
void getType_003()
{
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.this is not passed in (LINUX, SOLARIS), the osl_Socket_TypeRaw, type socket can not be created.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.this is not passed in (LINUX, SOLARIS), the osl_Socket_TypeRaw, type socket can not be created.",
sal_True);
}
#else
@@ -2281,21 +2281,21 @@ namespace osl_Socket
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeRaw == sSocket.getType( ) );
}
#endif
-
+
CPPUNIT_TEST_SUITE( getType );
CPPUNIT_TEST( getType_001 );
CPPUNIT_TEST( getType_002 );
CPPUNIT_TEST( getType_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getType
-
+
/** testing the methods:
inline sal_Int32 SAL_CALL getOption(
@@ -2303,9 +2303,9 @@ namespace osl_Socket
void* pBuffer,
sal_uInt32 BufferLen,
oslSocketOptionLevel Level= osl_Socket_LevelSocket) const;
-
+
inline sal_Int32 getOption( oslSocketOption option ) const;
-
+
*/
class getOption : public CppUnit::TestFixture
@@ -2315,7 +2315,7 @@ namespace osl_Socket
// initialization
void setUp( )
{
-
+
}
void tearDown( )
@@ -2324,50 +2324,50 @@ namespace osl_Socket
}
/** test writer's comment:
-
+
in oslSocketOption, the osl_Socket_OptionType denote 1 as osl_Socket_TypeStream.
- 2 as osl_Socket_TypeDgram, etc which is not mapping the oslSocketType enum. differ
+ 2 as osl_Socket_TypeDgram, etc which is not mapping the oslSocketType enum. differ
in 1.
*/
-
+
void getOption_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
sal_Int32 * pType = ( sal_Int32 * )malloc( sizeof ( sal_Int32 ) );
- *pType = 0;
+ *pType = 0;
sSocket.getOption( osl_Socket_OptionType, pType, sizeof ( sal_Int32 ) );
sal_Bool bOK = ( SOCK_STREAM == *pType );
- // there is a TypeMap(socket.c) which map osl_Socket_TypeStream to SOCK_STREAM on UNX, and SOCK_STREAM != osl_Socket_TypeStream
+ // there is a TypeMap(socket.c) which map osl_Socket_TypeStream to SOCK_STREAM on UNX, and SOCK_STREAM != osl_Socket_TypeStream
//sal_Bool bOK = ( TYPE_TO_NATIVE(osl_Socket_TypeStream) == *pType );
- free( pType );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get type option of socket.",
+ free( pType );
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get type option of socket.",
sal_True == bOK );
}
-
+
// getsockopt error
void getOption_004()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool * pbDontRoute = ( sal_Bool * )malloc( sizeof ( sal_Bool ) );
sal_Int32 nRes = sSocket.getOption( osl_Socket_OptionInvalid, pbDontRoute, sizeof ( sal_Bool ) );
free( pbDontRoute );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get invalid option of socket, should return -1.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get invalid option of socket, should return -1.",
nRes == -1 );
}
-
+
void getOption_simple_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool bOK = ( sal_False == sSocket.getOption( osl_Socket_OptionDontRoute ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
sal_True == bOK );
}
@@ -2375,50 +2375,50 @@ namespace osl_Socket
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool bOK = ( sal_False == sSocket.getOption( osl_Socket_OptionDebug ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getOption );
CPPUNIT_TEST( getOption_001 );
CPPUNIT_TEST( getOption_004 );
CPPUNIT_TEST( getOption_simple_001 );
CPPUNIT_TEST( getOption_simple_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getOption
/** testing the methods:
- inline sal_Bool SAL_CALL setOption( oslSocketOption Option,
+ inline sal_Bool SAL_CALL setOption( oslSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
- oslSocketOptionLevel Level= osl_Socket_LevelSocket ) const;
+ oslSocketOptionLevel Level= osl_Socket_LevelSocket ) const;
*/
class setOption : public CppUnit::TestFixture
{
public:
TimeValue *pTimeout;
-// LLA: maybe there is an error in the source,
+// LLA: maybe there is an error in the source,
// as long as I remember, if a derived class do not overload all ctors there is a problem.
::osl::AcceptorSocket asAcceptorSocket;
-
+
void setUp( )
{
-
+
}
-
+
void tearDown( )
{
asAcceptorSocket.close( );
}
-
+
// LLA:
// getSocketOption returns BufferLen, or -1 if something failed
@@ -2442,7 +2442,7 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "setOption function failed.", ( sal_True == b1 ) );
sal_Int32 n2 = asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pGetBuffer, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption function failed.", ( n2 == nBufferLen ) );
-
+
// on Linux, the value of option is 1, on Solaris, it's 16, but it's not important the exact value,
// just judge it is zero or not!
sal_Bool bOK = ( 0 != *pGetBuffer );
@@ -2455,9 +2455,9 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "setOption function failed.", ( sal_True == b3 ) );
sal_Int32 n4 = asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pGetBuffer, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption (DONTROUTE) function failed.", ( n4 == nBufferLen ) );
-
+
sal_Bool bOK2 = ( 0 == *pGetBuffer );
-
+
t_print("#setOption_001: getOption is %d \n", *pGetBuffer);
// LLA: sal_Bool * pbDontTouteSet = ( sal_Bool * )malloc( sizeof ( sal_Bool ) );
@@ -2466,22 +2466,22 @@ namespace osl_Socket
// LLA: *pbDontTouteGet = sal_False;
// LLA: asAcceptorSocket.setOption( osl_Socket_OptionDontRoute, pbDontTouteSet, sizeof ( sal_Bool ) );
// LLA: asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pbDontTouteGet, sizeof ( sal_Bool ) );
-// LLA: ::rtl::OUString suError = outputError(::rtl::OUString::valueOf((sal_Int32)*pbDontTouteGet),
-// LLA: ::rtl::OUString::valueOf((sal_Int32)*pbDontTouteSet),
+// LLA: ::rtl::OUString suError = outputError(::rtl::OUString::valueOf((sal_Int32)*pbDontTouteGet),
+// LLA: ::rtl::OUString::valueOf((sal_Int32)*pbDontTouteSet),
// LLA: "test for setOption function: set osl_Socket_OptionDontRoute and then check");
-// LLA:
+// LLA:
// LLA: sal_Bool bOK = ( sal_True == *pbDontTouteGet );
// LLA: free( pbDontTouteSet );
// LLA: free( pbDontTouteGet );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
( sal_True == bOK ) && (sal_True == bOK2) );
free( pbDontRouteSet );
free( pGetBuffer );
-// LLA: CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+// LLA: CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
void setOption_002()
{
/// set and get option.
@@ -2497,17 +2497,17 @@ namespace osl_Socket
linger aLingerGet;
asAcceptorSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
-
+
sal_Int32 n1 = asAcceptorSocket.getOption( osl_Socket_OptionLinger, &aLingerGet, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption (SO_LINGER) function failed.", ( n1 == nBufferLen ) );
-
+
//t_print("#setOption_002: getOption is %d \n", aLingerGet.l_linger);
sal_Bool bOK = ( 7 == aLingerGet.l_linger );
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check. ",
- sal_True == bOK );
-
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check. ",
+ sal_True == bOK );
+
}
-
+
void setOption_003()
{
linger aLingerSet;
@@ -2516,8 +2516,8 @@ namespace osl_Socket
sal_Bool b1 = asAcceptorSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, 0 );
printUString( asAcceptorSocket.getErrorAsString() );
- CPPUNIT_ASSERT_MESSAGE( "setOption (SO_LINGER) function failed for optlen is 0.",
- ( b1 == sal_False ) );
+ CPPUNIT_ASSERT_MESSAGE( "setOption (SO_LINGER) function failed for optlen is 0.",
+ ( b1 == sal_False ) );
}
void setOption_simple_001()
@@ -2525,23 +2525,23 @@ namespace osl_Socket
/// set and get option.
asAcceptorSocket.setOption( osl_Socket_OptionDontRoute, 1 ); //sal_True );
sal_Bool bOK = ( 0 != asAcceptorSocket.getOption( osl_Socket_OptionDontRoute ) );
-
+
t_print("setOption_simple_001(): getoption is %d \n", asAcceptorSocket.getOption( osl_Socket_OptionDontRoute ) );
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
( sal_True == bOK ) );
}
-
+
void setOption_simple_002()
{
/// set and get option.
// LLA: this does not work, due to the fact that SO_LINGER is a structure
// LLA: asAcceptorSocket.setOption( osl_Socket_OptionLinger, 7 );
// LLA: sal_Bool bOK = ( 7 == asAcceptorSocket.getOption( osl_Socket_OptionLinger ) );
-
-// LLA: CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+
+// LLA: CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
// LLA: ( sal_True == bOK ) );
}
-
+
CPPUNIT_TEST_SUITE( setOption );
CPPUNIT_TEST( setOption_001 );
CPPUNIT_TEST( setOption_002 );
@@ -2549,7 +2549,7 @@ namespace osl_Socket
CPPUNIT_TEST( setOption_simple_001 );
// LLA: CPPUNIT_TEST( setOption_simple_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class setOption
@@ -2561,13 +2561,13 @@ namespace osl_Socket
{
public:
::osl::AcceptorSocket asAcceptorSocket;
-
+
void enableNonBlockingMode_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -2575,20 +2575,20 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
+
+ /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
sal_Bool bOK = sal_True;
asAcceptorSocket.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for enableNonBlockingMode function: launch a server socket and make it non blocking. if it can pass the acceptConnection statement, it is non-blocking",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for enableNonBlockingMode function: launch a server socket and make it non blocking. if it can pass the acceptConnection statement, it is non-blocking",
( sal_True == bOK ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( enableNonBlockingMode );
CPPUNIT_TEST( enableNonBlockingMode_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class enableNonBlockingMode
@@ -2599,36 +2599,36 @@ namespace osl_Socket
{
public:
::osl::AcceptorSocket asAcceptorSocket;
-
+
void isNonBlockingMode_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
sal_Bool bOK3 = asAcceptorSocket.isNonBlockingMode( );
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
+
+ /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
sal_Bool bOK4 = asAcceptorSocket.isNonBlockingMode( );
asAcceptorSocket.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isNonBlockingMode function: launch a server socket and make it non blocking. it is expected to change from blocking mode to non-blocking mode.",
( sal_False == bOK3 ) && ( sal_True == bOK4 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isNonBlockingMode );
CPPUNIT_TEST( isNonBlockingMode_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isNonBlockingMode
/** testing the method:
@@ -2649,26 +2649,26 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void clearError_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIpInval, IP_PORT_HTTP2 );
::osl::SocketAddr saLocalSocketAddr;
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sSocket.bind( saBindSocketAddr );//build an error "osl_Socket_E_AddrNotAvail"
oslSocketError seBind = sSocket.getError( );
sSocket.clearError( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for clearError function: trick an error called sSocket.getError( ), and then clear the error states, check the result.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for clearError function: trick an error called sSocket.getError( ), and then clear the error states, check the result.",
osl_Socket_E_None == sSocket.getError( ) && seBind != osl_Socket_E_None );
}
-
-
+
+
CPPUNIT_TEST_SUITE( clearError );
CPPUNIT_TEST( clearError_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class clearError
@@ -2691,17 +2691,17 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getError_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( aHostIp1, IP_PORT_FTP );
::osl::SocketAddr saLocalSocketAddr;
-
- CPPUNIT_ASSERT_MESSAGE( "test for getError function: should get no error.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getError function: should get no error.",
osl_Socket_E_None == sSocket.getError( ) );
}
-
+
void getError_002()
{
::osl::Socket sSocket(sHandle);
@@ -2711,12 +2711,12 @@ namespace osl_Socket
sSocket.bind( saBindSocketAddr );//build an error "osl_Socket_E_AddrNotAvail"
//on Solaris, the error no is EACCES, but it has no mapped value, so getError() returned osl_Socket_E_InvalidError.
#if defined(SOLARIS)
- CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. ",
+ CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. ",
osl_Socket_E_InvalidError == sSocket.getError( ) );
#else
//while on Linux & Win32, the errno is EADDRNOTAVAIL, getError returned osl_Socket_E_AddrNotAvail.
-
- CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. Passed on Linux & Win32",
+
+ CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. Passed on Linux & Win32",
osl_Socket_E_AddrNotAvail == sSocket.getError( ) );
#endif
}
@@ -2725,15 +2725,15 @@ namespace osl_Socket
CPPUNIT_TEST( getError_001 );
CPPUNIT_TEST( getError_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getError
-
+
/** testing the methods:
inline oslSocket getHandle() const;
*/
-
+
class getHandle : public CppUnit::TestFixture
{
public:
@@ -2753,17 +2753,17 @@ namespace osl_Socket
{
::osl::Socket sSocket(sHandle);
::osl::Socket assignSocket = sSocket.getHandle();
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
-
+
void getHandle_002()
{
::osl::Socket sSocket( sHandle );
::osl::Socket assignSocket ( sSocket.getHandle( ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
@@ -2771,7 +2771,7 @@ namespace osl_Socket
CPPUNIT_TEST( getHandle_001 );
CPPUNIT_TEST( getHandle_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getHandle
@@ -2795,7 +2795,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::enableNonBlockingMode, "osl_So
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::isNonBlockingMode, "osl_Socket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::clearError, "osl_Socket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getError, "osl_Socket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getHandle, "osl_Socket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getHandle, "osl_Socket");
} // namespace osl_Socket
@@ -2805,7 +2805,7 @@ namespace osl_StreamSocket
{
/** testing the methods:
- inline StreamSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ inline StreamSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
@@ -2831,22 +2831,22 @@ namespace osl_StreamSocket
sHandle = NULL;
}
-
+
void ctors_none()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the stream socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the stream socket was created successfully.",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
-
+
void ctors_acquire()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( sHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
@@ -2854,31 +2854,31 @@ namespace osl_StreamSocket
{
/// Socket constructor.
::osl::StreamSocket ssSocket( sHandle, SAL_NO_ACQUIRE );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
-
+
void ctors_copy_ctor()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
/// Socket copy constructor.
::osl::StreamSocket copySocket( ssSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
osl_Socket_TypeStream == copySocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_acquire );
CPPUNIT_TEST( ctors_no_acquire );
CPPUNIT_TEST( ctors_copy_ctor );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
class send_recv: public CppUnit::TestFixture
{
public:
@@ -2889,9 +2889,9 @@ namespace osl_StreamSocket
void tearDown( )
{
-
+
}
-
+
void send_recv1()
{
//client sent two strings, and server received, check the order and value
@@ -2899,7 +2899,7 @@ namespace osl_StreamSocket
ClientSocketThread myClientThread;
myServerThread.create( );
myClientThread.create( );
-
+
//wait until the thread terminate
myClientThread.join( );
myServerThread.join( );
@@ -2907,10 +2907,10 @@ namespace osl_StreamSocket
strcat( myStr, pTestString1 );
strcat( myStr, pTestString2 );
sal_Int32 nRes = strcmp( myServerThread.pReadBuffer, myStr );
- CPPUNIT_ASSERT_MESSAGE(" test for send/recv with two threads: launch Server/Client threads, send data from client, check received data in Server thread.",
+ CPPUNIT_ASSERT_MESSAGE(" test for send/recv with two threads: launch Server/Client threads, send data from client, check received data in Server thread.",
nRes == 0 );
}
-
+
// error when recv
void send_recv2()
{
@@ -2918,12 +2918,12 @@ namespace osl_StreamSocket
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
sal_Char pReadBuffer[30] = "";
-
+
ClientSocketThread myClientThread;
myClientThread.create( );
-
- asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
-
+
+ asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
+
asAcceptorSocket.bind( saLocalSocketAddr );
asAcceptorSocket.listen( 1 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
@@ -2944,23 +2944,23 @@ namespace osl_StreamSocket
myServerThread.create( );
// thread_sleep( 1 );
myClientThread.create( );
-
+
//wait until the thread terminate
myClientThread.join( );
myServerThread.join( );
-
- //Maximum Packet Size is ( ARPANET, MILNET = 1007 Ethernet (10Mb) = 1500
- // Proteon PRONET = 2046), so here test read 4000 bytes
+
+ //Maximum Packet Size is ( ARPANET, MILNET = 1007 Ethernet (10Mb) = 1500
+ // Proteon PRONET = 2046), so here test read 4000 bytes
sal_Int32 nLength = myClientThread.getCount();
bool bIsOk = myClientThread.isOk(); // check if the values are right.
t_print("Length:=%d\n", nLength);
t_print(" bIsOk:=%d\n", bIsOk);
- CPPUNIT_ASSERT_MESSAGE(" test for write/read values with two threads: send data from server, check readed data in client.",
+ CPPUNIT_ASSERT_MESSAGE(" test for write/read values with two threads: send data from server, check readed data in client.",
nLength == _nBufferSize && bIsOk == true);
}
-
+
void write_read_001()
{
write_read(50, 10);
@@ -2977,7 +2977,7 @@ namespace osl_StreamSocket
{
write_read(8192, 3);
}
-
+
CPPUNIT_TEST_SUITE( send_recv );
CPPUNIT_TEST( write_read_001 );
CPPUNIT_TEST( write_read_002 );
@@ -2988,29 +2988,29 @@ namespace osl_StreamSocket
// CPPUNIT_TEST( write_read );
CPPUNIT_TEST_SUITE_END();
}; // class send_recv
-
+
class SendClientThread : public ClientSocketThread
{
protected:
-
+
void SAL_CALL run( )
{
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 5;
pTimeout->Nanosec = 0;
if ( osl_Socket_Ok == csConnectorSocket.connect( saTargetSocketAddr, pTimeout ))
{
sal_Int32 nWrite1 = csConnectorSocket.write( pTestString1, 11 ); // "test socket"
-
- sal_Int32 nWrite2 = csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
- thread_sleep( 2 );
- csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
+
+ sal_Int32 nWrite2 = csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
+ thread_sleep( 2 );
+ csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
t_print("nWrite1 is %d, nWrite2 is %d\n", nWrite1, nWrite2 );
//thread_sleep( 1 );
}
- else
+ else
t_print("# SendClientThread: connect failed! \n");
csConnectorSocket.close();
@@ -3029,9 +3029,9 @@ protected:
void tearDown( )
{
-
+
}
-
+
// similar to close_002
void shutdown_001()
{
@@ -3039,18 +3039,18 @@ protected:
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, aHostIp1 );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
-
+
//when accepting, shutdown the socket, the thread will not block for accepting
asSocket.shutdown();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK( ) == sal_True );
-#endif
+#endif
}
-
+
void shutdown_002()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
@@ -3061,48 +3061,48 @@ protected:
sal_Char pReadBuffer[40];
SendClientThread mySendThread;
mySendThread.create();
-
+
asSocket.enableNonBlockingMode( sal_False );
::osl::StreamSocket ssConnectionSocket;
oslSocketResult eResult = asSocket.acceptConnection( ssConnectionSocket );
CPPUNIT_ASSERT_MESSAGE("shutdown_002: acceptConnection fail", eResult == osl_Socket_Ok );
-
+
/* set socket option SO_LINGER 0, so close immediatly */
linger aLingerSet;
sal_Int32 nBufferLen = sizeof( struct linger );
aLingerSet.l_onoff = 0;
aLingerSet.l_linger = 0;
- ssConnectionSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
+ ssConnectionSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
thread_sleep( 1 );
//sal_uInt32 nRecv1 = 0;
sal_Int32 nRead1 = ssConnectionSocket.read( pReadBuffer, 11 );
-
+
//shutdown read after client the first send complete
ssConnectionSocket.shutdown( osl_Socket_DirRead );
-
- sal_Int32 nRead2 = ssConnectionSocket.read( pReadBuffer + nRead1, 12 );
+
+ sal_Int32 nRead2 = ssConnectionSocket.read( pReadBuffer + nRead1, 12 );
sal_Int32 nRead3 = ssConnectionSocket.read( pReadBuffer + nRead1 + nRead2, 12 );
t_print("after read 2, nRead1 is %d, nRead2 is %d, nRead3 is %d \n", nRead1, nRead2, nRead3 );
mySendThread.join();
-
+
ssConnectionSocket.close();
asSocket.close();
-
- /* on Linux, if send is before shutdown(DirRead), can read, nRecv2 still > 0,
+
+ /* on Linux, if send is before shutdown(DirRead), can read, nRecv2 still > 0,
http://dbforums.com/arch/186/2002/12/586417
While on Solaris, after shutdown(DirRead), all read will return 0
*/
#ifdef LINUX
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
nRead1 > 0 && nRead3 == 0 );
#else
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
nRead1 > 0 && nRead2 == 0 && nRead3 == 0 );
#endif
-
+
}
-
+
void shutdown_003()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
@@ -3113,19 +3113,19 @@ protected:
sal_Char pReadBuffer[40];
SendClientThread mySendThread;
mySendThread.create();
-
+
asSocket.enableNonBlockingMode( sal_False );
::osl::StreamSocket ssConnectionSocket;
oslSocketResult eResult = asSocket.acceptConnection( ssConnectionSocket );
CPPUNIT_ASSERT_MESSAGE("shutdown_002: acceptConnection fail", eResult == osl_Socket_Ok );
-
+
thread_sleep( 1 );
//shutdown write after client the first send complete
ssConnectionSocket.shutdown( osl_Socket_DirWrite );
-
+
// recv should not shutdown
sal_Int32 nRead1 = ssConnectionSocket.read( pReadBuffer, 11 );
-
+
sal_Int32 nWrite = ssConnectionSocket.write( pReadBuffer, 11 );
// still can read
sal_Int32 nRead3 = ssConnectionSocket.read( pReadBuffer + nRead1 , 12 );
@@ -3133,12 +3133,12 @@ protected:
mySendThread.join();
ssConnectionSocket.close();
asSocket.close();
-
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not send(write).",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not send(write).",
nRead1 > 0 && nWrite == 0 && nRead3 > 0);
-
+
}
-
+
CPPUNIT_TEST_SUITE( shutdown );
CPPUNIT_TEST( shutdown_001 );
CPPUNIT_TEST( shutdown_002 );
@@ -3153,27 +3153,27 @@ protected:
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 3;
pTimeout->Nanosec = 0;
sal_Bool bOk = asSocket.isExceptionPending( pTimeout );
free( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isExceptionPending.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isExceptionPending.",
bOk == sal_False );
}
-
+
/**tester's comments: lack of a case that return sal_True, do not know when it will return sal_True*/
-
-
+
+
CPPUNIT_TEST_SUITE( isExceptionPending );
CPPUNIT_TEST( isExPending_001 );
CPPUNIT_TEST_SUITE_END();
}; // class isExceptionPending
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::ctors, "osl_StreamSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::ctors, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::send_recv, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::shutdown, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::isExceptionPending, "osl_StreamSocket");
@@ -3185,7 +3185,7 @@ namespace osl_ConnectorSocket
{
/** testing the method:
- ConnectorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ ConnectorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
*/
@@ -3197,17 +3197,17 @@ namespace osl_ConnectorSocket
{
/// Socket constructor.
::osl::ConnectorSocket csSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the connector socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the connector socket was created successfully.",
osl_Socket_TypeStream == csSocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
/** testing the method:
oslSocketResult SAL_CALL connect(const SocketAddr& TargetHost, const TimeValue* pTimeout = 0);
*/
@@ -3218,8 +3218,8 @@ namespace osl_ConnectorSocket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -3237,32 +3237,32 @@ namespace osl_ConnectorSocket
csConnectorSocket.close( );
}
-
+
void connect_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT2 );
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT2 );
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
//asAcceptorSocket.enableNonBlockingMode( sal_True );
//oslSocketResult eResultAccept = asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
//CPPUNIT_ASSERT_MESSAGE( "accept failed.", osl_Socket_Ok == eResultAccept );
- /// launch client socket
+ /// launch client socket
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect failed.", osl_Socket_Ok == eResult );
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );/// connected.
-
- CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) &&
( osl_Socket_Ok == eResult ));
}
@@ -3272,23 +3272,23 @@ namespace osl_ConnectorSocket
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT3 );
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
asAcceptorSocket.enableNonBlockingMode( sal_True );
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_True );
-
+
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect failed.", osl_Socket_InProgress == eResult || osl_Socket_Ok == eResult );
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );
-
- CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for connect function: try to create a connection with remote host. and check the setup address.",
sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) ;
}
// really an error or just delayed
@@ -3297,26 +3297,26 @@ namespace osl_ConnectorSocket
{
::osl::SocketAddr saTargetSocketAddr1( aHostIp1, IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr2( aHostIpInval1, IP_PORT_MYPORT3 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_False );
-
- oslSocketResult eResult1 = csConnectorSocket.connect( saTargetSocketAddr1, pTimeout );
- oslSocketResult eResult2 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
+
+ oslSocketResult eResult1 = csConnectorSocket.connect( saTargetSocketAddr1, pTimeout );
+ oslSocketResult eResult2 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
CloseSocketThread myCloseThread( csConnectorSocket );
oslSocketResult eResult3 = csConnectorSocket.connect( saTargetSocketAddr2, pTimeout );
myCloseThread.join();
- CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult1 &&
+ CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult1 &&
osl_Socket_Error == eResult2 && osl_Socket_Error == eResult3 );
}
-
+
// really an error in non-blocking mode
void connect_004()
{
::osl::SocketAddr saTargetSocketAddr( aHostIpInval1, IP_PORT_MYPORT3 );
-
+
csConnectorSocket.enableNonBlockingMode( sal_True );
-
+
oslSocketResult eResult = csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
CPPUNIT_ASSERT_MESSAGE( "connect should failed.", osl_Socket_Error == eResult );
}
@@ -3329,14 +3329,14 @@ namespace osl_ConnectorSocket
CPPUNIT_TEST( connect_003 );
CPPUNIT_TEST( connect_004 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class connect
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::ctors, "osl_ConnectorSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::connect, "osl_ConnectorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::ctors, "osl_ConnectorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ConnectorSocket::connect, "osl_ConnectorSocket");
} // namespace osl_ConnectorSocket
@@ -3346,7 +3346,7 @@ namespace osl_AcceptorSocket
{
/** testing the methods:
- inline AcceptorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ inline AcceptorSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
*/
@@ -3354,63 +3354,63 @@ namespace osl_AcceptorSocket
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_001()
{
/// Socket constructor.
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the acceptor socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the acceptor socket was created successfully.",
osl_Socket_TypeStream == asSocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
#if 0
class operator_assign : public CppUnit::TestFixture
{
public:
-
+
void assign_001()
{
#if defined(LINUX)
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::AcceptorSocket asSocketAssign( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
asSocket.setOption( osl_Socket_OptionReuseAddr, 1);
- ::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_MYPORT4 );
+ ::osl::SocketAddr saSocketAddr( aHostIp1, IP_PORT_MYPORT4 );
asSocket.bind( saSocketAddr );
-
+
AcceptorThread myAcceptorThread( asSocketAssign, aHostIp1 );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
//when accepting, assign another socket to the socket, the thread will not be closed, so is blocking
asSocketAssign = asSocket;
-
+
t_print("#asSocketAssign port number is %d\n", asSocketAssign.getLocalPort() );
-
+
asSocketAssign.shutdown();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
-
-
+
+
#endif /* LINUX */
}
-
-
+
+
CPPUNIT_TEST_SUITE( operator_assign );
CPPUNIT_TEST( assign_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class operator_assign
#endif
-
+
/** testing the method:
inline sal_Bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
inline oslSocketResult SAL_CALL acceptConnection( StreamSocket& Connection);
@@ -3423,8 +3423,8 @@ namespace osl_AcceptorSocket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -3443,26 +3443,26 @@ namespace osl_AcceptorSocket
csConnectorSocket.close( );
}
-
+
void listen_accept_001()
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT3 );
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT3 );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
oslSocketResult eResult = asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept.",
( osl_Socket_Ok == eResult ) );
}
@@ -3472,43 +3472,43 @@ namespace osl_AcceptorSocket
::osl::SocketAddr saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT4 );
::osl::SocketAddr saPeerSocketAddr( aHostIp2, IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
oslSocketResult eResult = asAcceptorSocket.acceptConnection(ssConnection, saPeerSocketAddr); /// waiting for incoming connection...
-
- CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept, accept with peer address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for listen_accept function: try to create a connection with remote host, using listen and accept, accept with peer address.",
( sal_True == bOK2 ) &&
- ( osl_Socket_Ok == eResult ) &&
+ ( osl_Socket_Ok == eResult ) &&
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) );
}
-
+
void listen_accept_003()
{
-
+
}
-
+
CPPUNIT_TEST_SUITE( listen_accept );
CPPUNIT_TEST( listen_accept_001 );
CPPUNIT_TEST( listen_accept_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class listen_accept
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::ctors, "osl_AcceptorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::ctors, "osl_AcceptorSocket");
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::operator_assign, "osl_AcceptorSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::listen_accept, "osl_AcceptorSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_AcceptorSocket::listen_accept, "osl_AcceptorSocket");
} // namespace osl_AcceptorSocket
@@ -3517,7 +3517,7 @@ namespace osl_DatagramSocket
{
/** testing the methods:
- inline DatagramSocket(oslAddrFamily Family= osl_Socket_FamilyInet,
+ inline DatagramSocket(oslAddrFamily Family= osl_Socket_FamilyInet,
oslProtocol Protocol= osl_Socket_ProtocolIp,
oslSocketType Type= osl_Socket_TypeDgram);
*/
@@ -3525,23 +3525,23 @@ namespace osl_DatagramSocket
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_001()
{
/// Socket constructor.
::osl::DatagramSocket dsSocket;
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the datagram socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_001 constructor function: check if the datagram socket was created successfully.",
osl_Socket_TypeDgram == dsSocket.getType( ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
/**thread do sendTo, refer to http://www.coding-zone.co.uk/cpp/articles/140101networkprogrammingv.shtml
*/
class TalkerThread : public Thread
@@ -3549,7 +3549,7 @@ class TalkerThread : public Thread
protected:
::osl::SocketAddr saTargetSocketAddr;
::osl::DatagramSocket dsSocket;
-
+
void SAL_CALL run( )
{
dsSocket.sendTo( saTargetSocketAddr, pTestString1, strlen( pTestString1 ) + 1 ); // "test socket"
@@ -3557,15 +3557,15 @@ protected:
}
void SAL_CALL onTerminated( )
- {
+ {
}
-public:
- TalkerThread( ):
+public:
+ TalkerThread( ):
saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT9 )
- {
+ {
}
-
+
~TalkerThread( )
{
if ( isRunning( ) )
@@ -3580,7 +3580,7 @@ class ListenerThread : public Thread
protected:
::osl::SocketAddr saTargetSocketAddr;
::osl::DatagramSocket dsSocket;
-
+
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT10 );
@@ -3599,14 +3599,14 @@ protected:
{
}
-public:
+public:
sal_Char pRecvBuffer[30];
- ListenerThread( ):
- saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT10 )
- {
- pRecvBuffer[0] = '\0';
+ ListenerThread( ):
+ saTargetSocketAddr( aHostIp1, IP_PORT_MYPORT10 )
+ {
+ pRecvBuffer[0] = '\0';
}
-
+
~ListenerThread( )
{
if ( isRunning( ) )
@@ -3614,107 +3614,107 @@ public:
}
};
-
+
/** testing the methods:
inline sal_Int32 DatagramSocket::recvFrom(void* pBuffer, sal_uInt32 BufferSize,
SocketAddr* pSenderAddr, oslSocketMsgFlag Flag )
- inline sal_Int32 DatagramSocket::sendTo( const SocketAddr& ReceiverAddr,
+ inline sal_Int32 DatagramSocket::sendTo( const SocketAddr& ReceiverAddr,
const void* pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag )
*/
class sendTo_recvFrom : public CppUnit::TestFixture
{
public:
-
+
void sr_001()
- {
+ {
::osl::SocketAddr saLocalSocketAddr( aHostIp1, IP_PORT_MYPORT9 );
::osl::DatagramSocket dsSocket;
dsSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
dsSocket.bind( saLocalSocketAddr );
-
+
sal_Char pReadBuffer[30];
TalkerThread myTalkThread;
myTalkThread.create();
sal_Int32 nRecv = dsSocket.recvFrom( pReadBuffer, 30, &saLocalSocketAddr);
myTalkThread.join();
//t_print("#received buffer is %s# \n", pReadBuffer);
-
+
sal_Bool bOk = ( strcmp(pReadBuffer, pTestString1) == 0 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a talker thread and recvFrom in the main thread, check if the datagram socket can communicate successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a talker thread and recvFrom in the main thread, check if the datagram socket can communicate successfully.",
nRecv > 0 && bOk == sal_True );
}
-
+
void sr_002()
- {
+ {
::osl::SocketAddr saListenSocketAddr( aHostIp1, IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
-
- //listener thread construct a DatagramSocket, recvFrom waiting for data, then main thread sendto data
+
+ //listener thread construct a DatagramSocket, recvFrom waiting for data, then main thread sendto data
ListenerThread myListenThread;
myListenThread.create();
//to grantee the recvFrom is before sendTo
thread_sleep( 1 );
-
+
sal_Int32 nSend = dsSocket.sendTo( saListenSocketAddr, pTestString2, strlen( pTestString2 ) + 1 );
-
+
CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo failed: nSend <= 0.", nSend > 0);
-
+
myListenThread.join();
//t_print("#received buffer is %s# \n", myListenThread.pRecvBuffer);
-
+
sal_Bool bOk = ( strcmp( myListenThread.pRecvBuffer, pTestString2) == 0 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a listener thread and sendTo in the main thread, check if the datagram socket can communicate successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for sendTo/recvFrom function: create a listener thread and sendTo in the main thread, check if the datagram socket can communicate successfully.",
bOk == sal_True );
}
-
+
//sendTo error, return -1; recvFrom error, return -1
void sr_003()
- {
+ {
::osl::SocketAddr saListenSocketAddr( aHostIpInval1, IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
// Transport endpoint is not connected
sal_Int32 nSend = dsSocket.sendTo( saListenSocketAddr, pTestString2, strlen( pTestString2 ) + 1 );
- CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
- nSend == -1 );
+ CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
+ nSend == -1 );
}
-
+
void sr_004()
- {
+ {
::osl::SocketAddr saListenSocketAddr1( aHostIpInval1, IP_PORT_MYPORT10 );
::osl::SocketAddr saListenSocketAddr2( aHostIp2, IP_PORT_MYPORT10 );
::osl::DatagramSocket dsSocket;
-
+
dsSocket.enableNonBlockingMode( sal_True );
sal_Char pReadBuffer[30];
//sal_Int32 nRecv1 = dsSocket.recvFrom( pReadBuffer, 30, &saListenSocketAddr1 );
-
+
// will block ?
CloseSocketThread myThread( dsSocket );
myThread.create();
sal_Int32 nRecv2 = dsSocket.recvFrom( pReadBuffer, 30, &saListenSocketAddr1 );
myThread.join();
//t_print("#nRecv1 is %d nRecv2 is %d\n", nRecv1, nRecv2 );
- CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
- nRecv2 == -1 );
- }
-
+ CPPUNIT_ASSERT_MESSAGE( "DatagramSocket sendTo should fail: nSend <= 0.",
+ nRecv2 == -1 );
+ }
+
CPPUNIT_TEST_SUITE( sendTo_recvFrom );
CPPUNIT_TEST( sr_001 );
CPPUNIT_TEST( sr_002 );
CPPUNIT_TEST( sr_003 );
CPPUNIT_TEST( sr_004 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class sendTo_recvFrom
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::ctors, "osl_DatagramSocket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::sendTo_recvFrom, "osl_DatagramSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::ctors, "osl_DatagramSocket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_DatagramSocket::sendTo_recvFrom, "osl_DatagramSocket");
} // namespace osl_DatagramSocket
diff --git a/sal/qa/osl/socket/osl_Socket2.cxx b/sal/qa/osl/socket/osl_Socket2.cxx
index 60645f89b..cc1f2d9fd 100644
--- a/sal/qa/osl/socket/osl_Socket2.cxx
+++ b/sal/qa/osl/socket/osl_Socket2.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -93,12 +93,12 @@ class AcceptorThread : public Thread
::osl::AcceptorSocket asAcceptorSocket;
::rtl::OUString aHostIP;
sal_Bool bOK;
-protected:
+protected:
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( aHostIP, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
if ( sal_True != bOK1 )
@@ -108,19 +108,19 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# AcceptorSocket listen address failed.\n" ) ;
return;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
bOK = sal_True;
- t_print("AcceptorThread: acceptConnection failed! \n");
- }
+ t_print("AcceptorThread: acceptConnection failed! \n");
+ }
}
public:
AcceptorThread(::osl::AcceptorSocket & asSocket, ::rtl::OUString const& aBindIP )
@@ -128,9 +128,9 @@ public:
{
bOK = sal_False;
}
-
+
sal_Bool isOK() { return bOK; }
-
+
~AcceptorThread( )
{
if ( isRunning( ) )
@@ -152,16 +152,16 @@ namespace osl_Socket
*/
/** test writer's comment:
-
- class Socket can not be initialized by its protected constructor, though the protected
- constructor is the most convenient way to create a new socket.
+
+ class Socket can not be initialized by its protected constructor, though the protected
+ constructor is the most convenient way to create a new socket.
it only allow the method of C function osl_createSocket like:
- ::osl::Socket sSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream,
+ ::osl::Socket sSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream,
osl_Socket_ProtocolIp ) );
the use of C method lost some of the transparent of tester using C++ wrapper.
*/
-
+
class ctors : public CppUnit::TestFixture
{
public:
@@ -177,22 +177,22 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void ctors_none()
{
/// Socket constructor.
// ::osl::Socket sSocket();
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the socket was created successfully, if no exception occured",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the socket was created successfully, if no exception occured",
1 == 1 );
}
-
+
void ctors_acquire()
{
/// Socket constructor.
::osl::Socket sSocket( sHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == sSocket.getType( ) );
}
@@ -200,18 +200,18 @@ namespace osl_Socket
{
/// Socket constructor.
::osl::Socket sSocket( sHandle, SAL_NO_ACQUIRE );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
+
void ctors_copy_ctor()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket copySocket( sSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
osl_Socket_TypeStream == copySocket.getType( ) );
}
@@ -220,26 +220,26 @@ namespace osl_Socket
#ifdef WNT
oslSocket sHandleRaw = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
// LLA: ? ::osl::Socket sSocket( sHandleRaw );
- CPPUNIT_ASSERT_MESSAGE( " type osl_Socket_TypeRaw socket create failed on UNX ", sHandleRaw != NULL);
+ CPPUNIT_ASSERT_MESSAGE( " type osl_Socket_TypeRaw socket create failed on UNX ", sHandleRaw != NULL);
#else
oslSocket sHandleRaw = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
CPPUNIT_ASSERT_MESSAGE( " can't create socket with type osl_Socket_TypeRaw within UNX is ok.", sHandleRaw == NULL);
#endif
}
-
+
void ctors_family_Ipx()
{
oslSocket sHandleIpx = osl_createSocket( osl_Socket_FamilyIpx, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
CPPUNIT_ASSERT_MESSAGE( " family osl_Socket_FamilyIpx socket create failed! ", sHandleIpx != NULL);
::osl::Socket sSocket( sHandleIpx ); //, SAL_NO_ACQUIRE );
t_print("#Type is %d \n", sSocket.getType( ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for create new Socket instance that family is osl_Socket_FamilyIpx",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for create new Socket instance that family is osl_Socket_FamilyIpx",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_acquire );
@@ -248,17 +248,17 @@ namespace osl_Socket
CPPUNIT_TEST( ctors_TypeRaw );
CPPUNIT_TEST( ctors_family_Ipx );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
-
+
+
/** testing the methods:
inline Socket& SAL_CALL operator= ( oslSocket socketHandle);
inline Socket& SAL_CALL operator= (const Socket& sock);
inline sal_Bool SAL_CALL operator==( const Socket& rSocket ) const ;
inline sal_Bool SAL_CALL operator==( const oslSocket socketHandle ) const;
*/
-
+
class operators : public CppUnit::TestFixture
{
public:
@@ -274,9 +274,9 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
/** test writer's comment:
-
+
the assignment operator does not support direct assinment like:
::osl::Socket sSocket = sHandle.
*/
@@ -284,17 +284,17 @@ namespace osl_Socket
{
::osl::Socket sSocket(sHandle);
::osl::Socket assignSocket = sSocket.getHandle();
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
-
+
void operators_assignment()
{
::osl::Socket sSocket( sHandle );
::osl::Socket assignSocket = sSocket;
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
@@ -303,40 +303,40 @@ namespace osl_Socket
/// Socket constructor.
::osl::Socket sSocket( sHandle );
::osl::Socket equalSocket = sSocket;
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check equal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check equal.",
equalSocket == sHandle );
}
-
+
void operators_equal_handle_002()
{
/// Socket constructor.
::osl::Socket equalSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check unequal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_handle_001 function: check unequal.",
!( equalSocket == sHandle ) );
}
-
+
void operators_equal_001()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket equalSocket( sSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal function: check equal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal function: check equal.",
equalSocket == sSocket );
}
-
+
void operators_equal_002()
{
::osl::Socket sSocket( sHandle );
/// Socket copy constructor.
::osl::Socket equalSocket( osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp ) );
-
- CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_002 function: check unequal.",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for operators_equal_002 function: check unequal.",
!( equalSocket == sSocket ) );
}
-
+
CPPUNIT_TEST_SUITE( operators );
CPPUNIT_TEST( operators_assignment_handle );
CPPUNIT_TEST( operators_assignment );
@@ -345,15 +345,15 @@ namespace osl_Socket
CPPUNIT_TEST( operators_equal_001 );
CPPUNIT_TEST( operators_equal_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class operators
-
-
+
+
/** testing the methods:
inline void SAL_CALL shutdown( oslSocketDirection Direction = osl_Socket_DirReadWrite );
inline void SAL_CALL close();
*/
-
+
class close : public CppUnit::TestFixture
{
public:
@@ -369,62 +369,62 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void close_001()
{
::osl::Socket sSocket(sHandle);
sSocket.close();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close_001 function: this function is reserved for test.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close_001 function: this function is reserved for test.",
sSocket.getHandle() == sHandle );
}
-
+
void close_002()
{
//#if defined(LINUX)
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, rtl::OUString::createFromAscii("127.0.0.1") );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
//when accepting, close the socket, the thread will not block for accepting
//man close:Any locks held on the file it was associated with, and owned by the process, are removed
asSocket.close();
//thread_sleep( 2 );
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
-//#endif
+//#endif
}
-
+
// to cover "if ( pSockAddrIn->sin_addr.s_addr == htonl(INADDR_ANY) )" in osl_closeSocket( )
void close_003()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, rtl::OUString::createFromAscii("0.0.0.0") );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
asSocket.close();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK() == sal_True );
}
-
+
CPPUNIT_TEST_SUITE( close );
CPPUNIT_TEST( close_001 );
CPPUNIT_TEST( close_002 );
CPPUNIT_TEST( close_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class close
-
+
/** testing the method:
inline void SAL_CALL getLocalAddr( SocketAddr &Addr ) const;
*/
-
+
class getLocalAddr : public CppUnit::TestFixture
{
public:
@@ -446,33 +446,33 @@ namespace osl_Socket
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT8 );
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
-
+
sSocket.getLocalAddr( saLocalSocketAddr );
-
+
sal_Bool bOK = compareUString( saLocalSocketAddr.getHostname( 0 ), sSocket.getLocalHost() ) ;
-
- CPPUNIT_ASSERT_MESSAGE( "test for getLocalAddr function: first create a new socket, then a socket address, bind them, and check the address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getLocalAddr function: first create a new socket, then a socket address, bind them, and check the address.",
sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( getLocalAddr );
CPPUNIT_TEST( getLocalAddr_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalAddr
-
+
/** testing the method:
inline sal_Int32 SAL_CALL getLocalPort() const;
*/
-
+
class getLocalPort : public CppUnit::TestFixture
{
public:
@@ -488,30 +488,30 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getLocalPort_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT7 ); // aHostIp1 localhost
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
sal_Bool bOK = ( IP_PORT_MYPORT7 == sSocket.getLocalPort( ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getLocalPort function: first create a new socket, then a socket address, bind them, and check the port.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getLocalPort function: first create a new socket, then a socket address, bind them, and check the port.",
sal_True == bOK );
}
-
+
/** test writer's comment:
-
- the invalid port number can not be set by giving invalid port number
- such as 99999 or -1, it will convert to ( x mod 65535 ), so it will always be
- valid, the only instance that the getLocalPort returns OSL_INVALID_PORT
- is when saSocketAddr itself is an invalid one, that is , the IP or host name
+
+ the invalid port number can not be set by giving invalid port number
+ such as 99999 or -1, it will convert to ( x mod 65535 ), so it will always be
+ valid, the only instance that the getLocalPort returns OSL_INVALID_PORT
+ is when saSocketAddr itself is an invalid one, that is , the IP or host name
can not be found, then the created socket address is not valid.
*/
void getLocalPort_002()
@@ -522,8 +522,8 @@ namespace osl_Socket
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sSocket.bind( saBindSocketAddr );
//Invalid IP, so bind should fail
- ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
- ::rtl::OUString::valueOf((sal_Int32)OSL_INVALID_PORT),
+ ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
+ ::rtl::OUString::valueOf((sal_Int32)OSL_INVALID_PORT),
"test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned.");
sal_Bool bOK = ( OSL_INVALID_PORT == sSocket.getLocalPort( ) );
(void)bOK;
@@ -531,45 +531,45 @@ namespace osl_Socket
//on Unix, if Addr is not an address of type osl_Socket_FamilyInet, it returns OSL_INVALID_PORT
::rtl::OUString suError = ::rtl::OUString::createFromAscii( "on Unix, if Addr is not an address of type osl_Socket_FamilyInet, it returns OSL_INVALID_PORT, but can not create Addr of that case");
#endif
- CPPUNIT_ASSERT_MESSAGE( suError, sal_False );
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_False );
}
-
+
void getLocalPort_003()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( getLocalIP(), IP_PORT_INVAL);
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
- ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
- ::rtl::OUString::createFromAscii("34463"),
- "test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned");
+ ::rtl::OUString suError = outputError(::rtl::OUString::valueOf(sSocket.getLocalPort( )),
+ ::rtl::OUString::createFromAscii("34463"),
+ "test for getLocalPort function: first create a new socket, then an invalid socket address, bind them, and check the port assigned");
sal_Bool bOK = ( sSocket.getLocalPort( ) >= 1 && sSocket.getLocalPort( ) <= 65535);
-
- CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getLocalPort );
CPPUNIT_TEST( getLocalPort_001 );
// LLA: CPPUNIT_TEST( getLocalPort_002 );
CPPUNIT_TEST( getLocalPort_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalPort
-
+
/** testing the method:
inline ::rtl::OUString SAL_CALL getLocalHost() const;
Mindyliu: on Linux, at first it will check the binded in /etc/hosts, if it has the binded IP, it will return the hostname in it;
else if the binded IP is "127.0.0.1", it will return "localhost", if it's the machine's ethernet ip such as "129.158.217.90", it
- will return hostname of current processor such as "aegean.PRC.Sun.COM"
+ will return hostname of current processor such as "aegean.PRC.Sun.COM"
*/
-
+
class getLocalHost : public CppUnit::TestFixture
{
public:
@@ -585,15 +585,15 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getLocalHost_001()
{
::osl::Socket sSocket(sHandle);
//port number from IP_PORT_HTTP1 to IP_PORT_MYPORT6, mindyliu
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT6 );
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
::rtl::OUString suError1 = ::rtl::OUString::createFromAscii("Socket bind fail:") + sSocket.getErrorAsString();
CPPUNIT_ASSERT_MESSAGE( suError1, sal_True == bOK1 );
@@ -601,41 +601,41 @@ namespace osl_Socket
::rtl::OUString suError;
#ifdef WNT
bOK = compareUString( sSocket.getLocalHost( ), getThisHostname( ) ) ;
- suError = outputError(sSocket.getLocalHost( ), getThisHostname( ),
+ suError = outputError(sSocket.getLocalHost( ), getThisHostname( ),
"test for getLocalHost function: create localhost socket and check name");
-#else
+#else
::rtl::OUString aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) "localhost" );
sal_Bool bRes1, bRes2;
bRes1 = compareUString( sSocket.getLocalHost( ), aUString ) ;
bRes2 = compareUString( sSocket.getLocalHost( ), saBindSocketAddr.getHostname(0) ) ;
bOK = bRes1 || bRes2;
suError = outputError(sSocket.getLocalHost( ), aUString, "test for getLocalHost function: create localhost socket and check name");
-#endif
+#endif
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
void getLocalHost_002()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("123.45.67.89"), IP_PORT_POP3);
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sSocket.bind( saBindSocketAddr );
//Invalid IP, so bind should fail
sal_Bool bOK = compareUString( sSocket.getLocalHost( ), rtl::OUString::createFromAscii("") ) ;
::rtl::OUString suError = outputError(sSocket.getLocalHost( ), rtl::OUString::createFromAscii(""), "test for getLocalHost function: getLocalHost with invalid SocketAddr");
-
- CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+
+ CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getLocalHost );
CPPUNIT_TEST( getLocalHost_001 );
CPPUNIT_TEST( getLocalHost_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getLocalHost
-
+
/** testing the methods:
inline void SAL_CALL getPeerAddr( SocketAddr & Addr) const;
@@ -649,8 +649,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -668,7 +668,7 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void getPeer_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT );
@@ -676,41 +676,41 @@ namespace osl_Socket
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
::osl::StreamSocket ssConnection;
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
- /// launch server socket
+ /// launch server socket
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind '127.0.0.1' address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// get peer information
csConnectorSocket.getPeerAddr( saPeerSocketAddr );/// connected.
sal_Int32 peerPort = csConnectorSocket.getPeerPort( );
::rtl::OUString peerHost = csConnectorSocket.getPeerHost( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPeer function: setup a connection and then get the peer address, port and host from client side.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPeer function: setup a connection and then get the peer address, port and host from client side.",
( sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) )&&
- ( sal_True == compareUString( peerHost, saLocalSocketAddr.getHostname( 0 ) ) ) &&
+ ( sal_True == compareUString( peerHost, saLocalSocketAddr.getHostname( 0 ) ) ) &&
( peerPort == saLocalSocketAddr.getPort( ) ));
}
-
-
+
+
CPPUNIT_TEST_SUITE( getPeer );
CPPUNIT_TEST( getPeer_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getPeer
-
+
/** testing the methods:
inline sal_Bool SAL_CALL bind(const SocketAddr& LocalInterface);
*/
-
+
class bind : public CppUnit::TestFixture
{
@@ -727,48 +727,48 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void bind_001()
{
::osl::Socket sSocket(sHandle);
//bind must use local IP address ---mindyliu
::osl::SocketAddr saBindSocketAddr( getLocalIP(), IP_PORT_MYPORT5 );
-
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
+
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "Socket bind fail.", sal_True == bOK1 );
-
+
sal_Bool bOK2 = compareUString( sSocket.getLocalHost( ), saBindSocketAddr.getHostname( ) ) ;
-
+
sSocket.close();
CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.", sal_True == bOK2 );
}
-
+
void bind_002()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("123.45.67.89"), IP_PORT_NETBIOS );
::osl::SocketAddr saLocalSocketAddr;
-
+
sSocket.setOption( osl_Socket_OptionReuseAddr, 1); // sal_True);
sal_Bool bOK1 = sSocket.bind( saBindSocketAddr );
sal_Bool bOK2 = compareUString( sSocket.getLocalHost( ), getThisHostname( ) ) ;
-
- CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for bind function: bind a valid address.",
( sal_False == bOK1 ) && ( sal_False == bOK2 ) );
}
-
+
CPPUNIT_TEST_SUITE( bind );
CPPUNIT_TEST( bind_001 );
CPPUNIT_TEST( bind_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class bind
/** testing the methods:
inline sal_Bool SAL_CALL isRecvReady(const TimeValue *pTimeout = 0) const;
-
+
*/
class isRecvReady : public CppUnit::TestFixture
{
@@ -777,8 +777,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -796,14 +796,14 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void isRecvReady_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT1 );
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT1 );
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
::osl::StreamSocket ssConnection;
- /// launch server socket
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -812,21 +812,21 @@ namespace osl_Socket
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// is receive ready?
sal_Bool bOK3 = asAcceptorSocket.isRecvReady( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isRecvReady function: setup a connection and then check if it can transmit data.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isRecvReady function: setup a connection and then check if it can transmit data.",
( sal_True == bOK3 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isRecvReady );
CPPUNIT_TEST( isRecvReady_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isRecvReady
@@ -840,8 +840,8 @@ namespace osl_Socket
TimeValue *pTimeout;
::osl::AcceptorSocket asAcceptorSocket;
::osl::ConnectorSocket csConnectorSocket;
-
-
+
+
// initialization
void setUp( )
{
@@ -859,15 +859,15 @@ namespace osl_Socket
csConnectorSocket.close( );
}
-
+
void isSendReady_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT );
::osl::SocketAddr saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT );
::osl::SocketAddr saPeerSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -876,27 +876,27 @@ namespace osl_Socket
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
- /// launch client socket
+ /// launch client socket
csConnectorSocket.connect( saTargetSocketAddr, pTimeout ); /// connecting to server...
/// is send ready?
sal_Bool bOK3 = csConnectorSocket.isSendReady( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isSendReady function: setup a connection and then check if it can transmit data.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isSendReady function: setup a connection and then check if it can transmit data.",
( sal_True == bOK3 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isSendReady );
CPPUNIT_TEST( isSendReady_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isSendReady
/** testing the methods:
inline oslSocketType SAL_CALL getType() const;
-
+
*/
class getType : public CppUnit::TestFixture
@@ -906,7 +906,7 @@ namespace osl_Socket
// initialization
void setUp( )
{
-
+
}
void tearDown( )
@@ -914,31 +914,31 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getType_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeStream == sSocket.getType( ) );
}
-
+
void getType_002()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeDgram == sSocket.getType( ) );
}
-
+
#ifdef UNX
// mindy: since on LINUX and SOLARIS, Raw type socket can not be created, so do not test getType() here
// mindy: and add one test case to test creating Raw type socket--> ctors_TypeRaw()
void getType_003()
{
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.this is not passed in (LINUX, SOLARIS), the osl_Socket_TypeRaw, type socket can not be created.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.this is not passed in (LINUX, SOLARIS), the osl_Socket_TypeRaw, type socket can not be created.",
sal_True);
}
#else
@@ -946,21 +946,21 @@ namespace osl_Socket
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeRaw, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
- CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getType function: get type of socket.",
osl_Socket_TypeRaw == sSocket.getType( ) );
}
#endif
-
+
CPPUNIT_TEST_SUITE( getType );
CPPUNIT_TEST( getType_001 );
CPPUNIT_TEST( getType_002 );
CPPUNIT_TEST( getType_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getType
-
+
/** testing the methods:
inline sal_Int32 SAL_CALL getOption(
@@ -968,9 +968,9 @@ namespace osl_Socket
void* pBuffer,
sal_uInt32 BufferLen,
oslSocketOptionLevel Level= osl_Socket_LevelSocket) const;
-
+
inline sal_Int32 getOption( oslSocketOption option ) const;
-
+
*/
class getOption : public CppUnit::TestFixture
@@ -980,7 +980,7 @@ namespace osl_Socket
// initialization
void setUp( )
{
-
+
}
void tearDown( )
@@ -989,50 +989,50 @@ namespace osl_Socket
}
/** test writer's comment:
-
+
in oslSocketOption, the osl_Socket_OptionType denote 1 as osl_Socket_TypeStream.
- 2 as osl_Socket_TypeDgram, etc which is not mapping the oslSocketType enum. differ
+ 2 as osl_Socket_TypeDgram, etc which is not mapping the oslSocketType enum. differ
in 1.
*/
-
+
void getOption_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
sal_Int32 * pType = ( sal_Int32 * )malloc( sizeof ( sal_Int32 ) );
- *pType = 0;
+ *pType = 0;
sSocket.getOption( osl_Socket_OptionType, pType, sizeof ( sal_Int32 ) );
sal_Bool bOK = ( SOCK_STREAM == *pType );
- // there is a TypeMap(socket.c) which map osl_Socket_TypeStream to SOCK_STREAM on UNX, and SOCK_STREAM != osl_Socket_TypeStream
+ // there is a TypeMap(socket.c) which map osl_Socket_TypeStream to SOCK_STREAM on UNX, and SOCK_STREAM != osl_Socket_TypeStream
//sal_Bool bOK = ( TYPE_TO_NATIVE(osl_Socket_TypeStream) == *pType );
- free( pType );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get type option of socket.",
+ free( pType );
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get type option of socket.",
sal_True == bOK );
}
-
+
// getsockopt error
void getOption_004()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool * pbDontRoute = ( sal_Bool * )malloc( sizeof ( sal_Bool ) );
sal_Int32 nRes = sSocket.getOption( osl_Socket_OptionInvalid, pbDontRoute, sizeof ( sal_Bool ) );
free( pbDontRoute );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get invalid option of socket, should return -1.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get invalid option of socket, should return -1.",
nRes == -1 );
}
-
+
void getOption_simple_001()
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool bOK = ( sal_False == sSocket.getOption( osl_Socket_OptionDontRoute ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
sal_True == bOK );
}
@@ -1040,50 +1040,50 @@ namespace osl_Socket
{
sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeDgram, osl_Socket_ProtocolIp );
::osl::Socket sSocket(sHandle);
-
+
sal_Bool bOK = ( sal_False == sSocket.getOption( osl_Socket_OptionDebug ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getOption function: get debug option of socket.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getOption );
CPPUNIT_TEST( getOption_001 );
CPPUNIT_TEST( getOption_004 );
CPPUNIT_TEST( getOption_simple_001 );
CPPUNIT_TEST( getOption_simple_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getOption
/** testing the methods:
- inline sal_Bool SAL_CALL setOption( oslSocketOption Option,
+ inline sal_Bool SAL_CALL setOption( oslSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
- oslSocketOptionLevel Level= osl_Socket_LevelSocket ) const;
+ oslSocketOptionLevel Level= osl_Socket_LevelSocket ) const;
*/
class setOption : public CppUnit::TestFixture
{
public:
TimeValue *pTimeout;
-// LLA: maybe there is an error in the source,
+// LLA: maybe there is an error in the source,
// as long as I remember, if a derived class do not overload all ctors there is a problem.
::osl::AcceptorSocket asAcceptorSocket;
-
+
void setUp( )
{
-
+
}
-
+
void tearDown( )
{
asAcceptorSocket.close( );
}
-
+
// LLA:
// getSocketOption returns BufferLen, or -1 if something failed
@@ -1107,7 +1107,7 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "setOption function failed.", ( sal_True == b1 ) );
sal_Int32 n2 = asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pGetBuffer, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption function failed.", ( n2 == nBufferLen ) );
-
+
// on Linux, the value of option is 1, on Solaris, it's 16, but it's not important the exact value,
// just judge it is zero or not!
sal_Bool bOK = ( 0 != *pGetBuffer );
@@ -1120,9 +1120,9 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "setOption function failed.", ( sal_True == b3 ) );
sal_Int32 n4 = asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pGetBuffer, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption (DONTROUTE) function failed.", ( n4 == nBufferLen ) );
-
+
sal_Bool bOK2 = ( 0 == *pGetBuffer );
-
+
t_print("#setOption_001: getOption is %d \n", *pGetBuffer);
// LLA: sal_Bool * pbDontTouteSet = ( sal_Bool * )malloc( sizeof ( sal_Bool ) );
@@ -1131,22 +1131,22 @@ namespace osl_Socket
// LLA: *pbDontTouteGet = sal_False;
// LLA: asAcceptorSocket.setOption( osl_Socket_OptionDontRoute, pbDontTouteSet, sizeof ( sal_Bool ) );
// LLA: asAcceptorSocket.getOption( osl_Socket_OptionDontRoute, pbDontTouteGet, sizeof ( sal_Bool ) );
-// LLA: ::rtl::OUString suError = outputError(::rtl::OUString::valueOf((sal_Int32)*pbDontTouteGet),
-// LLA: ::rtl::OUString::valueOf((sal_Int32)*pbDontTouteSet),
+// LLA: ::rtl::OUString suError = outputError(::rtl::OUString::valueOf((sal_Int32)*pbDontTouteGet),
+// LLA: ::rtl::OUString::valueOf((sal_Int32)*pbDontTouteSet),
// LLA: "test for setOption function: set osl_Socket_OptionDontRoute and then check");
-// LLA:
+// LLA:
// LLA: sal_Bool bOK = ( sal_True == *pbDontTouteGet );
// LLA: free( pbDontTouteSet );
// LLA: free( pbDontTouteGet );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
( sal_True == bOK ) && (sal_True == bOK2) );
free( pbDontRouteSet );
free( pGetBuffer );
-// LLA: CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
+// LLA: CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
+
void setOption_002()
{
/// set and get option.
@@ -1162,17 +1162,17 @@ namespace osl_Socket
linger aLingerGet;
asAcceptorSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
-
+
sal_Int32 n1 = asAcceptorSocket.getOption( osl_Socket_OptionLinger, &aLingerGet, nBufferLen );
CPPUNIT_ASSERT_MESSAGE( "getOption (SO_LINGER) function failed.", ( n1 == nBufferLen ) );
-
+
//t_print("#setOption_002: getOption is %d \n", aLingerGet.l_linger);
sal_Bool bOK = ( 7 == aLingerGet.l_linger );
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check. ",
- sal_True == bOK );
-
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check. ",
+ sal_True == bOK );
+
}
-
+
void setOption_003()
{
linger aLingerSet;
@@ -1181,8 +1181,8 @@ namespace osl_Socket
sal_Bool b1 = asAcceptorSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, 0 );
printUString( asAcceptorSocket.getErrorAsString( ) );
- CPPUNIT_ASSERT_MESSAGE( "setOption (SO_LINGER) function failed for optlen is 0.",
- ( b1 == sal_False ) );
+ CPPUNIT_ASSERT_MESSAGE( "setOption (SO_LINGER) function failed for optlen is 0.",
+ ( b1 == sal_False ) );
}
void setOption_simple_001()
@@ -1190,23 +1190,23 @@ namespace osl_Socket
/// set and get option.
asAcceptorSocket.setOption( osl_Socket_OptionDontRoute, 1 ); //sal_True );
sal_Bool bOK = ( 0 != asAcceptorSocket.getOption( osl_Socket_OptionDontRoute ) );
-
+
t_print("setOption_simple_001(): getoption is %d \n", asAcceptorSocket.getOption( osl_Socket_OptionDontRoute ) );
- CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+ CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
( sal_True == bOK ) );
}
-
+
void setOption_simple_002()
{
/// set and get option.
// LLA: this does not work, due to the fact that SO_LINGER is a structure
// LLA: asAcceptorSocket.setOption( osl_Socket_OptionLinger, 7 );
// LLA: sal_Bool bOK = ( 7 == asAcceptorSocket.getOption( osl_Socket_OptionLinger ) );
-
-// LLA: CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
+
+// LLA: CPPUNIT_ASSERT_MESSAGE( "test for setOption function: set option of a socket and then check.",
// LLA: ( sal_True == bOK ) );
}
-
+
CPPUNIT_TEST_SUITE( setOption );
CPPUNIT_TEST( setOption_001 );
CPPUNIT_TEST( setOption_002 );
@@ -1214,7 +1214,7 @@ namespace osl_Socket
CPPUNIT_TEST( setOption_simple_001 );
// LLA: CPPUNIT_TEST( setOption_simple_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class setOption
@@ -1226,13 +1226,13 @@ namespace osl_Socket
{
public:
::osl::AcceptorSocket asAcceptorSocket;
-
+
void enableNonBlockingMode_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
@@ -1240,20 +1240,20 @@ namespace osl_Socket
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
+
+ /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
sal_Bool bOK = sal_True;
asAcceptorSocket.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for enableNonBlockingMode function: launch a server socket and make it non blocking. if it can pass the acceptConnection statement, it is non-blocking",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for enableNonBlockingMode function: launch a server socket and make it non blocking. if it can pass the acceptConnection statement, it is non-blocking",
( sal_True == bOK ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( enableNonBlockingMode );
CPPUNIT_TEST( enableNonBlockingMode_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class enableNonBlockingMode
@@ -1264,36 +1264,36 @@ namespace osl_Socket
{
public:
::osl::AcceptorSocket asAcceptorSocket;
-
+
void isNonBlockingMode_001()
{
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT );
::osl::StreamSocket ssConnection;
-
- /// launch server socket
+
+ /// launch server socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); // sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket bind address failed.", sal_True == bOK1 );
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
CPPUNIT_ASSERT_MESSAGE( "AcceptorSocket listen failed.", sal_True == bOK2 );
-
+
sal_Bool bOK3 = asAcceptorSocket.isNonBlockingMode( );
asAcceptorSocket.enableNonBlockingMode( sal_True );
asAcceptorSocket.acceptConnection(ssConnection); /// waiting for incoming connection...
-
- /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
+
+ /// if reach this statement, it is non-blocking mode, since acceptConnection will blocked by default.
sal_Bool bOK4 = asAcceptorSocket.isNonBlockingMode( );
asAcceptorSocket.close( );
-
+
CPPUNIT_ASSERT_MESSAGE( "test for isNonBlockingMode function: launch a server socket and make it non blocking. it is expected to change from blocking mode to non-blocking mode.",
( sal_False == bOK3 ) && ( sal_True == bOK4 ) );
}
-
-
+
+
CPPUNIT_TEST_SUITE( isNonBlockingMode );
CPPUNIT_TEST( isNonBlockingMode_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class isNonBlockingMode
/** testing the method:
@@ -1314,26 +1314,26 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void clearError_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("123.45.67.89"), IP_PORT_HTTP2 );
::osl::SocketAddr saLocalSocketAddr;
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
sSocket.bind( saBindSocketAddr );//build an error "osl_Socket_E_AddrNotAvail"
oslSocketError seBind = sSocket.getError( );
sSocket.clearError( );
-
- CPPUNIT_ASSERT_MESSAGE( "test for clearError function: trick an error called sSocket.getError( ), and then clear the error states, check the result.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for clearError function: trick an error called sSocket.getError( ), and then clear the error states, check the result.",
osl_Socket_E_None == sSocket.getError( ) && seBind != osl_Socket_E_None );
}
-
-
+
+
CPPUNIT_TEST_SUITE( clearError );
CPPUNIT_TEST( clearError_001 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class clearError
@@ -1356,17 +1356,17 @@ namespace osl_Socket
sHandle = NULL;
}
-
+
void getError_001()
{
::osl::Socket sSocket(sHandle);
::osl::SocketAddr saBindSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
::osl::SocketAddr saLocalSocketAddr;
-
- CPPUNIT_ASSERT_MESSAGE( "test for getError function: should get no error.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getError function: should get no error.",
osl_Socket_E_None == sSocket.getError( ) );
}
-
+
void getError_002()
{
::osl::Socket sSocket(sHandle);
@@ -1376,12 +1376,12 @@ namespace osl_Socket
sSocket.bind( saBindSocketAddr );//build an error "osl_Socket_E_AddrNotAvail"
//on Solaris, the error no is EACCES, but it has no mapped value, so getError() returned osl_Socket_E_InvalidError.
#if defined(SOLARIS)
- CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. ",
+ CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. ",
osl_Socket_E_InvalidError == sSocket.getError( ) );
#else
//while on Linux & Win32, the errno is EADDRNOTAVAIL, getError returned osl_Socket_E_AddrNotAvail.
-
- CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. Passed on Linux & Win32",
+
+ CPPUNIT_ASSERT_MESSAGE( "trick an error called sSocket.getError( ), check the getError result.Failed on Solaris, returned osl_Socket_E_InvalidError because no entry to map the errno EACCES. Passed on Linux & Win32",
osl_Socket_E_AddrNotAvail == sSocket.getError( ) );
#endif
}
@@ -1390,15 +1390,15 @@ namespace osl_Socket
CPPUNIT_TEST( getError_001 );
CPPUNIT_TEST( getError_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getError
-
+
/** testing the methods:
inline oslSocket getHandle() const;
*/
-
+
class getHandle : public CppUnit::TestFixture
{
public:
@@ -1418,17 +1418,17 @@ namespace osl_Socket
{
::osl::Socket sSocket(sHandle);
::osl::Socket assignSocket = sSocket.getHandle();
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment_handle function: test the assignment operator.",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
-
+
void getHandle_002()
{
::osl::Socket sSocket( sHandle );
::osl::Socket assignSocket ( sSocket.getHandle( ) );
-
- CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for operators_assignment function: assignment operator",
osl_Socket_TypeStream == assignSocket.getType( ) );
}
@@ -1436,7 +1436,7 @@ namespace osl_Socket
CPPUNIT_TEST( getHandle_001 );
CPPUNIT_TEST( getHandle_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getHandle
@@ -1460,7 +1460,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::enableNonBlockingMode, "osl_So
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::isNonBlockingMode, "osl_Socket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::clearError, "osl_Socket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getError, "osl_Socket");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getHandle, "osl_Socket");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::getHandle, "osl_Socket");
} // namespace osl_Socket
diff --git a/sal/qa/osl/socket/osl_SocketAddr.cxx b/sal/qa/osl/socket/osl_SocketAddr.cxx
index 8942e3a7b..f349420f2 100644
--- a/sal/qa/osl/socket/osl_SocketAddr.cxx
+++ b/sal/qa/osl/socket/osl_SocketAddr.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -91,44 +91,44 @@ namespace osl_SocketAddr
inline SocketAddr(const SocketAddr& Addr);
inline SocketAddr(const oslSocketAddr , __osl_socket_NoCopy nocopy );
inline SocketAddr(oslSocketAddr Addr);
- inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
+ inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
*/
class ctors : public CppUnit::TestFixture
{
public:
-
+
void ctors_none()
{
/// SocketAddr constructor.
::osl::SocketAddr saSocketAddr;
-
+
// oslSocketResult aResult;
// rtl::OUString suHost = saSocketAddr.getLocalHostname( &aResult);
// rtl::OUString suHost2 = getThisHostname();
- CPPUNIT_ASSERT_MESSAGE("test for none parameter constructor function: check if the socket address was created successfully",
+ CPPUNIT_ASSERT_MESSAGE("test for none parameter constructor function: check if the socket address was created successfully",
sal_True == saSocketAddr.is( ) );
}
-
+
void ctors_none_000()
{
/// SocketAddr constructor.
::osl::SocketAddr saSocketAddr;
-
+
oslSocketResult aResult;
rtl::OUString suHost = saSocketAddr.getLocalHostname( &aResult);
rtl::OUString suHost2 = getThisHostname();
sal_Bool bOk = compareUString(suHost, suHost2);
-
+
rtl::OUString suError = rtl::OUString::createFromAscii("Host names should be the same. From SocketAddr.getLocalHostname() it is'");
suError += suHost;
suError += rtl::OUString::createFromAscii("', from getThisHostname() it is '");
suError += suHost2;
suError += rtl::OUString::createFromAscii("'.");
-
+
CPPUNIT_ASSERT_MESSAGE(suError, sal_True == bOk);
}
@@ -137,23 +137,23 @@ namespace osl_SocketAddr
/// SocketAddr copy constructor.
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
::osl::SocketAddr saCopySocketAddr( saSocketAddr );
-
+
sal_Int32 nPort = saCopySocketAddr.getPort( );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy constructor function: copy constructor, do an action of copy construction then check the port with original set.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy constructor function: copy constructor, do an action of copy construction then check the port with original set.",
( sal_True == saCopySocketAddr.is( ) ) && ( nPort == IP_PORT_HTTP1 ) );
}
-
+
void ctors_copy_no_001()
{
#if 0
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
oslSocketAddr psaOSLSocketAddr = saSocketAddr.getHandle( );
-
+
::osl::SocketAddr saSocketAddrCopy( psaOSLSocketAddr, SAL_NO_COPY );
saSocketAddrCopy.setPort( IP_PORT_HTTP2 );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
saSocketAddr.getPort( ) == IP_PORT_HTTP2 );
#endif
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
@@ -162,23 +162,23 @@ namespace osl_SocketAddr
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
+
pSocketAddrCopy->setPort( IP_PORT_HTTP2 );
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getPort( ) == IP_PORT_HTTP2 );
delete pSocketAddrCopy;
// LLA: don't do this also: delete pSocketAddr;
}
-
+
void ctors_copy_no_002()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
CPPUNIT_ASSERT_MESSAGE("check for new SocketAddr", pSocketAddr != NULL);
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getHandle( ) == pSocketAddrCopy->getHandle( ) );
delete pSocketAddrCopy;
@@ -188,39 +188,39 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
::osl::SocketAddr saSocketAddrCopy( saSocketAddr.getHandle( ) );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, get its port to check copy effect.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, get its port to check copy effect.",
saSocketAddrCopy.getPort( ) == IP_PORT_HTTP1 );
}
-
+
void ctors_copy_handle_002()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
::osl::SocketAddr saSocketAddrCopy( saSocketAddr.getHandle( ) );
saSocketAddrCopy.setPort( IP_PORT_HTTP2 );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, the original one should not be changed.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr copy handle constructor function: copy another Socket's handle, the original one should not be changed.",
saSocketAddr.getPort( ) != IP_PORT_HTTP2 );
}
-
+
void ctors_hostname_port_001()
{
/// tcpip-specif constructor.
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
printUString( saSocketAddr.getHostname( ), "ctors_hostname_port_001:getHostname");
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: do a constructor using tcpip spec, check the result.",
- saSocketAddr.is( ) == sal_True &&
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: do a constructor using tcpip spec, check the result.",
+ saSocketAddr.is( ) == sal_True &&
( saSocketAddr.getPort( ) == IP_PORT_FTP )/*&&
( sal_True == compareUString( saSocketAddr.getHostname( ), aHostName1 ) ) */);
}
- //same as is_002
+ //same as is_002
void ctors_hostname_port_002()
{
/// tcpip-specif constructor.
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT2 );
-
+
CPPUNIT_ASSERT_MESSAGE("test for SocketAddr tcpip specif constructor function: using an invalid IP address, the socketaddr ctors should fail", sal_False == saSocketAddr.is( ));
}
CPPUNIT_TEST_SUITE( ctors );
@@ -234,12 +234,12 @@ namespace osl_SocketAddr
CPPUNIT_TEST( ctors_hostname_port_001 );
CPPUNIT_TEST( ctors_hostname_port_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
/** testing the method:
- inline sal_Bool is() const;
+ inline sal_Bool is() const;
*/
class is : public CppUnit::TestFixture
@@ -248,38 +248,38 @@ namespace osl_SocketAddr
void is_001()
{
::osl::SocketAddr saSocketAddr;
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create an unknown type socket, it should be True when call is.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create an unknown type socket, it should be True when call is.",
sal_True == saSocketAddr.is( ) );
}
// refer to setPort_003()
void is_002()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_INVAL );
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid port number",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid port number",
sal_True == saSocketAddr.is( ) );
}
void is_003()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid Ip number",
+
+ CPPUNIT_ASSERT_MESSAGE("test for is() function: create a tcp-ip socket using invalid Ip number",
sal_True != saSocketAddr.is( ) );
}
-
+
CPPUNIT_TEST_SUITE( is );
CPPUNIT_TEST( is_001 );
CPPUNIT_TEST( is_002 );
CPPUNIT_TEST( is_003 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class is
-
+
/** testing the method:
- inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = 0 ) const;
+ inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = 0 ) const;
*/
class getHostname : public CppUnit::TestFixture
@@ -288,40 +288,40 @@ namespace osl_SocketAddr
void setUp()
{
}
-
+
void tearDown()
{
}
-
+
void getHostname_000()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("129.158.217.107"), IP_PORT_FTP );
rtl::OUString suResult = saSocketAddr.getHostname( 0 );
-
+
}
-
- /** it will search the Ip in current machine's /etc/hosts at first, if find, then return the
- mapped hostname, otherwise, it will search via DNS server, and often return hostname+ Domain name
+
+ /** it will search the Ip in current machine's /etc/hosts at first, if find, then return the
+ mapped hostname, otherwise, it will search via DNS server, and often return hostname+ Domain name
like "sceri.PRC.Sun.COM"
The process is same as Socket::getLocalHost(), but getLocalHost can only return hostname of the current machine.
- */
+ */
void getHostname_001()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("129.158.217.107"), IP_PORT_FTP );
rtl::OUString suResult = saSocketAddr.getHostname( 0 );
rtl::OUString suError = outputError(suResult, rtl::OUString::createFromAscii("sceri.PRC.Sun.COM"), "test for getHostname(0)");
sal_Bool bOK = compareUString( suResult, rtl::OUString::createFromAscii("sceri.PRC.Sun.COM") );
- // search the returned hostname in /etc/hosts, if find, and the IP in the row is same as IP
- // in the Addr, it's right also.
+ // search the returned hostname in /etc/hosts, if find, and the IP in the row is same as IP
+ // in the Addr, it's right also.
if ( bOK == sal_False)
- {
+ {
rtl::OString aString = ::rtl::OUStringToOString( suResult, RTL_TEXTENCODING_ASCII_US );
if ( compareUString( getIPbyName( aString ), rtl::OUString::createFromAscii("129.158.217.107") ) == sal_True )
- bOK = sal_True;
+ bOK = sal_True;
}
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK);
}
-
+
// LLA: now we have to control, if this behaviour is right.
// LLA: this function does not work in company (Linux, Windows) but at home
void getHostname_002()
@@ -336,7 +336,7 @@ namespace osl_SocketAddr
oslSocketResult aResult;
rtl::OUString suResult = saSocketAddr.getHostname( &aResult );
CPPUNIT_ASSERT_MESSAGE("SocketAddr.getHostname failed.", aResult == osl_Socket_Ok);
-
+
rtl::OUString suError = outputError(suResult, suHostname, "test for getHostname(0)");
bOK = compareUString( suResult, suHostname );
if ( bOK == sal_False)
@@ -348,21 +348,21 @@ namespace osl_SocketAddr
bOK = sal_True;
}
}
-
+
CPPUNIT_ASSERT_MESSAGE( suError, sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( getHostname );
CPPUNIT_TEST( getHostname_001 );
CPPUNIT_TEST( getHostname_002 );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class getHostname
-
+
/** testing the method:
- inline sal_Int32 SAL_CALL getPort() const;
+ inline sal_Int32 SAL_CALL getPort() const;
*/
class getPort : public CppUnit::TestFixture
@@ -371,44 +371,44 @@ namespace osl_SocketAddr
void getPort_001()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort() function: get a normal port number.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort() function: get a normal port number.",
IP_PORT_FTP == saSocketAddr.getPort( ) );
}
-
+
void getPort_002()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_INVAL );
-
+
//t_print("#getPort_002: Port number is %d \n", saSocketAddr.getPort( ));
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid port to a SocketAddr, get the port to see if it can detect. it did not pass in (W32).",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid port to a SocketAddr, get the port to see if it can detect. it did not pass in (W32).",
saSocketAddr.getPort( )>=1 && saSocketAddr.getPort( ) <= 65535 );
}
- //two cases will return OSL_INVALID_PORT: 1. not valid SocketAddr
+ //two cases will return OSL_INVALID_PORT: 1. not valid SocketAddr
//2. SocketAddr family is not osl_Socket_FamilyInet, but case 2 could not be constructed
void getPort_003()
{
rtl::OUString suInvalidIP = rtl::OUString::createFromAscii("123.345.67.89");
::osl::SocketAddr saSocketAddr( suInvalidIP, IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid IP to a SocketAddr, get the port to see returned value. ",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getPort( ) function: give an invalid IP to a SocketAddr, get the port to see returned value. ",
saSocketAddr.getPort( ) == OSL_INVALID_PORT );
}
-
+
CPPUNIT_TEST_SUITE( getPort );
CPPUNIT_TEST( getPort_001 );
CPPUNIT_TEST( getPort_002 );
CPPUNIT_TEST( getPort_003 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getPort
-
+
/** testing the method:
- inline sal_Bool SAL_CALL setPort( sal_Int32 nPort );
+ inline sal_Bool SAL_CALL setPort( sal_Int32 nPort );
rfc1413.txt: TCP port numbers are from 1-65535
- rfc1700.txt: 0/tcp Reserved ; 0/udp Reserved
+ rfc1700.txt: 0/tcp Reserved ; 0/udp Reserved
*/
class setPort : public CppUnit::TestFixture
@@ -418,12 +418,12 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_TELNET );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: modify a port number setting, and check it.",
- ( sal_True == bOK ) &&
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: modify a port number setting, and check it.",
+ ( sal_True == bOK ) &&
( IP_PORT_TELNET == saSocketAddr.getPort( ) ) );
}
-
+
/** 0 to 1024 is known as the reserved port range (traditionally only root can assign programs to ports in
this range) and the ephemeral port range from 1025 to 65535.
As many of you programmers will know, when you specify the source port of 0 when you connect to a host,
@@ -436,66 +436,66 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_ZERO );
-
+
oslSocket sHandle = osl_createSocket( osl_Socket_FamilyInet, osl_Socket_TypeStream, osl_Socket_ProtocolIp );
- ::osl::Socket sSocket(sHandle);
- sSocket.setOption( osl_Socket_OptionReuseAddr, 1 );//sal_True);
+ ::osl::Socket sSocket(sHandle);
+ sSocket.setOption( osl_Socket_OptionReuseAddr, 1 );//sal_True);
sal_Bool bOK1 = sSocket.bind( saSocketAddr );
CPPUNIT_ASSERT_MESSAGE( "bind SocketAddr failed", bOK1 == sal_True );
-
+
sal_Int32 newPort = sSocket.getLocalPort();
//t_print("#new port is %d\n", newPort );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: port number should be in 1 ~ 65535, set port 0, it should be converted to a port number between 1024~65535.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort() function: port number should be in 1 ~ 65535, set port 0, it should be converted to a port number between 1024~65535.",
( 1024 <= newPort ) && ( 65535 >= newPort ) && ( bOK == sal_True ) );
-
+
}
-
+
void setPort_003()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP);
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_INVAL );
//on Linux, getPort return 34463
//t_print("#Port number is %d \n", saSocketAddr.getPort( ));
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an address with invalid port. it should return error or convert it to a valid port.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an address with invalid port. it should return error or convert it to a valid port.",
( ( 1 <= saSocketAddr.getPort( ) ) && ( 65535 >= saSocketAddr.getPort( ) ) &&( bOK == sal_True ) ) ||
bOK == sal_False);
}
-
+
/* this is not a inet-addr => can't set port */
void setPort_004()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("123.345.67.89"), IP_PORT_FTP);
sal_Bool bOK = saSocketAddr.setPort( IP_PORT_MYPORT );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an invalid address with valid port. it should return error.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setPort( ) function: set an invalid address with valid port. it should return error.",
bOK == sal_False);
}
-
-
+
+
CPPUNIT_TEST_SUITE( setPort );
CPPUNIT_TEST( setPort_001 );
CPPUNIT_TEST( setPort_002 );
CPPUNIT_TEST( setPort_003 );
CPPUNIT_TEST( setPort_004 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class setPort
-
+
/** tester comment:
-
+
In the following two functions, it use ::rtl::ByteSequence as an intermediate storage for address,
the ByteSequence object can hold sal_Int8 arrays, which is raged [-127, 127], in case of IP addr
- that is greater than 127, say 129.158.217.202, it will stored as -127, -98, -39, -54, it is unique
+ that is greater than 127, say 129.158.217.202, it will stored as -127, -98, -39, -54, it is unique
in the range of sal_Int8, but lack of readability.
- so may be a sal_uInt8 array is better.
+ so may be a sal_uInt8 array is better.
*/
/** testing the method:
- inline sal_Bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
+ inline sal_Bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
*/
class setAddr : public CppUnit::TestFixture
@@ -507,25 +507,25 @@ namespace osl_SocketAddr
saSocketAddr.setAddr( UStringIPToByteSequence( rtl::OUString::createFromAscii("127.0.0.1") ) );
::rtl::ByteSequence bsSocketAddr = saSocketAddr.getAddr( 0 );
sal_Bool bOK = sal_False;
-
+
// if ( ( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) && ( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
// bOK = sal_True;
bOK = ifIpv4is( bsSocketAddr, 127, 0, 0, 1 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for setAddr() function: construct Addr with \"129.158.217.202\", set it to \"127.0.0.1\", and check the correctness ",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for setAddr() function: construct Addr with \"129.158.217.202\", set it to \"127.0.0.1\", and check the correctness ",
sal_True == bOK );
}
-
-
+
+
CPPUNIT_TEST_SUITE( setAddr );
CPPUNIT_TEST( setAddr_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class setAddr
-
+
/** testing the method:
- inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = 0 ) const;
+ inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = 0 ) const;
*/
class getAddr : public CppUnit::TestFixture
@@ -533,24 +533,24 @@ namespace osl_SocketAddr
public:
void getAddr_001()
{
- oslSocketResult SocketResult;
+ oslSocketResult SocketResult;
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_FTP );
::rtl::ByteSequence bsSocketAddr = saSocketAddr.getAddr( &SocketResult );
-
+
sal_Bool bOK = sal_False;
//if ( ( osl_Socket_Ok == SocketResult ) &&( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
// bOK = sal_True;
bOK = ifIpv4is( bsSocketAddr, 127, 0, 0, 1 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for getAddr() function: construct a socketaddr with IP assigned, get the address to check correctness.Caught unknown exception on (Win32)",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for getAddr() function: construct a socketaddr with IP assigned, get the address to check correctness.Caught unknown exception on (Win32)",
sal_True == bOK && SocketResult == osl_Socket_Ok);
}
-
+
CPPUNIT_TEST_SUITE( getAddr );
CPPUNIT_TEST( getAddr_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getAddr
@@ -559,7 +559,7 @@ namespace osl_SocketAddr
inline SocketAddr & SAL_CALL operator= (const SocketAddr& Addr);
inline SocketAddr & SAL_CALL assign( oslSocketAddr Addr, __osl_socket_NoCopy nocopy );
inline sal_Bool SAL_CALL operator== (oslSocketAddr Addr) const;
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const; /// not implemented.
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const; /// not implemented.
*/
class operator_equal : public CppUnit::TestFixture
@@ -569,7 +569,7 @@ namespace osl_SocketAddr
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
sal_Bool bOK = sal_False;
::rtl::ByteSequence bsSocketAddr = saSocketAddrEqual.getAddr( 0 );
@@ -578,31 +578,31 @@ namespace osl_SocketAddr
if ( ( IP_PORT_TELNET == saSocketAddrEqual.getPort( ) ) && ( ifIpv4is( bsSocketAddr, 127, 0, 0, 1 ) == sal_True ) )
bOK = sal_True;
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: use operator= to assign Ip1 to Ip2, check its modification.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: use operator= to assign Ip1 to Ip2, check its modification.",
sal_True == bOK );
}
-
-
+
+
void operator_equal_002()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("129.158.217.199"), IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
- CPPUNIT_ASSERT_MESSAGE( "after assign, the assigned SocketAddr is not same as the original Addr",
+ CPPUNIT_ASSERT_MESSAGE( "after assign, the assigned SocketAddr is not same as the original Addr",
IP_PORT_TELNET == saSocketAddrEqual.getPort( ) );
saSocketAddrEqual.setPort( IP_PORT_MYPORT3 );
saSocketAddr.setPort( IP_PORT_HTTP2 );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: perform an equal action, then try to change the original address's port. it should not be changed ( handle released), it did not pass in (W32), this is under discussion.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal() function: perform an equal action, then try to change the original address's port. it should not be changed ( handle released), it did not pass in (W32), this is under discussion.",
IP_PORT_MYPORT3 == saSocketAddrEqual.getPort( ) );
}
-
+
void operator_equal_const_001()
{
const ::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
sal_Bool bOK = sal_False;
::rtl::ByteSequence bsSocketAddr = saSocketAddrEqual.getAddr( 0 );
@@ -611,22 +611,22 @@ namespace osl_SocketAddr
if ( ( IP_PORT_TELNET == saSocketAddrEqual.getPort( ) ) && ifIpv4is( bsSocketAddr, 127, 0, 0, 1 ) == sal_True )
bOK = sal_True;
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: use operator= const to assign Ip1 to Ip2, verify the change on the second one.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: use operator= const to assign Ip1 to Ip2, verify the change on the second one.",
sal_True == bOK );
}
-
+
void operator_equal_const_002()
{
const ::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrEqual( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP );
-
+
saSocketAddrEqual = saSocketAddr;
saSocketAddrEqual.setPort( IP_PORT_HTTP1 );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: change the second instance, the first one should not be altered, since it does not released the handle.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_const() function: change the second instance, the first one should not be altered, since it does not released the handle.",
IP_PORT_HTTP1 != saSocketAddr.getPort( ) );
}
-
+
void operator_equal_assign_001()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET );
@@ -635,31 +635,31 @@ namespace osl_SocketAddr
oslSocketAddr poslSocketAddr = pSocketAddr->getHandle( );
//if( m_handle ) osl_destroySocketAddr( m_handle ); so pSocketAddrAssign had been destroyed and then point to pSocketAddr
pSocketAddrAssign->assign(poslSocketAddr, SAL_NO_COPY);
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddrAssign->getPort( ) == IP_PORT_TELNET );
- delete pSocketAddrAssign;
+ delete pSocketAddrAssign;
}
-
+
void operator_is_equal_001()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET);
::osl::SocketAddr saSocketAddrequal( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two identical Address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two identical Address.",
sal_True == ( saSocketAddrequal == saSocketAddr.getHandle( ) ) );
}
-
+
void operator_is_equal_002()
{
::osl::SocketAddr saSocketAddr( rtl::OUString::createFromAscii("129.158.217.202"), IP_PORT_FTP);
::osl::SocketAddr saSocketAddrequal( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_TELNET );
- CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two different Address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for operator_equal_equal() function: check two different Address.",
sal_False == ( saSocketAddrequal == saSocketAddr.getHandle( ) ) );
}
-
+
CPPUNIT_TEST_SUITE( operator_equal );
CPPUNIT_TEST( operator_equal_001 );
CPPUNIT_TEST( operator_equal_002 );
@@ -669,30 +669,30 @@ namespace osl_SocketAddr
CPPUNIT_TEST( operator_is_equal_001 );
CPPUNIT_TEST( operator_is_equal_002 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class operator_equal
-
+
/** testing the method:
- inline oslSocketAddr SAL_CALL getHandle() const;
+ inline oslSocketAddr SAL_CALL getHandle() const;
*/
class getSocketAddrHandle : public CppUnit::TestFixture
{
public:
-
+
void getSocketAddrHandle_001()
{
::osl::SocketAddr* pSocketAddr = new ::osl::SocketAddr( rtl::OUString::createFromAscii("localhost"), IP_PORT_HTTP1 );
CPPUNIT_ASSERT_MESSAGE("check for new SocketAddr", pSocketAddr != NULL);
oslSocketAddr psaOSLSocketAddr = pSocketAddr->getHandle( );
::osl::SocketAddr* pSocketAddrCopy = new ::osl::SocketAddr( psaOSLSocketAddr, SAL_NO_COPY );
-
- CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
+
+ CPPUNIT_ASSERT_MESSAGE("test for SocketAddr no copy constructor function: do a no copy constructor on a given SocketAddr instance, modify the new instance's port, check the original one.",
pSocketAddr->getHandle( ) == pSocketAddrCopy->getHandle( ) );
- delete pSocketAddrCopy;
+ delete pSocketAddrCopy;
}
void getSocketAddrHandle_002()
@@ -702,20 +702,20 @@ namespace osl_SocketAddr
sal_Bool bOK = ( saSocketAddr == poslSocketAddr );
//t_print("getSocketAddrHandle_002\n");
- CPPUNIT_ASSERT_MESSAGE( "test for getHandle() function: use getHandle() function as an intermediate way to create identical address.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getHandle() function: use getHandle() function as an intermediate way to create identical address.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( getSocketAddrHandle );
CPPUNIT_TEST( getSocketAddrHandle_001 );
CPPUNIT_TEST( getSocketAddrHandle_002 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getSocketAddrHandle
/** testing the method:
- static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = 0);
+ static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = 0);
*/
class getLocalHostname : public CppUnit::TestFixture
@@ -732,13 +732,13 @@ namespace osl_SocketAddr
rtl::OUString suHostname = osl::SocketAddr::getLocalHostname(&aResult);
CPPUNIT_ASSERT_MESSAGE("getLocalHostname failed", aResult == osl_Socket_Ok);
}
-
+
void getLocalHostname_001()
{
oslSocketResult *pResult = NULL;
//printSocketResult(*pResult);
::rtl::OUString suResult = ::osl::SocketAddr::getLocalHostname( pResult );
-
+
// LLA: IMHO localhost, or hostname by itself should be ok.
rtl::OUString suThisHost = getThisHostname( );
bool bOk = false;
@@ -756,20 +756,20 @@ namespace osl_SocketAddr
::rtl::OUString suError;
suError = outputError(suResult, getThisHostname( ), "test for getLocalHostname() function");
-
+
CPPUNIT_ASSERT_MESSAGE( suError, bOk == true );
}
-
+
CPPUNIT_TEST_SUITE( getLocalHostname );
CPPUNIT_TEST( getLocalHostname_000 );
CPPUNIT_TEST( getLocalHostname_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getLocalHostname
/** testing the method:
- static inline void SAL_CALL resolveHostname( const ::rtl::OUString & strHostName , SocketAddr & Addr );
+ static inline void SAL_CALL resolveHostname( const ::rtl::OUString & strHostName , SocketAddr & Addr );
*/
class resolveHostname : public CppUnit::TestFixture
@@ -784,22 +784,22 @@ namespace osl_SocketAddr
if ( ( bsSocketAddr[0] == 127 ) && ( bsSocketAddr[1] == 0 ) &&( bsSocketAddr[2] == 0 ) && ( bsSocketAddr[3] == 1 ) )
bOK = sal_True;
-
- CPPUNIT_ASSERT_MESSAGE( "test for resolveHostname() function: try to resolve localhost to 127.0.0.1.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for resolveHostname() function: try to resolve localhost to 127.0.0.1.",
sal_True == bOK );
}
-
+
CPPUNIT_TEST_SUITE( resolveHostname );
- CPPUNIT_TEST( resolveHostname_001 );
+ CPPUNIT_TEST( resolveHostname_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class resolveHostname
-
+
/** testing the method:
static inline sal_Int32 SAL_CALL getServicePort(
const ::rtl::OUString& strServiceName,
- const ::rtl::OUString & strProtocolName= ::rtl::OUString::createFromAscii( "tcp" ) );
+ const ::rtl::OUString & strProtocolName= ::rtl::OUString::createFromAscii( "tcp" ) );
*/
class gettheServicePort : public CppUnit::TestFixture
@@ -810,45 +810,45 @@ namespace osl_SocketAddr
rtl::OUString suServiceFTP = rtl::OUString::createFromAscii( "ftp" );
rtl::OUString suProtocolTCP = rtl::OUString::createFromAscii( "tcp" );
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get ftp service port on TCP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get ftp service port on TCP protocol.",
IP_PORT_FTP== ::osl::SocketAddr::getServicePort( suServiceFTP, suProtocolTCP ) );
}
-
+
void gettheServicePort_002()
{
rtl::OUString suServiceTELNET = rtl::OUString::createFromAscii( "telnet" );
rtl::OUString suProtocolTCP = rtl::OUString::createFromAscii( "tcp" );
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get telnet service port on TCP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get telnet service port on TCP protocol.",
IP_PORT_TELNET== ::osl::SocketAddr::getServicePort( suServiceTELNET, suProtocolTCP ) );
}
-
+
void gettheServicePort_003()
{
//Solaris has no service called "https", please see /etc/services
rtl::OUString suServiceNETBIOS = rtl::OUString::createFromAscii( "netbios-dgm" );
rtl::OUString suProtocolUDP = rtl::OUString::createFromAscii( "udp" );
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get netbios-ssn service port on UDP protocol.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get netbios-ssn service port on UDP protocol.",
IP_PORT_NETBIOS_DGM == ::osl::SocketAddr::getServicePort( suServiceNETBIOS, suProtocolUDP ) );
}
-
+
void gettheServicePort_004()
{
rtl::OUString suProtocolUDP = rtl::OUString::createFromAscii( "udp" );
- CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get a service port which is not exist.",
+ CPPUNIT_ASSERT_MESSAGE( "test for getServicePort() function: try to get a service port which is not exist.",
OSL_INVALID_PORT == ::osl::SocketAddr::getServicePort( ::rtl::OUString::createFromAscii( "notexist" ), suProtocolUDP ) );
}
-
+
CPPUNIT_TEST_SUITE( gettheServicePort );
CPPUNIT_TEST( gettheServicePort_001 );
CPPUNIT_TEST( gettheServicePort_002 );
CPPUNIT_TEST( gettheServicePort_003 );
CPPUNIT_TEST( gettheServicePort_004 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class gettheServicePort
-
+
/** testing the method:
-
+
*/
class getFamilyOfSocketAddr : public CppUnit::TestFixture
@@ -862,20 +862,20 @@ namespace osl_SocketAddr
osl_Socket_FamilyInet,
osl_getFamilyOfSocketAddr( psaOSLSocketAddr ) );
- CPPUNIT_ASSERT_MESSAGE( "test for osl_getFamilyOfSocketAddr.",
+ CPPUNIT_ASSERT_MESSAGE( "test for osl_getFamilyOfSocketAddr.",
osl_getFamilyOfSocketAddr( psaOSLSocketAddr ) == osl_Socket_FamilyInet );
}
-
+
CPPUNIT_TEST_SUITE( getFamilyOfSocketAddr );
- CPPUNIT_TEST( getFamilyOfSocketAddr_001 );
+ CPPUNIT_TEST( getFamilyOfSocketAddr_001 );
CPPUNIT_TEST_SUITE_END( );
-
+
}; // class getFamilyOfSocketAddr
-
+
// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::ctors, "osl_SocketAddr");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::ctors, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::is, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::getHostname, "osl_SocketAddr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_SocketAddr::getPort, "osl_SocketAddr");
diff --git a/sal/qa/osl/socket/osl_Socket_tests.cxx b/sal/qa/osl/socket/osl_Socket_tests.cxx
index ff3e48a47..7f0fb5bbe 100644
--- a/sal/qa/osl/socket/osl_Socket_tests.cxx
+++ b/sal/qa/osl/socket/osl_Socket_tests.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,7 +36,7 @@
//------------------------------------------------------------------------
#include <osl_Socket_Const.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <osl/socket.hxx>
//------------------------------------------------------------------------
// helper functions
@@ -52,7 +52,7 @@ namespace osl_Socket
class tests : public CppUnit::TestFixture
{
public:
-
+
void test_001()
{
// _osl_getFullQualifiedDomainName( );
@@ -60,7 +60,7 @@ namespace osl_Socket
rtl::OUString suHostname = osl::SocketAddr::getLocalHostname(&aResult);
CPPUNIT_ASSERT_MESSAGE("getLocalHostname failed", aResult == osl_Socket_Ok);
}
-
+
CPPUNIT_TEST_SUITE( tests );
CPPUNIT_TEST( test_001 );
CPPUNIT_TEST_SUITE_END();
diff --git a/sal/qa/osl/socket/osl_StreamSocket.cxx b/sal/qa/osl/socket/osl_StreamSocket.cxx
index 6f65afd31..9769d13ad 100644
--- a/sal/qa/osl/socket/osl_StreamSocket.cxx
+++ b/sal/qa/osl/socket/osl_StreamSocket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
/** test coder preface:
1. the BSD socket function will meet "unresolved external symbol error" on Windows platform
if you are not including ws2_32.lib in makefile.mk, the including format will be like this:
-
+
.IF "$(GUI)" == "WNT"
SHL1STDLIBS += $(SOLARLIBDIR)$/cppunit.lib
SHL1STDLIBS += ws2_32.lib
@@ -49,19 +49,19 @@
2. since the Socket implementation of osl is only IPv4 oriented, our test are mainly focus on IPv4
category.
- 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
- guess what the exact functionality or usage of a member. Hope the Socket section's comment
- will be added.
+ 3. some fragment of Socket source implementation are lack of comment so it is hard for testers
+ guess what the exact functionality or usage of a member. Hope the Socket section's comment
+ will be added.
4. following functions are declared but not implemented:
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
*/
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//#include "osl_Socket_Const.h"
#include "sockethelper.hxx"
@@ -86,12 +86,12 @@ class AcceptorThread : public Thread
::osl::AcceptorSocket asAcceptorSocket;
::rtl::OUString aHostIP;
sal_Bool bOK;
-protected:
+protected:
void SAL_CALL run( )
{
::osl::SocketAddr saLocalSocketAddr( aHostIP, IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
+
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
sal_Bool bOK1 = asAcceptorSocket.bind( saLocalSocketAddr );
if ( sal_True != bOK1 )
@@ -101,19 +101,19 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# AcceptorSocket listen address failed.\n" ) ;
return;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
bOK = sal_True;
- t_print("AcceptorThread: acceptConnection failed! \n");
- }
+ t_print("AcceptorThread: acceptConnection failed! \n");
+ }
}
public:
AcceptorThread(::osl::AcceptorSocket & asSocket, ::rtl::OUString const& aBindIP )
@@ -121,9 +121,9 @@ public:
{
bOK = sal_False;
}
-
+
sal_Bool isOK() { return bOK; }
-
+
~AcceptorThread( )
{
if ( isRunning( ) )
@@ -141,14 +141,14 @@ class ServerSocketThread : public Thread
osl::Condition &m_aCondition;
protected:
oslThreadIdentifier m_id;
-
+
void SAL_CALL run( )
{
::osl::AcceptorSocket asAcceptorSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //integer not sal_Bool : sal_True);
while ( schedule( ) == sal_True )
{
@@ -160,14 +160,14 @@ protected:
}
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# ServerSocketThread: AcceptorSocket listen address failed.\n" ) ;
break;
}
asAcceptorSocket.enableNonBlockingMode( sal_False );
m_aCondition.set();
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
@@ -176,13 +176,13 @@ protected:
}
sal_Int32 nReadNumber1 = ssStreamConnection.recv( pReadBuffer, 11 );
sal_Int32 nReadNumber2 = ssStreamConnection.recv( pReadBuffer + nReadNumber1, 11 );
- pReadBuffer[nReadNumber1 + nReadNumber2] = '\0';
+ pReadBuffer[nReadNumber1 + nReadNumber2] = '\0';
//t_print("# read buffer content: %s\n", pReadBuffer );
break;
}
ssStreamConnection.close();
asAcceptorSocket.close();
-
+
}
void SAL_CALL onTerminated( )
@@ -200,7 +200,7 @@ public:
m_id = getIdentifier( );
//t_print("# successfully creat this ServerSocketThread %d!\n", m_id );
}
-
+
~ServerSocketThread( )
{
if ( isRunning( ) )
@@ -211,17 +211,17 @@ public:
/** Client Socket Thread, served as a temp little client to communicate with server.
*/
class ClientSocketThread : public Thread
-{
+{
protected:
osl::Condition &m_aCondition;
oslThreadIdentifier m_id;
::osl::SocketAddr m_saTargetSocketAddr;
::osl::ConnectorSocket m_csConnectorSocket;
-
+
void SAL_CALL run( )
{
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 5;
pTimeout->Nanosec = 0;
@@ -233,13 +233,13 @@ protected:
free( pTimeout );
return;
}
-
+
if ( osl_Socket_Ok == m_csConnectorSocket.connect( m_saTargetSocketAddr, pTimeout ))
{
m_csConnectorSocket.send( pTestString1, 11 ); // "test socket"
m_csConnectorSocket.send( pTestString2, 10);
}
- else
+ else
t_print("# ClientSocketThread: connect failed! \n");
// terminate();
//}
@@ -252,16 +252,16 @@ protected:
//t_print("# normally terminate this thread %d!\n", m_id );
}
-public:
+public:
ClientSocketThread( osl::Condition &_aCond ):
m_aCondition(_aCond),
- m_saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 ),
+ m_saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 ),
m_csConnectorSocket( )
{
m_id = getIdentifier( );
//t_print("# successfully creat this client thread %d!\n", m_id );
}
-
+
~ClientSocketThread( )
{
if ( isRunning( ) )
@@ -277,7 +277,7 @@ class ValueCheckProvider
bool m_bFoundFailure;
char *m_pBuffer;
sal_Int32 m_nBufferSize;
-
+
public:
ValueCheckProvider()
:m_bFoundFailure(false),
@@ -285,12 +285,12 @@ public:
m_nBufferSize(0)
{
}
-
+
bool isFailure() {return m_bFoundFailure;}
const char* getBuffer() {return m_pBuffer;}
char* getWriteBuffer() {return m_pBuffer;}
-
+
sal_Int32 getBufferSize() {return m_nBufferSize;}
bool checkValues(sal_Int32 _nLength, int _nValue)
@@ -335,7 +335,7 @@ class ReadSocketThread : public Thread
protected:
oslThreadIdentifier m_id;
-
+
void SAL_CALL run( )
{
::osl::SocketAddr m_aTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT10 );
@@ -348,54 +348,54 @@ protected:
else
{
t_print("start ReadSocketThread\n");
-
+
TimeValue *pTimeout;
pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 5;
pTimeout->Nanosec = 0;
-
+
m_aCondition.wait();
-
+
t_print("connect()\n");
-
+
oslSocketResult eResult = m_aConnectorSocket.connect( m_aTargetSocketAddr, pTimeout );
if ( osl_Socket_Ok == eResult )
{
sal_Int32 nReadCount = m_aConnectorSocket.read( m_aValues.getWriteBuffer(), m_aValues.getBufferSize() );
m_aValues.checkValues(nReadCount, m_nValue);
}
- else
+ else
{
t_print("# ReadSocketThread: connect failed! \n");
printSocketResult(eResult);
}
-
+
//remove this line for deadlock on solaris( margritte.germany )
m_aConnectorSocket.close();
free( pTimeout );
}
}
-
+
void SAL_CALL onTerminated( )
{
//t_print("# normally terminate this thread %d!\n", m_id );
}
-public:
+public:
sal_Int32 getCount() {return m_aValues.getBufferSize();}
bool isOk() {return m_aValues.isFailure() == true ? false : true;}
-
+
ReadSocketThread(sal_Int32 _nBufferSize, int _nValue, osl::Condition &_aCond )
: m_nValue( _nValue ),
m_aCondition(_aCond)
{
t_print("#init ReadSocketThread\n");
m_id = getIdentifier( );
-
+
//t_print("# successfully creat this client thread %d!\n", m_id );
m_aValues.createBuffer(_nBufferSize, 0);
}
-
+
~ReadSocketThread( )
{
if ( isRunning( ) )
@@ -405,7 +405,7 @@ public:
};
-/** Server Socket Thread, write a file which is large
+/** Server Socket Thread, write a file which is large
*/
class WriteSocketThread : public Thread
{
@@ -414,7 +414,7 @@ class WriteSocketThread : public Thread
protected:
oslThreadIdentifier m_id;
-
+
void SAL_CALL run( )
{
t_print("start WriteSocketThread\n");
@@ -424,12 +424,12 @@ protected:
{
t_print("LocalSocketAddr was NOT created successfully!\n");
}
-
+
::osl::StreamSocket ssStreamConnection;
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
/// if the thread should terminate, schedule return false
// while ( schedule( ) == sal_True )
// {
@@ -444,17 +444,17 @@ protected:
t_print("listen()\n");
sal_Bool bOK2 = asAcceptorSocket.listen( 1 );
if ( sal_True != bOK2 )
- {
+ {
t_print("# WriteSocketThread: AcceptorSocket listen address failed. \n" ) ;
}
else
{
-
+
// blocking mode, if read/recv failed, block until success
asAcceptorSocket.enableNonBlockingMode( sal_False);
t_print("acceptConnection()\n");
m_aCondition.set();
-
+
oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
@@ -462,14 +462,14 @@ protected:
}
else
{
-
+
// LLA: removed, due to the fact, this is to error prone
// LLA: char * pSrcRoot = getenv("SOURCE_ROOT");
// LLA: // LLA: This is absolute wrong!
// LLA: // strcat( pSrcRoot, "/sal/inc/osl/file.hxx");
// LLA: rtl::OString sSrcRoot(pSrcRoot);
// LLA: sSrcRoot += "/sal/inc/osl/file.hxx";
-// LLA:
+// LLA:
// LLA: ::rtl::OUString sFilePath = ::rtl::OUString::createFromAscii( sSrcRoot.getStr() );
// LLA: #ifdef WNT
// LLA: while (sFilePath.lastIndexOf('/') != -1)
@@ -478,7 +478,7 @@ protected:
// LLA: FILE *stream;
// LLA: sal_uInt64 nCount_read;
// LLA: sal_Char buffer_read[FILE_READ];
-// LLA:
+// LLA:
// LLA: if( (stream = fopen( oustring2char( sFilePath ), "r+t" )) != NULL )
// LLA: {
// LLA: /* Attempt to read in 25 characters */
@@ -487,9 +487,9 @@ protected:
// LLA: }
// LLA: else
// LLA: t_print("# File $SRC_ROOT/sal/inc/osl/file.hxx could not be opened\n" );
-
+
t_print("write()\n");
-
+
ssStreamConnection.write( m_aValues.getBuffer(), m_aValues.getBufferSize() );
t_print("done written.\n");
}
@@ -498,7 +498,7 @@ protected:
ssStreamConnection.close();
asAcceptorSocket.close();
}
-
+
void SAL_CALL onTerminated( )
{
//t_print("# normally terminate this server thread %d!\n", m_id );
@@ -514,10 +514,10 @@ public:
t_print("#init WriteSocketThread\n");
m_id = getIdentifier( );
//t_print("# successfully creat this server thread %d!\n", m_id );
-
+
m_aValues.createBuffer(_nBufferSize, _nValue);
}
-
+
~WriteSocketThread( )
{
if ( isRunning( ) )
@@ -532,7 +532,7 @@ namespace osl_StreamSocket
{
/** testing the methods:
- inline StreamSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
+ inline StreamSocket(oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeStream);
@@ -558,22 +558,22 @@ namespace osl_StreamSocket
sHandle = NULL;
}
-
+
void ctors_none()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the stream socket was created successfully.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_none constructor function: check if the stream socket was created successfully.",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
-
+
void ctors_acquire()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( sHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for ctors_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
@@ -581,31 +581,31 @@ namespace osl_StreamSocket
{
/// Socket constructor.
::osl::StreamSocket ssSocket( sHandle, SAL_NO_ACQUIRE );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_no_acquire constructor function: check if the socket was created successfully",
osl_Socket_TypeStream == ssSocket.getType( ) );
}
-
+
void ctors_copy_ctor()
{
/// Socket constructor.
::osl::StreamSocket ssSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
/// Socket copy constructor.
::osl::StreamSocket copySocket( ssSocket );
-
- CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
+
+ CPPUNIT_ASSERT_MESSAGE(" test for ctors_copy_ctor constructor function: create new Socket instance using copy constructor",
osl_Socket_TypeStream == copySocket.getType( ) );
}
-
+
CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_none );
CPPUNIT_TEST( ctors_acquire );
CPPUNIT_TEST( ctors_no_acquire );
CPPUNIT_TEST( ctors_copy_ctor );
CPPUNIT_TEST_SUITE_END();
-
+
}; // class ctors
-
+
class send_recv: public CppUnit::TestFixture
{
public:
@@ -616,9 +616,9 @@ namespace osl_StreamSocket
void tearDown( )
{
-
+
}
-
+
void send_recv1()
{
osl::Condition aCondition;
@@ -627,7 +627,7 @@ namespace osl_StreamSocket
ClientSocketThread myClientThread( aCondition );
myServerThread.create( );
myClientThread.create( );
-
+
//wait until the thread terminate
myClientThread.join( );
myServerThread.join( );
@@ -635,10 +635,10 @@ namespace osl_StreamSocket
strcat( myStr, pTestString1 );
strcat( myStr, pTestString2 );
sal_Int32 nRes = strcmp( myServerThread.pReadBuffer, myStr );
- CPPUNIT_ASSERT_MESSAGE(" test for send/recv with two threads: launch Server/Client threads, send data from client, check received data in Server thread.",
+ CPPUNIT_ASSERT_MESSAGE(" test for send/recv with two threads: launch Server/Client threads, send data from client, check received data in Server thread.",
nRes == 0 );
}
-
+
// error when recv
void send_recv2()
{
@@ -646,19 +646,19 @@ namespace osl_StreamSocket
::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 );
::osl::StreamSocket ssStreamConnection;
sal_Char pReadBuffer[30] = "";
-
+
osl::Condition aCondition;
- aCondition.reset();
+ aCondition.reset();
ClientSocketThread myClientThread( aCondition );
myClientThread.create( );
-
- asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
-
+
+ asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 );
+
asAcceptorSocket.bind( saLocalSocketAddr );
asAcceptorSocket.listen( 1 );
asAcceptorSocket.enableNonBlockingMode( sal_True );
aCondition.set();
-
+
asAcceptorSocket.acceptConnection( ssStreamConnection );
sal_Int32 nReadNumber = ssStreamConnection.recv( pReadBuffer, 11 );
@@ -670,7 +670,7 @@ namespace osl_StreamSocket
// LLA: This is a helper function, which create 2 threads, a server and a client.
// the server writes the buffersize to the client.
-
+
void write_read(sal_Int32 _nBufferSize, int _nValue)
{
//client sent two strings, and server received, check the order and value
@@ -680,23 +680,23 @@ namespace osl_StreamSocket
myServerThread.create( );
// thread_sleep( 1 );
myClientThread.create( );
-
+
//wait until the thread terminate
myClientThread.join( );
myServerThread.join( );
-
- //Maximum Packet Size is ( ARPANET, MILNET = 1007 Ethernet (10Mb) = 1500
- // Proteon PRONET = 2046), so here test read 4000 bytes
+
+ //Maximum Packet Size is ( ARPANET, MILNET = 1007 Ethernet (10Mb) = 1500
+ // Proteon PRONET = 2046), so here test read 4000 bytes
sal_Int32 nLength = myClientThread.getCount();
bool bIsOk = myClientThread.isOk(); // check if the values are right.
t_print("Length:=%d\n", nLength);
t_print(" bIsOk:=%d\n", bIsOk);
- CPPUNIT_ASSERT_MESSAGE(" test for write/read values with two threads: send data from server, check readed data in client.",
+ CPPUNIT_ASSERT_MESSAGE(" test for write/read values with two threads: send data from server, check readed data in client.",
nLength == _nBufferSize && bIsOk == true);
}
-
+
// Tests with different values and sizes
void write_read_001()
{
@@ -718,7 +718,7 @@ namespace osl_StreamSocket
{
write_read(32768, 3);
}
-
+
CPPUNIT_TEST_SUITE( send_recv );
CPPUNIT_TEST( write_read_001 );
CPPUNIT_TEST( write_read_002 );
@@ -730,7 +730,7 @@ namespace osl_StreamSocket
// CPPUNIT_TEST( write_read );
CPPUNIT_TEST_SUITE_END();
}; // class send_recv
-
+
// -----------------------------------------------------------------------------
class SendClientThread : public Thread
@@ -741,34 +741,34 @@ namespace osl_StreamSocket
void SAL_CALL run( )
{
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 5;
pTimeout->Nanosec = 0;
-
+
if ( osl_Socket_Ok == m_csConnectorSocket.connect( m_saTargetSocketAddr, pTimeout ))
{
sal_Int32 nWrite1 = m_csConnectorSocket.write( pTestString1, 11 ); // "test socket"
-
- sal_Int32 nWrite2 = m_csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
- thread_sleep( 2 );
- m_csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
+
+ sal_Int32 nWrite2 = m_csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
+ thread_sleep( 2 );
+ m_csConnectorSocket.write( pTestString2, strlen( pTestString2 ) + 1 );
t_print("nWrite1 is %d, nWrite2 is %d\n", nWrite1, nWrite2 );
//thread_sleep( 1 );
}
- else
+ else
t_print("# SendClientThread: connect failed! \n");
m_csConnectorSocket.close();
free( pTimeout );
}
- public:
+ public:
SendClientThread( ):
- m_saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 ),
+ m_saTargetSocketAddr( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT9 ),
m_csConnectorSocket( )
{
//t_print("# successfully creat this SendClientThread %d!\n", m_id );
}
-
+
~SendClientThread( )
{
if ( isRunning( ) )
@@ -787,9 +787,9 @@ namespace osl_StreamSocket
void tearDown( )
{
-
+
}
-
+
// similar to close_002
void shutdown_001()
{
@@ -797,18 +797,18 @@ namespace osl_StreamSocket
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
AcceptorThread myAcceptorThread( asSocket, rtl::OUString::createFromAscii("127.0.0.1") );
myAcceptorThread.create();
-
+
thread_sleep( 1 );
-
+
//when accepting, shutdown the socket, the thread will not block for accepting
asSocket.shutdown();
myAcceptorThread.join();
-
- CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for close when is accepting: the socket will quit accepting status.",
myAcceptorThread.isOK( ) == sal_True );
-#endif
+#endif
}
-
+
void shutdown_002()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
@@ -820,48 +820,48 @@ namespace osl_StreamSocket
// osl::Condition aCondition;
SendClientThread mySendThread;
mySendThread.create();
-
+
asSocket.enableNonBlockingMode( sal_False );
::osl::StreamSocket ssConnectionSocket;
oslSocketResult eResult = asSocket.acceptConnection( ssConnectionSocket );
CPPUNIT_ASSERT_MESSAGE("shutdown_002: acceptConnection fail", eResult == osl_Socket_Ok );
-
+
/* set socket option SO_LINGER 0, so close immediatly */
linger aLingerSet;
sal_Int32 nBufferLen = sizeof( struct linger );
aLingerSet.l_onoff = 0;
aLingerSet.l_linger = 0;
- ssConnectionSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
+ ssConnectionSocket.setOption( osl_Socket_OptionLinger, &aLingerSet, nBufferLen );
thread_sleep( 1 );
//sal_uInt32 nRecv1 = 0;
sal_Int32 nRead1 = ssConnectionSocket.read( pReadBuffer, 11 );
-
+
//shutdown read after client the first send complete
ssConnectionSocket.shutdown( osl_Socket_DirRead );
-
- sal_Int32 nRead2 = ssConnectionSocket.read( pReadBuffer + nRead1, 12 );
+
+ sal_Int32 nRead2 = ssConnectionSocket.read( pReadBuffer + nRead1, 12 );
sal_Int32 nRead3 = ssConnectionSocket.read( pReadBuffer + nRead1 + nRead2, 12 );
t_print("after read 2, nRead1 is %d, nRead2 is %d, nRead3 is %d \n", nRead1, nRead2, nRead3 );
mySendThread.join();
-
+
ssConnectionSocket.close();
asSocket.close();
-
- /* on Linux, if send is before shutdown(DirRead), can read, nRecv2 still > 0,
+
+ /* on Linux, if send is before shutdown(DirRead), can read, nRecv2 still > 0,
http://dbforums.com/arch/186/2002/12/586417
While on Solaris, after shutdown(DirRead), all read will return 0
*/
#ifdef LINUX
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
nRead1 > 0 && nRead3 == 0 );
#else
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not read(recv).",
nRead1 > 0 && nRead2 == 0 && nRead3 == 0 );
#endif
-
+
}
-
+
void shutdown_003()
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
@@ -873,19 +873,19 @@ namespace osl_StreamSocket
osl::Condition aCondition;
SendClientThread mySendThread;
mySendThread.create();
-
+
asSocket.enableNonBlockingMode( sal_False );
::osl::StreamSocket ssConnectionSocket;
oslSocketResult eResult = asSocket.acceptConnection( ssConnectionSocket );
CPPUNIT_ASSERT_MESSAGE("shutdown_002: acceptConnection fail", eResult == osl_Socket_Ok );
-
+
thread_sleep( 1 );
//shutdown write after client the first send complete
ssConnectionSocket.shutdown( osl_Socket_DirWrite );
-
+
// recv should not shutdown
sal_Int32 nRead1 = ssConnectionSocket.read( pReadBuffer, 11 );
-
+
sal_Int32 nWrite = ssConnectionSocket.write( pReadBuffer, 11 );
// still can read
sal_Int32 nRead3 = ssConnectionSocket.read( pReadBuffer + nRead1 , 12 );
@@ -893,12 +893,12 @@ namespace osl_StreamSocket
mySendThread.join();
ssConnectionSocket.close();
asSocket.close();
-
- CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not send(write).",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for shutdown read direction: the socket can not send(write).",
nRead1 > 0 && nWrite == 0 && nRead3 > 0);
-
+
}
-
+
CPPUNIT_TEST_SUITE( shutdown );
CPPUNIT_TEST( shutdown_001 );
CPPUNIT_TEST( shutdown_002 );
@@ -913,43 +913,43 @@ namespace osl_StreamSocket
{
::osl::AcceptorSocket asSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 3;
pTimeout->Nanosec = 0;
sal_Bool bOk = asSocket.isExceptionPending( pTimeout );
free( pTimeout );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isExceptionPending.",
+
+ CPPUNIT_ASSERT_MESSAGE( "test for isExceptionPending.",
bOk == sal_False );
}
-
+
/**tester's comments: lack of a case that return sal_True, do not know when it will return sal_True*/
-
-
+
+
CPPUNIT_TEST_SUITE( isExceptionPending );
CPPUNIT_TEST( isExPending_001 );
CPPUNIT_TEST_SUITE_END();
}; // class isExceptionPending
-
+
// -----------------------------------------------------------------------------
-/** Server Socket Thread, write a file which is large
+/** Server Socket Thread, write a file which is large
*/
// LLA: class WriteSocketThread : public Thread
// LLA: {
// LLA: ValueCheckProvider m_aValues;
-// LLA:
+// LLA:
// LLA: protected:
// LLA: oslThreadIdentifier m_id;
-// LLA:
+// LLA:
// LLA: void SAL_CALL run( )
// LLA: {
// LLA: ::osl::AcceptorSocket asAcceptorSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
// LLA: ::osl::SocketAddr saLocalSocketAddr( rtl::OUString::createFromAscii("10.16.66.252"), 8888 );
// LLA: ::osl::StreamSocket ssStreamConnection;
-// LLA:
-// LLA: //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+// LLA:
+// LLA: //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
// LLA: asAcceptorSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-// LLA:
+// LLA:
// LLA: /// if the thread should terminate, schedule return false
// LLA: while ( schedule( ) == sal_True )
// LLA: {
@@ -967,15 +967,15 @@ namespace osl_StreamSocket
// LLA: }
// LLA: // blocking mode, if read/recv failed, block until success
// LLA: asAcceptorSocket.enableNonBlockingMode( sal_False);
-// LLA:
+// LLA:
// LLA: oslSocketResult eResult = asAcceptorSocket.acceptConnection( ssStreamConnection );
// LLA: if (eResult != osl_Socket_Ok )
// LLA: {
// LLA: t_print("WriteSocketThread: acceptConnection failed! \n");
// LLA: break;
// LLA: }
-// LLA:
-// LLA:
+// LLA:
+// LLA:
// LLA: sal_Int32 nReadNumber1 = ssStreamConnection.write( m_aValues.getBuffer(), m_aValues.getBufferSize() );
// LLA: break;
// LLA: }
@@ -999,15 +999,15 @@ namespace osl_StreamSocket
rtl::OString m_sAddr;
bool m_bOk;
-
+
void setFailed()
{
m_bOk = false;
}
-
+
protected:
oslThreadIdentifier m_id;
-
+
void read()
{
if (m_sAddr.getLength() == 0)
@@ -1015,7 +1015,7 @@ namespace osl_StreamSocket
setFailed();
return;
}
-
+
// 10.16.66.252
::osl::SocketAddr aSocketAddr( rtl::OUString::createFromAscii(m_sAddr.getStr()), IP_PORT_TEST );
::osl::ConnectorSocket aSocket; // ( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
@@ -1029,13 +1029,13 @@ namespace osl_StreamSocket
pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 20;
pTimeout->Nanosec = 0;
-
-
+
+
// blocking mode, if read/recv failed, block until success
t_print("enableNonBlockingMode(false)\n");
aSocket.enableNonBlockingMode( sal_False );
-
+
t_print("connect()\n");
oslSocketResult eResult = aSocket.connect( aSocketAddr, pTimeout );
if ( osl_Socket_Ok == eResult)
@@ -1047,7 +1047,7 @@ namespace osl_StreamSocket
t_print("%d bytes recived.\n", m_nReadCount);
}
}
- else
+ else
{
t_print("# ReadSocket2Thread: connect failed! \n");
printSocketResult(eResult);
@@ -1058,7 +1058,7 @@ namespace osl_StreamSocket
aSocket.close();
free( pTimeout );
}
-
+
void SAL_CALL run( )
{
read();
@@ -1071,9 +1071,9 @@ namespace osl_StreamSocket
public:
sal_Int32 getCount() {return m_nReadCount;}
- bool isOk() {return m_nReadCount == 0 ? false : true;}
+ bool isOk() {return m_nReadCount == 0 ? false : true;}
bool getFailed() {return m_bOk == false ? true : false;}
-
+
ReadSocket2Thread(osl::Condition &_aCondition)
:m_aCondition(_aCondition),
m_nReadCount(0),
@@ -1085,16 +1085,16 @@ namespace osl_StreamSocket
{
m_nBufferSize = 1024;
}
-
+
m_id = getIdentifier( );
//t_print("# successfully creat this client thread %d!\n", m_id );
}
-
+
void setAddr(rtl::OString const& _sAddr)
{
m_sAddr = _sAddr;
}
-
+
~ReadSocket2Thread( )
{
if ( isRunning( ) )
@@ -1117,7 +1117,7 @@ namespace osl_StreamSocket
{
t_print("# cant set port\n" );
}
-
+
if (! aSocketAddr.setHostname(rtl::OUString::createFromAscii(_sAddr.getStr())))
{
t_print("# cant set hostname/ip\n" );
@@ -1125,11 +1125,11 @@ namespace osl_StreamSocket
rtl::OUString aHostname = aSocketAddr.getHostname();
aSocketAddr.getPort();
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
aSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True);
-
+
/// if the thread should terminate, schedule return false
// while ( schedule( ) == sal_True )
// {
@@ -1141,11 +1141,11 @@ namespace osl_StreamSocket
{
t_print("# can't listen. \n" );
}
-
+
// blocking mode, if read/recv failed, block until success
aSocket.enableNonBlockingMode( sal_False);
::osl::StreamSocket ssStreamConnection;
-
+
oslSocketResult eResult = aSocket.acceptConnection( ssStreamConnection );
if (eResult != osl_Socket_Ok )
{
@@ -1157,7 +1157,7 @@ namespace osl_StreamSocket
ssStreamConnection.write( pBuffer, nBufferSize );
// break;
// }
-
+
// ssStreamConnection.close();
aSocket.close();
}
@@ -1168,16 +1168,16 @@ namespace osl_StreamSocket
{
::osl::ConnectorSocket aSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr aSocketAddr( rtl::OUString::createFromAscii(_sAddr.getStr()), IP_PORT_TEST );
-
+
if (! aSocketAddr.is())
{
t_print("is failed.\n");
return;
}
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
aSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True;
-
+
oslSocketResult aResult = aSocket.connect( aSocketAddr );
if ( aResult != osl_Socket_Ok )
{
@@ -1187,15 +1187,15 @@ namespace osl_StreamSocket
{
// blocking mode, if read/recv failed, block until success
// aSocket.enableNonBlockingMode( sal_False );
-
+
// _aCondition.set();
::osl::StreamSocket ssStreamConnection(aSocket);
-
+
char const * pBuffer = "GET / HTTP/1.0\015\012\015\012";
sal_Int32 nBufferSize = strlen(pBuffer);
ssStreamConnection.write( pBuffer, nBufferSize );
-
+
char *pBufferPeek = (char*) malloc(1024);
sal_Int32 nReadNumber = ssStreamConnection.recv( pBufferPeek, 1024, osl_Socket_MsgPeek);
free(pBufferPeek);
@@ -1209,7 +1209,7 @@ namespace osl_StreamSocket
// char * pBuffer3 = "quit\n";
// nBufferSize = strlen(pBuffer3);
// nWriteNumber = ssStreamConnection.write( pBuffer3, nBufferSize );
-
+
rtl::OUString suError = ssStreamConnection.getErrorAsString();
free(pBuffer2);
// ssStreamConnection.close();
@@ -1221,29 +1221,29 @@ namespace osl_StreamSocket
}
- public:
+ public:
// LLA: orig void send_recv()
// LLA: orig {
// LLA: orig if ( ifAvailable(rtl::OUString::createFromAscii("margritte.germany")) == sal_True )
// LLA: orig t_print("margritte is alive ! \n");
// LLA: orig if ( ifAvailable(rtl::OUString::createFromAscii("10.16.66.252")) == sal_False )
// LLA: orig {
-// LLA: orig t_print("ip 10.16.66.252 is not alive! \n");
+// LLA: orig t_print("ip 10.16.66.252 is not alive! \n");
// LLA: orig return;
// LLA: orig }
// LLA: orig ReadSocket2Thread myReadThread;
// LLA: orig myReadThread.create();
-// LLA: orig
+// LLA: orig
// LLA: orig thread_sleep( 2 );
// LLA: orig // send_Acceptor();
// LLA: orig send_Connector();
-// LLA: orig
+// LLA: orig
// LLA: orig myReadThread.join();
-// LLA: orig
+// LLA: orig
// LLA: orig // statistics
// LLA: orig sal_uInt32 nLength = myReadThread.getCount();
// LLA: orig bool bIsOk = myReadThread.isOk(); // check if the values are right.
-// LLA: orig
+// LLA: orig
// LLA: orig t_print("Length:=%d\n", nLength);
// LLA: orig t_print(" bIsOk:=%d\n", bIsOk);
// LLA: orig }
@@ -1252,15 +1252,15 @@ namespace osl_StreamSocket
// LLA: send_Connector_2_margritte works, it send strings to echo server on margritte
// but can not receive anything
-
+
void send_Connector_2_margritte(rtl::OString const& _sAddr)
{
::osl::ConnectorSocket aSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr aSocketAddr( rtl::OUString::createFromAscii(_sAddr.getStr()), IP_PORT_TEST );
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
aSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True;
-
+
oslSocketResult aResult = aSocket.connect( aSocketAddr );
if ( aResult != osl_Socket_Ok )
{
@@ -1270,16 +1270,16 @@ namespace osl_StreamSocket
{
// blocking mode, if read/recv failed, block until success
aSocket.enableNonBlockingMode( sal_False );
-
+
::osl::StreamSocket ssStreamConnection(aSocket);
-
+
char const * pBuffer = "Test String\n";
sal_Int32 nBufferSize = strlen(pBuffer);
sal_Int32 nWriteNumber = ssStreamConnection.write( pBuffer, nBufferSize );
// char * pBuffer2 = " ";
// sal_Int32 nReadNumber = ssStreamConnection.read( pBuffer2, strlen(pBuffer2) );
-
+
char const * pBuffer3 = "quit\n";
nBufferSize = strlen(pBuffer3);
nWriteNumber = ssStreamConnection.write( pBuffer3, nBufferSize );
@@ -1299,7 +1299,7 @@ namespace osl_StreamSocket
}
send_Connector_2_margritte(sAddr);
}
-
+
// -----------------------------------------------------------------------------
void send_recv()
@@ -1310,7 +1310,7 @@ namespace osl_StreamSocket
// t_print("margritte is alive ! \n");
// sAddr = "margritte.germany";
// }
-
+
sAddr = "margritte.germany.sun.com";
if ( ifAvailable(rtl::OUString::createFromAscii(sAddr.getStr())) == sal_True )
{
@@ -1340,10 +1340,10 @@ namespace osl_StreamSocket
// }
// }
// }
-
+
// if ( ifAvailable(rtl::OUString::createFromAscii("10.16.64.196")) == sal_False )
// {
- // t_print("ip 10.16.64.196 is not alive! \n");
+ // t_print("ip 10.16.64.196 is not alive! \n");
// return;
// }
@@ -1368,7 +1368,7 @@ namespace osl_StreamSocket
// statistics
sal_uInt32 nLength = myReadThread.getCount();
bool bIsOk = myReadThread.isOk(); // check if the values are right.
-
+
t_print("Length:=%d\n", nLength);
t_print(" bIsOk:=%d\n", bIsOk);
}
@@ -1377,8 +1377,8 @@ namespace osl_StreamSocket
t_print("ERROR: No echo Server on %s found.\n", sAddr.getStr());
}
}
-
-
+
+
void getPage(rtl::OString const& _sAddr);
void test_getPage()
{
@@ -1388,7 +1388,7 @@ namespace osl_StreamSocket
rtl::OString sPage("lla-1");
getPage(sPage);
}
-
+
CPPUNIT_TEST_SUITE( justtest );
CPPUNIT_TEST( send_recv );
CPPUNIT_TEST( test_getPage );
@@ -1401,7 +1401,7 @@ namespace osl_StreamSocket
rtl::OUString suAddr = rtl::OUString::createFromAscii(_sAddr.getStr());
::osl::ConnectorSocket aSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr aSocketAddr( suAddr, 80 );
-
+
{
// some checks
aSocketAddr.getPort();
@@ -1420,9 +1420,9 @@ namespace osl_StreamSocket
printSocketResult(aResult);
}
}
-
+
oslSocketResult aResult;
-
+
// SocketAddr::resolveHostname(suAddr, aSocketAddr);
// if (! aSocketAddr.is())
// {
@@ -1434,7 +1434,7 @@ namespace osl_StreamSocket
// {
// t_print("problem with hostname: ");
// printSocketResult(aResult);
- //
+ //
// }
if (! aSocketAddr.is())
@@ -1442,10 +1442,10 @@ namespace osl_StreamSocket
t_print("SocketAddr::is() failed.\n");
return;
}
-
- //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
+
+ //if has not set this option, socket addr can not be binded in some time(maybe 2 minutes) by another socket
aSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True;
-
+
aResult = aSocket.connect( aSocketAddr );
if ( aResult != osl_Socket_Ok )
{
@@ -1455,16 +1455,16 @@ namespace osl_StreamSocket
{
// blocking mode, if read/recv failed, block until success
// aSocket.enableNonBlockingMode( sal_False );
-
+
// _aCondition.set();
::osl::StreamSocket ssStreamConnection(aSocket);
-
+
char const * pBuffer = "GET / HTTP/1.0\015\012\015\012";
sal_Int32 nBufferSize = strlen(pBuffer);
ssStreamConnection.write( pBuffer, nBufferSize );
-
-
+
+
char *pBufferPeek = (char*) malloc(1024);
sal_Int32 nReadNumber = 1;
while ( nReadNumber != 0)
@@ -1484,7 +1484,7 @@ namespace osl_StreamSocket
// char * pBuffer3 = "quit\n";
// nBufferSize = strlen(pBuffer3);
// nWriteNumber = ssStreamConnection.write( pBuffer3, nBufferSize );
-
+
rtl::OUString suError = ssStreamConnection.getErrorAsString();
}
aSocket.shutdown(osl_Socket_DirReadWrite);
@@ -1493,12 +1493,12 @@ namespace osl_StreamSocket
// -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::ctors, "osl_StreamSocket");
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::ctors, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::send_recv, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::shutdown, "osl_StreamSocket");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::isExceptionPending, "osl_StreamSocket");
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::justtest, "osl_StreamSocket");
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamSocket::justtest, "osl_StreamSocket");
} // namespace osl_StreamSocket
diff --git a/sal/qa/osl/socket/sockethelper.cxx b/sal/qa/osl/socket/sockethelper.cxx
index 0fd95d567..f8355c8a8 100644
--- a/sal/qa/osl/socket/sockethelper.cxx
+++ b/sal/qa/osl/socket/sockethelper.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,7 +32,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
#include "sockethelper.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//------------------------------------------------------------------------
// Ip version definition
@@ -48,7 +48,7 @@
sal_Bool compareUString( const ::rtl::OUString & ustr1, const ::rtl::OUString & ustr2 )
{
sal_Bool bOk = ustr1.equalsIgnoreAsciiCase( ustr2 );
-
+
return bOk;
}
@@ -58,7 +58,7 @@ sal_Bool compareUString( const ::rtl::OUString & ustr, const sal_Char *astr )
{
::rtl::OUString ustr2 = rtl::OUString::createFromAscii( astr );
sal_Bool bOk = ustr.equalsIgnoreAsciiCase( ustr2 );
-
+
return bOk;
}
@@ -78,7 +78,7 @@ sal_Bool compareSocketAddr( const ::osl::SocketAddr & addr1 , const ::osl::Socke
return (char *)sStr;
}*/
-/** print a UNI_CODE String. And also print some comments of the string.
+/** print a UNI_CODE String. And also print some comments of the string.
*/
void printUString( const ::rtl::OUString & str, const char* msg)
{
@@ -89,7 +89,7 @@ void printUString( const ::rtl::OUString & str, const char* msg)
t_print("%s\n", aString.getStr( ) );
}
-/** get the local host name.
+/** get the local host name.
mindy: gethostbyname( "localhost" ), on Linux, it returns the hostname in /etc/hosts + domain name,
if no entry in /etc/hosts, it returns "localhost" + domain name
*/
@@ -97,7 +97,7 @@ void printUString( const ::rtl::OUString & str, const char* msg)
{
struct hostent *hptr;
- hptr = gethostbyname( "localhost" );
+ hptr = gethostbyname( "localhost" );
OSL_ENSURE( hptr != NULL, "#In getHostname function, error on gethostbyname()" );
::rtl::OUString aUString = ::rtl::OUString::createFromAscii( (const sal_Char *) hptr->h_name );
@@ -111,7 +111,7 @@ void printUString( const ::rtl::OUString & str, const char* msg)
::rtl::OUString aUString;
#ifdef WNT
struct hostent *hptr;
- hptr = gethostbyname( "localhost" );
+ hptr = gethostbyname( "localhost" );
OSL_ENSURE( hptr != NULL, "#In getHostname function, error on gethostbyname()" );
rtl::OString sHostname(hptr->h_name);
aUString = ::rtl::OStringToOUString(sHostname, RTL_TEXTENCODING_ASCII_US);
@@ -120,21 +120,21 @@ void printUString( const ::rtl::OUString & str, const char* msg)
if (gethostname(hostname, 255) != 0) {
OSL_ENSURE( false, "#Error: gethostname failed." );
}
-
+
struct hostent *hptr;
//first search /ets/hosts, then search from dns
- hptr = gethostbyname( hostname);
+ hptr = gethostbyname( hostname);
if ( hptr != NULL )
{
strcpy( hostname, hptr->h_name );
}
-
- t_print("hostname is %s \n", hostname );
+
+ t_print("hostname is %s \n", hostname );
rtl::OString sHostname( hostname );
aUString = ::rtl::OStringToOUString( sHostname, RTL_TEXTENCODING_ASCII_US );
aUString.getLength();
#endif
- return aUString;
+ return aUString;
}
/** get IP by name, search /etc/hosts first, then search from dns, fail return OUString("")
@@ -144,15 +144,15 @@ void printUString( const ::rtl::OUString & str, const char* msg)
::rtl::OUString aUString;
struct hostent *hptr;
//first search /ets/hosts, then search from dns
- hptr = gethostbyname( str_name.getStr());
+ hptr = gethostbyname( str_name.getStr());
if ( hptr != NULL )
{
struct in_addr ** addrptr;
addrptr = (struct in_addr **) hptr->h_addr_list ;
- //if there are more than one IPs on the same machine, we select one
+ //if there are more than one IPs on the same machine, we select one
for (; *addrptr; addrptr++)
{
- t_print("#Local IP Address: %s\n", inet_ntoa(**addrptr));
+ t_print("#Local IP Address: %s\n", inet_ntoa(**addrptr));
aUString = ::rtl::OUString::createFromAscii( (sal_Char *) (inet_ntoa(**addrptr)) );
}
}
@@ -165,14 +165,14 @@ void printUString( const ::rtl::OUString & str, const char* msg)
{
char hostname[255];
gethostname(hostname, 255);
-
- return getIPbyName( hostname );
+
+ return getIPbyName( hostname );
}
/** construct error message
*/
::rtl::OUString outputError( const ::rtl::OUString & returnVal, const ::rtl::OUString & rightVal, const sal_Char * msg )
-{
+{
::rtl::OUString aUString;
if ( returnVal.equals( rightVal ) )
return aUString;
@@ -192,14 +192,14 @@ void thread_sleep( sal_Int32 _nSec )
/// print statement in thread process must use fflush() to force display.
// printf("wait %d seconds. ", _nSec );
// fflush(stdout);
-
+
#ifdef WNT //Windows
Sleep( _nSec * 100 );
#endif
#if ( defined UNX ) || ( defined OS2 ) //Unix
usleep(_nSec * 100000);
#endif
- // t_print("# done\n" );
+ // t_print("# done\n" );
}
/** print Boolean value.
@@ -219,7 +219,7 @@ void printByteSequence_IP( const ::rtl::ByteSequence & bsByteSeq, sal_Int32 nLen
for ( int i = 0; i < nLen; i++ ){
if ( bsByteSeq[i] < 0 )
t_print("%d ", 256 + bsByteSeq[i] );
- else
+ else
t_print("%d ", bsByteSeq[i] );
}
t_print(" .\n" );
@@ -241,7 +241,7 @@ void printByteSequence_IP( const ::rtl::ByteSequence & bsByteSeq, sal_Int32 nLen
{
if ( ( *pChar != '.' ) && ( i !=aString.getLength( ) ) )
tmpBuffer[nCharCounter++] = *pChar;
- else
+ else
{
tmpBuffer[nCharCounter] = '\0';
nCharCounter = 0;
@@ -284,7 +284,7 @@ void printSocketResult( oslSocketResult eResult )
/** if 4 parts of an IP addr are equal to specified values
*/
sal_Bool ifIpv4is( const ::rtl::ByteSequence Ipaddr, sal_Int8 seq1, sal_Int8 seq2, sal_Int8 seq3, sal_Int8 seq4 )
-{
+{
if ( ( Ipaddr[0] == seq1 ) && ( Ipaddr[1] == seq2 ) && ( Ipaddr[2] == seq3 ) && ( Ipaddr[3] == seq4 ) )
return sal_True;
return sal_False;
@@ -308,7 +308,7 @@ sal_Bool ifIpv4is( const ::rtl::ByteSequence Ipaddr, sal_Int8 seq1, sal_Int8 seq
pid = fork();
if (pid == 0)
{
-#if ( defined LINUX )
+#if ( defined LINUX )
char *argv[] =
{
"/bin/ping",
@@ -330,7 +330,7 @@ sal_Bool ifIpv4is( const ::rtl::ByteSequence Ipaddr, sal_Int8 seq1, sal_Int8 seq
close (p[0]);
dup2 (p[1], 1);
close (p[1]);
-#if ( defined LINUX )
+#if ( defined LINUX )
execv ("/bin/ping", argv);
#endif
#if ( defined SOLARIS )
@@ -348,15 +348,15 @@ sal_Bool ifIpv4is( const ::rtl::ByteSequence Ipaddr, sal_Int8 seq1, sal_Int8 seq
buffer[k] = 0;
if (buffer[k - 1] == '\n')
buffer[k - 1] = 0;
-#if ( defined LINUX )
+#if ( defined LINUX )
char strOK[] = "bytes from";
#endif
#if ( defined SOLARIS )
char strOK[] = "is alive";
-#endif
+#endif
if (strstr( buffer, strOK ) != NULL )
result = sal_True;
- t_print("buffer is %s\n", buffer );
+ t_print("buffer is %s\n", buffer );
}
close (p[0]);
waitpid (pid, &nStatus, 0);
@@ -375,20 +375,20 @@ sal_Bool ifAvailable( rtl::OUString const& strAddrOrHostName )
{
::osl::ConnectorSocket aSocket( osl_Socket_FamilyInet, osl_Socket_ProtocolIp, osl_Socket_TypeStream );
::osl::SocketAddr aSocketAddr( strAddrOrHostName, 7 );
-
+
if (! aSocketAddr.is())
{
aSocket.close();
return sal_False;
}
-
+
aSocket.setOption( osl_Socket_OptionReuseAddr, 1 ); //sal_True;
TimeValue *pTimeout;
- pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
+ pTimeout = ( TimeValue* )malloc( sizeof( TimeValue ) );
pTimeout->Seconds = 3;
pTimeout->Nanosec = 0;
-
+
oslSocketResult aResult = aSocket.connect( aSocketAddr, pTimeout );
free( pTimeout );
aSocket.close();
@@ -399,6 +399,6 @@ sal_Bool ifAvailable( rtl::OUString const& strAddrOrHostName )
t_print("\n");
return sal_False;
- }
- return sal_True;
+ }
+ return sal_True;
}
diff --git a/sal/qa/osl/thread/makefile.mk b/sal/qa/osl/thread/makefile.mk
index e74400ba6..86551fc67 100644
--- a/sal/qa/osl/thread/makefile.mk
+++ b/sal/qa/osl/thread/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_thread.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/sal/qa/osl/thread/test_thread.cxx b/sal/qa/osl/thread/test_thread.cxx
index f1693449e..21fd2e297 100644
--- a/sal/qa/osl/thread/test_thread.cxx
+++ b/sal/qa/osl/thread/test_thread.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@
#include "sal/config.h"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/conditn.hxx"
#include "osl/thread.hxx"
#include "osl/time.h"
diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk
index 4fad63894..ce88442a5 100755
--- a/sal/qa/rtl/alloc/makefile.mk
+++ b/sal/qa/rtl/alloc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,20 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:jobfile by codegen.pl
+# auto generated Target:jobfile by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_alloc.obj
SHL1TARGET= rtl_Alloc
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
-# .IF "$(GUI)" == "WNT"
-# SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-# .ENDIF
-# .IF "$(GUI)" == "UNX"
-# SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index b8422f822..ae9a1e9e9 100755
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
// autogenerated file with codegen.pl
#include <rtl/alloc.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
namespace rtl_alloc
{
@@ -44,7 +44,7 @@ namespace rtl_alloc
bool checkMemory(char* _pMemory, sal_uInt32 _nSize, char _n)
{
bool bOk = true;
-
+
for (sal_uInt32 i=0;i<_nSize;i++)
{
if (_pMemory[i] != _n)
@@ -54,7 +54,7 @@ namespace rtl_alloc
}
return bOk;
}
-
+
class Memory : public CppUnit::TestFixture
{
// for normal alloc functions
@@ -67,7 +67,7 @@ public:
m_nSizeOfMemory(50 * 1024 * 1024)
{
}
-
+
// initialise your test code values here.
void setUp()
{
@@ -87,7 +87,7 @@ public:
{
// this is demonstration code
// CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
+
CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pMemory != NULL);
memset(m_pMemory, 1, m_nSizeOfMemory);
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, m_nSizeOfMemory, 1) == true);
@@ -98,7 +98,7 @@ public:
t_print("reallocate memory\n");
sal_uInt32 nSize = 10 * 1024 * 1024;
m_pMemory = (char*)rtl_reallocateMemory(m_pMemory, nSize);
-
+
CPPUNIT_ASSERT_MESSAGE( "Can reallocate memory.", m_pMemory != NULL);
memset(m_pMemory, 2, nSize);
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, nSize, 2) == true);
@@ -109,8 +109,8 @@ public:
// // CPPUNIT_ASSERT_STUB();
// }
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(Memory);
@@ -125,14 +125,14 @@ class ZeroMemory : public CppUnit::TestFixture
// for zero functions
char *m_pZeroMemory;
sal_uInt32 m_nSizeOfZeroMemory;
-
+
public:
ZeroMemory()
:m_pZeroMemory(NULL),
m_nSizeOfZeroMemory( 50 * 1024 * 1024 )
{
}
-
+
// initialise your test code values here.
void setUp()
{
@@ -159,8 +159,8 @@ public:
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 3) == true);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(ZeroMemory);
diff --git a/sal/qa/rtl/bootstrap/makefile.mk b/sal/qa/rtl/bootstrap/makefile.mk
index ff47fa6c7..a492af8dd 100644
--- a/sal/qa/rtl/bootstrap/makefile.mk
+++ b/sal/qa/rtl/bootstrap/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -55,14 +55,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_Bootstrap.obj
SHL1TARGET= rtl_Bootstrap
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -72,7 +70,7 @@ DEF1NAME =$(SHL1TARGET)
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
-OBJ2FILES=$(OBJ)$/bootstrap_process.obj
+OBJ2FILES=$(OBJ)$/bootstrap_process.obj
APP2TARGET=bootstrap_process
APP2OBJS=$(OBJ2FILES)
diff --git a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
index e66216e60..0a437530a 100644
--- a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
+++ b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,9 +39,9 @@
#include <stdlib.h>
#include <algorithm> // STL
-#include "cppunit/stringhelper.hxx"
+#include "testshl/stringhelper.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
//#include "stringhelper.hxx"
//#include "valueequal.hxx"
#include <rtl/bootstrap.hxx>
@@ -61,7 +61,7 @@ using namespace rtl;
#define TESTSHL2_INI "testshl2"
#define PSEUDO_INI "pseudo"
-/** print a UNI_CODE String. And also print some comments of the string.
+/** print a UNI_CODE String. And also print some comments of the string.
*/
inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" )
{
@@ -121,10 +121,10 @@ static rtl::OUString getExecutableDirectory()
}
-// get the URL of testshl2rc/rtlrc/pseudorc
+// get the URL of testshl2rc/rtlrc/pseudorc
inline rtl::OUString t_getSourcePath(rtl::OString const& _sFilename)
{
-
+
rtl::OUString aDirURL(getExecutableDirectory());
aDirURL += OUString::createFromAscii( "/");
aDirURL += OUString::createFromAscii( _sFilename.getStr() );
@@ -141,15 +141,15 @@ inline rtl::OUString t_getSourcePath(rtl::OString const& _sFilename)
rtl::OUString suPath;
if (filename != "")
{
- suPath = rtl::OUString::createFromAscii(pStr) + rtl::OUString::createFromAscii( "/sal/qa/rtl/bootstrap/" )
+ suPath = rtl::OUString::createFromAscii(pStr) + rtl::OUString::createFromAscii( "/sal/qa/rtl/bootstrap/" )
+ rtl::OUString::createFromAscii( filename );
}
- else
+ else
{
- suPath = rtl::OUString::createFromAscii(pStr) + rtl::OUString::createFromAscii( "/sal/qa/rtl/bootstrap" );
+ suPath = rtl::OUString::createFromAscii(pStr) + rtl::OUString::createFromAscii( "/sal/qa/rtl/bootstrap" );
}
rtl::OUString suURL;
- ::osl::FileBase::getFileURLFromSystemPath( suPath, suURL );
+ ::osl::FileBase::getFileURLFromSystemPath( suPath, suURL );
return suURL;
*/
}
@@ -181,8 +181,8 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
-
+ }
+
// ctor with ini name
void ctor_001()
{
@@ -211,7 +211,7 @@ namespace rtl_Bootstrap
printUString( suGetname );
CPPUNIT_ASSERT_MESSAGE("ctor error without initial file.", suGetname.getLength() != 0 );
}
-
+
CPPUNIT_TEST_SUITE(ctor);
CPPUNIT_TEST(ctor_001);
CPPUNIT_TEST(ctor_002);
@@ -219,7 +219,7 @@ namespace rtl_Bootstrap
}; // class ctor
class getFrom : public CppUnit::TestFixture
- {
+ {
public:
// initialise your test code values here.
void setUp()
@@ -228,7 +228,7 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
+ }
// get the value of env variable
void getFrom_001()
{
@@ -257,10 +257,10 @@ namespace rtl_Bootstrap
# # the SRC_ROOT is e:\Qadev\cvs\m19
# # suValue is e:Qadevcvsm19
reason:
- The problem is that the internally getenv()ed variable SRC_ROOT is macro expanded,
+ The problem is that the internally getenv()ed variable SRC_ROOT is macro expanded,
thus every \ will introduce an escape.
*/
-
+
// get the value of a variable in ini file
void getFrom_002()
{
@@ -272,7 +272,7 @@ namespace rtl_Bootstrap
printUString( suGetname );
CPPUNIT_ASSERT_MESSAGE("get the value of a variable in ini file.", suGetname.getLength() != 0 );
}
-
+
//use defaut value
void getFrom_003()
{
@@ -281,11 +281,11 @@ namespace rtl_Bootstrap
rtl::OUString suGetname;
rtl::OUString suValuename = rtl::OUString::createFromAscii( "MY_VALUE" );
rtl::OUString myDefault = rtl::OUString::createFromAscii( "2" );
- aBootstrap.getFrom( suValuename, suGetname, myDefault );
+ aBootstrap.getFrom( suValuename, suGetname, myDefault );
//printUString( suGetname );
CPPUNIT_ASSERT_MESSAGE("getFrom use default.", suGetname.compareTo( myDefault ) == 0 );
}
-
+
void getFrom_004()
{
t_print("1\n");
@@ -296,7 +296,7 @@ namespace rtl_Bootstrap
rtl::OUString suGetIniName;
aBootstrap.getIniName( suGetIniName );
-
+
printUString(suGetIniName, "Current bootstrap file");
sal_Int32 nIndex = suGetIniName.indexOf(rtl::OUString::createFromAscii( "pseudo" ));
CPPUNIT_ASSERT_MESSAGE("ini name must have 'pseudo' in name.", nIndex > 0);
@@ -325,7 +325,7 @@ namespace rtl_Bootstrap
/** helper function: return the child process's ret value( typedef sal_uInt32 oslProcessExitCode;)
* param1 is the process's name(only file name, not include path)
- */
+ */
oslProcessExitCode ini_execProcess( const sal_Char* process_name, const sal_Char * flag )
{
rtl::OUString suCWD = getModulePath();
@@ -342,26 +342,26 @@ namespace rtl_Bootstrap
OUString suIniname = t_getSourcePath("rtl");
printUString( suIniname, "rtl path:");
//OUString suEnv2( OUString::createFromAscii("-env:MYENV=bootstrap_process"));
-
+
pParameters[0] = suFlag.pData;
pParameters[1] = suEnv1.pData;
// the custom ini/rc file's URL
pParameters[2] = suIniname.pData;
-
+
oslProcessError osl_error = osl_executeProcess(
suFileURL.pData,
pParameters,
nParameterCount,
osl_Process_WAIT,
- 0,
+ 0,
suCWD.pData,
NULL,
0,
&hProcess );
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
osl_joinProcess(hProcess);
@@ -370,7 +370,7 @@ namespace rtl_Bootstrap
osl_error = osl_getProcessInfo( hProcess, osl_Process_EXITCODE, pInfo );
CPPUNIT_ASSERT_MESSAGE
(
- "osl_getProcessInfo returned with failure",
+ "osl_getProcessInfo returned with failure",
osl_Process_E_None == osl_error
);
@@ -379,17 +379,17 @@ namespace rtl_Bootstrap
delete pInfo;
return nCode;
}
-
+
void getFrom_005_1()
{
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "1" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by command line can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by command line can not be gotten!",
nExitCode == 10 );
}
void getFrom_005_2()
{
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "2" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by .ini/rc file can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by .ini/rc file can not be gotten!",
nExitCode == 20 );
}
void getFrom_005_3()
@@ -400,25 +400,25 @@ namespace rtl_Bootstrap
setenv("QADEV_BOOTSTRAP", "sun&ms", 0);
#endif
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "3" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by environment variables can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by environment variables can not be gotten!",
nExitCode == 30 );
}
void getFrom_005_4()
{
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "4" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by customed .ini/rc file can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by customed .ini/rc file can not be gotten!",
nExitCode == 40 );
}
void getFrom_005_5()
{
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "5" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by inheritance can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by inheritance can not be gotten!",
nExitCode == 50 );
}
void getFrom_005_6()
{
oslProcessExitCode nExitCode = ini_execProcess( "bootstrap_process", "6" );
- CPPUNIT_ASSERT_MESSAGE("Parameters passed by default can not be gotten!",
+ CPPUNIT_ASSERT_MESSAGE("Parameters passed by default can not be gotten!",
nExitCode == 60 );
}
@@ -447,8 +447,8 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
-
+ }
+
void setIniFilename_001()
{
Bootstrap aBootstrap;
@@ -483,7 +483,7 @@ namespace rtl_Bootstrap
printUString( suGetname );
CPPUNIT_ASSERT_MESSAGE("setIniFilename and get value of the argument.", suGetname.getLength() != 0 );
}
-
+
CPPUNIT_TEST_SUITE(setIniFilename);
CPPUNIT_TEST(setIniFilename_001);
CPPUNIT_TEST(setIniFilename_002);
@@ -500,8 +500,8 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
-
+ }
+
void getHandle_001()
{
rtl::OUString suIniname = t_getSourcePath(TESTSHL2_INI);
@@ -523,14 +523,14 @@ namespace rtl_Bootstrap
rtl::OUString suValue;
rtl::OUString suKeyName = rtl::OUString::createFromAscii( "PSEUDOFILE" );
rtl_bootstrap_get_from_handle(bsHandle, suKeyName.pData, &suValue.pData, NULL);
- printUString( suValue);
-
+ printUString( suValue);
+
CPPUNIT_ASSERT_MESSAGE("Can not use the handle which is returned by getHandle!", suValue.equals( rtl::OUString::createFromAscii("be pseudo") ) == sal_True );
- // CPPUNIT_ASSERT_MESSAGE("Can not use the handle which is returned by getHandle!",
+ // CPPUNIT_ASSERT_MESSAGE("Can not use the handle which is returned by getHandle!",
// suGetname.equalsIgnoreAsciiCase( iniName ) == sal_True );
}
-
+
CPPUNIT_TEST_SUITE(getHandle);
CPPUNIT_TEST(getHandle_001);
CPPUNIT_TEST(getHandle_002);
@@ -547,8 +547,8 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
-
+ }
+
void set_001()
{
//in ini fle, INHERITED_VALUE=inherited_value
@@ -569,17 +569,17 @@ namespace rtl_Bootstrap
rtl::OUString suName = rtl::OUString::createFromAscii( "INHERITED_VALUE" );
rtl::OUString suGetOrientValue;
Bootstrap::get( suName, suGetOrientValue);
- // ?? INHERITED_VALUE = ok now, which is set in set_001
+ // ?? INHERITED_VALUE = ok now, which is set in set_001
printUString( suGetOrientValue );
-
+
rtl::OUString suValue = rtl::OUString::createFromAscii( TESTSHL2_INI );
// set to another value
Bootstrap::set( suName, suValue );
rtl::OUString suGetValue;
Bootstrap::get( suName, suGetValue);
CPPUNIT_ASSERT_MESSAGE("set and get argument failed.", suGetValue.compareTo(suValue) == 0 );
- }
-
+ }
+
CPPUNIT_TEST_SUITE(set);
CPPUNIT_TEST(set_001);
CPPUNIT_TEST(set_002);
@@ -595,7 +595,7 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
+ }
void expandMacrosFrom_001()
{
rtl::OUString suIniname = t_getSourcePath(TESTSHL2_INI);
@@ -611,20 +611,20 @@ namespace rtl_Bootstrap
/** here a special macro should expand
* if rtlrc is under sal/qa/rtl/bootstrap/, "${rtlrc:Bootstrap:RTLVALUE}" could be expanded
- * else rtlrc is under solver/680/unxlngi4.pro/bin/, "${file:/// ....solver/680/unxlngi4.pro/bin/rtlrc:Bootstrap:RTLVALUE}"
+ * else rtlrc is under solver/680/unxlngi4.pro/bin/, "${file:/// ....solver/680/unxlngi4.pro/bin/rtlrc:Bootstrap:RTLVALUE}"
* could not be expanded
*/
void expandMacrosFrom_002()
{
// Build a string with '${rtl.ini:RTLVALUE}' and try to expand it.
// In function 'create_rtlrc() is the content of the rtl.ini file.
-
+
rtl::OUString suIniname = t_getSourcePath(TESTSHL2_INI);
t_print("inifile is:");
printUString( suIniname );
Bootstrap aBootstrap( suIniname) ;
rtl::OUString suMacro = rtl::OUString::createFromAscii( "${" ); //rtlrc:Bootstrap:RTLVALUE}");
-
+
rtl::OUString aDirURL = OUString::createFromAscii( "$ORIGIN");
aDirURL += OUString::createFromAscii( "/");
aDirURL += OUString::createFromAscii( "rtl" );
@@ -632,8 +632,8 @@ namespace rtl_Bootstrap
aDirURL += rtl::OUString::createFromAscii(".ini");
#else
aDirURL += rtl::OUString::createFromAscii("rc");
-#endif
-
+#endif
+
suMacro += aDirURL;//t_getSourcePath("rtl");
suMacro += rtl::OUString::createFromAscii( "::RTLVALUE}");
@@ -703,18 +703,18 @@ namespace rtl_Bootstrap
// {
// // test, to read and expand SOFROMVALUE4
// // SOFROMVALUE4 is 'rtl(.ini|rc):Other_Section:TESTSHL_SOVALUE' which should expand to '' if all is ok.
-//
+//
// rtl::OUString suIniname = t_getSourcePath(TESTSHL2_INI);
// t_print("inifile is:");
// printUString( suIniname );
// Bootstrap aBootstrap( suIniname);
-//
+//
// rtl::OUString suMacro;
// aBootstrap.getFrom(rtl::OUString::createFromAscii( "SOFROMVALUE4" ), suMacro );
-//
+//
// t_print("SOFROMVALUE4:");
// printUString( suMacro );
-//
+//
// if (suMacro.equals(rtl::OUString::createFromAscii("testshl2_file") ) == sal_True)
// {
// CPPUNIT_ASSERT_MESSAGE("Value 'SOFROMVALUE4' is read from the wrong section out of the wrong ini file.", 0 );
@@ -737,7 +737,7 @@ namespace rtl_Bootstrap
suMacro[1] = rtl::OUString::createFromAscii( "$SYSUSERHOME" );
suMacro[2] = rtl::OUString::createFromAscii( "$SYSBINDIR" );
suMacro[3] = rtl::OUString::createFromAscii( "$ORIGIN" );
-
+
for ( int i = 0; i < 4; i++ )
{
aBootstrap.expandMacrosFrom( suMacro[i] );
@@ -745,7 +745,7 @@ namespace rtl_Bootstrap
}
// printUString( t_getSourcePath("") );
// CPPUNIT_ASSERT_MESSAGE("some integral variables.", suMacro[3].equalsIgnoreAsciiCase(t_getSourcePath("")) == sal_True );
- CPPUNIT_ASSERT_MESSAGE("some integral variables.", suMacro[0].getLength() > 0 &&
+ CPPUNIT_ASSERT_MESSAGE("some integral variables.", suMacro[0].getLength() > 0 &&
suMacro[1].getLength() > 0 &&
suMacro[2].getLength() > 0 &&
suMacro[3].getLength() > 0);
@@ -816,7 +816,7 @@ namespace rtl_Bootstrap
// expansion including a section currently erroneously does not
// recursively expand macros in the resulting replacement text
}
-
+
CPPUNIT_TEST_SUITE(expandMacrosFrom);
CPPUNIT_TEST(expandMacrosFrom_001);
CPPUNIT_TEST(expandMacrosFrom_002);
@@ -842,22 +842,22 @@ namespace rtl_Bootstrap
void tearDown()
{
- }
-
+ }
+
void expandMacros_001()
{
rtl::OUString suIniname = t_getSourcePath(TESTSHL2_INI);
Bootstrap aBootstrap( suIniname) ;
rtl::OUString suMacro = rtl::OUString::createFromAscii( "$INHERITED_VALUE/well" );
Bootstrap::expandMacros( suMacro );
-
+
rtl::OUString suName = rtl::OUString::createFromAscii( "INHERITED_VALUE" );
OUString suGetValue;
- Bootstrap::get( suName, suGetValue );
+ Bootstrap::get( suName, suGetValue );
suGetValue += OUString::createFromAscii( "/well" );
CPPUNIT_ASSERT_MESSAGE("expandMacros failed.", suGetValue.compareTo(suMacro) == 0 );
}
-
+
CPPUNIT_TEST_SUITE(expandMacros);
CPPUNIT_TEST(expandMacros_001);
// CPPUNIT_TEST(expandMacros_002);
@@ -887,11 +887,11 @@ namespace rtl_Bootstrap
// {
// rtl::OUString fileName;
// osl_getExecutableFile(&fileName.pData);
-//
+//
// sal_Int32 nDirEnd = fileName.lastIndexOf('/');
-//
+//
// OSL_ENSURE(nDirEnd >= 0, "Cannot locate executable directory");
-//
+//
// rtl::OUString aDirURL = fileName.copy(0, nDirEnd);
// return aDirURL;
// }
@@ -963,7 +963,7 @@ static void create_testshl2rc()
rtl::OString sLines;
sLines += "[Bootstrap]\n";
sLines += "FILE=testshl2 file\n";
- sLines += "MYBOOTSTRAPTESTVALUE=file\n";
+ sLines += "MYBOOTSTRAPTESTVALUE=file\n";
sLines += "INHERITED_VALUE=inherited_value\n";
sLines += "INHERITED_OVERWRITTEN_VALUE=not_overwritten\n";
sLines += "MYVAR=src680_test\n";
diff --git a/sal/qa/rtl/cipher/makefile.mk b/sal/qa/rtl/cipher/makefile.mk
index c8d508f8b..fc7a97565 100644
--- a/sal/qa/rtl/cipher/makefile.mk
+++ b/sal/qa/rtl/cipher/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_cipher.obj
SHL1TARGET= rtl_cipher
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx
index 60c99f4fb..a55f4a20d 100644
--- a/sal/qa/rtl/cipher/rtl_cipher.cxx
+++ b/sal/qa/rtl/cipher/rtl_cipher.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,7 +32,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/cipher.h>
@@ -53,7 +53,7 @@ rtl::OString createHex(sal_uInt8 *_pKeyBuffer, sal_uInt32 _nKeyLen)
}
aBuffer.append( nValue, 16 /* radix */ );
}
-
+
return aBuffer.makeStringAndClear();
}
@@ -71,52 +71,52 @@ public:
{
}
- void create_001()
+ void create_001()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void create_002()
+ void create_002()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeECB);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
}
- void create_003()
+ void create_003()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void create_004()
+ void create_004()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeCBC);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
}
- void create_005()
- {
+ void create_005()
+ {
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void create_006()
+ void create_006()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeStream);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
}
- void create_007()
- {
+ void create_007()
+ {
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeInvalid);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
}
- void create_008()
+ void create_008()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeInvalid);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(create);
@@ -144,32 +144,32 @@ public:
{
}
- void createBF_001()
+ void createBF_001()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void createBF_002()
+ void createBF_002()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeCBC);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void createBF_003()
+ void createBF_003()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeStream);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- void createBF_004()
+ void createBF_004()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeInvalid);
CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
// rtl_cipher_destroy(aCipher);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(createBF);
@@ -236,25 +236,25 @@ public:
/* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len);
CPPUNIT_ASSERT_MESSAGE("decode should not work", aError != rtl_Cipher_E_None);
-
+
// rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len);
// t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr());
// t_print(T_VERBOSE, " ascii: %s\n", sPlainText2Str.getStr());
- //
+ //
// // t_print(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
- //
+ //
// sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16);
- //
+ //
// CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0);
- //
+ //
// delete [] pPlainText2Buffer;
- //
+ //
// delete [] pCipherBuffer;
// delete [] pPlainTextBuffer;
- //
+ //
// delete [] pArgBuffer;
// delete [] pKeyBuffer;
- //
+ //
// rtl_cipher_destroy(aCipher);
}
@@ -302,7 +302,7 @@ public:
/* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len);
CPPUNIT_ASSERT_MESSAGE("wrong decode", aError == rtl_Cipher_E_None);
-
+
rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len);
t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr());
t_print(T_VERBOSE, " as ascii: %s\n", sPlainText2Str.getStr());
@@ -310,7 +310,7 @@ public:
// t_print(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16);
-
+
CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0);
delete [] pPlainText2Buffer;
@@ -339,8 +339,8 @@ public:
test_encode(1,0,"B2Aahg5B");
test_encode(1,2,"Longer text string");
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(decode);
@@ -361,11 +361,11 @@ public:
{
}
- void decodeBF_001()
+ void decodeBF_001()
{
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(decodeBF);
@@ -385,14 +385,14 @@ public:
{
}
- void destroy_001()
+ void destroy_001()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
rtl_cipher_destroy(aCipher);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(destroy);
@@ -412,7 +412,7 @@ public:
{
}
- void destroyBF_001()
+ void destroyBF_001()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB);
CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
@@ -420,8 +420,8 @@ public:
// more proforma
// should not GPF
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(destroyBF);
@@ -501,8 +501,8 @@ public:
test_encode(1,1,1);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(encode);
@@ -522,11 +522,11 @@ public:
{
}
- void encodeBF_001()
+ void encodeBF_001()
{
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(encodeBF);
@@ -659,8 +659,8 @@ public:
rtl_cipher_destroy(aCipher);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(init);
@@ -683,13 +683,13 @@ public:
{
}
- void initBF_001()
+ void initBF_001()
{
// seems to be the same as init, so empty
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(initBF);
diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk
index aa24d698e..8b1ee4a6f 100755
--- a/sal/qa/rtl/crc32/makefile.mk
+++ b/sal/qa/rtl/crc32/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,19 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:jobfile by codegen.pl
+# auto generated Target:jobfile by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_crc32.obj
SHL1TARGET= rtl_crc32
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/crc32/rtl_crc32.cxx b/sal/qa/rtl/crc32/rtl_crc32.cxx
index 694a31b43..09f492376 100755
--- a/sal/qa/rtl/crc32/rtl_crc32.cxx
+++ b/sal/qa/rtl/crc32/rtl_crc32.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@
#include "precompiled_sal.hxx"
// autogenerated file with codegen.pl
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/crc.h>
namespace rtl_CRC32
@@ -51,7 +51,7 @@ public:
{
}
-
+
// insert your test code here.
void rtl_crc32_001()
{
@@ -157,8 +157,8 @@ public:
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(test);
diff --git a/sal/qa/rtl/digest/makefile.mk b/sal/qa/rtl/digest/makefile.mk
index a80835047..778652290 100644
--- a/sal/qa/rtl/digest/makefile.mk
+++ b/sal/qa/rtl/digest/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -48,12 +48,10 @@ CXXFLAGS+= $(LFS_CFLAGS)
#----------------------------------- OStringBuffer -----------------------------------
SHL1OBJS= \
- $(SLO)$/rtl_digest.obj
+ $(SLO)$/rtl_digest.obj
SHL1TARGET= rtl_digest
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME= $(SHL1TARGET)
diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx
index c986536bc..39833cadb 100644
--- a/sal/qa/rtl/digest/rtl_digest.cxx
+++ b/sal/qa/rtl/digest/rtl_digest.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/digest.h>
#include <rtl/ustring.hxx>
@@ -96,37 +96,37 @@ public:
{
}
- void create_001()
+ void create_001()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", handle != 0);
rtl_digest_destroy( handle );
}
- void create_002()
+ void create_002()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD2 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", handle != 0);
rtl_digest_destroy( handle );
}
- void create_003()
+ void create_003()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmSHA", handle != 0);
rtl_digest_destroy( handle );
}
- void create_004()
+ void create_004()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmSHA1", handle != 0);
rtl_digest_destroy( handle );
}
- void create_005()
+ void create_005()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_MD5 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmHMAC_MD5", handle != 0);
rtl_digest_destroy( handle );
}
- void create_006()
+ void create_006()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_SHA1 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmHMAC_SHA1", handle != 0);
@@ -141,8 +141,8 @@ public:
rtl_digest_destroy( handle );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(create);
@@ -176,7 +176,7 @@ public:
void createMD5_001()
{
rtlDigest handle = rtl_digest_createMD5();
-
+
rtlDigestAlgorithm aAlgo = rtl_digest_queryAlgorithm(handle);
CPPUNIT_ASSERT_MESSAGE("query handle", rtl_Digest_AlgorithmMD5 == aAlgo);
@@ -311,7 +311,7 @@ public:
{
}
- void createHMAC_SHA1_001()
+ void createHMAC_SHA1_001()
{
rtlDigest handle = rtl_digest_createHMAC_SHA1();
@@ -341,10 +341,10 @@ public:
{
}
- void query_001()
+ void query_001()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
-
+
rtlDigestAlgorithm aAlgo = rtl_digest_queryAlgorithm(handle);
CPPUNIT_ASSERT_MESSAGE("query handle", rtl_Digest_AlgorithmMD5 == aAlgo);
@@ -359,7 +359,7 @@ public:
rtl_digest_destroy( handle );
}
- void query_003()
+ void query_003()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA );
@@ -368,7 +368,7 @@ public:
rtl_digest_destroy( handle );
}
- void query_004()
+ void query_004()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
@@ -386,7 +386,7 @@ public:
rtl_digest_destroy( handle );
}
- void query_006()
+ void query_006()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_SHA1 );
@@ -405,8 +405,8 @@ public:
rtl_digest_destroy( handle );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(queryAlgorithm);
@@ -434,17 +434,17 @@ public:
{
}
- void queryLength_MD5()
+ void queryLength_MD5()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
-
+
sal_uInt32 nAlgoLength = rtl_digest_queryLength(handle);
// t_print("nAlgoLength:=%d\n", nAlgoLength);
CPPUNIT_ASSERT_MESSAGE("query Length", RTL_DIGEST_LENGTH_MD5 == nAlgoLength);
rtl_digest_destroy( handle );
}
- void queryLength_MD2()
+ void queryLength_MD2()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD2 );
@@ -464,7 +464,7 @@ public:
rtl_digest_destroy( handle );
}
- void queryLength_SHA1()
+ void queryLength_SHA1()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
@@ -474,7 +474,7 @@ public:
rtl_digest_destroy( handle );
}
- void queryLength_HMAC_MD5()
+ void queryLength_HMAC_MD5()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_MD5 );
@@ -484,7 +484,7 @@ public:
rtl_digest_destroy( handle );
}
- void queryLength_HMAC_SHA1()
+ void queryLength_HMAC_SHA1()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_SHA1 );
@@ -506,8 +506,8 @@ public:
rtl_digest_destroy( handle );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(queryLength);
@@ -536,7 +536,7 @@ rtl::OString createHex(sal_uInt8 *_pMD5KeyBuffer, sal_uInt32 _nMD5KeyLen)
}
aBuffer.append( nValue, 16 /* radix */ );
}
-
+
return aBuffer.makeStringAndClear();
}
@@ -554,21 +554,21 @@ public:
{
}
- void init_000()
+ void init_000()
{
rtlDigest handle = NULL;
-
+
rtlDigestError aError = rtl_digest_init(handle, NULL, 0);
-
+
CPPUNIT_ASSERT_MESSAGE("init(NULL, 0, 0)", aError == rtl_Digest_E_Argument);
}
- void init_001()
+ void init_001()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
-
+
rtlDigestError aError = rtl_digest_init(handle, NULL, 0);
-
+
CPPUNIT_ASSERT_MESSAGE("init(handle, 0, 0)", aError == rtl_Digest_E_None);
rtl_digest_destroy( handle );
@@ -578,11 +578,11 @@ public:
void init_MD2()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD2 );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
rtlDigestError aError = rtl_digest_init(handle, pData, nSize);
CPPUNIT_ASSERT_MESSAGE("init(handle, pData, nSize)", aError == rtl_Digest_E_None);
@@ -595,7 +595,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("MD2 Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -606,11 +606,11 @@ public:
void init_MD5()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
rtlDigestError aError = rtl_digest_init(handle, pData, nSize);
CPPUNIT_ASSERT_MESSAGE("init(handle, pData, nSize)", aError == rtl_Digest_E_None);
@@ -623,7 +623,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("MD5 Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -634,11 +634,11 @@ public:
void init_SHA()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
rtlDigestError aError = rtl_digest_init(handle, pData, nSize);
CPPUNIT_ASSERT_MESSAGE("init(handle, pData, nSize)", aError == rtl_Digest_E_None);
@@ -651,7 +651,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("SHA Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -661,11 +661,11 @@ public:
void init_SHA1()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
rtlDigestError aError = rtl_digest_init(handle, pData, nSize);
CPPUNIT_ASSERT_MESSAGE("init(handle, pData, nSize)", aError == rtl_Digest_E_None);
@@ -678,7 +678,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("SHA1 Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -688,11 +688,11 @@ public:
void init_HMAC_MD5()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_MD5 );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
sal_uInt32 nKeyLen = rtl_digest_queryLength( handle );
CPPUNIT_ASSERT_MESSAGE( "Keylen must be greater 0", nKeyLen );
@@ -709,7 +709,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("HMAC_MD5 Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -719,18 +719,18 @@ public:
void init_HMAC_SHA1()
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmHMAC_SHA1 );
-
+
rtl::OString aMsg = sSampleString;
const sal_uInt8 *pData = (const sal_uInt8*)aMsg.getStr();
sal_uInt32 nSize = ( aMsg.getLength() );
-
+
sal_uInt32 nKeyLen = rtl_digest_queryLength( handle );
CPPUNIT_ASSERT_MESSAGE( "Keylen must be greater 0", nKeyLen );
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
CPPUNIT_ASSERT( pKeyBuffer );
memset(pKeyBuffer, 0, nKeyLen);
-
+
rtlDigestError aError = rtl_digest_init(handle, pKeyBuffer, nKeyLen );
CPPUNIT_ASSERT_MESSAGE("init(handle, pData, nSize)", aError == rtl_Digest_E_None);
@@ -740,7 +740,7 @@ public:
rtl_digest_get( handle, pKeyBuffer, nKeyLen );
rtl::OString aSum = createHex(pKeyBuffer, nKeyLen);
delete [] pKeyBuffer;
-
+
t_print("HMAC_SHA1 Sum: %s\n", aSum.getStr());
// LLA: how to check right values
// samples?
@@ -749,8 +749,8 @@ public:
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(init);
@@ -770,20 +770,20 @@ public:
rtl::OString getMD5Sum(rtl::OString const& _aMsg )
{
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
-
+
const sal_uInt8 *pData = (const sal_uInt8*)_aMsg.getStr();
sal_uInt32 nSize = ( _aMsg.getLength() );
-
+
rtl_digest_init(handle, pData, nSize);
rtl_digest_update( handle, pData, nSize );
-
+
sal_uInt32 nMD5KeyLen = rtl_digest_queryLength( handle );
sal_uInt8 *pMD5KeyBuffer = new sal_uInt8[ nMD5KeyLen ];
-
+
rtl_digest_get( handle, pMD5KeyBuffer, nMD5KeyLen );
rtl::OString aMD5Sum = createHex(pMD5KeyBuffer, nMD5KeyLen);
delete [] pMD5KeyBuffer;
-
+
rtl_digest_destroy( handle );
return aMD5Sum;
}
@@ -827,8 +827,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("differ only in one char", aMsgMD5Sum1.equals(aMsgMD5Sum2) == sal_False);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(equalTests);
@@ -857,14 +857,14 @@ public:
rtl::OString aMsg1 = sSampleString;
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_MD2 ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_MD2 );
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
rtlDigestError aError = rtl_digest_MD2(pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_MD2);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_MD2);
@@ -874,8 +874,8 @@ public:
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_MD2);
@@ -900,14 +900,14 @@ public:
rtl::OString aMsg1 = sSampleString;
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_MD5 ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_MD5 );
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
rtlDigestError aError = rtl_digest_MD5(pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_MD5);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_MD5);
@@ -917,8 +917,8 @@ public:
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_MD5);
@@ -945,14 +945,14 @@ public:
rtl::OString aMsg1 = sSampleString;
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_SHA ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_SHA);
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
rtlDigestError aError = rtl_digest_SHA(pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_SHA);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_SHA);
@@ -962,8 +962,8 @@ public:
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_SHA);
@@ -990,14 +990,14 @@ public:
rtl::OString aMsg1 = sSampleString;
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_SHA1 ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_SHA1);
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
rtlDigestError aError = rtl_digest_SHA1(pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_SHA1);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_SHA1);
@@ -1006,8 +1006,8 @@ public:
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_SHA1);
@@ -1031,30 +1031,30 @@ public:
void HMAC_MD5_001()
{
rtl::OString aMsg1 = sSampleString;
-
+
sal_uInt8 *pKeyBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_HMAC_MD5 ];
CPPUNIT_ASSERT( pKeyBuffer );
memset(pKeyBuffer, 0, RTL_DIGEST_LENGTH_HMAC_MD5);
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_HMAC_MD5 ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_HMAC_MD5);
-
+
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
-
+
rtlDigestError aError = rtl_digest_HMAC_MD5(pKeyBuffer, RTL_DIGEST_LENGTH_HMAC_MD5, pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_HMAC_MD5);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
-
+
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_HMAC_MD5);
t_print("Decrypt HMAC_MD5: %s\n", aStr.getStr());
CPPUNIT_ASSERT_MESSAGE("md5sum of sample string is wrong. Code changes or sample problems, please check.", aStr.equals(sSampleString_HMAC_MD5) );
-
+
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_HMAC_MD5);
@@ -1078,31 +1078,31 @@ public:
void HMAC_SHA1_001()
{
rtl::OString aMsg1 = sSampleString;
-
+
sal_uInt8 *pKeyBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_HMAC_SHA1 ];
CPPUNIT_ASSERT( pKeyBuffer );
memset(pKeyBuffer, 0, RTL_DIGEST_LENGTH_HMAC_SHA1);
sal_uInt8 *pBuffer = new sal_uInt8[ RTL_DIGEST_LENGTH_HMAC_SHA1 ];
- CPPUNIT_ASSERT( pBuffer );
+ CPPUNIT_ASSERT( pBuffer );
memset(pBuffer, 0, RTL_DIGEST_LENGTH_HMAC_SHA1);
-
+
sal_uInt8 *pMsg1 = (sal_uInt8*)aMsg1.getStr();
sal_Int32 nLen = aMsg1.getLength();
-
+
rtlDigestError aError = rtl_digest_HMAC_SHA1(pKeyBuffer, RTL_DIGEST_LENGTH_HMAC_SHA1, pMsg1, nLen, pBuffer, RTL_DIGEST_LENGTH_HMAC_SHA1);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
-
+
rtl::OString aStr = createHex(pBuffer, RTL_DIGEST_LENGTH_HMAC_SHA1);
t_print("Decrypt HMAC_SHA1: %s\n", aStr.getStr());
CPPUNIT_ASSERT_MESSAGE("md5sum of sample string is wrong. Code changes or sample problems, please check.", aStr.equals(sSampleString_HMAC_SHA1) );
-
+
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_HMAC_SHA1);
@@ -1132,7 +1132,7 @@ public:
sal_uInt8 *pPassword = (sal_uInt8*)_sPassword.getStr();
sal_Int32 nPasswordLen = _sPassword.getLength();
-
+
sal_uInt32 nSaltDataLen = RTL_DIGEST_LENGTH_HMAC_SHA1;
sal_uInt8 *pSaltData = new sal_uInt8[ nSaltDataLen ];
CPPUNIT_ASSERT( pSaltData );
@@ -1143,9 +1143,9 @@ public:
// wilful contamination
pSaltData[0] = 1;
}
-
+
rtlDigestError aError = rtl_digest_PBKDF2(pKeyBuffer, nKeyLen, pPassword, nPasswordLen, pSaltData, nSaltDataLen, _nCount);
-
+
CPPUNIT_ASSERT(aError == rtl_Digest_E_None );
rtl::OString aKey = createHex(pKeyBuffer, nKeyLen);
@@ -1155,12 +1155,12 @@ public:
// t_print("Salt: %s\n", sSalt.getStr());
// CPPUNIT_ASSERT_MESSAGE("md5sum of sample string is wrong. Code changes or sample problems, please check.", aStr.equals(sSampleString_PBKDF2) );
-
+
delete [] pSaltData;
delete [] pKeyBuffer;
return aKey;
}
-
+
void PBKDF2_001()
{
rtl::OString aPassword = "Password";
@@ -1175,8 +1175,8 @@ public:
run_check_PBKDF2(aPassword, true, 3);
run_check_PBKDF2(aPassword, true, 4);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(digest_PBKDF2);
@@ -1249,7 +1249,7 @@ public:
rtl_digest_destroyMD5(aHandle);
}
-
+
void updateMD5_002()
{
rtlDigest aHandle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
@@ -1295,8 +1295,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(update);
@@ -1342,7 +1342,7 @@ public:
// test with wrong algorithm
rtlDigest aHandle = rtl_digest_create( rtl_Digest_AlgorithmMD2 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != 0);
-
+
sal_uInt32 nKeyLen = rtl_digest_queryLength( aHandle );
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -1359,7 +1359,7 @@ public:
{
rtlDigest aHandle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", aHandle != 0);
-
+
sal_uInt32 nKeyLen = rtl_digest_queryLength( aHandle );
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -1373,8 +1373,8 @@ public:
delete [] pKeyBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(get);
@@ -1408,8 +1408,8 @@ public:
rtl_digest_destroy( handle );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(destroy);
diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk
index 7ee93688e..b46518fb2 100644
--- a/sal/qa/rtl/doublelock/makefile.mk
+++ b/sal/qa/rtl/doublelock/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,7 +45,7 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:testjob by codegen.pl
+# auto generated Target:testjob by codegen.pl
.IF "$(GUI)" == "WNT"
CFLAGS+=/Ob1
@@ -55,9 +55,7 @@ SHL1OBJS= \
$(SLO)$/rtl_doublelocking.obj
SHL1TARGET= rtl_doublelocking
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
index 1c5ba8506..cbcc334d3 100644
--- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
+++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@
#include <rtl/instance.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// -----------------------------------------------------------------------------
#define CONST_TEST_STRING "gregorian"
@@ -62,7 +62,7 @@ struct Gregorian : public rtl::StaticWithInit<const ::rtl::OUString, Gregorian>
inline void printOUString( ::rtl::OUString const & _suStr )
{
rtl::OString aString;
-
+
t_print( "OUString: " );
aString = ::rtl::OUStringToOString( _suStr, RTL_TEXTENCODING_ASCII_US );
t_print( "'%s'\n", aString.getStr( ) );
@@ -75,7 +75,7 @@ namespace ThreadHelper
// QUIET=1,
// VERBOSE
// } eSleepVerboseMode;
-
+
void thread_sleep_tenth_sec(sal_Int32 _nTenthSec/*, eSleepVerboseMode nVerbose = VERBOSE*/)
{
// if (nVerbose == VERBOSE)
@@ -122,7 +122,7 @@ public:
sal_Int32 getFails() {return m_nFails;}
protected:
-
+
/** guarded value which initialized 0
@see ThreadSafeValue
@@ -145,14 +145,14 @@ protected:
ThreadHelper::thread_sleep_tenth_sec(1);
}
}
-
+
public:
-
- virtual void SAL_CALL suspend()
+
+ virtual void SAL_CALL suspend()
{
::osl::Thread::suspend();
}
-
+
~OGetThread()
{
if (isRunning())
@@ -172,7 +172,7 @@ namespace rtl_DoubleLocking
class getValue : public CppUnit::TestFixture
{
public:
-
+
// initialise your test code values here.
void setUp()
{
@@ -193,11 +193,11 @@ namespace rtl_DoubleLocking
aStr.getLength() != 0
);
}
-
+
/** check 2 threads.
ALGORITHM:
- Here the function should show, that 2 different threads,
+ Here the function should show, that 2 different threads,
which only increase a value, should run at the same time with same prio.
The test fails, if the difference between the two values is more than 5%
but IMHO this isn't a failure, it's only a feature of the OS.
@@ -208,47 +208,47 @@ namespace rtl_DoubleLocking
// initial 5 threads with different priorities
OGetThread* pThread = new OGetThread();
OGetThread* p2Thread = new OGetThread();
-
+
//Create them and start running at the same time
pThread->create();
p2Thread->create();
-
+
ThreadHelper::thread_sleep_tenth_sec(50);
-
+
pThread->terminate();
p2Thread->terminate();
-
+
sal_Int32 nValueOK = 0;
nValueOK = pThread->getOK();
-
+
sal_Int32 nValueOK2 = 0;
nValueOK2 = p2Thread->getOK();
-
+
t_print("Value in Thread #1 is %d\n", nValueOK);
t_print("Value in Thread #2 is %d\n", nValueOK2);
sal_Int32 nValueFails = 0;
nValueFails = pThread->getFails();
-
+
sal_Int32 nValueFails2 = 0;
nValueFails2 = p2Thread->getFails();
t_print("Fails in Thread #1 is %d\n", nValueFails);
t_print("Fails in Thread #2 is %d\n", nValueFails2);
-
+
// ThreadHelper::thread_sleep_tenth_sec(1);
pThread->join();
p2Thread->join();
-
+
delete pThread;
delete p2Thread;
-
+
CPPUNIT_ASSERT_MESSAGE(
"getValue() failed, wrong value expected.",
nValueOK != 0 && nValueFails == 0 && nValueFails2 == 0
);
}
-
+
CPPUNIT_TEST_SUITE(getValue);
CPPUNIT_TEST(getValue_001);
CPPUNIT_TEST(getValue_002);
diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk
index 6ad4991bc..8e4710c5a 100644
--- a/sal/qa/rtl/locale/makefile.mk
+++ b/sal/qa/rtl/locale/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:locale by codegen.pl
+# auto generated Target:locale by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_locale.obj
SHL1TARGET= rtl_locale
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx
index 910bde1dc..c67725903 100644
--- a/sal/qa/rtl/locale/rtl_locale.cxx
+++ b/sal/qa/rtl/locale/rtl_locale.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@
#include "precompiled_sal.hxx"
// autogenerated file with codegen.pl
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/locale.hxx>
#include <osl/thread.h>
@@ -76,8 +76,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("locale must not null", aLocale.getData() != NULL);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(getDefault);
@@ -106,12 +106,12 @@ public:
rtl::OLocale::setDefault(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString());
rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
CPPUNIT_ASSERT_MESSAGE("locale must not null", aLocale.getData() != NULL);
-
+
// be sure to not GPF
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(setDefault);
@@ -148,8 +148,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString::createFromAscii("de")));
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(getLanguage);
@@ -187,8 +187,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString::createFromAscii("DE")));
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(getCountry);
@@ -226,8 +226,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString::createFromAscii("hochdeutsch")));
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(getVariant);
@@ -265,8 +265,8 @@ public:
CPPUNIT_ASSERT_MESSAGE("locale hashcode must be 3831", nHashCode != 0);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(hashCode);
@@ -293,7 +293,7 @@ public:
{
rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString());
rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"));
-
+
sal_Bool bLocaleAreEqual = sal_False;
bLocaleAreEqual = (aLocale1 == aLocale2);
@@ -304,14 +304,14 @@ public:
{
rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString());
rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"));
-
+
sal_Int32 nEqual = rtl_locale_equals(aLocale1.getData(), aLocale2.getData());
t_print("rtl_locale_equals() result: %d\n", nEqual);
CPPUNIT_ASSERT(nEqual != 0);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(equals);
diff --git a/sal/qa/rtl/logfile/makefile.mk b/sal/qa/rtl/logfile/makefile.mk
index 23a597923..da70d7533 100644
--- a/sal/qa/rtl/logfile/makefile.mk
+++ b/sal/qa/rtl/logfile/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,9 +47,7 @@ CXXFLAGS+= $(LFS_CFLAGS)
SHL1OBJS= \
$(SLO)$/rtl_logfile.obj
SHL1TARGET= rtl_logfile
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/sal/qa/rtl/logfile/rtl_logfile.cxx b/sal/qa/rtl/logfile/rtl_logfile.cxx
index 486520ca9..d589cfb2b 100644
--- a/sal/qa/rtl/logfile/rtl_logfile.cxx
+++ b/sal/qa/rtl/logfile/rtl_logfile.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,10 +43,10 @@
#if defined(UNX) || defined(OS2)
# include <unistd.h>
-#endif
+#endif
#include <rtl/logfile.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// #ifndef _OSL_MODULE_HXX_
// #include <osl/module.hxx>
@@ -113,24 +113,24 @@ inline ::rtl::OUString getCurrentPID( )
#else
nPID = getpid();
#endif
- return ( ::rtl::OUString::valueOf( ( long )nPID ) );
+ return ( ::rtl::OUString::valueOf( ( long )nPID ) );
}
// -----------------------------------------------------------------------------
/*
- * LLA:
+ * LLA:
* check if logfile is create
* be careful with relative logfiles they will create near the source, maybe it's no write access to it.
* use absolute path to logfile instead.
*/
namespace rtl_logfile
{
- class logfile : public CppUnit::TestFixture
+ class logfile : public CppUnit::TestFixture
{
public:
-
- //directly call rtl_logfile_trace
+
+ //directly call rtl_logfile_trace
void logfile_001()
{
#ifdef SOLARIS
@@ -154,7 +154,7 @@ namespace rtl_logfile
::osl::File aTestFile( suFilePath );
printUString( suFilePath );
nError1 = aTestFile.open ( OpenFlag_Read );
- CPPUNIT_ASSERT_MESSAGE("create the log file: but the logfile does not exist",
+ CPPUNIT_ASSERT_MESSAGE("create the log file: but the logfile does not exist",
( ::osl::FileBase::E_NOENT != nError1 ) &&
( ::osl::FileBase::E_ACCES != nError1 ) );
sal_Char buffer_read[400];
@@ -165,7 +165,7 @@ namespace rtl_logfile
aTestFile.sync();
aTestFile.close();
/*// delete logfile on the disk
-
+
nError1 = osl::File::remove( suFilePath );
printError( nError1 );
CPPUNIT_ASSERT_MESSAGE( "In deleteTestFile Function: remove ", ( ::osl::FileBase::E_None == nError1 ) || ( nError1 == ::osl::FileBase::E_NOENT ) );
@@ -190,7 +190,7 @@ namespace rtl_logfile
RTL_LOGFILE_TRACE3( "trace %d %d %d" , 1 , 2 ,3 );
// TODO: assertion test!
}
-
+
void logfile_003()
{
#ifdef SOLARIS
@@ -209,15 +209,15 @@ namespace rtl_logfile
RTL_LOGFILE_CONTEXT_TRACE3 ( foo , "trace %d %d %d" , 1 , 2 , 3);
// TODO: assertion test!
}
-
-
+
+
CPPUNIT_TEST_SUITE( logfile );
CPPUNIT_TEST( logfile_001 );
CPPUNIT_TEST( logfile_002 );
CPPUNIT_TEST( logfile_003 );
CPPUNIT_TEST_SUITE_END( );
};
-
+
} // namespace rtl_logfile
// -----------------------------------------------------------------------------
@@ -226,25 +226,25 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_logfile::logfile, "rtl_logfile" );
// -----------------------------------------------------------------------------
NOADDITIONAL;
-//~ do some clean up work after all test completed.
+//~ do some clean up work after all test completed.
class GlobalObject
{
public:
~GlobalObject()
{
try
- {
+ {
t_print( "\n#Do some clean-ups ... only delete logfile1_*.log here!\n" );
rtl::OUString suFilePath = getTempPath();
suFilePath += rtl::OUString::createFromAscii("logfile1_") + getCurrentPID( );
suFilePath += rtl::OUString::createFromAscii(".log");
-
+
//if ( ifFileExist( suFilePath ) == sal_True )
::osl::FileBase::RC nError1;
nError1 = osl::File::remove( suFilePath );
#ifdef WNT
t_print("Please remove logfile* manully! Error is Permision denied!");
-#endif
+#endif
}
catch (CppUnit::Exception &e)
{
@@ -259,5 +259,5 @@ public:
GlobalObject theGlobalObject;
-
+
diff --git a/sal/qa/rtl/math/makefile.mk b/sal/qa/rtl/math/makefile.mk
index 14e8cec2e..5db3ffdd2 100644
--- a/sal/qa/rtl/math/makefile.mk
+++ b/sal/qa/rtl/math/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -48,17 +48,10 @@ CXXFLAGS+= $(LFS_CFLAGS)
#----------------------------------- OStringBuffer -----------------------------------
SHL1OBJS= \
- $(SLO)$/test_rtl_math.obj
+ $(SLO)$/test_rtl_math.obj
SHL1TARGET= rtl_math
-SHL1STDLIBS=\
- $(SALLIB)
-.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -71,9 +64,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS= \
$(SLO)$/rtl_math.obj
SHL2TARGET= rtl_math2
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME= $(SHL2TARGET)
@@ -90,14 +81,12 @@ SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
# SHL3OBJS= \
# $(SLO)$/rtl_old_testint64.obj
# SHL3TARGET= rtl_old_testint64
-# SHL3STDLIBS=\
-# $(SALLIB) \
-# $(CPPUNITLIB)
-#
+# SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
+#
# SHL3IMPLIB= i$(SHL3TARGET)
# DEF3NAME= $(SHL3TARGET)
# SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
-#
+#
#------------------------------- All object files -------------------------------
# do this here, so we get right dependencies
diff --git a/sal/qa/rtl/math/rtl_math.cxx b/sal/qa/rtl/math/rtl_math.cxx
index 206c98bcd..a9c16541e 100644
--- a/sal/qa/rtl/math/rtl_math.cxx
+++ b/sal/qa/rtl/math/rtl_math.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@
#endif
#include <math.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/math.h>
#include <rtl/string.hxx>
@@ -68,10 +68,10 @@ public:
sError += ") but is:(";
sError += rtl::OString::valueOf(_nResult);
sError += ")";
-
+
CPPUNIT_ASSERT_MESSAGE(sError.getStr(), bEqualResult == true);
}
-
+
// insert your test code here.
void round_000()
{
@@ -585,8 +585,8 @@ public:
equalCheck(nResult, double(-0.2));
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(test);
diff --git a/sal/qa/rtl/math/rtl_old_testint64.cxx b/sal/qa/rtl/math/rtl_old_testint64.cxx
index 229450e1c..c873b2862 100644
--- a/sal/qa/rtl/math/rtl_old_testint64.cxx
+++ b/sal/qa/rtl/math/rtl_old_testint64.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,16 +49,16 @@
// #define TEST_ENSURE(c, m) OSL_VERIFY(c)
// #endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// -----------------------------------------------------------------------------
namespace rtl_math
{
- class int64 : public CppUnit::TestFixture
+ class int64 : public CppUnit::TestFixture
{
public:
void test_int64();
-
+
CPPUNIT_TEST_SUITE( int64 );
CPPUNIT_TEST( test_int64 );
CPPUNIT_TEST_SUITE_END( );
diff --git a/sal/qa/rtl/ostring/makefile.mk b/sal/qa/rtl/ostring/makefile.mk
index 279697313..d2c6049af 100644
--- a/sal/qa/rtl/ostring/makefile.mk
+++ b/sal/qa/rtl/ostring/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_OString2.obj
SHL1TARGET= rtl_OString2
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -68,9 +66,7 @@ SHL2OBJS= \
$(SLO)$/rtl_str.obj
SHL2TARGET= rtl_str
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME =$(SHL2TARGET)
@@ -82,9 +78,7 @@ SHL3OBJS= \
$(SLO)$/rtl_string.obj
SHL3TARGET= rtl_string
-SHL3STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL3IMPLIB= i$(SHL3TARGET)
DEF3NAME =$(SHL3TARGET)
diff --git a/sal/qa/rtl/ostring/rtl_OString2.cxx b/sal/qa/rtl/ostring/rtl_OString2.cxx
index 7c289376f..2ff2ca6b4 100644
--- a/sal/qa/rtl/ostring/rtl_OString2.cxx
+++ b/sal/qa/rtl/ostring/rtl_OString2.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
// autogenerated file with codegen.pl
// There exist some more test code in sal/qa/rtl_strings/rtl_OString.cxx
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "valueequal.hxx"
namespace rtl_OString
@@ -53,7 +53,7 @@ class valueOf : public CppUnit::TestFixture
bool bEqualResult = is_float_equal(_nValue, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void valueOf_float_test(float _nValue)
{
valueOf_float_test_impl(_nValue);
@@ -71,8 +71,8 @@ public:
void tearDown()
{
- }
-
+ }
+
// insert your test code here.
void valueOf_float_test_001()
{
@@ -119,7 +119,7 @@ public:
}
private:
-
+
void valueOf_double_test_impl(double _nValue)
{
rtl::OString sValue;
@@ -127,21 +127,21 @@ private:
t_print(T_VERBOSE, "nDouble := %.20f sValue := %s\n", _nValue, sValue.getStr());
double nValueATOF = atof( sValue.getStr() );
-
+
bool bEqualResult = is_double_equal(_nValue, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void valueOf_double_test(double _nValue)
{
valueOf_double_test_impl(_nValue);
-
+
// test also the negative part.
double nNegativeValue = -_nValue;
valueOf_double_test_impl(nNegativeValue);
}
public:
-
+
// valueOf double
void valueOf_double_test_001()
{
@@ -185,8 +185,8 @@ public:
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(valueOf);
@@ -216,44 +216,44 @@ class toDouble : public CppUnit::TestFixture
{
public:
-
+
toDouble()
{
// testPrecision a;
}
-
-
+
+
// initialise your test code values here.
void setUp()
{
}
-
+
void tearDown()
{
}
-
+
void toDouble_test_impl(rtl::OString const& _sValue)
{
double nValueATOF = atof( _sValue.getStr() );
-
+
// rtl::OUString suValue = rtl::OUString::createFromAscii( _sValue.getStr() );
double nValueToDouble = _sValue.toDouble();
-
+
bool bEqualResult = is_double_equal(nValueToDouble, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void toDouble_test(rtl::OString const& _sValue)
{
toDouble_test_impl(_sValue);
-
+
// test also the negativ part.
rtl::OString sNegativValue("-");
sNegativValue += _sValue;
toDouble_test_impl(sNegativValue);
}
-
+
// insert your test code here.
void toDouble_selftest()
{
@@ -276,7 +276,7 @@ public:
CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000000001) == true);
t_print("Selftest done.\n");
}
-
+
void toDouble_test_3()
{
rtl::OString sValue("3");
@@ -298,7 +298,7 @@ public:
rtl::OString sValue("3.141592653589793238462643383279502884197169399375");
toDouble_test(sValue);
}
-
+
void toDouble_test_1()
{
rtl::OString sValue("1");
@@ -339,14 +339,14 @@ public:
rtl::OString sValue("1e308");
toDouble_test(sValue);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toDouble);
CPPUNIT_TEST(toDouble_selftest);
-
+
CPPUNIT_TEST(toDouble_test_3);
CPPUNIT_TEST(toDouble_test_3_5);
CPPUNIT_TEST(toDouble_test_3_0625);
@@ -369,22 +369,22 @@ class getToken : public CppUnit::TestFixture
{
public:
-
+
// initialise your test code values here.
void setUp()
{
}
-
+
void tearDown()
{
}
-
+
// -----------------------------------------------------------------------------
void getToken_000()
{
rtl::OString sTokenStr;
-
+
sal_Int32 nIndex = 0;
do
{
@@ -398,7 +398,7 @@ public:
void getToken_001()
{
rtl::OString sTokenStr = "a;b";
-
+
sal_Int32 nIndex = 0;
rtl::OString sToken = sTokenStr.getToken( 0, ';', nIndex );
@@ -412,7 +412,7 @@ public:
void getToken_002()
{
rtl::OString sTokenStr = "a;b.c";
-
+
sal_Int32 nIndex = 0;
rtl::OString sToken = sTokenStr.getToken( 0, ';', nIndex );
@@ -429,7 +429,7 @@ public:
void getToken_003()
{
rtl::OString sTokenStr = "a;;b";
-
+
sal_Int32 nIndex = 0;
rtl::OString sToken = sTokenStr.getToken( 0, ';', nIndex );
@@ -446,7 +446,7 @@ public:
void getToken_004()
{
rtl::OString sTokenStr = "longer.then.ever.";
-
+
sal_Int32 nIndex = 0;
rtl::OString sToken = sTokenStr.getToken( 0, '.', nIndex );
@@ -485,12 +485,12 @@ public:
class replaceAt : public CppUnit::TestFixture
{
-public:
+public:
// initialise your test code values here.
void setUp()
{
}
-
+
void tearDown()
{
}
@@ -499,50 +499,50 @@ public:
{
::rtl::OString aStr1;
aStr1= input->replaceAt( index, count, *newStr );
-
+
t_print("the result OString is %s#\n", aStr1.getStr() );
sal_Bool bRes = ( expVal->compareTo(aStr1) == 0 );
- return bRes;
+ return bRes;
}
// -----------------------------------------------------------------------------
void replaceAt_001()
{
- sal_Bool bRes = check_replaceAt(new rtl::OString("Java@Sun"),
- new rtl::OString("Sun java"), new rtl::OString("Java@Sun"), 0, 8 );
+ sal_Bool bRes = check_replaceAt(new rtl::OString("Java@Sun"),
+ new rtl::OString("Sun java"), new rtl::OString("Java@Sun"), 0, 8 );
CPPUNIT_ASSERT_MESSAGE("string differs, replace whole string", bRes == sal_True);
}
void replaceAt_002()
{
sal_Bool bRes = check_replaceAt(new rtl::OString("Sun Java desktop system"),
- new rtl::OString("Sun "), new rtl::OString("Java desktop system"), 10, 8 );
+ new rtl::OString("Sun "), new rtl::OString("Java desktop system"), 10, 8 );
CPPUNIT_ASSERT_MESSAGE("index > length of input string", bRes == sal_True);
}
void replaceAt_003()
{
sal_Bool bRes = check_replaceAt(new rtl::OString("SuJava desktop system"),
- new rtl::OString("Sun "), new rtl::OString("Java desktop system"), 2, 64 );
+ new rtl::OString("Sun "), new rtl::OString("Java desktop system"), 2, 64 );
CPPUNIT_ASSERT_MESSAGE("larger count", bRes == sal_True);
}
void replaceAt_004()
- {
+ {
sal_Bool bRes = check_replaceAt(new rtl::OString("Java desktop system"),
- new rtl::OString("Sun "), new rtl::OString("Java desktop system"), -4, 8 );
+ new rtl::OString("Sun "), new rtl::OString("Java desktop system"), -4, 8 );
CPPUNIT_ASSERT_MESSAGE("navigate index", bRes == sal_True);
}
void replaceAt_005()
- {
+ {
sal_Bool bRes = check_replaceAt(new rtl::OString("Sun Jesktop System"),
- new rtl::OString("Sun Java Desktop System"), new rtl::OString(""), 5, 5 );
+ new rtl::OString("Sun Java Desktop System"), new rtl::OString(""), 5, 5 );
CPPUNIT_ASSERT_MESSAGE("replace with null string", bRes == sal_True);
}
-
+
CPPUNIT_TEST_SUITE(replaceAt);
CPPUNIT_TEST(replaceAt_001);
@@ -552,7 +552,7 @@ public:
CPPUNIT_TEST(replaceAt_005);
CPPUNIT_TEST_SUITE_END();
}; // class replaceAt
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OString::valueOf, "rtl_OString");
diff --git a/sal/qa/rtl/ostring/rtl_str.cxx b/sal/qa/rtl/ostring/rtl_str.cxx
index ed1cff89f..6ce43ae0b 100644
--- a/sal/qa/rtl/ostring/rtl_str.cxx
+++ b/sal/qa/rtl/ostring/rtl_str.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
namespace rtl_str
{
@@ -39,7 +39,7 @@ namespace rtl_str
class compare : public CppUnit::TestFixture
{
public:
-
+
void compare_000()
{
rtl_str_compare( NULL, NULL);
@@ -67,7 +67,7 @@ namespace rtl_str
sal_Int32 nValue = rtl_str_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal.", nValue == 0);
}
-
+
void compare_003()
{
rtl::OString aStr1 = "Line must differ.";
@@ -76,9 +76,9 @@ namespace rtl_str
sal_Int32 nValue = rtl_str_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(compare);
@@ -94,7 +94,7 @@ namespace rtl_str
class compareIgnoreAsciiCase : public CppUnit::TestFixture
{
public:
-
+
void compare_000()
{
rtl_str_compareIgnoreAsciiCase( NULL, NULL);
@@ -131,7 +131,7 @@ namespace rtl_str
sal_Int32 nValue = rtl_str_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void compare_003()
{
rtl::OString aStr1 = "Line must differ.";
@@ -140,9 +140,9 @@ namespace rtl_str
sal_Int32 nValue = rtl_str_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(compareIgnoreAsciiCase);
@@ -156,11 +156,11 @@ namespace rtl_str
}; // class compareIgnoreAsciiCase
// -----------------------------------------------------------------------------
-
+
class shortenedCompareIgnoreAsciiCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void compare_000()
{
rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( NULL, 0, NULL, 0, 0);
@@ -201,7 +201,7 @@ namespace rtl_str
aStr1.getLength());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void compare_003()
{
rtl::OString aStr1 = "Line must differ.";
@@ -212,7 +212,7 @@ namespace rtl_str
5);
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal first 5 characters.", nValue == 0);
}
-
+
void compare_004()
{
rtl::OString aStr1 = "Line must differ.";
@@ -223,9 +223,9 @@ namespace rtl_str
aStr1.getLength());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(shortenedCompareIgnoreAsciiCase_WithLength);
@@ -245,7 +245,7 @@ namespace rtl_str
class hashCode : public CppUnit::TestFixture
{
public:
-
+
void hashCode_000()
{
rtl_str_hashCode( NULL );
@@ -258,7 +258,7 @@ namespace rtl_str
t_print("hashcode: %d\n", nHashCode);
// CPPUNIT_ASSERT_MESSAGE("failed.", nValue == 0);
}
-
+
void hashCode_002()
{
rtl::OString aStr1 = "Line for a hashCode.";
@@ -281,10 +281,10 @@ namespace rtl_str
CPPUNIT_ASSERT_MESSAGE("hashcodes must differ.", nHashCode1 != nHashCode2 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(hashCode);
CPPUNIT_TEST(hashCode_000);
CPPUNIT_TEST(hashCode_001);
@@ -299,7 +299,7 @@ namespace rtl_str
class indexOfChar : public CppUnit::TestFixture
{
public:
-
+
void indexOfChar_000()
{
rtl_str_indexOfChar( NULL, 0 );
@@ -311,17 +311,17 @@ namespace rtl_str
sal_Int32 nIndex = rtl_str_indexOfChar( aStr1.getStr(), 'L' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* sal_Int32 */ nIndex = rtl_str_indexOfChar( aStr1.getStr(), 'i' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 1);
-
+
/* sal_Int32 */ nIndex = rtl_str_indexOfChar( aStr1.getStr(), 'n' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 2);
/* sal_Int32 */ nIndex = rtl_str_indexOfChar( aStr1.getStr(), 'e' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 3);
}
-
+
void indexOfChar_002()
{
rtl::OString aStr1 = "Line for a indexOfChar.";
@@ -330,10 +330,10 @@ namespace rtl_str
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(indexOfChar);
CPPUNIT_TEST(indexOfChar_000);
CPPUNIT_TEST(indexOfChar_001);
@@ -345,7 +345,7 @@ namespace rtl_str
class lastIndexOfChar : public CppUnit::TestFixture
{
public:
-
+
void lastIndexOfChar_000()
{
rtl_str_lastIndexOfChar( NULL, 0 );
@@ -357,17 +357,17 @@ namespace rtl_str
sal_Int32 nIndex = rtl_str_lastIndexOfChar( aStr1.getStr(), 'C' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 22);
-
+
/* sal_Int32 */ nIndex = rtl_str_lastIndexOfChar( aStr1.getStr(), 'h' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 23);
-
+
/* sal_Int32 */ nIndex = rtl_str_lastIndexOfChar( aStr1.getStr(), 'a' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 24);
/* sal_Int32 */ nIndex = rtl_str_lastIndexOfChar( aStr1.getStr(), 'r' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 25);
}
-
+
void lastIndexOfChar_002()
{
rtl::OString aStr1 = "Line for a lastIndexOfChar.";
@@ -376,10 +376,10 @@ namespace rtl_str
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(lastIndexOfChar);
CPPUNIT_TEST(lastIndexOfChar_000);
CPPUNIT_TEST(lastIndexOfChar_001);
@@ -393,7 +393,7 @@ namespace rtl_str
class indexOfStr : public CppUnit::TestFixture
{
public:
-
+
void indexOfStr_000()
{
rtl_str_indexOfStr( NULL, 0 );
@@ -411,17 +411,17 @@ namespace rtl_str
sal_Int32 nIndex = rtl_str_indexOfStr( aStr1.getStr(), "Line" );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* sal_Int32 */ nIndex = rtl_str_indexOfStr( aStr1.getStr(), "for" );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 5);
-
+
/* sal_Int32 */ nIndex = rtl_str_indexOfStr( aStr1.getStr(), "a" );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 9);
/* sal_Int32 */ nIndex = rtl_str_indexOfStr( aStr1.getStr(), "a index" );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex ==9);
}
-
+
void indexOfStr_002()
{
rtl::OString aStr1 = "Line for a indexOfStr.";
@@ -430,10 +430,10 @@ namespace rtl_str
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(indexOfStr);
CPPUNIT_TEST(indexOfStr_000);
CPPUNIT_TEST(indexOfStr_001);
@@ -446,7 +446,7 @@ namespace rtl_str
class lastIndexOfStr : public CppUnit::TestFixture
{
public:
-
+
void lastIndexOfStr_000()
{
rtl_str_lastIndexOfStr( NULL, NULL );
@@ -462,19 +462,19 @@ namespace rtl_str
{
rtl::OString aStr1 = "Line for a lastIndexOfStr.";
rtl::OString aSearchStr = "Index";
-
+
sal_Int32 nIndex = rtl_str_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 15);
-
+
/* rtl::OString */ aSearchStr = "Line";
/* sal_Int32 */ nIndex = rtl_str_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* rtl::OString */ aSearchStr = "";
/* sal_Int32 */ nIndex = rtl_str_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1);
}
-
+
void lastIndexOfStr_002()
{
rtl::OString aStr1 = "Line for a lastIndexOfStr.";
@@ -493,10 +493,10 @@ namespace rtl_str
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 20 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(lastIndexOfStr);
CPPUNIT_TEST(lastIndexOfStr_000);
CPPUNIT_TEST(lastIndexOfStr_001);
@@ -510,7 +510,7 @@ namespace rtl_str
class replaceChar : public CppUnit::TestFixture
{
public:
-
+
void replaceChar_000()
{
rtl_str_replaceChar( NULL, 0, 0 );
@@ -520,21 +520,21 @@ namespace rtl_str
{
rtl::OString aStr1 = "replace char.";
rtl::OString aShouldStr1 = "ruplacu char.";
-
+
sal_Char* pStr = (sal_Char*) malloc(aStr1.getLength() + 1);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
strcpy(pStr, aStr1.getStr());
rtl_str_replaceChar( pStr, 'e', 'u' );
-
+
CPPUNIT_ASSERT_MESSAGE("replace failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(replaceChar);
CPPUNIT_TEST(replaceChar_000);
CPPUNIT_TEST(replaceChar_001);
@@ -546,7 +546,7 @@ namespace rtl_str
class replaceChar_WithLength : public CppUnit::TestFixture
{
public:
-
+
void replaceChar_WithLength_000()
{
rtl_str_replaceChar_WithLength( NULL, 0, 0, 0 );
@@ -560,21 +560,21 @@ namespace rtl_str
{
rtl::OString aStr1 = "replace char.";
rtl::OString aShouldStr1 = "ruplace char.";
-
+
sal_Char* pStr = (sal_Char*) malloc(aStr1.getLength() + 1);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
strcpy(pStr, aStr1.getStr());
rtl_str_replaceChar_WithLength( pStr, 6, 'e', 'u' );
-
+
CPPUNIT_ASSERT_MESSAGE("replace failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(replaceChar_WithLength);
CPPUNIT_TEST(replaceChar_WithLength_000);
CPPUNIT_TEST(replaceChar_WithLength_000_1);
@@ -588,7 +588,7 @@ namespace rtl_str
class toAsciiLowerCase : public CppUnit::TestFixture
{
public:
-
+
void toAsciiLowerCase_000()
{
rtl_str_toAsciiLowerCase( NULL );
@@ -598,21 +598,21 @@ namespace rtl_str
{
rtl::OString aStr1 = "CHANGE THIS TO ASCII LOWER CASE.";
rtl::OString aShouldStr1 = "change this to ascii lower case.";
-
+
sal_Char* pStr = (sal_Char*) malloc(aStr1.getLength() + 1);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
strcpy(pStr, aStr1.getStr());
rtl_str_toAsciiLowerCase( pStr );
-
+
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiLowerCase);
CPPUNIT_TEST(toAsciiLowerCase_000);
CPPUNIT_TEST(toAsciiLowerCase_001);
@@ -623,7 +623,7 @@ namespace rtl_str
class toAsciiLowerCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void toAsciiLowerCase_WithLength_000()
{
rtl_str_toAsciiLowerCase_WithLength( NULL, 0 );
@@ -633,22 +633,22 @@ namespace rtl_str
{
rtl::OString aStr1 = "CHANGE THIS TO ASCII LOWER CASE.";
rtl::OString aShouldStr1 = "change thiS TO ASCII LOWER CASE.";
-
+
sal_Char* pStr = (sal_Char*) malloc(aStr1.getLength() + 1);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
strcpy(pStr, aStr1.getStr());
rtl_str_toAsciiLowerCase_WithLength( pStr, 10 );
-
+
t_print("Lowercase with length: '%s'\n", pStr);
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiLowerCase_WithLength);
CPPUNIT_TEST(toAsciiLowerCase_WithLength_000);
CPPUNIT_TEST(toAsciiLowerCase_WithLength_001);
@@ -660,7 +660,7 @@ namespace rtl_str
class toAsciiUpperCase : public CppUnit::TestFixture
{
public:
-
+
void toAsciiUpperCase_000()
{
rtl_str_toAsciiUpperCase( NULL );
@@ -670,21 +670,21 @@ namespace rtl_str
{
rtl::OString aStr1 = "change this to ascii upper case.";
rtl::OString aShouldStr1 = "CHANGE THIS TO ASCII UPPER CASE.";
-
+
sal_Char* pStr = (sal_Char*) malloc(aStr1.getLength() + 1);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
strcpy(pStr, aStr1.getStr());
rtl_str_toAsciiUpperCase( pStr );
-
+
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiUpperCase);
CPPUNIT_TEST(toAsciiUpperCase_000);
CPPUNIT_TEST(toAsciiUpperCase_001);
@@ -695,7 +695,7 @@ namespace rtl_str
class toAsciiUpperCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void toAsciiUpperCase_WithLength_000()
{
rtl_str_toAsciiUpperCase_WithLength( NULL, 0 );
@@ -711,16 +711,16 @@ namespace rtl_str
strcpy(pStr, aStr1.getStr());
rtl_str_toAsciiUpperCase_WithLength( pStr, 10 );
-
+
t_print("Uppercase with length: '%s'\n", aStr1.getStr());
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(rtl::OString(pStr)) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiUpperCase_WithLength);
CPPUNIT_TEST(toAsciiUpperCase_WithLength_000);
CPPUNIT_TEST(toAsciiUpperCase_WithLength_001);
@@ -738,13 +738,13 @@ namespace rtl_str
rtl_str_trim_WithLength(NULL, 0);
// should not GPF
}
-
+
void trim_WithLength_000_1()
{
char pStr[] = { " trim this" };
rtl_str_trim_WithLength( pStr, 0 );
}
-
+
void trim_WithLength_001()
{
char const *pStr = " trim this";
@@ -753,26 +753,26 @@ namespace rtl_str
{
strcpy(pStr2, pStr);
rtl_str_trim_WithLength( pStr2, 2 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should be empty", strlen(pStr2) == 0);
free(pStr2);
}
}
-
+
void trim_WithLength_002()
{
- char const *pStr = "trim this";
+ char const *pStr = "trim this";
sal_Char *pStr2 = (sal_Char*)malloc(strlen(pStr) + 1);
if (pStr2)
{
strcpy(pStr2, pStr);
rtl_str_trim_WithLength( pStr2, 5 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", strlen(pStr2) == 4);
free(pStr2);
}
}
-
+
void trim_WithLength_003()
{
char const *pStr = " trim this";
@@ -781,10 +781,10 @@ namespace rtl_str
{
strcpy(pStr2, pStr);
rtl_str_trim_WithLength( pStr2, 11 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", strlen(pStr2) == 4);
free(pStr2);
- }
+ }
}
void trim_WithLength_004()
@@ -795,7 +795,7 @@ namespace rtl_str
{
strcpy(pStr2, pStr);
rtl_str_trim_WithLength( pStr2, 17 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", strlen(pStr2) == 4);
free(pStr2);
}
@@ -809,16 +809,16 @@ namespace rtl_str
{
strcpy(pStr2, pStr);
rtl_str_trim_WithLength( pStr2, strlen(pStr2) );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", strlen(pStr2) == 11);
free(pStr2);
}
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(trim_WithLength);
CPPUNIT_TEST(trim_WithLength_000);
CPPUNIT_TEST(trim_WithLength_000_1);
@@ -829,7 +829,7 @@ namespace rtl_str
CPPUNIT_TEST(trim_WithLength_005);
CPPUNIT_TEST_SUITE_END();
};
-
+
// -----------------------------------------------------------------------------
class valueOfChar : public CppUnit::TestFixture
@@ -846,22 +846,22 @@ namespace rtl_str
if (pStr)
{
rtl_str_valueOfChar(pStr, 'A');
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'A'", pStr[0] == 'A');
free(pStr);
}
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(valueOfChar);
CPPUNIT_TEST(valueOfChar_000);
CPPUNIT_TEST(valueOfChar_001);
CPPUNIT_TEST_SUITE_END();
};
-
+
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_str::compare, "rtl_str");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_str::compareIgnoreAsciiCase, "rtl_str");
diff --git a/sal/qa/rtl/ostring/rtl_string.cxx b/sal/qa/rtl/ostring/rtl_string.cxx
index 9b692a818..a1fc88037 100644
--- a/sal/qa/rtl/ostring/rtl_string.cxx
+++ b/sal/qa/rtl/ostring/rtl_string.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
namespace rtl_string
{
@@ -39,13 +39,13 @@ namespace rtl_string
class getLength : public CppUnit::TestFixture
{
public:
-
+
void getLength_000()
{
rtl_string_getLength( NULL );
// should not GPF
}
-
+
void getLength_001()
{
rtl::OString aStr("Test Length.");
@@ -58,28 +58,28 @@ namespace rtl_string
&& (strlen(aStr.getStr())
== sal::static_int_cast< sal_uInt32 >(nValue)));
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(getLength);
CPPUNIT_TEST(getLength_000);
CPPUNIT_TEST(getLength_001);
CPPUNIT_TEST_SUITE_END();
}; // class getLength
-
+
// -----------------------------------------------------------------------------
class newFromString : public CppUnit::TestFixture
{
public:
-
+
// void newFromString_000()
// {
// sal_Int32 nValue = rtl_string_newFromString( NULL, NULL );
// // should not GPF
// }
-
+
void newFromString_001()
{
rtl::OString aStr("Test Length.");
@@ -89,13 +89,13 @@ namespace rtl_string
rtl::OString aNewStr(pStr);
CPPUNIT_ASSERT_MESSAGE("Strings must be equal", aStr.equals(aNewStr) == sal_True);
-
+
rtl_string_release(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(newFromString);
// CPPUNIT_TEST(newFromString_000);
CPPUNIT_TEST(newFromString_001);
@@ -107,13 +107,13 @@ namespace rtl_string
class convertUStringToString : public CppUnit::TestFixture
{
public:
-
+
// void newFromString_000()
// {
// sal_Int32 nValue = rtl_string_newFromString( NULL, NULL );
// // should not GPF
// }
-
+
void convertUStringToString_001()
{
rtl::OUString suString = rtl::OUString::createFromAscii("Hello");
@@ -127,7 +127,7 @@ namespace rtl_string
{
rtl::OString sStr("H\xE4llo");
rtl::OUString suString = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_ISO_8859_15);
-
+
rtl::OString sString;
sal_Bool bRet = rtl_convertUStringToString(&sString.pData, suString.getStr(), suString.getLength(), RTL_TEXTENCODING_ISO_8859_15, OUSTRING_TO_OSTRING_CVTFLAGS);
@@ -138,7 +138,7 @@ namespace rtl_string
{
rtl::OString sStr("H\xC3\xA4llo");
rtl::OUString suString = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_UTF8);
-
+
rtl::OString sString;
sal_Bool bRet = rtl_convertUStringToString(&sString.pData, suString.getStr(), suString.getLength(), RTL_TEXTENCODING_ISO_8859_15, OUSTRING_TO_OSTRING_CVTFLAGS);
@@ -158,10 +158,10 @@ namespace rtl_string
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(convertUStringToString);
CPPUNIT_TEST(convertUStringToString_001);
CPPUNIT_TEST(convertUStringToString_002);
diff --git a/sal/qa/rtl/oustring/makefile.mk b/sal/qa/rtl/oustring/makefile.mk
index dedaa6501..40e4ba4a0 100644
--- a/sal/qa/rtl/oustring/makefile.mk
+++ b/sal/qa/rtl/oustring/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_OUString2.obj
SHL1TARGET= rtl_OUString2
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -68,9 +66,7 @@ SHL2OBJS= \
$(SLO)$/rtl_ustr.obj
SHL2TARGET= rtl_ustr
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME =$(SHL2TARGET)
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 8f755bcdc..8632a159a 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,14 +38,14 @@
#include <algorithm> // STL
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "stringhelper.hxx"
#include "valueequal.hxx"
inline void printOUString( ::rtl::OUString const & _suStr )
{
rtl::OString aString;
-
+
t_print( "OUString: " );
aString = ::rtl::OUStringToOString( _suStr, RTL_TEXTENCODING_ASCII_US );
t_print( "'%s'\n", aString.getStr( ) );
@@ -53,10 +53,10 @@ inline void printOUString( ::rtl::OUString const & _suStr )
namespace rtl_OUString
{
-
+
class ctors_rtl_uString : public CppUnit::TestFixture
{
-
+
public:
/// test of OUString(rtl_uString*)
void ctors_001()
@@ -65,7 +65,7 @@ namespace rtl_OUString
rtl::OUString aStrToTest(pStr->pData);
delete pStr;
-
+
// maybe here should we do something with current memory
char* pBuffer = (char*) malloc(2 * 8);
memset(pBuffer, 0, 2 * 8);
@@ -74,11 +74,11 @@ namespace rtl_OUString
sal_Bool bResult = aStrToTest.equals(rtl::OUString::createFromAscii("a String"));
CPPUNIT_ASSERT_MESSAGE("String must not be empty", bResult == sal_True);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ctors_rtl_uString);
CPPUNIT_TEST(ctors_001);
CPPUNIT_TEST_SUITE_END();
@@ -100,7 +100,7 @@ class valueOf : public CppUnit::TestFixture
bool bEqualResult = is_float_equal(_nValue, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void valueOf_float_test(float _nValue)
{
valueOf_float_test_impl(_nValue);
@@ -157,7 +157,7 @@ public:
}
private:
-
+
void valueOf_double_test_impl(double _nValue)
{
rtl::OUString suValue;
@@ -167,21 +167,21 @@ private:
t_print(T_VERBOSE, "nDouble := %.20f sValue := %s\n", _nValue, sValue.getStr());
double nValueATOF = atof( sValue.getStr() );
-
+
bool bEqualResult = is_double_equal(_nValue, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void valueOf_double_test(double _nValue)
{
valueOf_double_test_impl(_nValue);
-
+
// test also the negative part.
double nNegativeValue = -_nValue;
valueOf_double_test_impl(nNegativeValue);
}
public:
-
+
// valueOf double
void valueOf_double_test_001()
{
@@ -225,8 +225,8 @@ public:
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(valueOf);
@@ -258,8 +258,8 @@ sal_Int16 SAL_CALL checkPrecisionSize()
// sal_Int16 nSize = sizeof(T);
volatile T nCalcValue = 1.0;
-
- // (i + 1) is the current precision
+
+ // (i + 1) is the current precision
// numerical series
// 1.1
// 10.1
@@ -291,7 +291,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
// 1.001
// ...
// 1.000...001
-
+
for (j=0;j<50;j++)
{
nCalcValue /= 10;
@@ -299,7 +299,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
volatile T dSub = nValue - static_cast<T>(1.0);
// ---- 0.02 ----- 0.01 ---- 0 --- -0.99 ---- -0.98 ----
// volatile T dSubAbsolut = fabs(dSub);
- // ---- 0.02 ----- 0.01 ---- 0 (cut)
+ // ---- 0.02 ----- 0.01 ---- 0 (cut)
if ( dSub == 0)
break;
}
@@ -318,7 +318,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
t_print("warning: presision differs more than 1!\n");
}
}
-
+
return i;
}
@@ -332,15 +332,15 @@ sal_Int16 SAL_CALL checkPrecisionSize()
sal_Int16 nPrecision;
nPrecision = checkPrecisionSize<float>();
t_print("precision of float: %d sizeof()=%d \n", nPrecision, sizeof(float));
-
+
nPrecision = checkPrecisionSize<double>();
t_print("precision of double: %d sizeof()=%d \n", nPrecision, sizeof(double));
-
+
nPrecision = checkPrecisionSize<long double>();
t_print("precision of long double: %d sizeof()=%d \n", nPrecision, sizeof(long double));
-
+
}
-
+
};
class toInt: public CppUnit::TestFixture {
@@ -370,13 +370,13 @@ sal_Int16 SAL_CALL checkPrecisionSize()
CPPUNIT_TEST(test);
CPPUNIT_TEST_SUITE_END();
};
-
+
// -----------------------------------------------------------------------------
// - toDouble (tests)
// -----------------------------------------------------------------------------
class toDouble : public CppUnit::TestFixture
{
- public:
+ public:
void toDouble_test_impl(rtl::OString const& _sValue)
{
//t_print("the original str is %s\n", _sValue.getStr());
@@ -389,7 +389,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
bool bEqualResult = is_double_equal(nValueToDouble, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void toDouble_test(rtl::OString const& _sValue)
{
toDouble_test_impl(_sValue);
@@ -399,7 +399,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
sNegativValue += _sValue;
toDouble_test_impl(sNegativValue);
}
-
+
// insert your test code here.
void toDouble_selftest()
{
@@ -413,7 +413,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000001) == false);
CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000001) == false);
CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000000001) == false);
+ CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000000001) == false);
CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000000001) == false);
CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000001) == false);
// we check til 15 values after comma
@@ -422,7 +422,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000000001) == true);
t_print("Selftest done.\n");
}
-
+
void toDouble_test_3()
{
rtl::OString sValue("3");
@@ -444,7 +444,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
rtl::OString sValue("3.141592653589793238462643383279502884197169399375");
toDouble_test(sValue);
}
-
+
void toDouble_test_1()
{
rtl::OString sValue("1");
@@ -485,14 +485,14 @@ sal_Int16 SAL_CALL checkPrecisionSize()
rtl::OString sValue("1e308");
toDouble_test(sValue);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toDouble);
CPPUNIT_TEST(toDouble_selftest);
-
+
CPPUNIT_TEST(toDouble_test_3);
CPPUNIT_TEST(toDouble_test_3_5);
CPPUNIT_TEST(toDouble_test_3_0625);
@@ -513,7 +513,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
// -----------------------------------------------------------------------------
class toFloat : public CppUnit::TestFixture
{
- public:
+ public:
void toFloat_test_impl(rtl::OString const& _sValue)
{
//t_print("the original str is %s\n", _sValue.getStr());
@@ -526,7 +526,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
bool bEqualResult = is_float_equal(nValueToFloat, nValueATOF);
CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
}
-
+
void toFloat_test(rtl::OString const& _sValue)
{
toFloat_test_impl(_sValue);
@@ -536,7 +536,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
sNegativValue += _sValue;
toFloat_test_impl(sNegativValue);
}
-
+
// insert your test code here.
void toFloat_selftest()
{
@@ -549,10 +549,10 @@ sal_Int16 SAL_CALL checkPrecisionSize()
CPPUNIT_ASSERT (is_float_equal(1.0f, 1.0000001f) == true);
CPPUNIT_ASSERT (is_float_equal(1.0f, 1.00000001f) == true);
CPPUNIT_ASSERT (is_float_equal(1.0f, 1.000000001f) == true);
-
+
t_print("Selftest done.\n");
}
-
+
void toFloat_test_3()
{
rtl::OString sValue("3");
@@ -579,7 +579,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
rtl::OString sValue("3.141592653589793238462643383279502884197169399375");
toFloat_test(sValue);
}
-
+
void toFloat_test_1()
{
rtl::OString sValue("1");
@@ -625,14 +625,14 @@ sal_Int16 SAL_CALL checkPrecisionSize()
rtl::OString sValue("1e308");
toFloat_test(sValue);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toFloat);
CPPUNIT_TEST(toFloat_selftest);
-
+
CPPUNIT_TEST(toFloat_test_3);
CPPUNIT_TEST(toFloat_test_3_5);
CPPUNIT_TEST(toFloat_test_3_0625);
@@ -666,7 +666,7 @@ public:
sal_Int32 nPos = _suStr.lastIndexOf(_suSearchStr);
CPPUNIT_ASSERT_MESSAGE("expected position is wrong", nPos == _nExpectedResultPos);
}
-
+
void lastIndexOf_salunicode(rtl::OUString const& _suStr, sal_Unicode _cuSearchChar, sal_Int32 _nExpectedResultPos)
{
// Algorithm
@@ -676,7 +676,7 @@ public:
sal_Int32 nPos = _suStr.lastIndexOf(_cuSearchChar);
CPPUNIT_ASSERT_MESSAGE("expected position is wrong", nPos == _nExpectedResultPos);
}
-
+
void lastIndexOf_oustring_offset(rtl::OUString const& _suStr, rtl::OUString const& _suSearchStr, sal_Int32 _nExpectedResultPos, sal_Int32 _nStartOffset)
{
sal_Int32 nPos = _suStr.lastIndexOf(_suSearchStr, _nStartOffset);
@@ -698,7 +698,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring_offset(aStr, aSearchStr, 0, aStr.getLength());
}
-
+
void lastIndexOf_test_oustring_offset_002()
{
// search for sun, start at pos = 3, found (pos==0)
@@ -706,7 +706,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring_offset(aStr, aSearchStr, 0, 3);
}
-
+
void lastIndexOf_test_oustring_offset_003()
{
// search for sun, start at pos = 2, found (pos==-1)
@@ -714,7 +714,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring_offset(aStr, aSearchStr, -1, 2);
}
-
+
void lastIndexOf_test_oustring_offset_004()
{
// search for sun, start at the end, found (pos==0)
@@ -722,7 +722,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring_offset(aStr, aSearchStr, -1, -1);
}
-
+
void lastIndexOf_test_oustring_001()
{
// search for sun, found (pos==0)
@@ -730,7 +730,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, 0);
}
-
+
void lastIndexOf_test_oustring_002()
{
// search for sun, found (pos==4)
@@ -738,7 +738,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, 4);
}
-
+
void lastIndexOf_test_oustring_003()
{
// search for sun, found (pos==8)
@@ -746,7 +746,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, 8);
}
-
+
void lastIndexOf_test_oustring_004()
{
// search for sun, found (pos==8)
@@ -754,7 +754,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, 8);
}
-
+
void lastIndexOf_test_oustring_005()
{
// search for sun, found (pos==4)
@@ -762,7 +762,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, 4);
}
-
+
void lastIndexOf_test_oustring_006()
{
// search for sun, found (pos==-1)
@@ -770,7 +770,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("sun");
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
-
+
void lastIndexOf_test_oustring_007()
{
// search for earth, not found (-1)
@@ -778,7 +778,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("earth");
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
-
+
void lastIndexOf_test_oustring_008()
{
// search for earth, not found (-1)
@@ -786,7 +786,7 @@ public:
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("earth");
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
-
+
void lastIndexOf_test_oustring_009()
{
// search for earth, not found (-1)
@@ -795,7 +795,7 @@ public:
lastIndexOf_oustring(aStr, aSearchStr, -1);
}
-
+
void lastIndexOf_test_salunicode_001()
{
// search for 's', found (19)
@@ -833,11 +833,11 @@ public:
sal_Unicode cuChar = L't';
lastIndexOf_salunicode_offset(aStr, cuChar, 0, 1);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(lastIndexOf);
CPPUNIT_TEST(lastIndexOf_test_oustring_001);
CPPUNIT_TEST(lastIndexOf_test_oustring_002);
@@ -875,7 +875,7 @@ public:
void getToken_000()
{
rtl::OUString suTokenStr;
-
+
sal_Int32 nIndex = 0;
do
{
@@ -889,7 +889,7 @@ public:
void getToken_001()
{
rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;b");
-
+
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
@@ -903,7 +903,7 @@ public:
void getToken_002()
{
rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;b.c");
-
+
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
@@ -920,7 +920,7 @@ public:
void getToken_003()
{
rtl::OUString suTokenStr = rtl::OUString::createFromAscii("a;;b");
-
+
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, ';', nIndex );
@@ -937,7 +937,7 @@ public:
void getToken_004()
{
rtl::OUString suTokenStr = rtl::OUString::createFromAscii("longer.then.ever.");
-
+
sal_Int32 nIndex = 0;
rtl::OUString suToken = suTokenStr.getToken( 0, '.', nIndex );
@@ -1039,12 +1039,12 @@ public:
pStrs = new rtl::OUString[nSequence];
pValues = new sal_uIntPtr[nSequence];
- for (i = 0; i < nSequence; i++)
+ for (i = 0; i < nSequence; i++)
{
pStrs[i] = rtl::OUString::valueOf( sqrt( static_cast<double>(i) ) ).intern();
pValues[i] = reinterpret_cast<sal_uIntPtr>( pStrs[i].pData );
}
- for (i = 0; i < nSequence; i++)
+ for (i = 0; i < nSequence; i++)
{
rtl::OUString aNew = rtl::OUString::valueOf( sqrt( static_cast<double>(i) ) ).intern();
CPPUNIT_ASSERT_MESSAGE("double intern failed",
@@ -1052,14 +1052,14 @@ public:
}
// Free strings to check for leaks
- for (i = 0; i < nSequence; i++)
+ for (i = 0; i < nSequence; i++)
{
// Overwrite - hopefully this re-uses the memory
pStrs[i] = rtl::OUString();
pStrs[i] = rtl::OUString::valueOf( sqrt( static_cast<double>(i) ) );
}
- for (i = 0; i < nSequence; i++)
+ for (i = 0; i < nSequence; i++)
{
rtl::OUString aIntern;
sal_uIntPtr nValue;
diff --git a/sal/qa/rtl/oustring/rtl_ustr.cxx b/sal/qa/rtl/oustring/rtl_ustr.cxx
index ffaa87f1f..43610d046 100644
--- a/sal/qa/rtl/oustring/rtl_ustr.cxx
+++ b/sal/qa/rtl/oustring/rtl_ustr.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,14 +31,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
/** print a UNI_CODE file name.
*/
inline void printOUString( ::rtl::OUString const & _suStr )
{
rtl::OString aString;
-
+
t_print( "OUString: " );
aString = ::rtl::OUStringToOString( _suStr, RTL_TEXTENCODING_ASCII_US );
t_print( "%s\n", aString.getStr( ) );
@@ -51,8 +51,8 @@ namespace rtl_ustr
class compare : public CppUnit::TestFixture
{
public:
-
-
+
+
void compare_000()
{
rtl_ustr_compare( NULL, NULL);
@@ -82,7 +82,7 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal.", nValue == 0);
}
-
+
void compare_003()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -91,9 +91,9 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_compare( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(compare);
@@ -109,7 +109,7 @@ namespace rtl_ustr
class compareIgnoreAsciiCase : public CppUnit::TestFixture
{
public:
-
+
void compare_000()
{
rtl_ustr_compareIgnoreAsciiCase( NULL, NULL);
@@ -146,7 +146,7 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void compare_003()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -155,9 +155,9 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_compareIgnoreAsciiCase( aStr1.getStr(), aStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(compareIgnoreAsciiCase);
@@ -171,11 +171,11 @@ namespace rtl_ustr
}; // class compareIgnoreAsciiCase
// -----------------------------------------------------------------------------
-
+
class shortenedCompareIgnoreAsciiCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void compare_000()
{
rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( NULL, 0, NULL, 0, 0);
@@ -216,7 +216,7 @@ namespace rtl_ustr
aStr1.getLength());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void compare_003()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -227,7 +227,7 @@ namespace rtl_ustr
5);
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal first 5 characters.", nValue == 0);
}
-
+
void compare_004()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -238,9 +238,9 @@ namespace rtl_ustr
aStr1.getLength());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(shortenedCompareIgnoreAsciiCase_WithLength);
@@ -256,17 +256,17 @@ namespace rtl_ustr
// // -----------------------------------------------------------------------------
-//
+//
// class hashCode : public CppUnit::TestFixture
// {
// public:
-//
+//
// void hashCode_000()
// {
// sal_Int32 nHashCode = rtl_ustr_hashCode( NULL );
// volatile int dummy = 0;
// }
-//
+//
// void hashCode_001()
// {
// rtl::OString aStr1 = "Line for a hashCode.";
@@ -274,33 +274,33 @@ namespace rtl_ustr
// t_print("hashcode: %d\n", nHashCode);
// // CPPUNIT_ASSERT_MESSAGE("failed.", nValue == 0);
// }
-//
+//
// void hashCode_002()
// {
// rtl::OString aStr1 = "Line for a hashCode.";
// sal_Int32 nHashCode1 = rtl_ustr_hashCode( aStr1.getStr() );
-//
+//
// rtl::OString aStr2 = "Line for a hashCode.";
// sal_Int32 nHashCode2 = rtl_ustr_hashCode( aStr2.getStr() );
-//
+//
// CPPUNIT_ASSERT_MESSAGE("hashcodes must be equal.", nHashCode1 == nHashCode2 );
// }
-//
+//
// void hashCode_003()
// {
// rtl::OString aStr1 = "Line for a hashCode.";
// sal_Int32 nHashCode1 = rtl_ustr_hashCode( aStr1.getStr() );
-//
+//
// rtl::OString aStr2 = "Line for an other hashcode.";
// sal_Int32 nHashCode2 = rtl_ustr_hashCode( aStr2.getStr() );
-//
+//
// CPPUNIT_ASSERT_MESSAGE("hashcodes must differ.", nHashCode1 != nHashCode2 );
// }
-//
-// // Change the following lines only, if you add, remove or rename
-// // member functions of the current class,
+//
+// // Change the following lines only, if you add, remove or rename
+// // member functions of the current class,
// // because these macros are need by auto register mechanism.
-//
+//
// CPPUNIT_TEST_SUITE(hashCode);
// CPPUNIT_TEST(hashCode_000);
// CPPUNIT_TEST(hashCode_001);
@@ -308,14 +308,14 @@ namespace rtl_ustr
// CPPUNIT_TEST(hashCode_003);
// CPPUNIT_TEST_SUITE_END();
// }; // class compare
-//
-//
+//
+//
// // -----------------------------------------------------------------------------
-//
+//
class indexOfChar : public CppUnit::TestFixture
{
public:
-
+
void indexOfChar_000()
{
rtl_ustr_indexOfChar( NULL, 0 );
@@ -327,17 +327,17 @@ namespace rtl_ustr
sal_Int32 nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'L' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* sal_Int32 */ nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'i' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 1);
-
+
/* sal_Int32 */ nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'n' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 2);
/* sal_Int32 */ nIndex = rtl_ustr_indexOfChar( aStr1.getStr(), 'e' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 3);
}
-
+
void indexOfChar_002()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfChar.");
@@ -346,10 +346,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(indexOfChar);
CPPUNIT_TEST(indexOfChar_000);
CPPUNIT_TEST(indexOfChar_001);
@@ -361,7 +361,7 @@ namespace rtl_ustr
class lastIndexOfChar : public CppUnit::TestFixture
{
public:
-
+
void lastIndexOfChar_000()
{
rtl_ustr_lastIndexOfChar( NULL, 0 );
@@ -373,17 +373,17 @@ namespace rtl_ustr
sal_Int32 nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'C' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 22);
-
+
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'h' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 23);
-
+
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'a' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 24);
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfChar( aStr1.getStr(), 'r' );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 25);
}
-
+
void lastIndexOfChar_002()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfChar.");
@@ -392,10 +392,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(lastIndexOfChar);
CPPUNIT_TEST(lastIndexOfChar_000);
CPPUNIT_TEST(lastIndexOfChar_001);
@@ -409,7 +409,7 @@ namespace rtl_ustr
class indexOfStr : public CppUnit::TestFixture
{
public:
-
+
void indexOfStr_000()
{
rtl_ustr_indexOfStr( NULL, 0 );
@@ -428,11 +428,11 @@ namespace rtl_ustr
rtl::OUString suSearch = rtl::OUString::createFromAscii("Line");
sal_Int32 nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* rtl::OUString */ suSearch = rtl::OUString::createFromAscii("for");
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 5);
-
+
/* rtl::OUString */ suSearch = rtl::OUString::createFromAscii("a");
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 9);
@@ -441,7 +441,7 @@ namespace rtl_ustr
/* sal_Int32 */ nIndex = rtl_ustr_indexOfStr( aStr1.getStr(), suSearch );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex ==9);
}
-
+
void indexOfStr_002()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a indexOfStr.");
@@ -451,10 +451,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(indexOfStr);
CPPUNIT_TEST(indexOfStr_000);
CPPUNIT_TEST(indexOfStr_001);
@@ -467,7 +467,7 @@ namespace rtl_ustr
class lastIndexOfStr : public CppUnit::TestFixture
{
public:
-
+
void lastIndexOfStr_000()
{
rtl_ustr_lastIndexOfStr( NULL, NULL );
@@ -483,19 +483,19 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
rtl::OUString aSearchStr = rtl::OUString::createFromAscii("Index");
-
+
sal_Int32 nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 15);
-
+
/* rtl::OString */ aSearchStr = rtl::OUString::createFromAscii("Line");
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 0);
-
+
/* rtl::OString */ aSearchStr = rtl::OUString::createFromAscii("");
/* sal_Int32 */ nIndex = rtl_ustr_lastIndexOfStr( aStr1.getStr(), aSearchStr.getStr() );
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == -1);
}
-
+
void lastIndexOfStr_002()
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("Line for a lastIndexOfStr.");
@@ -514,10 +514,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("index is wrong.", nIndex == 20 );
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(lastIndexOfStr);
CPPUNIT_TEST(lastIndexOfStr_000);
CPPUNIT_TEST(lastIndexOfStr_001);
@@ -531,7 +531,7 @@ namespace rtl_ustr
class replaceChar : public CppUnit::TestFixture
{
public:
-
+
void replaceChar_000()
{
rtl_ustr_replaceChar( NULL, 0, 0 );
@@ -541,7 +541,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("replace char.");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("ruplacu char.");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc( nLength + sizeof(sal_Unicode)); // length + 1 (null terminator)
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -555,10 +555,10 @@ namespace rtl_ustr
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(replaceChar);
CPPUNIT_TEST(replaceChar_000);
CPPUNIT_TEST(replaceChar_001);
@@ -570,7 +570,7 @@ namespace rtl_ustr
class replaceChar_WithLength : public CppUnit::TestFixture
{
public:
-
+
void replaceChar_WithLength_000()
{
rtl_ustr_replaceChar_WithLength( NULL, 0, 0, 0 );
@@ -584,7 +584,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("replace char.");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("ruplace char.");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -592,7 +592,7 @@ namespace rtl_ustr
rtl_ustr_replaceChar_WithLength( pStr, 6, 'e', 'u' );
rtl::OUString suStr(pStr, aStr1.getLength());
-
+
CPPUNIT_ASSERT_MESSAGE("replace failed", aShouldStr1.equals(suStr) == sal_True);
free(pStr);
}
@@ -601,7 +601,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("eeeeeeeeeeeee");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("uuuuuueeeeeee");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength); // no null terminator is need
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -609,15 +609,15 @@ namespace rtl_ustr
rtl_ustr_replaceChar_WithLength( pStr, 6, 'e', 'u' );
rtl::OUString suStr(pStr, aStr1.getLength());
-
+
CPPUNIT_ASSERT_MESSAGE("replace failed", aShouldStr1.equals(suStr) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(replaceChar_WithLength);
CPPUNIT_TEST(replaceChar_WithLength_000);
CPPUNIT_TEST(replaceChar_WithLength_000_1);
@@ -632,7 +632,7 @@ namespace rtl_ustr
class toAsciiLowerCase : public CppUnit::TestFixture
{
public:
-
+
void toAsciiLowerCase_000()
{
rtl_ustr_toAsciiLowerCase( NULL );
@@ -642,7 +642,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII LOWER CASE.");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("change this to ascii lower case.");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode) ); // we need to add '\0' so one more
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -651,15 +651,15 @@ namespace rtl_ustr
rtl_ustr_toAsciiLowerCase( pStr );
rtl::OUString suStr(pStr, aStr1.getLength());
-
+
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(suStr) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiLowerCase);
CPPUNIT_TEST(toAsciiLowerCase_000);
CPPUNIT_TEST(toAsciiLowerCase_001);
@@ -670,7 +670,7 @@ namespace rtl_ustr
class toAsciiLowerCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void toAsciiLowerCase_WithLength_000()
{
rtl_ustr_toAsciiLowerCase_WithLength( NULL, 0 );
@@ -680,7 +680,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII LOWER CASE.");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("change thiS TO ASCII LOWER CASE.");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength);
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -699,10 +699,10 @@ namespace rtl_ustr
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiLowerCase_WithLength);
CPPUNIT_TEST(toAsciiLowerCase_WithLength_000);
CPPUNIT_TEST(toAsciiLowerCase_WithLength_001);
@@ -714,7 +714,7 @@ namespace rtl_ustr
class toAsciiUpperCase : public CppUnit::TestFixture
{
public:
-
+
void toAsciiUpperCase_000()
{
rtl_ustr_toAsciiUpperCase( NULL );
@@ -724,7 +724,7 @@ namespace rtl_ustr
{
rtl::OUString aStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
-
+
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
@@ -733,15 +733,15 @@ namespace rtl_ustr
rtl_ustr_toAsciiUpperCase( pStr );
rtl::OUString suStr(pStr, aStr1.getLength());
-
+
CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(suStr) == sal_True);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiUpperCase);
CPPUNIT_TEST(toAsciiUpperCase_000);
CPPUNIT_TEST(toAsciiUpperCase_001);
@@ -752,7 +752,7 @@ namespace rtl_ustr
class toAsciiUpperCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void toAsciiUpperCase_WithLength_000()
{
rtl_ustr_toAsciiUpperCase_WithLength( NULL, 0 );
@@ -776,10 +776,10 @@ namespace rtl_ustr
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(toAsciiUpperCase_WithLength);
CPPUNIT_TEST(toAsciiUpperCase_WithLength_000);
CPPUNIT_TEST(toAsciiUpperCase_WithLength_001);
@@ -797,7 +797,7 @@ namespace rtl_ustr
rtl_ustr_trim_WithLength(NULL, 0);
// should not GPF
}
-
+
void trim_WithLength_000_1()
{
rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
@@ -809,7 +809,7 @@ namespace rtl_ustr
rtl_ustr_trim_WithLength( pStr, 0 );
free(pStr);
}
-
+
void trim_WithLength_001()
{
rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
@@ -818,12 +818,12 @@ namespace rtl_ustr
memcpy(pStr, suStr.getStr(), nLength);
rtl_ustr_trim_WithLength( pStr, 2 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should be empty", rtl::OUString(pStr).getLength() == 0);
free(pStr);
}
-
-
+
+
void trim_WithLength_002()
{
rtl::OUString suStr = rtl::OUString::createFromAscii("trim this");
@@ -833,12 +833,12 @@ namespace rtl_ustr
memcpy(pStr, suStr.getStr(), nLength);
rtl_ustr_trim_WithLength( pStr, 5 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", rtl::OUString(pStr).getLength() == 4);
free(pStr);
}
-
-
+
+
void trim_WithLength_003()
{
rtl::OUString suStr = rtl::OUString::createFromAscii(" trim this");
@@ -848,7 +848,7 @@ namespace rtl_ustr
memcpy(pStr, suStr.getStr(), nLength);
rtl_ustr_trim_WithLength( pStr, 11 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", rtl::OUString(pStr).getLength() == 4);
free(pStr);
}
@@ -862,7 +862,7 @@ namespace rtl_ustr
memcpy(pStr, suStr.getStr(), nLength);
rtl_ustr_trim_WithLength( pStr, 17 );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim'", rtl::OUString(pStr).getLength() == 4);
free(pStr);
}
@@ -876,15 +876,15 @@ namespace rtl_ustr
memcpy(pStr, suStr.getStr(), nLength);
rtl_ustr_trim_WithLength( pStr, suStr.getLength() );
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'trim \\t this'", rtl::OUString(pStr).getLength() == 11);
free(pStr);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(trim_WithLength);
CPPUNIT_TEST(trim_WithLength_000);
CPPUNIT_TEST(trim_WithLength_000_1);
@@ -895,7 +895,7 @@ namespace rtl_ustr
CPPUNIT_TEST(trim_WithLength_005);
CPPUNIT_TEST_SUITE_END();
};
-
+
// -----------------------------------------------------------------------------
class valueOfChar : public CppUnit::TestFixture
@@ -912,16 +912,16 @@ namespace rtl_ustr
if (pStr)
{
rtl_ustr_valueOfChar(pStr, 'A');
-
+
CPPUNIT_ASSERT_MESSAGE("string should contain 'A'", pStr[0] == L'A');
free(pStr);
}
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(valueOfChar);
CPPUNIT_TEST(valueOfChar_000);
CPPUNIT_TEST(valueOfChar_001);
@@ -934,7 +934,7 @@ namespace rtl_ustr
class ascii_compare_WithLength : public CppUnit::TestFixture
{
public:
- void zero_length()
+ void zero_length()
{
sal_Unicode pUnicode[] = {0xffff, 0xffff};
char const * pAscii = "reference";
@@ -943,7 +943,7 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("ref string is empty, compare failed, needs to be <0.", value < 0);
}
- void equal_ascii_shorter()
+ void equal_ascii_shorter()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("referenceString"));
char const * pAscii = "reference";
@@ -952,7 +952,7 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("ref string is bigger, compare failed, needs to be >0.", value > 0);
}
- void equal_ascii_shorter_asciiLength()
+ void equal_ascii_shorter_asciiLength()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("referenceString"));
char const * pAscii = "reference";
@@ -961,40 +961,40 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("ref string is bigger despite ascii length, compare failed, needs to be == 0.", value == 0);
}
- void equal_ref_shorter()
+ void equal_ref_shorter()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("reference"));
char const * pAscii = "referenceString";
-
+
sal_Int32 value = rtl_ustr_ascii_compare_WithLength(refStr.pData->buffer, refStr.pData->length, pAscii);
CPPUNIT_ASSERT_MESSAGE("ascii string is bigger, but only compared to ref length, needs to be 0.", value < 0);
}
- void equal()
+ void equal()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("reference"));
char const * pAscii = "reference";
-
+
sal_Int32 value = rtl_ustr_ascii_compare_WithLength(refStr.pData->buffer, refStr.pData->length, pAscii);
CPPUNIT_ASSERT_MESSAGE("strings are equal, compare failed, needs to be 0.", value == 0);
}
- void unequal_reference_bigger()
+ void unequal_reference_bigger()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("defghi"));
char const * pAscii = "abc";
-
+
sal_Int32 value = rtl_ustr_ascii_compare_WithLength(refStr.pData->buffer, refStr.pData->length, pAscii);
CPPUNIT_ASSERT_MESSAGE("strings are unequal and ref is bigger, needs to be >0.", value > 0);
}
- void unequal_ascii_bigger()
+ void unequal_ascii_bigger()
{
rtl::OUString refStr(RTL_CONSTASCII_USTRINGPARAM("abc"));
char const * pAscii = "defghi";
-
+
sal_Int32 value = rtl_ustr_ascii_compare_WithLength(refStr.pData->buffer, refStr.pData->length, pAscii);
-
+
CPPUNIT_ASSERT_MESSAGE("strings are unequal and ascii is bigger, needs to be <0.", value < 0);
}
@@ -1011,11 +1011,11 @@ namespace rtl_ustr
-
+
class ascii_shortenedCompareIgnoreAsciiCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void ascii_shortenedCompareIgnoreAsciiCase_WithLength_000()
{
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( NULL, 0, NULL, 0);
@@ -1062,10 +1062,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ascii_shortenedCompareIgnoreAsciiCase_WithLength);
CPPUNIT_TEST(ascii_shortenedCompareIgnoreAsciiCase_WithLength_000);
CPPUNIT_TEST(ascii_shortenedCompareIgnoreAsciiCase_WithLength_000_1);
@@ -1081,7 +1081,7 @@ namespace rtl_ustr
class ascii_compareIgnoreAsciiCase_WithLength : public CppUnit::TestFixture
{
public:
-
+
void ascii_compareIgnoreAsciiCase_WithLength_000()
{
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( NULL, 0, NULL);
@@ -1128,10 +1128,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ascii_compareIgnoreAsciiCase_WithLength);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_WithLength_000);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_WithLength_000_1);
@@ -1147,7 +1147,7 @@ namespace rtl_ustr
class ascii_compare : public CppUnit::TestFixture
{
public:
-
+
void ascii_compare_000()
{
rtl_ustr_ascii_compare( NULL, NULL);
@@ -1187,10 +1187,10 @@ namespace rtl_ustr
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ascii_compare);
CPPUNIT_TEST(ascii_compare_000);
CPPUNIT_TEST(ascii_compare_000_1);
@@ -1205,7 +1205,7 @@ namespace rtl_ustr
class ascii_compareIgnoreAsciiCase : public CppUnit::TestFixture
{
public:
-
+
void ascii_compareIgnoreAsciiCase_000()
{
rtl_ustr_ascii_compareIgnoreAsciiCase( NULL, NULL);
@@ -1244,7 +1244,7 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void ascii_compareIgnoreAsciiCase_003()
{
rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -1253,31 +1253,31 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
+
//! LLA: some more tests with some high level strings
// void ascii_compareIgnoreAsciiCase_001()
// {
// rtl::OUString suStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
// rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
- //
+ //
// sal_uInt32 nLength = suStr1.getLength() * sizeof(sal_Unicode);
// sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
// CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
// memset(pStr, 0, nLength + sizeof(sal_Unicode));
// memcpy(pStr, suStr1.getStr(), nLength);
- //
+ //
// rtl_ustr_ascii_compareIgnoreAsciiCase( pStr );
// rtl::OUString suStr(pStr, suStr1.getLength());
- //
+ //
// CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(suStr) == sal_True);
// free(pStr);
// }
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ascii_compareIgnoreAsciiCase);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_000);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_000_1);
@@ -1303,7 +1303,7 @@ namespace rtl_ustr
class getToken : public CppUnit::TestFixture
{
public:
-
+
void getToken_000()
{
rtl_ustr_ascii_compareIgnoreAsciiCase( NULL, NULL);
@@ -1342,7 +1342,7 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings are equal (if case insensitve).", nValue == 0);
}
-
+
void ascii_compareIgnoreAsciiCase_003()
{
rtl::OUString suStr1 = rtl::OUString::createFromAscii("Line must differ.");
@@ -1351,31 +1351,31 @@ namespace rtl_ustr
sal_Int32 nValue = rtl_ustr_ascii_compareIgnoreAsciiCase( suStr1.getStr(), sStr2.getStr());
CPPUNIT_ASSERT_MESSAGE("compare failed, strings differ.", nValue != 0);
}
-
+
//! LLA: some more tests with some high level strings
// void ascii_compareIgnoreAsciiCase_001()
// {
// rtl::OUString suStr1 = rtl::OUString::createFromAscii("change this to ascii upper case.");
// rtl::OUString aShouldStr1 = rtl::OUString::createFromAscii("CHANGE THIS TO ASCII UPPER CASE.");
- //
+ //
// sal_uInt32 nLength = suStr1.getLength() * sizeof(sal_Unicode);
// sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
// CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
// memset(pStr, 0, nLength + sizeof(sal_Unicode));
// memcpy(pStr, suStr1.getStr(), nLength);
- //
+ //
// rtl_ustr_ascii_compareIgnoreAsciiCase( pStr );
// rtl::OUString suStr(pStr, suStr1.getLength());
- //
+ //
// CPPUNIT_ASSERT_MESSAGE("failed", aShouldStr1.equals(suStr) == sal_True);
// free(pStr);
// }
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(ascii_compareIgnoreAsciiCase);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_000);
CPPUNIT_TEST(ascii_compareIgnoreAsciiCase_000_1);
@@ -1394,7 +1394,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::ascii_compare_WithLength, "rtl_u
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::shortenedCompareIgnoreAsciiCase_WithLength, "rtl_ustr");
// CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::hashCode, "rtl_ustr");
-
+
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::indexOfChar, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::lastIndexOfChar, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::indexOfStr, "rtl_ustr");
@@ -1402,7 +1402,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::lastIndexOfStr, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::replaceChar, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::replaceChar_WithLength, "rtl_ustr");
-
+
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::toAsciiLowerCase, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::toAsciiLowerCase_WithLength, "rtl_ustr");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ustr::toAsciiUpperCase, "rtl_ustr");
diff --git a/sal/qa/rtl/oustringbuffer/makefile.mk b/sal/qa/rtl/oustringbuffer/makefile.mk
index 9737d998a..a910d7222 100644
--- a/sal/qa/rtl/oustringbuffer/makefile.mk
+++ b/sal/qa/rtl/oustringbuffer/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_OUStringBuffer2.obj
SHL1TARGET= rtl_OUStringBuffer2
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx b/sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx
index 5d73b2051..febaa2a9d 100644
--- a/sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx
+++ b/sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "stringhelper.hxx"
#include <rtl/ustrbuf.hxx>
#include <rtl/uri.hxx>
@@ -50,7 +50,7 @@ public:
void tearDown()
{
- }
+ }
void insertUtf32_001()
{
diff --git a/sal/qa/rtl/process/makefile.mk b/sal/qa/rtl/process/makefile.mk
index c1f5d9cad..ac8d66e24 100644
--- a/sal/qa/rtl/process/makefile.mk
+++ b/sal/qa/rtl/process/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_Process.obj
SHL1TARGET= rtl_Process
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -62,7 +60,7 @@ DEF1NAME =$(SHL1TARGET)
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
-OBJ3FILES=$(OBJ)$/child_process.obj
+OBJ3FILES=$(OBJ)$/child_process.obj
APP3TARGET=child_process
APP3OBJS=$(OBJ3FILES)
@@ -74,7 +72,7 @@ APP3OBJS=$(OBJ3FILES)
#.ENDIF
APP3STDLIBS=$(SALLIB)
-OBJ4FILES=$(OBJ)$/child_process_id.obj
+OBJ4FILES=$(OBJ)$/child_process_id.obj
APP4TARGET=child_process_id
APP4OBJS=$(OBJ4FILES)
diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx
index c5f5b683f..422ae09ee 100644
--- a/sal/qa/rtl/process/rtl_Process.cxx
+++ b/sal/qa/rtl/process/rtl_Process.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,7 +36,7 @@
#include <string.h>
#include <sal/types.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
#include <rtl/process.h>
@@ -48,7 +48,7 @@
using namespace osl;
using namespace rtl;
-/** print a UNI_CODE String. And also print some comments of the string.
+/** print a UNI_CODE String. And also print some comments of the string.
*/
inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = NULL )
{
@@ -89,8 +89,8 @@ public:
void tearDown()
{
- }
-
+ }
+
void getAppCommandArg_001()
{
#if defined(WNT) || defined(OS2)
@@ -131,33 +131,33 @@ public:
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
//we could get return value only after the process terminated
osl_joinProcess(hProcess);
// CPPUNIT_ASSERT_MESSAGE
// (
- // "osl_joinProcess returned with failure",
+ // "osl_joinProcess returned with failure",
// osl_Process_E_None == osl_error
// );
oslProcessInfo* pInfo = new oslProcessInfo;
- //please pay attention to initial the Size to sizeof(oslProcessInfo), or else
+ //please pay attention to initial the Size to sizeof(oslProcessInfo), or else
//you will get unknow error when call osl_getProcessInfo
pInfo->Size = sizeof(oslProcessInfo);
osl_error = osl_getProcessInfo( hProcess, osl_Process_EXITCODE, pInfo );
CPPUNIT_ASSERT_MESSAGE
(
- "osl_getProcessInfo returned with failure",
+ "osl_getProcessInfo returned with failure",
osl_Process_E_None == osl_error
);
- t_print("the exit code is %d.\n", pInfo->Code );
+ t_print("the exit code is %d.\n", pInfo->Code );
CPPUNIT_ASSERT_MESSAGE("rtl_getAppCommandArg or rtl_getAppCommandArgCount error.", pInfo->Code == 2);
delete pInfo;
}
-
-
+
+
CPPUNIT_TEST_SUITE(getAppCommandArg);
CPPUNIT_TEST(getAppCommandArg_001);
// CPPUNIT_TEST(getAppCommandArg_002);
@@ -203,7 +203,7 @@ void printUuidtoBuffer( sal_uInt8 *pNode, sal_Char * pBuffer )
nPtr++;
}
sprintf( (sal_Char *)(pBuffer + nPtr), "%02x", nValue );
- nPtr += 2 ;
+ nPtr += 2 ;
}
}
@@ -217,15 +217,15 @@ public:
void tearDown()
{
- }
- //gets a 16-byte fixed size identifier which is guaranteed not to change during the current process.
+ }
+ //gets a 16-byte fixed size identifier which is guaranteed not to change during the current process.
void getGlobalProcessId_001()
{
sal_uInt8 pTargetUUID1[16];
sal_uInt8 pTargetUUID2[16];
rtl_getGlobalProcessId( pTargetUUID1 );
rtl_getGlobalProcessId( pTargetUUID2 );
- CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", !memcmp( pTargetUUID1 , pTargetUUID2 , 16 ) );
+ CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", !memcmp( pTargetUUID1 , pTargetUUID2 , 16 ) );
}
//different processes different pids
void getGlobalProcessId_002()
@@ -241,7 +241,7 @@ public:
sal_Char pUUID1[32];
printUuidtoBuffer( pTargetUUID1, pUUID1 );
printf("# UUID to String is %s\n", pUUID1);
-
+
rtl::OUString suCWD = getModulePath();
oslProcess hProcess = NULL;
rtl::OUString suFileURL = suCWD;
@@ -253,7 +253,7 @@ public:
NULL,
0,
osl_Process_WAIT,
- 0,
+ 0,
suCWD.pData,
NULL,
0,
@@ -261,24 +261,24 @@ public:
NULL,
pChildOutputRead,
NULL);
-
+
CPPUNIT_ASSERT_MESSAGE
(
- "osl_createProcess failed",
+ "osl_createProcess failed",
osl_error == osl_Process_E_None
);
//we could get return value only after the process terminated
osl_joinProcess(hProcess);
-
+
sal_Char pUUID2[33];
pUUID2[32] = '\0';
sal_uInt64 nRead = 0;
osl_readFile( *pChildOutputRead, pUUID2, 32, &nRead );
t_print("read buffer is %s, nRead is %d \n", pUUID2, nRead );
- OUString suUUID2 = OUString::createFromAscii( pUUID2 );
- CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", suUUID2.equalsAsciiL( pUUID1, 32) == sal_False );
+ OUString suUUID2 = OUString::createFromAscii( pUUID2 );
+ CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", suUUID2.equalsAsciiL( pUUID1, 32) == sal_False );
}
-
+
CPPUNIT_TEST_SUITE(getGlobalProcessId);
CPPUNIT_TEST(getGlobalProcessId_001);
CPPUNIT_TEST(getGlobalProcessId_002);
diff --git a/sal/qa/rtl/random/makefile.mk b/sal/qa/rtl/random/makefile.mk
index 61cd9b676..0fc2e5e5a 100644
--- a/sal/qa/rtl/random/makefile.mk
+++ b/sal/qa/rtl/random/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:job by codegen.pl
+# auto generated Target:job by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_random.obj
SHL1TARGET= rtl_Random
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/sal/qa/rtl/random/rtl_random.cxx b/sal/qa/rtl/random/rtl_random.cxx
index 26cab8bf5..ae3845bd1 100644
--- a/sal/qa/rtl/random/rtl_random.cxx
+++ b/sal/qa/rtl/random/rtl_random.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,7 +35,7 @@
#include <algorithm> // STL
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/random.h>
namespace rtl_random
@@ -58,7 +58,7 @@ public:
void createPool_001()
{
// this is demonstration code
-
+
rtlRandomPool aPool = rtl_random_createPool();
// LLA: seems to be that an other test is not possible for createPool()
@@ -67,8 +67,8 @@ public:
rtl_random_destroyPool(aPool);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(createPool);
@@ -105,8 +105,8 @@ public:
rtl_random_destroyPool(aPool);
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(destroyPool);
@@ -133,7 +133,7 @@ public:
void addBytes_000()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 4;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen ];
memset(pBuffer, 0, nBufLen);
@@ -170,8 +170,8 @@ public:
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(addBytes);
@@ -184,7 +184,7 @@ public:
class Statistics
{
int m_nDispensation[256];
-
+
int m_nMin;
int m_nMax;
int m_nAverage;
@@ -204,33 +204,33 @@ public:
clearDispensation();
}
~Statistics(){}
-
+
void addValue(sal_Int16 _nIndex, sal_Int32 _nValue)
{
OSL_ASSERT(_nIndex >= 0 && _nIndex < 256);
m_nDispensation[_nIndex] += _nValue;
}
-
+
void build(sal_Int32 _nCountMax)
{
m_nMin = _nCountMax;
m_nMax = 0;
-
+
m_nAverage = _nCountMax / 256;
-
+
m_nMinDeviation = _nCountMax;
m_nMaxDeviation = 0;
-
+
for (int i = 0;i < 256;i ++) // show dispensation
{
m_nMin = std::min(m_nMin, m_nDispensation[i]);
m_nMax = std::max(m_nMax, m_nDispensation[i]);
-
+
m_nMinDeviation = std::min(m_nMinDeviation, abs(m_nAverage - m_nDispensation[i]));
m_nMaxDeviation = std::max(m_nMaxDeviation, abs(m_nAverage - m_nDispensation[i]));
}
}
-
+
void print()
{
// LLA: these are only info values
@@ -244,7 +244,7 @@ public:
sal_Int32 getAverage() {return m_nAverage;}
sal_Int32 getMaxDeviation() {return m_nMaxDeviation;}
-
+
};
class getBytes : public CppUnit::TestFixture
@@ -263,7 +263,7 @@ public:
void getBytes_000()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 4;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen ];
memset(pBuffer, 0, nBufLen);
@@ -284,7 +284,7 @@ public:
void getBytes_001()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 4;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen ];
memset(pBuffer, 0, nBufLen);
@@ -301,7 +301,7 @@ public:
void getBytes_002()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 4;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen << 1 ];
memset(pBuffer, 0, nBufLen << 1);
@@ -314,7 +314,7 @@ public:
t_print("%2x %2x %2x %2x %2x %2x %2x %2x\n", pBuffer[0], pBuffer[1], pBuffer[2], pBuffer[3], pBuffer[4], pBuffer[5], pBuffer[6], pBuffer[7]);
CPPUNIT_ASSERT_MESSAGE("internal memory overwrite", pBuffer[4] == 0 && pBuffer[5] == 0 && pBuffer[6] == 0 && pBuffer[7] == 0);
-
+
rtl_random_destroyPool(aPool);
delete [] pBuffer;
}
@@ -322,17 +322,17 @@ public:
void getBytes_003()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 1;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen ];
memset(pBuffer, 0, nBufLen);
Statistics aStat;
-
+
CPPUNIT_ASSERT_MESSAGE("memset failed", pBuffer[0] == 0);
int nCount = 0;
-
+
int nCountMax = 1000000;
for(nCount = 0;nCount < nCountMax; nCount ++) // run 100000000 through getBytes(...)
{
@@ -354,17 +354,17 @@ public:
void getBytes_003_1()
{
rtlRandomPool aPool = rtl_random_createPool();
-
+
sal_uInt32 nBufLen = 256;
sal_uInt8 *pBuffer = new sal_uInt8[ nBufLen ];
memset(pBuffer, 0, nBufLen);
Statistics aStat;
-
+
CPPUNIT_ASSERT_MESSAGE("memset failed", pBuffer[0] == 0);
int nCount = 0;
-
+
int nCountMax = 10000;
for(nCount = 0;nCount < nCountMax; nCount ++) // run 100000000 through getBytes(...)
{
@@ -386,8 +386,8 @@ public:
delete [] pBuffer;
}
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE(getBytes);
diff --git a/sal/qa/rtl/strings/makefile.mk b/sal/qa/rtl/strings/makefile.mk
index 16abc6b7e..8b2a62b82 100644
--- a/sal/qa/rtl/strings/makefile.mk
+++ b/sal/qa/rtl/strings/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -49,7 +49,7 @@ SHL1OBJS := \
$(SLO)$/test_oustring_endswith.obj \
$(SLO)$/test_oustring_noadditional.obj
SHL1IMPLIB := i$(SHL1TARGET)
-SHL1STDLIBS := $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS := $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP := $(PRJ)$/qa$/export.map
DEF1NAME := $(SHL1TARGET)
diff --git a/sal/qa/rtl/strings/test_oustring_compare.cxx b/sal/qa/rtl/strings/test_oustring_compare.cxx
index 1f2955631..582dd6a21 100644
--- a/sal/qa/rtl/strings/test_oustring_compare.cxx
+++ b/sal/qa/rtl/strings/test_oustring_compare.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/string.h"
#include "rtl/ustring.hxx"
diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx
index e868f303e..e1219c302 100644
--- a/sal/qa/rtl/strings/test_oustring_convert.cxx
+++ b/sal/qa/rtl/strings/test_oustring_convert.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/string.hxx"
#include "rtl/ustring.hxx"
@@ -123,7 +123,7 @@ void testConvertToString(TestConvertToString const & rTest)
CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false);
}
}
-
+
}
void test::oustring::Convert::convertToString()
diff --git a/sal/qa/rtl/strings/test_oustring_endswith.cxx b/sal/qa/rtl/strings/test_oustring_endswith.cxx
index 6d744f2cf..467878697 100644
--- a/sal/qa/rtl/strings/test_oustring_endswith.cxx
+++ b/sal/qa/rtl/strings/test_oustring_endswith.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/string.h"
#include "rtl/string.hxx"
diff --git a/sal/qa/rtl/strings/test_oustring_noadditional.cxx b/sal/qa/rtl/strings/test_oustring_noadditional.cxx
index 7ee72133e..dd30871b7 100644
--- a/sal/qa/rtl/strings/test_oustring_noadditional.cxx
+++ b/sal/qa/rtl/strings/test_oustring_noadditional.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,6 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
NOADDITIONAL;
diff --git a/sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx b/sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx
index 83d7aaeb4..71fb6def0 100644
--- a/sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx
+++ b/sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
diff --git a/sal/qa/rtl/textenc/makefile.mk b/sal/qa/rtl/textenc/makefile.mk
index c2b9a836a..31f700b7b 100644
--- a/sal/qa/rtl/textenc/makefile.mk
+++ b/sal/qa/rtl/textenc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,9 +47,7 @@ CXXFLAGS+= $(LFS_CFLAGS)
SHL1OBJS= \
$(SLO)$/rtl_textcvt.obj
SHL1TARGET= rtl_textcvt
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
@@ -65,9 +63,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS= \
$(SLO)$/rtl_tencinfo.obj
SHL2TARGET= rtl_tencinfo
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME =$(SHL2TARGET)
diff --git a/sal/qa/rtl/textenc/rtl_tencinfo.cxx b/sal/qa/rtl/textenc/rtl_tencinfo.cxx
index 7357ba3df..2bc3f930a 100644
--- a/sal/qa/rtl/textenc/rtl_tencinfo.cxx
+++ b/sal/qa/rtl/textenc/rtl_tencinfo.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,21 +36,21 @@
#include <osl/thread.h>
#include <rtl/tencinfo.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// -----------------------------------------------------------------------------
namespace rtl_tencinfo
{
- class getBestMime : public CppUnit::TestFixture
+ class getBestMime : public CppUnit::TestFixture
{
public:
void setUp()
{
}
-
+
void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
- {
+ {
const sal_Char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( _aCurrentEncode );
if (pCharSet == 0)
{
@@ -59,9 +59,9 @@ namespace rtl_tencinfo
else
{
t_print(T_VERBOSE, "'%s' is charset: '%s'\n", _pRTL_TEXTENCODING, pCharSet);
-
+
rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
- if (_aCurrentEncode != eTextEnc &&
+ if (_aCurrentEncode != eTextEnc &&
eTextEnc != RTL_TEXTENCODING_DONTKNOW)
{
t_print("rtl_getBestMimeCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING, pCharSet);
@@ -72,9 +72,9 @@ namespace rtl_tencinfo
// sError += ") returns null";
// CPPUNIT_ASSERT_MESSAGE(sError.getStr(), eTextEnc != RTL_TEXTENCODING_DONTKNOW);
// CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
- }
+ }
}
-
+
// the defines for the follows test could be found in file inc/rtl/textenc.h
// ----------------------------------------
@@ -533,7 +533,7 @@ namespace rtl_tencinfo
// check( "RTL_TEXTENCODING_UCS4", RTL_TEXTENCODING_UCS4 );
// check( "RTL_TEXTENCODING_UCS2", RTL_TEXTENCODING_UCS2 );
// check( "RTL_TEXTENCODING_UNICODE", RTL_TEXTENCODING_UNICODE /* RTL_TEXTENCODING_UCS2 */ );
-
+
CPPUNIT_TEST_SUITE( getBestMime );
CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1252 );
@@ -628,18 +628,18 @@ namespace rtl_tencinfo
CPPUNIT_TEST_SUITE_END( );
};
-
+
// -----------------------------------------------------------------------------
- class getBestUnix : public CppUnit::TestFixture
+ class getBestUnix : public CppUnit::TestFixture
{
public:
void setUp()
{
}
-
+
void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
- {
+ {
const sal_Char *pCharSet = rtl_getBestUnixCharsetFromTextEncoding( _aCurrentEncode );
if (pCharSet == 0)
{
@@ -648,9 +648,9 @@ namespace rtl_tencinfo
else
{
t_print(T_VERBOSE, "'%s' is charset: '%s'\n", _pRTL_TEXTENCODING, pCharSet);
-
+
rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromUnixCharset( pCharSet );
- if (_aCurrentEncode != eTextEnc &&
+ if (_aCurrentEncode != eTextEnc &&
eTextEnc != RTL_TEXTENCODING_DONTKNOW)
{
t_print("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING, pCharSet);
@@ -663,7 +663,7 @@ namespace rtl_tencinfo
// CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
}
}
-
+
// ----------------------------------------
void UnixCharsetFromTextEncoding_MS_1252()
@@ -1206,19 +1206,19 @@ namespace rtl_tencinfo
CPPUNIT_TEST_SUITE_END( );
};
-
+
// -----------------------------------------------------------------------------
- class getBestWindows : public CppUnit::TestFixture
+ class getBestWindows : public CppUnit::TestFixture
{
public:
void setUp()
{
}
-
+
void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
- {
+ {
const sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( _aCurrentEncode );
if (nCharSet == 1)
{
@@ -1227,23 +1227,23 @@ namespace rtl_tencinfo
else
{
t_print(T_VERBOSE, "'%s' is charset: '%d'\n", _pRTL_TEXTENCODING, nCharSet);
-
+
rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromWindowsCharset( nCharSet );
- if (_aCurrentEncode != eTextEnc &&
+ if (_aCurrentEncode != eTextEnc &&
eTextEnc != RTL_TEXTENCODING_DONTKNOW)
{
t_print("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %d\n", _pRTL_TEXTENCODING, nCharSet);
- t_print("rtl_getTextEncodingFromWindowsCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING, _aCurrentEncode, eTextEnc );
+ t_print("rtl_getTextEncodingFromWindowsCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING, _aCurrentEncode, eTextEnc );
}
// rtl::OString sError = "getTextEncodingFromWindowsCharset(";
// sError += rtl::OString::valueOf(nCharSet);
// sError += ") returns nul.";
-
+
// CPPUNIT_ASSERT_MESSAGE(sError.getStr(), eTextEnc != RTL_TEXTENCODING_DONTKNOW);
// CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
}
}
-
+
// ----------------------------------------
void WindowsCharsetFromTextEncoding_MS_1252()
{
@@ -1690,7 +1690,7 @@ namespace rtl_tencinfo
check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8 );
}
// ----------------------------------------
-
+
CPPUNIT_TEST_SUITE( getBestWindows );
CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1252 );
CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_ROMAN );
@@ -1794,8 +1794,8 @@ namespace rtl_tencinfo
void tearDown()
{
- }
-
+ }
+
// not implemented encoding test
void getTextEncodingInfo_001()
{
@@ -1806,7 +1806,7 @@ namespace rtl_tencinfo
// implemented
sal_Bool bRes11 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo1 );
CPPUNIT_ASSERT_MESSAGE("should return sal_False.", bRes1 == sal_False && bRes11 == sal_False );
-
+
aInfo2.StructSize = 5;
sal_Bool bRes2 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo2 );
sal_Bool bRes21 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo2 );
@@ -1815,9 +1815,9 @@ namespace rtl_tencinfo
aInfo3.StructSize = 6;
sal_Bool bRes3 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo3 );
sal_Bool bRes31 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo3 );
- CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes3 == sal_True && bRes31 == sal_True );
+ CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes3 == sal_True && bRes31 == sal_True );
//&& aInfo2.MinimumCharSize >=1 );
-
+
aInfo4.StructSize = 8;
sal_Bool bRes4 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo4 );
sal_Bool bRes41 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo4);
@@ -1826,8 +1826,8 @@ namespace rtl_tencinfo
aInfo5.StructSize = sizeof aInfo5;
sal_Bool bRes5 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo5 );
- CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes5 == sal_False && aInfo5.Flags == 0);
-
+ CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes5 == sal_False && aInfo5.Flags == 0);
+
}
CPPUNIT_TEST_SUITE(getTextEncodingInfo);
CPPUNIT_TEST(getTextEncodingInfo_001);
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 2e192ead9..2129815a6 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,7 +36,7 @@
#include <cstddef>
#include <cstring>
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/string.hxx"
#include "rtl/tencinfo.h"
#include "rtl/textcvt.h"
diff --git a/sal/qa/rtl/uri/makefile.mk b/sal/qa/rtl/uri/makefile.mk
index 95ba01deb..2c536da48 100644
--- a/sal/qa/rtl/uri/makefile.mk
+++ b/sal/qa/rtl/uri/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,9 +47,7 @@ CXXFLAGS+= $(LFS_CFLAGS)
SHL1OBJS= \
$(SLO)$/rtl_Uri.obj
SHL1TARGET= rtl_uri_simple
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
@@ -61,9 +59,7 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
SHL2OBJS= \
$(SLO)$/rtl_testuri.obj
SHL2TARGET= rtl_Uri
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
DEF2NAME =$(SHL2TARGET)
diff --git a/sal/qa/rtl/uri/rtl_Uri.cxx b/sal/qa/rtl/uri/rtl_Uri.cxx
index 9e7c114e8..cc27f956b 100644
--- a/sal/qa/rtl/uri/rtl_Uri.cxx
+++ b/sal/qa/rtl/uri/rtl_Uri.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +38,7 @@
#include <osl/thread.h>
#include <osl/file.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// -----------------------------------------------------------------------------
@@ -55,7 +55,7 @@ namespace Stringtest
sStrBuf.append( cHex[nlow] );
return sStrBuf.makeStringAndClear();
}
-
+
rtl::OString escapeString(rtl::OString const& _sStr)
{
rtl::OStringBuffer sStrBuf;
@@ -75,10 +75,10 @@ namespace Stringtest
}
return sStrBuf.makeStringAndClear();
}
-
+
// -----------------------------------------------------------------------------
- class Convert : public CppUnit::TestFixture
+ class Convert : public CppUnit::TestFixture
{
rtl::OUString m_aStr;
public:
@@ -95,12 +95,12 @@ namespace Stringtest
rtl::OUString suStr = rtl::OStringToOUString(_suStr, RTL_TEXTENCODING_UTF8);
return suStr;
}
-
+
rtl::OString convertToOString(rtl::OUString const& _suStr)
{
return rtl::OUStringToOString(_suStr, osl_getThreadTextEncoding()/*RTL_TEXTENCODING_ASCII_US*/);
}
-
+
void showContent(rtl::OUString const& _suStr)
{
rtl::OString sStr = convertToOString(_suStr);
@@ -127,7 +127,7 @@ namespace Stringtest
suStr = rtl::Uri::encode(_suStr, rtl_UriCharClassUnoParamValue, _eMechanism, RTL_TEXTENCODING_UTF8);
showContent(suStr);
}
-
+
void toUTF8(rtl::OUString const& _suStr)
{
t_print("rtl_UriEncodeIgnoreEscapes \n");
@@ -140,13 +140,13 @@ namespace Stringtest
toUTF8_mech(_suStr, rtl_UriEncodeCheckEscapes);
t_print("\n");
}
-
+
void test_FromUTF8_001()
{
// string --> ustring
rtl::OString sStrUTF8("h%C3%A4llo");
rtl::OUString suStrUTF8 = rtl::OStringToOUString(sStrUTF8, RTL_TEXTENCODING_ASCII_US);
-
+
// UTF8 --> real ustring
rtl::OUString suStr_UriDecodeToIuri = rtl::Uri::decode(suStrUTF8, rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
showContent(suStr_UriDecodeToIuri);
@@ -154,24 +154,24 @@ namespace Stringtest
// string --> ustring
rtl::OString sStr("h\xE4llo");
rtl::OUString suString = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_ISO_8859_15);
-
+
CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suString.equals(suStr_UriDecodeToIuri) == sal_True);
// ustring --> ustring (UTF8)
rtl::OUString suStr2 = rtl::Uri::encode(suStr_UriDecodeToIuri, rtl_UriCharClassUnoParamValue, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
showContent(suStr2);
-
+
CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suStr2.equals(suStrUTF8) == sal_True);
// suStr should be equal to suStr2
}
-
+
// "%C3%84qypten";
// testshl2 ../../../unxlngi4.pro/lib/libConvert.so "-onlyerrors"
// # Type: 'Directory' file name '%E6%89%8B%E6%9C%BA%E5%8F%B7%E7%A0%81'
// # Type: 'Directory' file name '%E6%9C%AA%E5%91%BD%E5%90%8Dzhgb18030'
// # Type: 'Regular file' file name '%E5%B7%A5%E4%BD%9C'
// # Type: 'Regular file' file name '%E4%BA%8C%E6%89%8B%E6%88%BF%E4%B9%B0%E5%8D%96%E5%90%88%E5%90%8C%E8%8D%89%E7%A8%BF.doc'
- // ls
+ // ls
rtl::OString getFileTypeName(osl::FileStatus const& _aStatus)
{
rtl::OString sType;
@@ -219,10 +219,10 @@ namespace Stringtest
{
sType = "ERROR: osl_FileStatus_Mask_Type not set for FileStatus!";
}
- return sType;
+ return sType;
}
-
-
+
+
void test_UTF8_files()
{
#ifdef UNX
@@ -242,10 +242,10 @@ namespace Stringtest
aStatus.isValid(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes))
{
rtl::OString sType = getFileTypeName(aStatus);
-
+
rtl::OUString suFilename = aStatus.getFileName();
// rtl::OUString suFullFileURL;
-
+
rtl::OUString suStrUTF8 = rtl::Uri::encode(suFilename, rtl_UriCharClassUnoParamValue, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
rtl::OString sStrUTF8 = convertToOString(suStrUTF8);
t_print("Type: '%s' file name '%s'\n", sType.getStr(), sStrUTF8.getStr());
@@ -260,7 +260,7 @@ namespace Stringtest
t_print("can't open dir:'%s'\n", sStr.getStr());
}
}
-
+
void test_FromUTF8()
{
rtl::OString sStr("h%C3%A4llo");
@@ -273,23 +273,23 @@ namespace Stringtest
rtl::OUString suStr_UriDecodeNone = rtl::Uri::decode(suStr, rtl_UriDecodeNone, RTL_TEXTENCODING_UTF8);
showContent(suStr_UriDecodeNone);
toUTF8(suStr_UriDecodeNone);
-
+
rtl::OUString suStr_UriDecodeToIuri = rtl::Uri::decode(suStr, rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
showContent(suStr_UriDecodeToIuri);
toUTF8(suStr_UriDecodeToIuri);
-
+
rtl::OUString suStr_UriDecodeWithCharset = rtl::Uri::decode(suStr, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8);
showContent(suStr_UriDecodeWithCharset);
toUTF8(suStr_UriDecodeWithCharset);
}
-
+
CPPUNIT_TEST_SUITE( Convert );
CPPUNIT_TEST( test_FromUTF8_001 );
// CPPUNIT_TEST( test_UTF8_files );
// CPPUNIT_TEST( test_FromUTF8 );
CPPUNIT_TEST_SUITE_END( );
};
-
+
}
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index 8a018416e..4d1d80830 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include <cstddef>
#include <stdio.h>
diff --git a/sal/qa/rtl/uuid/makefile.mk b/sal/qa/rtl/uuid/makefile.mk
index ed780dd82..554c2034d 100644
--- a/sal/qa/rtl/uuid/makefile.mk
+++ b/sal/qa/rtl/uuid/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,14 +45,12 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_Uuid.obj
SHL1TARGET= rtl_Uuid
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/rtl/uuid/rtl_Uuid.cxx b/sal/qa/rtl/uuid/rtl_Uuid.cxx
index 5920a30a9..0cfe6acca 100644
--- a/sal/qa/rtl/uuid/rtl_Uuid.cxx
+++ b/sal/qa/rtl/uuid/rtl_Uuid.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,7 +34,7 @@
#include <math.h>
#include <stdio.h>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/uuid.h>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
@@ -46,7 +46,7 @@
using namespace rtl;
-/** print a UNI_CODE String. And also print some comments of the string.
+/** print a UNI_CODE String. And also print some comments of the string.
*/
inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" )
{
@@ -88,8 +88,8 @@ public:
void tearDown()
{
- }
-
+ }
+
#define TEST_UUID 20
void createUuid_001()
{
@@ -142,7 +142,7 @@ public:
}
CPPUNIT_ASSERT_MESSAGE("createUuid: every uuid must be different.", bRes == sal_True );
}*/
-
+
CPPUNIT_TEST_SUITE(createUuid);
CPPUNIT_TEST(createUuid_001);
//CPPUNIT_TEST(createUuid_002);
@@ -172,8 +172,8 @@ public:
void tearDown()
{
- }
-
+ }
+
void createNamedUuid_001()
{
sal_uInt8 NameSpace_DNS[16] = RTL_UUID_NAMESPACE_DNS;
@@ -193,7 +193,7 @@ public:
rtl_createNamedUuid( pNamedUUID2 , NameSpace_DNS , pName );
CPPUNIT_ASSERT_MESSAGE( "Same name should generate the same uuid", ! memcmp( pNamedUUID , pNamedUUID2 , 16 ) && rtl_compareUuid( pNamedUUID , pNamedUUID2 ) == 0 );
CPPUNIT_ASSERT_MESSAGE( "Same name should generate the same uuid", ! memcmp( pNamedUUID , pPriorCalculatedUUID , 16 ) );
-
+
// Different names does not generate the same uuid
rtl_string_newFromStr( &pName , "this is a bla.blubs.DNS-Namf" );
rtl_createNamedUuid( pNamedUUID2 , NameSpace_DNS , pName );
@@ -202,7 +202,7 @@ public:
// the same name with different namespace uuid produces different uuids
rtl_createNamedUuid( pNamedUUID , NameSpace_URL , pName );
CPPUNIT_ASSERT_MESSAGE( " same name with different namespace uuid produces different uuids", memcmp( pNamedUUID , pNamedUUID2 , 16 ) && rtl_compareUuid( pNamedUUID , pNamedUUID2 ) != 0);
-
+
//test compareUuid
if ( rtl_compareUuid( pNamedUUID , pNamedUUID2 ) > 0 )
{ CPPUNIT_ASSERT_MESSAGE( " compare uuids", rtl_compareUuid( pNamedUUID2 , pNamedUUID ) < 0);
@@ -212,7 +212,7 @@ public:
rtl_string_release( pName );
}
-
+
CPPUNIT_TEST_SUITE(createNamedUuid);
CPPUNIT_TEST(createNamedUuid_001);
CPPUNIT_TEST_SUITE_END();
@@ -228,4 +228,4 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_Uuid::createNamedUuid, "rtl_Uuid");
// to let the user the possibility to also register some functions by hand.
NOADDITIONAL;
-
+
diff --git a/sal/qa/rtl_strings/makefile.mk b/sal/qa/rtl_strings/makefile.mk
index 4cd99ba3a..166ef568d 100644
--- a/sal/qa/rtl_strings/makefile.mk
+++ b/sal/qa/rtl_strings/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,15 +44,13 @@ CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# BEGIN ----------------------------------------------------------------
-# auto generated Target:FileBase by codegen.pl
+# auto generated Target:FileBase by codegen.pl
SHL1OBJS= \
$(SLO)$/rtl_String_Utils.obj \
$(SLO)$/rtl_OString.obj
SHL1TARGET= rtl_OString
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
@@ -65,15 +63,13 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:FileBase by codegen.pl
+# auto generated Target:FileBase by codegen.pl
SHL2OBJS= \
$(SLO)$/rtl_String_Utils.obj \
$(SLO)$/rtl_OUString.obj
SHL2TARGET= rtl_OUString
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL2IMPLIB= i$(SHL2TARGET)
# SHL2DEF= $(MISC)$/$(SHL2TARGET).def
@@ -86,22 +82,13 @@ SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
# END ------------------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-# auto generated Target:FileBase by codegen.pl
+# auto generated Target:FileBase by codegen.pl
SHL3OBJS= \
$(SLO)$/rtl_String_Utils.obj \
$(SLO)$/rtl_OUStringBuffer.obj
SHL3TARGET= rtl_OUStringBuffer
-SHL3STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
-
-# .IF "$(GUI)" == "WNT"
-# SHL3STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-# .ENDIF
-# .IF "$(GUI)" == "UNX"
-# SHL3STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .ENDIF
+SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL3IMPLIB= i$(SHL3TARGET)
# SHL3DEF= $(MISC)$/$(SHL3TARGET).def
@@ -115,12 +102,10 @@ SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
# BEGIN ----------------------------------------------------------------
SHL4OBJS= \
- $(SLO)$/rtl_old_teststrbuf.obj
+ $(SLO)$/rtl_old_teststrbuf.obj
SHL4TARGET= rtl_old_teststrbuf
-SHL4STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL4STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL4IMPLIB= i$(SHL4TARGET)
DEF4NAME =$(SHL4TARGET)
@@ -130,12 +115,10 @@ SHL4VERSIONMAP = $(PRJ)$/qa$/export.map
# BEGIN ----------------------------------------------------------------
SHL5OBJS= \
- $(SLO)$/rtl_old_testowstring.obj
+ $(SLO)$/rtl_old_testowstring.obj
SHL5TARGET= rtl_old_testowstring
-SHL5STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL5STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL5IMPLIB= i$(SHL5TARGET)
DEF5NAME =$(SHL5TARGET)
@@ -145,12 +128,10 @@ SHL5VERSIONMAP = $(PRJ)$/qa$/export.map
# BEGIN ----------------------------------------------------------------
SHL6OBJS= \
- $(SLO)$/rtl_old_testostring.obj
+ $(SLO)$/rtl_old_testostring.obj
SHL6TARGET= rtl_old_testostring
-SHL6STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL6STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL6IMPLIB= i$(SHL6TARGET)
DEF6NAME =$(SHL6TARGET)
diff --git a/sal/qa/rtl_strings/rtl_old_testostring.cxx b/sal/qa/rtl_strings/rtl_old_testostring.cxx
index d947b35c2..329eb71c7 100644
--- a/sal/qa/rtl_strings/rtl_old_testostring.cxx
+++ b/sal/qa/rtl_strings/rtl_old_testostring.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,7 +48,7 @@
#include <rtl/string.hxx>
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#define TEST_ENSURE(c, m) CPPUNIT_ASSERT_MESSAGE((m), (c))
@@ -63,7 +63,7 @@ using namespace rtl;
// -----------------------------------------------------------------------------
namespace rtl_OString
{
- class oldtests : public CppUnit::TestFixture
+ class oldtests : public CppUnit::TestFixture
{
public:
void test_OString();
diff --git a/sal/qa/rtl_strings/rtl_old_testowstring.cxx b/sal/qa/rtl_strings/rtl_old_testowstring.cxx
index eaa633793..e334c1d80 100644
--- a/sal/qa/rtl_strings/rtl_old_testowstring.cxx
+++ b/sal/qa/rtl_strings/rtl_old_testowstring.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -61,7 +61,7 @@
#include <rtl/locale.hxx>
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#define TEST_ENSURE(c, m) CPPUNIT_ASSERT_MESSAGE((m), (c))
// #if OSL_DEBUG_LEVEL > 0
@@ -75,7 +75,7 @@ using namespace rtl;
// -----------------------------------------------------------------------------
namespace rtl_OUString
{
- class oldtests : public CppUnit::TestFixture
+ class oldtests : public CppUnit::TestFixture
{
public:
void test_OUString();
@@ -148,7 +148,7 @@ void oldtests::test_OUString()
#endif
// LLA: locale tests removed ::rtl::OLocale locale = ::rtl::OLocale::getDefault();
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed OUString s61(OUString::createFromAscii("HaLLo"));
// LLA: locale tests removed s61 = s61.toLowerCase(locale);
// LLA: locale tests removed TEST_ENSURE( s61 == OUString::createFromAscii("hallo"), "test_OWString error 17a");
@@ -156,25 +156,25 @@ void oldtests::test_OUString()
// LLA: locale tests removed TEST_ENSURE( s61 == OUString::createFromAscii("HALLO"), "test_OWString error 17b");
// LLA: locale tests removed s61 = s61.toLowerCase();
// LLA: locale tests removed TEST_ENSURE( s61 == OUString::createFromAscii("hallo"), "test_OWString error 17c");
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed ::rtl::OLocale::setDefault( OUString::createFromAscii( "de" ), OUString::createFromAscii( "DE" ), OUString() );
// LLA: locale tests removed locale = OLocale::getDefault();
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed // AB, 24.3.2000, removed NAMESPACE_RTL(OLocale)::getENGLISH() and error 18
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed OUString s7(OUString::createFromAscii("HaLLo"));
// LLA: locale tests removed s7 = s7.toLowerCase(locale);
// LLA: locale tests removed TEST_ENSURE( s7 == OUString::createFromAscii("hallo"), "test_OWString error 19");
// LLA: locale tests removed s7 = s7.toUpperCase(locale);
// LLA: locale tests removed TEST_ENSURE( s7 == OUString::createFromAscii("HALLO"), "test_OWString error 20");
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed OUString s8(OUString::createFromAscii("HaLLo ICH BIn eIn "));
// LLA: locale tests removed s8 += OUString::valueOf( (sal_Unicode)0xDF );
// LLA: locale tests removed locale = OLocale::registerLocale( OUString::createFromAscii("tr"), OUString::createFromAscii("TR"), OUString());
// LLA: locale tests removed s8 = s8.toLowerCase(locale);
// LLA: locale tests removed s8 = s8.toUpperCase(locale);
// LLA: locale tests removed TEST_ENSURE( s8 == OUString::createFromAscii("HALLO ICH BIN EIN SS"), "test_OWString error 21");
-// LLA: locale tests removed
+// LLA: locale tests removed
// LLA: locale tests removed s7 = OUString::createFromAscii("Hallo ich bIn ein I");
// LLA: locale tests removed s7 = s8.toUpperCase(locale);
// LLA: locale tests removed TEST_ENSURE( s7 != OUString::createFromAscii("HALLO ICH BIN EIN I"), "test_OWString error 21.b");
@@ -199,60 +199,60 @@ void oldtests::test_OUString()
TEST_ENSURE( s7 != OUString::createFromAscii("blabla"), "test_OWString error 28");
TEST_ENSURE( OUString::createFromAscii("blabla") != s7, "test_OWString error 29");
- s8 = OUString::createFromAscii("Hallo");
- TEST_ENSURE( s7 <= s8, "test_OWString error 30");
- TEST_ENSURE( s7 >= s8, "test_OwString error 31");
+ s8 = OUString::createFromAscii("Hallo");
+ TEST_ENSURE( s7 <= s8, "test_OWString error 30");
+ TEST_ENSURE( s7 >= s8, "test_OwString error 31");
s8 = s8.replace((sal_Unicode)'l', (sal_Unicode)'r');
- TEST_ENSURE( s8 == OUString::createFromAscii("Harro"), "test_OWString error 32");
-// LLA: len() unknown TEST_ENSURE( s8.len() == 5, "test_OWString error 33");
-
+ TEST_ENSURE( s8 == OUString::createFromAscii("Harro"), "test_OWString error 32");
+// LLA: len() unknown TEST_ENSURE( s8.len() == 5, "test_OWString error 33");
+
// "Ich bin ein String mit einem A und C und vielen m, m, m, m"
// | | | | | | | | | | | |
//index 0 5 10 15 20 25 30 35 40 45 50 55
s8 = OUString::createFromAscii("Ich bin ein String mit einem A und C und vielen m, m, m, m");
-// LLA: no matching TEST_ENSURE( s8.search((sal_Unicode)'I') == 0, "test_OWString error 34");
-// LLA: no matching TEST_ENSURE( s8.search((sal_Unicode)'A') == 29, "test_OWString error 35");
+// LLA: no matching TEST_ENSURE( s8.search((sal_Unicode)'I') == 0, "test_OWString error 34");
+// LLA: no matching TEST_ENSURE( s8.search((sal_Unicode)'A') == 29, "test_OWString error 35");
// LLA: no matching s7 = OUString::createFromAscii("A und C");
-// LLA: no matching TEST_ENSURE( s8.search(s7) == 29, "test_OWString error 36");
-// LLA: no matching TEST_ENSURE( s8.search(OUString::createFromAscii("mit einem A")) == 19, "test_OWString error 37");
-// LLA: no matching
+// LLA: no matching TEST_ENSURE( s8.search(s7) == 29, "test_OWString error 36");
+// LLA: no matching TEST_ENSURE( s8.search(OUString::createFromAscii("mit einem A")) == 19, "test_OWString error 37");
+// LLA: no matching
// LLA: no matching s8 = OUString::createFromAscii("||token1|token2|token3||token4|token5||" );
-// LLA: no matching TEST_ENSURE( s8.getTokenCount('|') == 10, "test_OWString error 38a");
-// LLA: no matching TEST_ENSURE( s8.getToken(10,'|') == OUString(), "test_OWString error 39a");
-// LLA: no matching
+// LLA: no matching TEST_ENSURE( s8.getTokenCount('|') == 10, "test_OWString error 38a");
+// LLA: no matching TEST_ENSURE( s8.getToken(10,'|') == OUString(), "test_OWString error 39a");
+// LLA: no matching
// LLA: no matching s8 = OUString::createFromAscii("token1");
-// LLA: no matching TEST_ENSURE( s8.getTokenCount('|') == 1, "test_OWString error 38b");
-// LLA: no matching TEST_ENSURE( s8.getToken(0,'|') == OUString::createFromAscii("token1"), "test_OWString error 39b");
-// LLA: no matching TEST_ENSURE( s8.getToken(-1,'|') == OUString(), "test_OWString error 39c");
-// LLA: no matching TEST_ENSURE( s8.getToken(1,'|') == OUString(), "test_OWString error 39d");
-// LLA: no matching
+// LLA: no matching TEST_ENSURE( s8.getTokenCount('|') == 1, "test_OWString error 38b");
+// LLA: no matching TEST_ENSURE( s8.getToken(0,'|') == OUString::createFromAscii("token1"), "test_OWString error 39b");
+// LLA: no matching TEST_ENSURE( s8.getToken(-1,'|') == OUString(), "test_OWString error 39c");
+// LLA: no matching TEST_ENSURE( s8.getToken(1,'|') == OUString(), "test_OWString error 39d");
+// LLA: no matching
// LLA: no matching s8 = OUString::createFromAscii("|hallo1|hallo2|hallo3|hallo4|hallo5|hallo6|hallo7|hallo8|");
-// LLA: no matching TEST_ENSURE( s8.getTokenCount((sal_Unicode)'|') == 10, "test_OWString error 38");
-// LLA: no matching TEST_ENSURE( s8.getToken(3, (sal_Unicode)'|') == OUString::createFromAscii("hallo3"), "test_OWString error 39");
+// LLA: no matching TEST_ENSURE( s8.getTokenCount((sal_Unicode)'|') == 10, "test_OWString error 38");
+// LLA: no matching TEST_ENSURE( s8.getToken(3, (sal_Unicode)'|') == OUString::createFromAscii("hallo3"), "test_OWString error 39");
// LLA: removed due to the fact, this is not a clean test!
// LLA: s7 = OUString();
// LLA: s7 += s8;
-// LLA: TEST_ENSURE( s7 == s8, "test_OWString error 40");
-// LLA:
-// LLA: s7 = s8.replaceAt(8, 6, OUString::createFromAscii("mmmmmmmmmm"));
-// LLA: TEST_ENSURE( s7.getLength() == 61, "test_OWString error 41");
-// LLA:
-// LLA: s8 = s7.replaceAt(8, 11, OUString());
-// LLA: TEST_ENSURE( s8.getLength() == 50, "test_OWString error 42");
-// LLA:
-// LLA: s7 = s8.replaceAt(8, 0, OUString::createFromAscii("hallo2|"));
-// LLA: TEST_ENSURE( s7.getLength() == 57, "test_OWString error 43");
-// LLA:
+// LLA: TEST_ENSURE( s7 == s8, "test_OWString error 40");
+// LLA:
+// LLA: s7 = s8.replaceAt(8, 6, OUString::createFromAscii("mmmmmmmmmm"));
+// LLA: TEST_ENSURE( s7.getLength() == 61, "test_OWString error 41");
+// LLA:
+// LLA: s8 = s7.replaceAt(8, 11, OUString());
+// LLA: TEST_ENSURE( s8.getLength() == 50, "test_OWString error 42");
+// LLA:
+// LLA: s7 = s8.replaceAt(8, 0, OUString::createFromAscii("hallo2|"));
+// LLA: TEST_ENSURE( s7.getLength() == 57, "test_OWString error 43");
+// LLA:
// LLA: sal_Int32 pos = 0;
// LLA: while ((pos = s7.indexOf(OUString::createFromAscii("|"))) >= 0)
// LLA: {
// LLA: s8 = s7.replaceAt(pos, 1, OUString::createFromAscii("**"));
// LLA: s7 = s8;
-// LLA: }
-// LLA: TEST_ENSURE( s7.getLength() == 66, "test_OWString error 44");
+// LLA: }
+// LLA: TEST_ENSURE( s7.getLength() == 66, "test_OWString error 44");
TEST_ENSURE( OUString::createFromAscii("aaa" ).compareTo( OUString::createFromAscii("bbb" ) ) < 0, "test_OWString error 46" );
TEST_ENSURE( OUString::createFromAscii("aaa" ).compareTo( OUString::createFromAscii("aaa" ) ) == 0, "test_OWString error 46" );
diff --git a/sal/qa/rtl_strings/rtl_old_teststrbuf.cxx b/sal/qa/rtl_strings/rtl_old_teststrbuf.cxx
index 9747028f9..c277517d5 100644
--- a/sal/qa/rtl_strings/rtl_old_teststrbuf.cxx
+++ b/sal/qa/rtl_strings/rtl_old_teststrbuf.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,7 +53,7 @@
#include <rtl/ustrbuf.hxx>
#endif
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
using namespace rtl;
@@ -68,11 +68,11 @@ using namespace rtl;
// -----------------------------------------------------------------------------
namespace rtl_OStringBuffer
{
- class oldtests : public CppUnit::TestFixture
+ class oldtests : public CppUnit::TestFixture
{
public:
void test_OStringBuffer();
-
+
CPPUNIT_TEST_SUITE( oldtests );
CPPUNIT_TEST( test_OStringBuffer );
CPPUNIT_TEST_SUITE_END( );
@@ -162,11 +162,11 @@ void oldtests::test_OStringBuffer()
namespace rtl_OUStringBuffer
{
- class oldtests : public CppUnit::TestFixture
+ class oldtests : public CppUnit::TestFixture
{
public:
void test_OUStringBuffer();
-
+
CPPUNIT_TEST_SUITE( oldtests );
CPPUNIT_TEST( test_OUStringBuffer );
CPPUNIT_TEST_SUITE_END( );
@@ -260,7 +260,7 @@ void oldtests::test_OUStringBuffer()
printf("test_OWStringBuffer OK !!!\n");
return;
}
-
+
} // namespace rtl_OUStringBuffer
diff --git a/sal/qa/sal/makefile.mk b/sal/qa/sal/makefile.mk
index ebf7aa314..61f279e22 100644
--- a/sal/qa/sal/makefile.mk
+++ b/sal/qa/sal/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@ ENABLE_EXCEPTIONS := TRUE
SHL1TARGET = $(TARGET)_types
SHL1OBJS = $(SLO)$/test_types.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/sal/qa/sal/test_types.cxx b/sal/qa/sal/test_types.cxx
index 195ba66c7..5d72175bb 100644
--- a/sal/qa/sal/test_types.cxx
+++ b/sal/qa/sal/test_types.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,7 +35,7 @@
#include <stdio.h> // C99 snprintf not necessarily in <cstdio>
#include <string.h> // wntmsci10 does not know <cstring> std::strcmp
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "sal/types.h"
namespace {
diff --git a/sal/qa/systools/makefile.mk b/sal/qa/systools/makefile.mk
index cde5b71c2..035bef25c 100644
--- a/sal/qa/systools/makefile.mk
+++ b/sal/qa/systools/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -47,15 +47,12 @@ CXXFLAGS+= $(LFS_CFLAGS)
CFLAGS+=/Ob0
# BEGIN ----------------------------------------------------------------
-# auto generated Target:joblist by codegen.pl
+# auto generated Target:joblist by codegen.pl
SHL1OBJS= \
$(SLO)$/test_comtools.obj
SHL1TARGET= test_comtools
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)\
- uuid.lib
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) uuid.lib
SHL1IMPLIB= i$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/sal/qa/systools/test_comtools.cxx b/sal/qa/systools/test_comtools.cxx
index f79b00996..c61ff435d 100644
--- a/sal/qa/systools/test_comtools.cxx
+++ b/sal/qa/systools/test_comtools.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@
#include "precompiled_sal.hxx"
// autogenerated file with codegen.pl
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <systools/win32/comtools.hxx>
class COMObject : public IUnknown
@@ -42,25 +42,25 @@ public:
COMObject() : ref_count_(0)
{
}
-
+
~COMObject()
{
}
-
+
ULONG __stdcall AddRef()
{
ref_count_++;
return ref_count_;
}
-
+
ULONG __stdcall Release()
{
ULONG cnt = --ref_count_;
if (cnt == 0)
delete this;
- return cnt;
+ return cnt;
}
-
+
HRESULT __stdcall QueryInterface(REFIID riid, LPVOID* ppv)
{
if (riid == IID_IUnknown)
@@ -68,17 +68,17 @@ public:
AddRef();
*ppv = this;
return S_OK;
- }
- return E_NOINTERFACE;
+ }
+ return E_NOINTERFACE;
}
-
+
ULONG GetRefCount() const
{
return ref_count_;
}
-
+
private:
- ULONG ref_count_;
+ ULONG ref_count_;
};
sal::systools::COMReference<IUnknown> comObjectSource()
@@ -93,22 +93,22 @@ bool comObjectSink(sal::systools::COMReference<IUnknown> r, ULONG expectedRefCou
if (p)
return (p->GetRefCount() == expectedRefCountOnReturn);
else
- return (0 == expectedRefCountOnReturn);
+ return (0 == expectedRefCountOnReturn);
}
void comObjectSource2(LPVOID* ppv)
{
COMObject* p = new COMObject;
p->AddRef();
- *ppv = p;
+ *ppv = p;
}
namespace test_comtools
{
-
+
class test_COMReference : public CppUnit::TestFixture
{
-
+
public:
/// test of COMReference<IUnknown> r;
void default_ctor()
@@ -116,7 +116,7 @@ namespace test_comtools
sal::systools::COMReference<IUnknown> r;
CPPUNIT_ASSERT_MESSAGE("COMReference should be empty", r.get() == NULL);
}
-
+
void test_ctor_manual_AddRef()
{
COMObject* p = new COMObject;
@@ -124,88 +124,88 @@ namespace test_comtools
sal::systools::COMReference<IUnknown> r(p, false);
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_copy_ctor()
{
sal::systools::COMReference<IUnknown> r(comObjectSource());
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_copy_assignment()
{
sal::systools::COMReference<IUnknown> r;
CPPUNIT_ASSERT_MESSAGE("COMReference should be empty", r.get() == NULL);
-
+
r = comObjectSource();
CPPUNIT_ASSERT_MESSAGE("COMReference should be empty", r.get() != NULL);
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_ref_to_ref_assignment()
{
sal::systools::COMReference<IUnknown> r1 = comObjectSource();
sal::systools::COMReference<IUnknown> r2 = r1;
- CPPUNIT_ASSERT_MESSAGE("Wrong reference count 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
+ CPPUNIT_ASSERT_MESSAGE("Wrong reference count 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
}
-
+
void test_pointer_to_ref_assignment()
{
- sal::systools::COMReference<IUnknown> r;
+ sal::systools::COMReference<IUnknown> r;
r = new COMObject;
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_pointer_to_ref_assignment2()
{
sal::systools::COMReference<IUnknown> r = comObjectSource();
r = new COMObject;
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_source_sink()
{
CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 0 is expected", comObjectSink(comObjectSource(), 0));
}
-
+
void test_address_operator()
{
sal::systools::COMReference<IUnknown> r;
comObjectSource2(reinterpret_cast<LPVOID*>(&r));
CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
}
-
+
void test_address_operator2()
{
sal::systools::COMReference<IUnknown> r1 = comObjectSource();
sal::systools::COMReference<IUnknown> r2 = r1;
- CPPUNIT_ASSERT_MESSAGE("Wrong reference count 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
+ CPPUNIT_ASSERT_MESSAGE("Wrong reference count 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
comObjectSource2(reinterpret_cast<LPVOID*>(&r1));
CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r1.get())->GetRefCount() == 1);
- CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 1);
+ CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 1);
}
-
+
void test_clear()
{
sal::systools::COMReference<IUnknown> r = comObjectSource();
- CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
+ CPPUNIT_ASSERT_MESSAGE("Wrong reference count 1 is expected", reinterpret_cast<COMObject*>(r.get())->GetRefCount() == 1);
r.clear();
- CPPUNIT_ASSERT_MESSAGE("Expect reference to be empty", !r.is());
+ CPPUNIT_ASSERT_MESSAGE("Expect reference to be empty", !r.is());
}
-
+
void test_query_interface()
{
try
{
sal::systools::COMReference<IUnknown> r1 = comObjectSource();
sal::systools::COMReference<IUnknown> r2 = r1.QueryInterface<IUnknown>(IID_IUnknown);
- CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
+ CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
}
catch(sal::systools::ComError& ex)
{
CPPUNIT_ASSERT_MESSAGE("Exception should not have been thrown", false);
- }
+ }
}
-
+
void test_query_interface_throw()
{
try
@@ -219,11 +219,11 @@ namespace test_comtools
}
CPPUNIT_ASSERT_MESSAGE("Exception should have been thrown", false);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
// because these macros are need by auto register mechanism.
-
+
CPPUNIT_TEST_SUITE(test_COMReference);
CPPUNIT_TEST(default_ctor);
CPPUNIT_TEST(test_ctor_manual_AddRef);
diff --git a/sal/qa/testHelperFunctions/makefile.mk b/sal/qa/testHelperFunctions/makefile.mk
index 0064cabef..33c43f259 100644
--- a/sal/qa/testHelperFunctions/makefile.mk
+++ b/sal/qa/testHelperFunctions/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -49,9 +49,7 @@ SHL1OBJS= \
$(SLO)$/testHelperFunctions2.obj
SHL1TARGET= testHelperFunctions
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUNITLIB)
+SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
diff --git a/sal/qa/testHelperFunctions/testHelperFunctions.cxx b/sal/qa/testHelperFunctions/testHelperFunctions.cxx
index 2a86f45b1..9d96d9193 100644
--- a/sal/qa/testHelperFunctions/testHelperFunctions.cxx
+++ b/sal/qa/testHelperFunctions/testHelperFunctions.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +38,7 @@
#include "stringhelper.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
// void isJaBloed()
// {
@@ -47,12 +47,12 @@
inline sal_Int64 t_abs64(sal_Int64 _nValue)
{
- // std::abs() seems to have some ambiguity problems (so-texas)
+ // std::abs() seems to have some ambiguity problems (so-texas)
// return abs(_nValue);
t_print("t_abs64(%ld)\n", _nValue);
// CPPUNIT_ASSERT(_nValue < 2147483647);
- if (_nValue < 0)
+ if (_nValue < 0)
{
_nValue = -_nValue;
}
@@ -115,7 +115,7 @@ namespace testOfHelperFunctions
t_print("n32 should be -2^31 is: %d\n", n32);
CPPUNIT_ASSERT_MESSAGE("n32!=2147483648", n32 == -2147483648 );
}
-
+
void test_t_abs64::test1_0()
{
@@ -158,10 +158,10 @@ namespace testOfHelperFunctions
sal_Int64 n3 = 4294967296LL;
CPPUNIT_ASSERT_MESSAGE("4294967296 is != 0", n3 != 0 );
-
+
CPPUNIT_ASSERT_MESSAGE("n=2^31 << 1, n2 = 2^31 * 2, n3 = 2^32, all should equal!", n == n2 && n == n3 );
}
-
+
void test_t_abs64::test3()
{
@@ -196,14 +196,14 @@ namespace testOfHelperFunctions
t_print64(n);
CPPUNIT_ASSERT_MESSAGE("n=-2^33", t_abs64(n) > 0 );
}
-
+
// -----------------------------------------------------------------------------
class test_t_print : public CppUnit::TestFixture
{
public:
void t_print_001();
-
+
CPPUNIT_TEST_SUITE( test_t_print );
CPPUNIT_TEST( t_print_001 );
CPPUNIT_TEST_SUITE_END( );
@@ -222,7 +222,7 @@ namespace testOfHelperFunctions
sValue <<= suValue;
t_print("a String '%s'\n", sValue.getStr());
}
-
+
class StopWatch
{
@@ -234,8 +234,8 @@ namespace testOfHelperFunctions
:m_bStarted(false)
{
}
-
- void start()
+
+ void start()
{
m_bStarted = true;
osl_getSystemTime(&m_aStartTime);
@@ -293,11 +293,11 @@ namespace testOfHelperFunctions
}
return sBack;
}
-
+
void showTime(const rtl::OString & aWhatStr)
{
OSL_ENSURE(!m_bStarted, "Not Stopped.");
-
+
sal_Int32 nSeconds = m_aEndTime.Seconds - m_aStartTime.Seconds;
sal_Int32 nNanoSec = sal_Int32(m_aEndTime.Nanosec) - sal_Int32(m_aStartTime.Nanosec);
// printf("Seconds: %d Nanosec: %d ", nSeconds, nNanoSec);
@@ -322,16 +322,16 @@ namespace testOfHelperFunctions
aStr += makeThreeDigits(rtl::OString::valueOf((nNanoSec % 1000000) / 1000));
aStr += ":";
aStr += makeThreeDigits(rtl::OString::valueOf((nNanoSec % 1000)));
-
+
printf("%s\n", aStr.getStr());
// cout << aStr.getStr() << endl;
}
-
+
};
-
+
static sal_Bool isEqualTimeValue ( const TimeValue* time1, const TimeValue* time2)
{
- if( time1->Seconds == time2->Seconds &&
+ if( time1->Seconds == time2->Seconds &&
time1->Nanosec == time2->Nanosec)
return sal_True;
else
@@ -375,11 +375,11 @@ bool isBTimeGreaterATime(TimeValue const& A, TimeValue const& B)
class test_TimeValues : public CppUnit::TestFixture
{
public:
-
+
void t_time1();
void t_time2();
void t_time3();
-
+
CPPUNIT_TEST_SUITE( test_TimeValues );
CPPUNIT_TEST( t_time1 );
CPPUNIT_TEST( t_time2 );
@@ -433,7 +433,7 @@ void test_TimeValues::t_time3()
// osl_getSystemTime(&aStartTime);
// // testSession(xORB, false);
// osl_getSystemTime(&aEndTime);
- //
+ //
// sal_Int32 nSeconds = aEndTime.Seconds - aStartTime.Seconds;
// sal_Int32 nNanoSec = aEndTime.Nanosec - aStartTime.Nanosec;
// if (nNanoSec < 0)
@@ -441,10 +441,10 @@ void test_TimeValues::t_time3()
// nNanoSec = 1000000000 - nNanoSec;
// nSeconds++;
// }
- //
+ //
// // cout << "Time: " << nSeconds << ". " << nNanoSec << endl;
// }
-
+
} // namespace testOfHelperFunctions
diff --git a/sal/qa/testHelperFunctions/testHelperFunctions2.cxx b/sal/qa/testHelperFunctions/testHelperFunctions2.cxx
index ce88777d3..1adae36ad 100644
--- a/sal/qa/testHelperFunctions/testHelperFunctions2.cxx
+++ b/sal/qa/testHelperFunctions/testHelperFunctions2.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include "stringhelper.hxx"
namespace testOfHelperFunctions
@@ -40,7 +40,7 @@ namespace testOfHelperFunctions
{
public:
void valueequal_001();
-
+
CPPUNIT_TEST_SUITE( test_valueequal );
CPPUNIT_TEST( valueequal_001 );
CPPUNIT_TEST_SUITE_END( );
@@ -53,7 +53,7 @@ namespace testOfHelperFunctions
sValue <<= suValue;
t_print("'%s'\n", sValue.getStr());
}
-
+
} // namespace testOfHelperFunctions
// -----------------------------------------------------------------------------
diff --git a/salhelper/qa/makefile.mk b/salhelper/qa/makefile.mk
index 9987b3a27..4589338a5 100644
--- a/salhelper/qa/makefile.mk
+++ b/salhelper/qa/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@ ENABLE_EXCEPTIONS := TRUE
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_api.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) $(SALHELPERLIB)
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) $(SALHELPERLIB) $(TESTSHL2LIB)
SHL1IMPLIB = i$(SHL1TARGET)
SHL1VERSIONMAP = version.map
DEF1NAME = $(SHL1TARGET)
@@ -51,4 +51,4 @@ SLOFILES = $(SHL1OBJS)
ALLTAR: test
test .PHONY: $(SHL1TARGETN)
- cd $(SHL1TARGETN:d) && testshl2 $(SHL1TARGETN:f)
+ cd $(SHL1TARGETN:d) && $(TESTSHL2) $(SHL1TARGETN:f)
diff --git a/salhelper/qa/test_api.cxx b/salhelper/qa/test_api.cxx
index ad66df136..83df7ec08 100644
--- a/salhelper/qa/test_api.cxx
+++ b/salhelper/qa/test_api.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -59,7 +59,7 @@ std::type_info const & getSimpleReferenceObjectTypeInfo()
}
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/mutex.hxx"
#include "salhelper/condition.hxx"
#include "salhelper/dynload.hxx"
diff --git a/stoc/test/uriproc/makefile.mk b/stoc/test/uriproc/makefile.mk
index 85e3a294f..78b54bb2a 100644
--- a/stoc/test/uriproc/makefile.mk
+++ b/stoc/test/uriproc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -56,7 +56,7 @@ UNOTYPES = \
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_uriproc.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx
index bf182b645..71f92e504 100644
--- a/stoc/test/uriproc/test_uriproc.cxx
+++ b/stoc/test/uriproc/test_uriproc.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -47,7 +47,7 @@
#include "com/sun/star/uri/XVndSunStarScriptUrlReference.hpp"
#include "com/sun/star/util/XMacroExpander.hpp"
#include "cppuhelper/servicefactory.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/diagnose.h"
#include "osl/thread.h"
#include "rtl/string.h"