summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/osl/conditn.h2
-rw-r--r--sal/inc/osl/diagnose.hxx14
-rw-r--r--sal/inc/osl/endian.h2
-rw-r--r--sal/inc/osl/file.h8
-rw-r--r--sal/inc/osl/file.hxx4
-rw-r--r--sal/inc/osl/pipe_decl.hxx8
-rw-r--r--sal/inc/osl/process.h18
-rw-r--r--sal/inc/osl/security.h2
-rw-r--r--sal/inc/osl/semaphor.h2
-rw-r--r--sal/inc/osl/semaphor.hxx2
-rw-r--r--sal/inc/osl/socket.h24
-rw-r--r--sal/inc/osl/socket_decl.hxx22
-rw-r--r--sal/inc/osl/thread.hxx2
-rw-r--r--sal/inc/rtl/allocator.hxx171
-rw-r--r--sal/inc/rtl/bootstrap.h2
-rw-r--r--sal/inc/rtl/bootstrap.hxx2
-rw-r--r--sal/inc/rtl/instance.hxx6
-rw-r--r--sal/inc/rtl/math.hxx4
-rw-r--r--sal/inc/rtl/string.h2
-rw-r--r--sal/inc/rtl/string.hxx6
-rw-r--r--sal/inc/rtl/tencinfo.h2
-rw-r--r--sal/inc/rtl/tres.h2
-rw-r--r--sal/inc/rtl/ustring.h2
-rw-r--r--sal/inc/rtl/ustring.hxx2
-rw-r--r--sal/inc/sal/main.h2
-rw-r--r--sal/inc/systools/win32/StrConvert.h4
-rw-r--r--sal/osl/all/debugbase.cxx2
-rw-r--r--sal/osl/os2/file_path_helper.h2
-rw-r--r--sal/osl/os2/file_path_helper.hxx2
-rw-r--r--sal/osl/os2/file_url.cxx4
-rw-r--r--sal/osl/os2/file_url.h2
-rw-r--r--sal/osl/os2/makefile.mk2
-rw-r--r--sal/osl/os2/pipe.cxx8
-rw-r--r--sal/osl/os2/process.c8
-rw-r--r--sal/osl/os2/profile.c4
-rw-r--r--sal/osl/os2/socket.c10
-rw-r--r--sal/osl/os2/system.h4
-rw-r--r--sal/osl/unx/asm/interlck_sparc.s2
-rw-r--r--sal/osl/unx/file_url.cxx4
-rw-r--r--sal/osl/unx/pipe.c8
-rw-r--r--sal/osl/unx/process.c2
-rw-r--r--sal/osl/unx/signal.c4
-rw-r--r--sal/osl/unx/socket.c10
-rw-r--r--sal/osl/unx/system.h4
-rw-r--r--sal/osl/w32/MAKEFILE.MK2
-rw-r--r--sal/osl/w32/file_dirvol.cxx4
-rw-r--r--sal/osl/w32/file_url.cxx2
-rw-r--r--sal/osl/w32/interlck.c2
-rw-r--r--sal/osl/w32/module.cxx6
-rw-r--r--sal/osl/w32/nlsupport.c2
-rw-r--r--sal/osl/w32/path_helper.hxx2
-rw-r--r--sal/osl/w32/pipe.c8
-rw-r--r--sal/osl/w32/process.cxx2
-rw-r--r--sal/osl/w32/procimpl.cxx12
-rw-r--r--sal/osl/w32/profile.cxx2
-rw-r--r--sal/osl/w32/security.c2
-rw-r--r--sal/osl/w32/socket.cxx8
-rw-r--r--sal/prj/build.lst9
-rw-r--r--sal/qa/buildall.pl8
-rw-r--r--sal/qa/helper/gcov/deprecated.txt4
-rw-r--r--sal/qa/osl/condition/makefile.mk29
-rw-r--r--sal/qa/osl/condition/osl_Condition.cxx341
-rw-r--r--sal/qa/osl/condition/osl_Condition_Const.h4
-rw-r--r--sal/qa/osl/file/osl_File.cxx16
-rw-r--r--sal/qa/osl/module/osl_Module_Const.h2
-rw-r--r--sal/qa/osl/mutex/osl_Mutex.cxx16
-rw-r--r--sal/qa/osl/pipe/makefile.mk39
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx1180
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx2
-rw-r--r--sal/qa/osl/process/osl_process.cxx4
-rw-r--r--sal/qa/osl/socket/osl_ConnectorSocket.cxx2
-rw-r--r--sal/qa/osl/socket/osl_Socket.cxx6
-rw-r--r--sal/qa/osl/socket/osl_Socket2.cxx2
-rw-r--r--sal/qa/osl/socket/osl_StreamSocket.cxx8
-rw-r--r--sal/qa/osl/socket/sockethelper.cxx2
-rw-r--r--sal/qa/osl/socket/sockethelper.hxx2
-rw-r--r--sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx2
-rw-r--r--sal/qa/rtl_strings/rtl_OUString.cxx2
-rw-r--r--sal/qa/sal/makefile.mk32
-rw-r--r--sal/qa/sal/test_types.cxx26
-rw-r--r--sal/rtl/source/bootstrap.cxx11
-rw-r--r--sal/rtl/source/hash.cxx5
-rw-r--r--sal/rtl/source/unload.cxx20
-rw-r--r--sal/systools/win32/kill/kill.cxx2
-rw-r--r--sal/systools/win32/uwinapi/MoveFileExA.cpp2
-rw-r--r--sal/test/bootstrap2
-rwxr-xr-xsal/test/bootstrap.bat2
-rwxr-xr-xsal/test/bootstrap.pl4
-rw-r--r--sal/textenc/generate/cns116431992.pl6
-rw-r--r--sal/textenc/tcvtkr1.tab2
-rw-r--r--sal/textenc/tcvtmb.c2
-rw-r--r--sal/textenc/tcvtutf8.c2
-rw-r--r--sal/typesconfig/typesconfig.c2
-rw-r--r--sal/workben/tgetpwnam.cxx2
94 files changed, 862 insertions, 1393 deletions
diff --git a/sal/inc/osl/conditn.h b/sal/inc/osl/conditn.h
index 0e130c60e9ef..0b2184c5467c 100644
--- a/sal/inc/osl/conditn.h
+++ b/sal/inc/osl/conditn.h
@@ -35,7 +35,7 @@ typedef void* oslCondition;
typedef enum {
osl_cond_result_ok, /* successful completion */
- osl_cond_result_error, /* error occured, check osl_getLastSocketError() for details */
+ osl_cond_result_error, /* error occurred, check osl_getLastSocketError() for details */
osl_cond_result_timeout, /* blocking operation timed out */
osl_cond_result_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
} oslConditionResult;
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 9d887aafd9c9..5cab37981afc 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -23,21 +23,10 @@
#if ! defined(OSL_DIAGNOSE_HXX_INCLUDED)
#define OSL_DIAGNOSE_HXX_INCLUDED
-#if ! defined(_OSL_DIAGNOSE_H_)
#include "osl/diagnose.h"
-#endif
-#if ! defined(_OSL_INTERLOCK_H_)
#include "osl/interlck.h"
-#endif
-#if ! defined(_OSL_MUTEX_HXX_)
#include "osl/mutex.hxx"
-#endif
-#if ! defined(INCLUDED_RTL_ALLOCATOR_HXX)
-#include "rtl/allocator.hxx"
-#endif
-#if ! defined(_RTL_INSTANCE_HXX_)
#include "rtl/instance.hxx"
-#endif
#include <hash_set>
#include <functional>
#include <typeinfo>
@@ -91,8 +80,7 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> {
}
};
-typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
- ::rtl::Allocator<void const*> > VoidPointerSet;
+typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*> > VoidPointerSet;
struct ObjectRegistryData {
ObjectRegistryData( ::std::type_info const& rTypeInfo )
diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h
index 476fd6eb93a3..27e678a2a624 100644
--- a/sal/inc/osl/endian.h
+++ b/sal/inc/osl/endian.h
@@ -157,7 +157,7 @@ extern "C" {
#elif defined _BIG_ENDIAN
# define OSL_BIGENDIAN
#else
-# error undetermined endianess
+# error undetermined endianness
#endif
diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index be5add4fcb8f..3e0c74be4ac1 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -57,7 +57,7 @@ contain only ASCII characters<p>
case preserving or not. The operating system implementation itself should
determine if it can map case-insensitive paths. The case correct notation of
a filename or file path is part of the "File Info". This case correct name
-can be used as a unique key if neccessary.<p>
+can be used as a unique key if necessary.<p>
4. Obtaining information about files or volumes is controlled by a
bitmask which specifies which fields are of interest. Due to performance
@@ -336,7 +336,7 @@ typedef enum {
#define osl_File_Attribute_OthRead 0x00001000
#define osl_File_Attribute_OthExe 0x00002000
-/* Flags specifying which fields to retreive by osl_getFileStatus */
+/* Flags specifying which fields to retrieve by osl_getFileStatus */
#define osl_FileStatus_Mask_Type 0x00000001
#define osl_FileStatus_Mask_Attributes 0x00000002
@@ -557,7 +557,7 @@ oslFileError SAL_CALL osl_getVolumeDeviceMountPath( oslVolumeDeviceHandle Handle
#define osl_Volume_Attribute_Case_Is_Preserved 0x00000040L
#define osl_Volume_Attribute_Case_Sensitive 0x00000080L
-/* Flags specifying which fields to retreive by osl_getVolumeInfo */
+/* Flags specifying which fields to retrieve by osl_getVolumeInfo */
#define osl_VolumeInfo_Mask_Attributes 0x00000001L
#define osl_VolumeInfo_Mask_TotalSpace 0x00000002L
@@ -584,7 +584,7 @@ struct _oslVolumeInfo {
sal_uInt32 uValidFields;
/** Attributes of the volume (remote and/or removable) */
sal_uInt32 uAttributes;
-/** Total availiable space on the volume for the current process/user */
+/** Total available space on the volume for the current process/user */
sal_uInt64 uTotalSpace;
/** Used space on the volume for the current process/user */
sal_uInt64 uUsedSpace;
diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index bd9c9f04b05d..ff745c7c5321 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -476,7 +476,7 @@ public:
/** Constructor.
@param nMask
- Set of flaggs decribing the demanded information.
+ Set of flaggs describing the demanded information.
*/
VolumeInfo( sal_uInt32 nMask ): _nMask( nMask )
@@ -750,7 +750,7 @@ public:
/** Constructor.
@param nMask
- Set of flaggs decribing the demanded information.
+ Set of flaggs describing the demanded information.
*/
FileStatus( sal_uInt32 nMask ): _nMask( nMask )
diff --git a/sal/inc/osl/pipe_decl.hxx b/sal/inc/osl/pipe_decl.hxx
index 55698bedef5f..3310867bca27 100644
--- a/sal/inc/osl/pipe_decl.hxx
+++ b/sal/inc/osl/pipe_decl.hxx
@@ -128,9 +128,9 @@ public:
inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
- /** Delivers a constant decribing the last error for the pipe system.
- @return ENONE if no error occured, invalid_PipeError if
- an unknown (unmapped) error occured, otherwise an enum describing the
+ /** Delivers a constant describing the last error for the pipe system.
+ @return ENONE if no error occurred, invalid_PipeError if
+ an unknown (unmapped) error occurred, otherwise an enum describing the
error.
*/
inline oslPipeError SAL_CALL getError() const;
@@ -203,7 +203,7 @@ public:
@param pBuffer [in] Points to a buffer that contains the send-data.
@param BytesToSend [in] The number of bytes to send. pBuffer must have at least
this size.
- @return the number of transfered bytes.
+ @return the number of transferred bytes.
*/
inline sal_Int32 SAL_CALL send(const void* pBuffer, sal_Int32 BytesToSend) const;
diff --git a/sal/inc/osl/process.h b/sal/inc/osl/process.h
index c5eed8216e54..c4783648b569 100644
--- a/sal/inc/osl/process.h
+++ b/sal/inc/osl/process.h
@@ -64,7 +64,7 @@ typedef sal_uInt32 oslProcessExitCode;
typedef enum {
osl_Process_E_None, /* no error */
osl_Process_E_NotFound, /* image not found */
- osl_Process_E_TimedOut, /* timout occured */
+ osl_Process_E_TimedOut, /* timout occurred */
osl_Process_E_NoPermission, /* permission denied */
osl_Process_E_Unknown, /* unknown error */
osl_Process_E_InvalidError, /* unmapped error */
@@ -138,7 +138,7 @@ typedef void* oslProcess;
the process will be started in the context of the current user.
@param ustrDirectory
- [in] The file URL of the working directory of the new proces. If the specified directory
+ [in] The file URL of the working directory of the new process. If the specified directory
does not exist or is inaccessible the working directory of the newly created process
is undefined. If this parameter is NULL or the caller provides an empty string the
new process will have the same current working directory as the calling process.
@@ -153,7 +153,7 @@ typedef void* oslProcess;
[in] The number of environment variables to set.
@param pProcess
- [out] Pointer to a oslProcess variable, wich receives the handle of the newly created process.
+ [out] Pointer to a oslProcess variable, which receives the handle of the newly created process.
This parameter must not be NULL.
@return
@@ -208,7 +208,7 @@ oslProcessError SAL_CALL osl_executeProcess(
the process will be started in the context of the current user.
@param ustrDirectory
- [in] The file URL of the working directory of the new proces. If the specified directory
+ [in] The file URL of the working directory of the new process. If the specified directory
does not exist or is inaccessible the working directory of the newly created process
is undefined. If this parameter is NULL or the caller provides an empty string the
new process will have the same current working directory as the calling process.
@@ -223,7 +223,7 @@ oslProcessError SAL_CALL osl_executeProcess(
[in] The number of environment variables to set.
@param pProcess
- [out] Pointer to a oslProcess variable, wich receives the handle of the newly created process.
+ [out] Pointer to a oslProcess variable, which receives the handle of the newly created process.
This parameter must not be NULL.
@param pChildInputWrite
@@ -318,7 +318,7 @@ oslProcessError SAL_CALL osl_joinProcess(oslProcess Process);
@return
osl_Process_E_None on success
osl_Process_E_TimedOut waiting for the child process timed out
- osl_Process_E_Unknown an error occured or the parameter are invalid
+ osl_Process_E_Unknown an error occurred or the parameter are invalid
@see osl_executeProcess
*/
@@ -378,13 +378,13 @@ oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **strCom
*/
void SAL_CALL osl_setCommandArgs (int argc, char **argv);
-/** Get the value of one enviroment variable.
+/** Get the value of one environment variable.
@param strVar [in] denotes the name of the variable to get.
@param strValue [out] string that receives the value of environment variable.
*/
oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *strVar, rtl_uString **strValue);
-/** Set the value of one enviroment variable.
+/** Set the value of one environment variable.
@param strVar [in] denotes the name of the variable to set.
@param strValue [in] string of the new value of environment variable.
@@ -392,7 +392,7 @@ oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *strVar, rtl_uString **s
*/
oslProcessError SAL_CALL osl_setEnvironment(rtl_uString *strVar, rtl_uString *strValue);
-/** Unsets the value of one enviroment variable.
+/** Unsets the value of one environment variable.
@param strVar [in] denotes the name of the variable to unset.
@since UDK 3.2.13
diff --git a/sal/inc/osl/security.h b/sal/inc/osl/security.h
index d2d9b47c8326..5eed5e7a0808 100644
--- a/sal/inc/osl/security.h
+++ b/sal/inc/osl/security.h
@@ -74,7 +74,7 @@ oslSecurityError SAL_CALL osl_loginUser(
the maped drive on this server.
@param strUserName [in] denotes the name of the user to logg in.
@param strPasswd [in] the password for this user.
- @param strFileServer [in] denotes the file server on wich the user is logged in.
+ @param strFileServer [in] denotes the file server on which the user is logged in.
@param pSecurity [out] returns the security handle if user could be logged in.
@return osl_Security_E_None if user could be logged in, otherwise an error-code.
@see osl_freeSecurityHandle
diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h
index d3e1159ce405..1a81751a7de1 100644
--- a/sal/inc/osl/semaphor.h
+++ b/sal/inc/osl/semaphor.h
@@ -39,7 +39,7 @@ typedef void* oslSemaphore;
@param InitialCount denotes the starting value the semaphore. If you set it to
zero, the first acquire() blocks. Otherwise InitialCount acquire()s are
- immedeatly successfull.
+ immedeatly successful.
@return 0 if the semaphore could not be created, otherwise a handle to the sem.
*/
oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount);
diff --git a/sal/inc/osl/semaphor.hxx b/sal/inc/osl/semaphor.hxx
index 9ae6dca14178..be548815ea21 100644
--- a/sal/inc/osl/semaphor.hxx
+++ b/sal/inc/osl/semaphor.hxx
@@ -43,7 +43,7 @@ namespace osl
/** Creates a semaphore.<BR>
@param InitialCount denotes the starting value the semaphore. If you set it to
zero, the first acquire() blocks. Otherwise InitialCount acquire()s are
- immedeatly successfull.
+ immediately successful.
@return 0 if the semaphore could not be created, otherwise a handle to the sem.
*/
diff --git a/sal/inc/osl/socket.h b/sal/inc/osl/socket.h
index 175688dcec5c..28db6c76b5e2 100644
--- a/sal/inc/osl/socket.h
+++ b/sal/inc/osl/socket.h
@@ -190,7 +190,7 @@ typedef enum {
*/
typedef enum {
osl_Socket_Ok, /* successful completion */
- osl_Socket_Error, /* error occured, check osl_getLastSocketError() for details */
+ osl_Socket_Error, /* error occurred, check osl_getLastSocketError() for details */
osl_Socket_TimedOut, /* blocking operation timed out */
osl_Socket_Interrupted, /* blocking operation was interrupted */
osl_Socket_InProgress, /* nonblocking operation is in progress */
@@ -545,7 +545,7 @@ sal_Int32 SAL_CALL osl_receiveFromSocket(oslSocket Socket,
<li><code>osl_Socket_MsgMaxIOVLen</code>
</ul>
- @return the number of transfered bytes.
+ @return the number of transferred bytes.
*/
sal_Int32 SAL_CALL osl_sendSocket(oslSocket Socket,
const void* pBuffer,
@@ -575,7 +575,7 @@ sal_Int32 SAL_CALL osl_sendSocket(oslSocket Socket,
<li><code>osl_Socket_MsgMaxIOVLen</code>
</ul>
- @return the number of transfered bytes.
+ @return the number of transferred bytes.
*/
sal_Int32 SAL_CALL osl_sendToSocket(oslSocket Socket,
oslSocketAddr ReceiverAddr,
@@ -589,7 +589,7 @@ sal_Int32 SAL_CALL osl_sendToSocket(oslSocket Socket,
how long the operation will block if the Socket is not ready.
@return <code>sal_True</code> if read operations (recv, recvFrom, accept) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occured.
+ will NOT block; <code>sal_False</code> if it would block or if an error occurred.
@param Socket the Socket to perfom the operation on.
@param pTimeout if NULL, the operation will block without a timeout.
@@ -600,7 +600,7 @@ sal_Bool SAL_CALL osl_isReceiveReady(oslSocket Socket, const TimeValue* pTimeout
You can specify a timeout-value in seconds/microseconds that denotes
how long the operation will block if the Socket is not ready.
@return <code>sal_True</code> if send operations (send, sendTo) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occured.
+ will NOT block; <code>sal_False</code> if it would block or if an error occurred.
@param Socket the Socket to perfom the operation on.
@param pTimeout if NULL, the operation will block without a timeout. Otherwise
@@ -612,7 +612,7 @@ sal_Bool SAL_CALL osl_isSendReady(oslSocket Socket, const TimeValue* pTimeout);
You can specify a timeout-value in seconds/microseconds that denotes
how long the operation will block if the Socket has no pending OOB data.
@return <code>sal_True</code> if OOB-request operations (recv with appropriate flags)
- on the Socket will NOT block; <code>sal_False</code> if it would block or if an error occured.
+ on the Socket will NOT block; <code>sal_False</code> if it would block or if an error occurred.
@param Socket the Socket to perfom the operation on.
@param pTimeout if NULL, the operation will block without a timeout.
@@ -700,7 +700,7 @@ sal_Bool SAL_CALL osl_shutdownSocket(oslSocket Socket,
<li><code>osl_Socket_OptionTcpNoDelay</code><br>
Disables the Nagle algorithm for send coalescing. (Do not
- collect data until a packet is full, instead send immediatly.
+ collect data until a packet is full, instead send immediately.
This increases network traffic but might improve latency-times.)
1 = disables the algorithm, 0 = keeps it enabled.
</ul>
@@ -712,7 +712,7 @@ sal_Bool SAL_CALL osl_shutdownSocket(oslSocket Socket,
@param BufferSize contains the length of the Buffer.
- @return -1 if an error occured or else the size of the data copied into
+ @return -1 if an error occurred or else the size of the data copied into
pBuffer.
@see osl_setSocketOption()
*/
@@ -773,7 +773,7 @@ sal_Bool SAL_CALL osl_isNonBlockingMode(oslSocket Socket);
<li> osl_Socket_TypeRaw
<li> osl_Socket_TypeRdm
<li> osl_Socket_TypeSeqPacket
- <li> osl_invalid_SocketType, if an error occured
+ <li> osl_invalid_SocketType, if an error occurred
</ul>
*/
@@ -784,10 +784,10 @@ oslSocketType SAL_CALL osl_getSocketType(oslSocket Socket);
*/
void SAL_CALL osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError);
-/** returns a constant decribing the last error for the socket system.
- @return <code>osl_Socket_E_NONE</code> if no error occured,
+/** returns a constant describing the last error for the socket system.
+ @return <code>osl_Socket_E_NONE</code> if no error occurred,
<code>osl_invalid_SocketError</code> if an unknown (unmapped)
- error occured, otherwise an enum describing the error.
+ error occurred, otherwise an enum describing the error.
*/
oslSocketError SAL_CALL osl_getLastSocketError(oslSocket Socket);
diff --git a/sal/inc/osl/socket_decl.hxx b/sal/inc/osl/socket_decl.hxx
index 4830590d90b9..136e61925f61 100644
--- a/sal/inc/osl/socket_decl.hxx
+++ b/sal/inc/osl/socket_decl.hxx
@@ -272,7 +272,7 @@ namespace osl
You can specify a timeout-value in seconds/nanoseconds that denotes
how the operation will block if the Socket is not ready.
@return <code>sal_True</code> if read operations (recv, recvFrom, accept) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occured.
+ will NOT block; <code>sal_False</code> if it would block or if an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
@@ -284,7 +284,7 @@ namespace osl
You can specify a timeout-value in seconds/nanoseconds that denotes
how the operation will block if the Socket is not ready.
@return <code>sal_True</code> if send operations (send, sendTo) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occured.
+ will NOT block; <code>sal_False</code> if it would block or if an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
@@ -299,7 +299,7 @@ namespace osl
@return <code>sal_True</code> if OOB-request operations (recv with appropriate flags)
on the Socket will NOT block; <code>sal_False</code> if it would block or if
- an error occured.
+ an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
@@ -315,7 +315,7 @@ namespace osl
<li> <code>osl_Socket_TypeRaw</code>
<li> <code>osl_Socket_TypeRdm</code>
<li> <code>osl_Socket_TypeSeqPacket</code>
- <li> <code>osl_invalid_SocketType</code>, if an error occured
+ <li> <code>osl_invalid_SocketType</code>, if an error occurred
</ul>
*/
inline oslSocketType SAL_CALL getType() const;
@@ -380,7 +380,7 @@ namespace osl
<li><code>osl_Socket_OptionTcpNoDelay</code><br>
Disables the Nagle algorithm for send coalescing. (Do not
- collect data until a packet is full, instead send immediatly.
+ collect data until a packet is full, instead send immediately.
This increases network traffic but might improve latency-times.)
1 = disables the algorithm, 0 = keeps it enabled.
</ul>
@@ -399,7 +399,7 @@ namespace osl
<li><code>osl_Socket_LevelTcp</code> : Level of Transmission Control Protocol
</ul>
@return The size of the attribute copied into pBuffer or -1 if an error
- occured.
+ occurred.
*/
inline sal_Int32 SAL_CALL getOption(
oslSocketOption Option,
@@ -481,10 +481,10 @@ namespace osl
*/
inline void SAL_CALL clearError() const;
- /** returns a constant decribing the last error for the socket system.
+ /** returns a constant describing the last error for the socket system.
- @return osl_Socket_E_NONE if no error occured, invalid_SocketError if
- an unknown (unmapped) error occured, otherwise an enum describing the
+ @return osl_Socket_E_NONE if no error occurred, invalid_SocketError if
+ an unknown (unmapped) error occurred, otherwise an enum describing the
error.
@see osl_getLastSocketError()
*/
@@ -574,7 +574,7 @@ namespace osl
<li><code>osl_Socket_MsgMaxIOVLen</code>
</ul>
- @return the number of transfered bytes. It may be less than BytesToSend.
+ @return the number of transferred bytes. It may be less than BytesToSend.
*/
sal_Int32 SAL_CALL send(const void* pBuffer,
sal_uInt32 BytesToSend,
@@ -705,7 +705,7 @@ namespace osl
<li><code>osl_Socket_MsgMaxIOVLen</code>
</ul>
- @return the number of transfered bytes.
+ @return the number of transferred bytes.
*/
inline sal_Int32 SAL_CALL sendTo( const SocketAddr& ReceiverAddr,
const void* pBuffer,
diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx
index 5755e5ed5209..b57f7b617f55 100644
--- a/sal/inc/osl/thread.hxx
+++ b/sal/inc/osl/thread.hxx
@@ -202,7 +202,7 @@ public:
}
/** Set the data associated with the data key.
- @returns True if operation was successfull
+ @returns True if operation was successful
*/
sal_Bool SAL_CALL setData(void *pData)
{
diff --git a/sal/inc/rtl/allocator.hxx b/sal/inc/rtl/allocator.hxx
deleted file mode 100644
index d4c1d47a1fd1..000000000000
--- a/sal/inc/rtl/allocator.hxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-#if !defined INCLUDED_RTL_ALLOCATOR_HXX
-#define INCLUDED_RTL_ALLOCATOR_HXX
-
-#if ! defined(_SAL_TYPES_H_)
-#include "sal/types.h"
-#endif
-#if ! defined(_RTL_ALLOC_H_)
-#include "rtl/alloc.h"
-#endif
-
-#include <cstddef>
-
-//######################################################
-// This is no general purpose STL allocator but one
-// necessary to use STL for some implementation but
-// avoid linking sal against the STLPort library!!!
-// For more information on when and how to define a
-// custom stl allocator have a look at Scott Meyers:
-// "Effective STL", Nicolai M. Josuttis:
-// "The C++ Standard Library - A Tutorial and Reference"
-// and at http://www.josuttis.com/cppcode/allocator.html
-
-namespace rtl {
-
-/** @internal */
-template<class T>
-class Allocator
-{
-public:
- typedef T value_type;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef ::std::size_t size_type;
- typedef ::std::ptrdiff_t difference_type;
-
- //-----------------------------------------
- template<class U>
- struct rebind
- {
- typedef Allocator<U> other;
- };
-
- //-----------------------------------------
- pointer address (reference value) const
- {
- return &value;
- }
-
- //-----------------------------------------
- const_pointer address (const_reference value) const
- {
- return &value;
- }
-
- //-----------------------------------------
- Allocator() SAL_THROW(())
- {}
-
- //-----------------------------------------
- template<class U>
- Allocator (const Allocator<U>&) SAL_THROW(())
- {}
-
- //-----------------------------------------
- Allocator(const Allocator&) SAL_THROW(())
- {}
-
- //-----------------------------------------
- ~Allocator() SAL_THROW(())
- {}
-
- //-----------------------------------------
- size_type max_size() const SAL_THROW(())
- {
- return size_type(-1)/sizeof(T);
- }
-
- //-----------------------------------------
- /* Normally the code for allocate should
- throw a std::bad_alloc exception if the
- requested memory could not be allocated:
- (C++ standard 20.4.1.1):
-
- pointer allocate (size_type n, const void* hint = 0)
- {
- pointer p = reinterpret_cast<pointer>(
- rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
-
- if (NULL == p)
- throw ::std::bad_alloc();
-
- return p;
- }
-
- but some compilers do not compile it if exceptions
- are not enabled, e.g. GCC under Linux and it is
- in general not desired to compile sal with exceptions
- enabled. */
- pointer allocate (size_type n, const void* hint = 0)
- {
- hint = hint; /* avoid warnings */
- return reinterpret_cast<pointer>(
- rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
- }
-
- //-----------------------------------------
- void deallocate (pointer p, size_type /* n */)
- {
- rtl_freeMemory(p);
- }
-
- //-----------------------------------------
- void construct (pointer p, const T& value)
- {
- new ((void*)p)T(value);
- }
-
- //-----------------------------------------
- void destroy (pointer p)
- {
- p->~T();
- }
-};
-
-//######################################################
-// Custom STL allocators must be stateless (see
-// references above) that's why the operators below
-// return always true or false
-
-/** @internal */
-template<class T, class U>
-inline bool operator== (const Allocator<T>&, const Allocator<U>&) SAL_THROW(())
-{
- return true;
-}
-
-/** @internal */
-template<class T, class U>
-inline bool operator!= (const Allocator<T>&, const Allocator<U>&) SAL_THROW(())
-{
- return false;
-}
-
-} /* namespace rtl */
-
-#endif /* INCLUDED_RTL_ALLOCATOR_HXX */
-
diff --git a/sal/inc/rtl/bootstrap.h b/sal/inc/rtl/bootstrap.h
index 98b9dc80bdeb..6eee37ddb2ce 100644
--- a/sal/inc/rtl/bootstrap.h
+++ b/sal/inc/rtl/bootstrap.h
@@ -213,7 +213,7 @@ void SAL_CALL rtl_bootstrap_expandMacros(
an arbitrary, non-NULL value
@param encoded
- non-NULL out parameter, receiving the given value with all occurences of
+ non-NULL out parameter, receiving the given value with all occurrences of
special characters ("$" and "\") escaped
@since UDK 3.2.9
diff --git a/sal/inc/rtl/bootstrap.hxx b/sal/inc/rtl/bootstrap.hxx
index 85da7ec2639e..4b66440a9280 100644
--- a/sal/inc/rtl/bootstrap.hxx
+++ b/sal/inc/rtl/bootstrap.hxx
@@ -145,7 +145,7 @@ namespace rtl
an arbitrary value
@return
- the given value, with all occurences of special characters ("$" and
+ the given value, with all occurrences of special characters ("$" and
"\") escaped
@since UDK 3.2.9
diff --git a/sal/inc/rtl/instance.hxx b/sal/inc/rtl/instance.hxx
index 321bfd7f33ec..1693e11fd102 100644
--- a/sal/inc/rtl/instance.hxx
+++ b/sal/inc/rtl/instance.hxx
@@ -227,10 +227,10 @@ namespace {
Some comments:
For any instantiation of rtl_Instance, at most one call to a create method
- may occur in the program code: Each occurance of a create method within
+ may occur in the program code: Each occurrence of a create method within
the program code is supposed to return a fresh object instance on the
first call, and that same object instance on subsequent calls; but
- independent occurances of create methods are supposed to return
+ independent occurrences of create methods are supposed to return
independent object instances. Since there is a one-to-one correspondence
between object instances and instantiations of rtl_Instance, the
requirement should be clear. One measure to enforce the requirement is
@@ -240,7 +240,7 @@ namespace {
needs a funny "hand coded" prefix "rtl_" instead of a proper namespace
prefix like "::rtl::".
- A known problem with this template is when two occurences of calls to
+ A known problem with this template is when two occurrences of calls to
create methods with identical template arguments appear in one translation
unit. Those two places will share a single object instance. This can be
avoided by using different Init structs (see the above code samples) in
diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 30b9974c4701..8d87c733455d 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -276,10 +276,10 @@ inline double approxAdd(double a, double b)
return a + b;
}
-/** Substract two values (a-b).
+/** Subtract two values (a-b).
If signs are identical and the values are equal according to approxEqual()
- the method returns 0.0 instead of calculating the substraction.
+ the method returns 0.0 instead of calculating the subtraction.
*/
inline double approxSub(double a, double b)
{
diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index e2a027ea4a3c..278375b0abb7 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -1056,7 +1056,7 @@ void SAL_CALL rtl_string_newTrim( rtl_String ** newStr, rtl_String * str ) SAL_T
the number of the token to return, starting at index.
@param cTok
- the character that seperates the tokens.
+ the character that separates the tokens.
@param index
the position at which searching for the token starts. Must not be greater
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 47631fd8c9a0..8c98a3657ab2 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -726,7 +726,7 @@ public:
while ( nIndex >= 0 );
@param token the number of the token to return.
- @param cTok the character which seperate the tokens.
+ @param cTok the character which separate the tokens.
@param index the position at which the token is searched in the
string.
The index must not be greater thanthe length of the
@@ -945,10 +945,10 @@ struct OStringHash
struct CStringEqual
{
bool operator()( const char* p1, const char* p2) const {
- while( *p1)
+ while( *p1 != '\0')
if( *(p1++) != *(p2++))
return false;
- return true;
+ return (*p2 == '\0');
}
};
diff --git a/sal/inc/rtl/tencinfo.h b/sal/inc/rtl/tencinfo.h
index d92954380145..cdb0a934142d 100644
--- a/sal/inc/rtl/tencinfo.h
+++ b/sal/inc/rtl/tencinfo.h
@@ -99,7 +99,7 @@ typedef struct _rtl_TextEncodingInfo
ASCII control codes 0x00--1F are not included here, as they are used for
special purposes in some encodings.
- If an encoding has this property, it is easy to search for occurences of
+ If an encoding has this property, it is easy to search for occurrences of
ASCII characters within strings of this encoding---you do not need to
keep track whether a byte in the range 0x20--7F really represents an
ASCII character or rather is part of some multi-byte character.
diff --git a/sal/inc/rtl/tres.h b/sal/inc/rtl/tres.h
index 40895edb9d68..7a118ba04e32 100644
--- a/sal/inc/rtl/tres.h
+++ b/sal/inc/rtl/tres.h
@@ -53,7 +53,7 @@ typedef struct _rtl_TestResult rtl_TestResult;
typedef void* rtl_funcstate;
typedef void* rtl_cmpstate;
- /* type definitions of function pointers wich can be overloaded */
+ /* type definitions of function pointers which can be overloaded */
typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)(
rtl_TestResult*,
sal_Bool,
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index 2b3be9af78bf..0d7b4a87e33a 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -1418,7 +1418,7 @@ void SAL_CALL rtl_uString_newTrim( rtl_uString ** newStr, rtl_uString * str ) SA
the number of the token to return, starting at index.
@param cTok
- the character that seperates the tokens.
+ the character that separates the tokens.
@param index
the position at which searching for the token starts. Must not be greater
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 183aa8b72f64..b1ed2eb28723 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1095,7 +1095,7 @@ public:
while ( nIndex >= 0 );
@param token the number of the token to return
- @param cTok the character which seperate the tokens.
+ @param cTok the character which separate the tokens.
@param index the position at which the token is searched in the
string.
The index must not be greater than the length of the
diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h
index 9051b6833b07..8180d11e640b 100644
--- a/sal/inc/sal/main.h
+++ b/sal/inc/sal/main.h
@@ -83,7 +83,7 @@ int SAL_CALL main(int argc, char ** argv) \
#define INCLUDED_STDLIB_H
#endif
-/* Sorry but this is neccessary cause HINSTANCE is a typedef that differs (C++ causes an error) */
+/* Sorry but this is necessary cause HINSTANCE is a typedef that differs (C++ causes an error) */
#if 0
diff --git a/sal/inc/systools/win32/StrConvert.h b/sal/inc/systools/win32/StrConvert.h
index aa20000baedc..8f8fb83d0689 100644
--- a/sal/inc/systools/win32/StrConvert.h
+++ b/sal/inc/systools/win32/StrConvert.h
@@ -72,7 +72,7 @@ if( wcStr ) \
calculates the needed length of a corresponding the multi byte string
list for a wide char string list.
- @Param: cp - the code page to use for convertion.
+ @Param: cp - the code page to use for conversion.
wcList - a double '\0' terminated wide char string list.
*/
@@ -82,7 +82,7 @@ int WideCharListGetMultiByteLength( UINT codepage, LPCWSTR wcList );
converts a double '\0' terminated list of wide char strings to a
multi byte string list.
- @Param: cp - the code page to use for convertion.
+ @Param: cp - the code page to use for conversion.
wcList - a double '\0' terminated wide char string list.
mbList - a double '\0' terminated multi byte string list.
dwSize - size of buffer for multi byte string list.
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 1315a878263c..6234a5bca550 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -44,7 +44,7 @@
namespace {
-typedef std::vector<rtl::OString, rtl::Allocator<rtl::OString> > OStringVec;
+typedef std::vector<rtl::OString> OStringVec;
struct StaticDebugBaseAddressFilter
: rtl::StaticWithInit<OStringVec const, StaticDebugBaseAddressFilter> {
diff --git a/sal/osl/os2/file_path_helper.h b/sal/osl/os2/file_path_helper.h
index b6a95ba75ece..d8017ea327af 100644
--- a/sal/osl/os2/file_path_helper.h
+++ b/sal/osl/os2/file_path_helper.h
@@ -155,7 +155,7 @@
/*****************************************
osl_systemPathGetParent
- Replaces the last occurrance of a path
+ Replaces the last occurrence of a path
separator with '\0' and returns the
position where the '/' was replaced
diff --git a/sal/osl/os2/file_path_helper.hxx b/sal/osl/os2/file_path_helper.hxx
index f1fbd4862d13..385fd86d7f7d 100644
--- a/sal/osl/os2/file_path_helper.hxx
+++ b/sal/osl/os2/file_path_helper.hxx
@@ -162,7 +162,7 @@ namespace osl
/*****************************************
systemPathGetParent
- Replaces the last occurrance of a path
+ Replaces the last occurrence of a path
separator with '\0' and returns the
position where the '/' was replaced
diff --git a/sal/osl/os2/file_url.cxx b/sal/osl/os2/file_url.cxx
index e04db43f6057..425b0c47db3d 100644
--- a/sal/osl/os2/file_url.cxx
+++ b/sal/osl/os2/file_url.cxx
@@ -739,7 +739,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
/* adapt index to pTmp */
nIndex += pTmp->length - ustrSystemPath->length;
- /* remove all occurances of '//' */
+ /* remove all occurrences of '//' */
for( nSrcIndex = nIndex + 1; nSrcIndex < pTmp->length; nSrcIndex++ )
{
if( ((sal_Unicode) '/' == pTmp->buffer[nSrcIndex]) && ((sal_Unicode) '/' == pTmp->buffer[nIndex]) )
@@ -913,7 +913,7 @@ oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *ustrFileURL, rt
{
nOffset += nIndex;
- /* break url down in '/' devided tokens tokens */
+ /* break url down in '/' divided tokens tokens */
nIndex = rtl_ustr_indexOfChar_WithLength( ustrFileURL->buffer + nOffset, ustrFileURL->length - nOffset, (sal_Unicode) '/' );
/* copy token to new string */
diff --git a/sal/osl/os2/file_url.h b/sal/osl/os2/file_url.h
index e9010d631b12..c9d4c814a016 100644
--- a/sal/osl/os2/file_url.h
+++ b/sal/osl/os2/file_url.h
@@ -23,7 +23,7 @@
/***************************************************
* Internal header file, declares all functions
- * that are not part of the offical API and are
+ * that are not part of the official API and are
* not defined in the osl header files
**************************************************/
diff --git a/sal/osl/os2/makefile.mk b/sal/osl/os2/makefile.mk
index 4b0e8ad80163..cb2531a8a9ec 100644
--- a/sal/osl/os2/makefile.mk
+++ b/sal/osl/os2/makefile.mk
@@ -38,7 +38,7 @@ MULTITHREAD_OBJ=TRUE
.INCLUDE : settings.mk
# Uncomment the following line if you want to compile with -Wall
-# it disables lots of unnecessary warnings comming from the Win32
+# it disables lots of unnecessary warnings coming from the Win32
# header files (disabling warnings via command line only works with
# MSVC >= 7.x)
#
diff --git a/sal/osl/os2/pipe.cxx b/sal/osl/os2/pipe.cxx
index c12753298279..90df6b9779a2 100644
--- a/sal/osl/os2/pipe.cxx
+++ b/sal/osl/os2/pipe.cxx
@@ -468,7 +468,7 @@ oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe)
sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_Int32 BytesSend= 0;
sal_Int32 BytesToSend= n;
@@ -479,7 +479,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
RetVal= osl_sendPipe(pPipe, pBuffer, BytesToSend);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -495,7 +495,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
sal_Int32 BytesRead= 0;
sal_Int32 BytesToRead= n;
@@ -505,7 +505,7 @@ sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
sal_Int32 RetVal;
RetVal= osl_receivePipe(pPipe, pBuffer, BytesToRead);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/osl/os2/process.c b/sal/osl/os2/process.c
index 185a6ca6a57f..9fcc9bd0f1a3 100644
--- a/sal/osl/os2/process.c
+++ b/sal/osl/os2/process.c
@@ -464,11 +464,11 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName,
OSL_TRACE( "osl_executeProcess with DosExecPgm (args: %s)\n", args );
- /* calculate needed space for environment: since enviroment var search
- is a linear scan of the current enviroment, we place new variables
+ /* calculate needed space for environment: since environment var search
+ is a linear scan of the current environment, we place new variables
before existing ones; so the child will find new definitions before
olders; this doesn't require us to replace existing vars */
- // existing enviroment size
+ // existing environment size
n = 0;
p = environ;
while( *p)
@@ -848,7 +848,7 @@ oslProcessError SAL_CALL osl_getCommandArgs( sal_Char* pszBuffer, sal_uInt32 Max
{
/*
* C-Runtime expects char to be unsigned and so to be
- * preceeded with 00 instead of FF when converting to int
+ * preceded with 00 instead of FF when converting to int
*/
int n = *((unsigned char *) pszCmdLine);
if (! (isspace(n) || (*pszCmdLine == '\0')) )
diff --git a/sal/osl/os2/profile.c b/sal/osl/os2/profile.c
index f8e7874dd167..fb31bd2d169c 100644
--- a/sal/osl/os2/profile.c
+++ b/sal/osl/os2/profile.c
@@ -1923,7 +1923,7 @@ static osl_TProfileImpl* acquireProfile(oslProfile Profile, sal_Bool bWriteable)
if ( pProfile->m_strFileName != 0 && pProfile->m_strFileName->buffer[0] != 0 )
FileURLToPath( pszFilename, PATH_MAX, pProfile->m_strFileName );
- /* hack: usualy you have a specific HAB, but NULL works here... */
+ /* hack: usually you have a specific HAB, but NULL works here... */
pProfile->m_hIni = PrfOpenProfile(NULL, (PCSZ)pszFilename);
if (! pProfile->m_hIni)
return (NULL);
@@ -2124,7 +2124,7 @@ static sal_Bool lookupProfile(const sal_Char *pszPath, const sal_Char *pszFile,
if (osl_getExecutableFile(Path, sizeof(Path)) != osl_Process_E_None)
return (sal_False);
- /* seperate path from filename */
+ /* separate path from filename */
if ((pChr = strrchr(Path, '\\')) == NULL)
if ((pChr = strrchr(Path, ':')) == NULL)
return (sal_False);
diff --git a/sal/osl/os2/socket.c b/sal/osl/os2/socket.c
index 3066859bb800..f0cf028e4e69 100644
--- a/sal/osl/os2/socket.c
+++ b/sal/osl/os2/socket.c
@@ -782,7 +782,7 @@ oslSocketResult SAL_CALL osl_getAddrOfSocketAddr( oslSocketAddr pAddr, sal_Seque
/** try to figure out a full-qualified hostname, by adding the current domain
as given by the domainname program to the given hostname.
- This function MUST NOT call gethostbyname since pHostName allready points
+ This function MUST NOT call gethostbyname since pHostName already points
to data returned by gethostname and would be garbled: use gethostname_r
instead!
*/
@@ -2492,7 +2492,7 @@ sal_Int32 SAL_CALL osl_readSocket (
OSL_ASSERT( pSocket);
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
while (BytesToRead > 0)
{
sal_Int32 RetVal;
@@ -2501,7 +2501,7 @@ sal_Int32 SAL_CALL osl_readSocket (
BytesToRead,
osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -2521,7 +2521,7 @@ sal_Int32 SAL_CALL osl_readSocket (
sal_Int32 SAL_CALL osl_writeSocket(
oslSocket pSocket, const void *pBuffer, sal_Int32 n )
{
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_uInt32 BytesSend= 0;
sal_uInt32 BytesToSend= n;
sal_uInt8 *Ptr = ( sal_uInt8 * )pBuffer;
@@ -2534,7 +2534,7 @@ sal_Int32 SAL_CALL osl_writeSocket(
RetVal= osl_sendSocket( pSocket,Ptr,BytesToSend,osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/osl/os2/system.h b/sal/osl/os2/system.h
index a815659a1a0a..6d8d204d6008 100644
--- a/sal/osl/os2/system.h
+++ b/sal/osl/os2/system.h
@@ -362,7 +362,7 @@ char *macxp_tempnam( const char *tmpdir, const char *prefix );
#elif defined _BIG_ENDIAN_OO
# define _OSL_LITENDIAN
#else
-# error undetermined endianess
+# error undetermined endianness
#endif
#else
#if defined _LITTLE_ENDIAN
@@ -370,7 +370,7 @@ char *macxp_tempnam( const char *tmpdir, const char *prefix );
#elif defined _BIG_ENDIAN
# define _OSL_LITENDIAN
#else
-# error undetermined endianess
+# error undetermined endianness
#endif
#endif
diff --git a/sal/osl/unx/asm/interlck_sparc.s b/sal/osl/unx/asm/interlck_sparc.s
index 68fa1197394d..edf9884444dd 100644
--- a/sal/osl/unx/asm/interlck_sparc.s
+++ b/sal/osl/unx/asm/interlck_sparc.s
@@ -38,7 +38,7 @@
* bv9 = 1 use sparcv9/sparcv8plus "cas" (no spinlock)
*
* 32 bit mode without v8 support (implies v8plus) or 64 bit mode:
- * No need (nor the possibilty) to call osl_InterlockedCountSetV9(),
+ * No need (nor the possibility) to call osl_InterlockedCountSetV9(),
* sparcv9 mode is implied. Assemble with -xarch=v8plus (32 bit) or
* -xarch=v9 (64 bit).
*
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 7d11179aa2aa..e20c5b71a8b7 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -188,7 +188,7 @@ oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *ustrFileURL, rt
{
nOffset += nIndex;
- /* break url down in '/' devided tokens tokens */
+ /* break url down in '/' divided tokens tokens */
nIndex = rtl_ustr_indexOfChar_WithLength( ustrFileURL->buffer + nOffset, ustrFileURL->length - nOffset, (sal_Unicode) '/' );
/* copy token to new string */
@@ -368,7 +368,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
/* adapt index to pTmp */
nIndex += pTmp->length - ustrSystemPath->length;
- /* remove all occurances of '//' */
+ /* remove all occurrences of '//' */
for( nSrcIndex = nIndex + 1; nSrcIndex < pTmp->length; nSrcIndex++ )
{
if( ((sal_Unicode) '/' == pTmp->buffer[nSrcIndex]) && ((sal_Unicode) '/' == pTmp->buffer[nIndex]) )
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c
index 6f362c25a5ef..eb2e5fc49dd4 100644
--- a/sal/osl/unx/pipe.c
+++ b/sal/osl/unx/pipe.c
@@ -535,7 +535,7 @@ oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe)
sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_Int32 BytesSend= 0;
sal_Int32 BytesToSend= n;
@@ -546,7 +546,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
RetVal= osl_sendPipe(pPipe, pBuffer, BytesToSend);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -562,7 +562,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
sal_Int32 BytesRead= 0;
sal_Int32 BytesToRead= n;
@@ -572,7 +572,7 @@ sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
sal_Int32 RetVal;
RetVal= osl_receivePipe(pPipe, pBuffer, BytesToRead);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c
index 343df63a6db8..dd07d4effa21 100644
--- a/sal/osl/unx/process.c
+++ b/sal/osl/unx/process.c
@@ -1445,7 +1445,7 @@ static int is_timeout(const struct timeval* tend)
}
/**********************************************
- kill(pid, 0) is usefull for checking if a
+ kill(pid, 0) is useful for checking if a
process is still alive, but remember that
kill even returns 0 if the process is already
a zombie.
diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index 9a0ce703838a..1112764f9f5f 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -130,7 +130,7 @@ plan to have the new handler use this signal*/
{ SIGWINCH, ACT_IGNORE, NULL }, /* window size change */
{ SIGURG, ACT_EXIT, NULL }, /* urgent socket condition */
#ifdef SIGPOLL
- { SIGPOLL, ACT_EXIT, NULL }, /* pollable event occured */
+ { SIGPOLL, ACT_EXIT, NULL }, /* pollable event occurred */
#endif
{ SIGSTOP, ACT_SYSTEM, NULL }, /* stop (cannot be caught or ignored) */
{ SIGTSTP, ACT_SYSTEM, NULL }, /* user stop requested from tty */
@@ -252,7 +252,7 @@ static sal_Bool InitSignal()
/* Initialize the rest of the signals */
for (i = 0; i < NoSignals; i++)
{
- /* hack: stomcatd is attaching JavaVM wich dont work with an sigaction(SEGV) */
+ /* hack: stomcatd is attaching JavaVM which dont work with an sigaction(SEGV) */
if ((bSetSEGVHandler || Signals[i].Signal != SIGSEGV)
&& (bSetWINCHHandler || Signals[i].Signal != SIGWINCH)
&& (bSetILLHandler || Signals[i].Signal != SIGILL))
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index 0c640c897e89..a55d759f1ee0 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -782,7 +782,7 @@ oslSocketResult SAL_CALL osl_getAddrOfSocketAddr( oslSocketAddr pAddr, sal_Seque
/** try to figure out a full-qualified hostname, by adding the current domain
as given by the domainname program to the given hostname.
- This function MUST NOT call gethostbyname since pHostName allready points
+ This function MUST NOT call gethostbyname since pHostName already points
to data returned by gethostname and would be garbled: use gethostname_r
instead!
*/
@@ -2454,7 +2454,7 @@ sal_Int32 SAL_CALL osl_readSocket (
OSL_ASSERT( pSocket);
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
while (BytesToRead > 0)
{
sal_Int32 RetVal;
@@ -2463,7 +2463,7 @@ sal_Int32 SAL_CALL osl_readSocket (
BytesToRead,
osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -2483,7 +2483,7 @@ sal_Int32 SAL_CALL osl_readSocket (
sal_Int32 SAL_CALL osl_writeSocket(
oslSocket pSocket, const void *pBuffer, sal_Int32 n )
{
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_uInt32 BytesSend= 0;
sal_uInt32 BytesToSend= n;
sal_uInt8 *Ptr = ( sal_uInt8 * )pBuffer;
@@ -2496,7 +2496,7 @@ sal_Int32 SAL_CALL osl_writeSocket(
RetVal= osl_sendSocket( pSocket,Ptr,BytesToSend,osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index e85ee99afd10..beaaca3e2764 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -345,7 +345,7 @@ int macxp_resolveAlias(char *path, int buflen);
#elif defined _BIG_ENDIAN_OO
# define _OSL_LITENDIAN
#else
-# error undetermined endianess
+# error undetermined endianness
#endif
#else
#if defined _LITTLE_ENDIAN
@@ -353,7 +353,7 @@ int macxp_resolveAlias(char *path, int buflen);
#elif defined _BIG_ENDIAN
# define _OSL_LITENDIAN
#else
-# error undetermined endianess
+# error undetermined endianness
#endif
#endif
diff --git a/sal/osl/w32/MAKEFILE.MK b/sal/osl/w32/MAKEFILE.MK
index 2a60901ab5f3..8e84d6fa3b70 100644
--- a/sal/osl/w32/MAKEFILE.MK
+++ b/sal/osl/w32/MAKEFILE.MK
@@ -38,7 +38,7 @@ MULTITHREAD_OBJ=TRUE
.INCLUDE : settings.mk
# Uncomment the following line if you want to compile with -Wall
-# it disables lots of unnecessary warnings comming from the Win32
+# it disables lots of unnecessary warnings coming from the Win32
# header files (disabling warnings via command line only works with
# MSVC >= 7.x)
#
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index d73b5b5bd454..44b5b19861e1 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -515,7 +515,7 @@ static oslFileError osl_openLocalRoot(
ZeroMemory( pDirImpl, sizeof(Directory_Impl) );
rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strSysPath );
- /* Append backslash if neccessary */
+ /* Append backslash if necessary */
/* @@@ToDo
use function ensure backslash
@@ -580,7 +580,7 @@ static oslFileError SAL_CALL osl_openFileDirectory(
ZeroMemory( pDirImpl, sizeof(Directory_Impl) );
rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strDirectoryPath );
- /* Append backslash if neccessary */
+ /* Append backslash if necessary */
/* @@@ToDo
use function ensure backslash
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index 36bae58e273d..8eea0c194972 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -1004,7 +1004,7 @@ oslFileError SAL_CALL osl_searchFileURL(
LPCTSTR lpszSearchFile = reinterpret_cast<LPCTSTR>(ustrSysPath->buffer);
/* Allocate space for buffer according to previous returned count of required chars */
- /* +1 is not neccessary if we follow MSDN documentation but for robustness we do so */
+ /* +1 is not necessary if we follow MSDN documentation but for robustness we do so */
nBufferLength = dwResult + 1;
lpBuffer = lpBuffer ?
reinterpret_cast<LPTSTR>(rtl_reallocateMemory(lpBuffer, nBufferLength * sizeof(TCHAR))) :
diff --git a/sal/osl/w32/interlck.c b/sal/osl/w32/interlck.c
index 836d37ce48d1..d93b64b64373 100644
--- a/sal/osl/w32/interlck.c
+++ b/sal/osl/w32/interlck.c
@@ -33,7 +33,7 @@ extern int osl_isSingleCPU;
Instead there is only returned a value greater than zero is the increment
result is greater than zero, but not the the result of the addition.
For Windows NT the native function could be used, because the correct result
- is returned. Beacuse of simpler code maintance and performace reasons we use
+ is returned. Because of simpler code maintenance and performace reasons we use
on every x86-Windows-Platform the inline assembler implementation.
*/
diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx
index 7fa52e49113b..2d1c0f34c670 100644
--- a/sal/osl/w32/module.cxx
+++ b/sal/osl/w32/module.cxx
@@ -74,7 +74,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod
//on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit)
if (hInstance == NULL && Module->length > 260)
{
- std::vector<WCHAR, rtl::Allocator<WCHAR> > vec(Module->length + 1);
+ std::vector<WCHAR> vec(Module->length + 1);
DWORD len = GetShortPathNameW(reinterpret_cast<LPCWSTR>(Module->buffer),
&vec[0], Module->length + 1);
if (len )
@@ -310,7 +310,7 @@ typedef BOOL (WINAPI *SymGetModuleInfo_PROC)(
PIMAGEHLP_MODULE ModuleInfo
);
-/* Seems that IMAGEHLP.DLL is always availiable on NT 4. But MSDN from Platform SDK says Win 2K is required. MSDN from VS 6.0a says
+/* Seems that IMAGEHLP.DLL is always available on NT 4. But MSDN from Platform SDK says Win 2K is required. MSDN from VS 6.0a says
it's O.K on NT 4 ???!!!
BTW: We are using ANSI function because not all version of IMAGEHLP.DLL contain Unicode support
*/
@@ -421,7 +421,7 @@ typedef BOOL (WINAPI *GetModuleInformation_PROC)(
#define bufsizeof(buffer) (sizeof(buffer) / sizeof((buffer)[0]))
-/* This version can fail because PSAPI.DLL is not always part of NT 4 despite MSDN Libary 6.0a say so */
+/* This version can fail because PSAPI.DLL is not always part of NT 4 despite MSDN Library 6.0a say so */
static sal_Bool SAL_CALL _osl_addressGetModuleURL_NT( void *pv, rtl_uString **pustrURL )
{
diff --git a/sal/osl/w32/nlsupport.c b/sal/osl/w32/nlsupport.c
index ed33323163f5..8abbcef8d6b2 100644
--- a/sal/osl/w32/nlsupport.c
+++ b/sal/osl/w32/nlsupport.c
@@ -75,7 +75,7 @@ BOOL CALLBACK EnumLocalesProcA( LPSTR lpLocaleStringA )
/*
get the ISO language code for this locale
- remeber: we call the GetLocaleInfoW function
+ remember: we call the GetLocaleInfoW function
because the ansi version of this function returns
an error under WinNT/2000 when called with an
unicode only lcid
diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx
index 3e11371da0c2..630602913dd7 100644
--- a/sal/osl/w32/path_helper.hxx
+++ b/sal/osl/w32/path_helper.hxx
@@ -30,7 +30,7 @@
#include "path_helper.h"
#include <rtl/ustring.hxx>
-#include <rtl/allocator.hxx>
+#include <rtl/alloc.h>
namespace osl
{
diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c
index 7ffc05516eb2..33f1282ef2a8 100644
--- a/sal/osl/w32/pipe.c
+++ b/sal/osl/w32/pipe.c
@@ -561,7 +561,7 @@ sal_Int32 SAL_CALL osl_sendPipe(oslPipe pPipe,
sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_Int32 BytesSend= 0;
sal_Int32 BytesToSend= n;
@@ -572,7 +572,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
RetVal= osl_sendPipe(pPipe, pBuffer, BytesToSend);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -588,7 +588,7 @@ sal_Int32 SAL_CALL osl_writePipe( oslPipe pPipe, const void *pBuffer , sal_Int32
sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
{
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
sal_Int32 BytesRead= 0;
sal_Int32 BytesToRead= n;
@@ -598,7 +598,7 @@ sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n )
sal_Int32 RetVal;
RetVal= osl_receivePipe(pPipe, pBuffer, BytesToRead);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index dd3a22876f81..8188449a2483 100644
--- a/sal/osl/w32/process.cxx
+++ b/sal/osl/w32/process.cxx
@@ -516,7 +516,7 @@ static sal_Bool ReadPipe(oslPipe hPipe,
sal_Int32* nBytes)
{
*nBytes = osl_receivePipe(hPipe, pBuffer, BytesToRead);
- OSL_TRACE("tried to recieve %d, recieved %d.\n",
+ OSL_TRACE("tried to receive %d, received %d.\n",
BytesToRead, *nBytes);
return (sal_Bool)((*nBytes >= 0) && (osl_getLastPipeError(hPipe) == osl_Pipe_E_None));
}
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index ae2de9be2993..822a68131de0 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -43,7 +43,6 @@
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include "secimpl.h"
-#include "rtl/allocator.hxx"
#include <osl/file.hxx>
#include <list>
@@ -63,11 +62,11 @@ const rtl::OUString QUOTE = rtl::OUString::createFromAscii("\"");
namespace /* private */
{
//#################################################
- typedef std::list<rtl::OUString, rtl::Allocator<rtl::OUString> > string_container_t;
+ typedef std::list<rtl::OUString> string_container_t;
typedef string_container_t::iterator string_container_iterator_t;
typedef string_container_t::const_iterator string_container_const_iterator_t;
typedef std::pair<string_container_iterator_t, string_container_iterator_t> iterator_pair_t;
- typedef std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > environment_container_t;
+ typedef std::vector<sal_Unicode > environment_container_t;
//#################################################
/* Function object that compares two strings that are
@@ -307,7 +306,7 @@ namespace /* private */
rtl::OUString ret(path);
if (path.getLength() > 260)
{
- std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(path.getLength() + 1);
+ std::vector<sal_Unicode> vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(path.getStr()), reinterpret_cast<LPWSTR>(&vec[0]), path.getLength() + 1);
@@ -316,8 +315,7 @@ namespace /* private */
&& extension.getLength())
{
const rtl::OUString extPath(path + extension);
- std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec2(
- extPath.getLength() + 1);
+ std::vector<sal_Unicode > vec2( extPath.getLength() + 1);
const DWORD len2 = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(extPath.getStr()), reinterpret_cast<LPWSTR>(&vec2[0]), extPath.getLength() + 1);
ret = rtl::OUString(&vec2[0], len2);
@@ -622,7 +620,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
}
}
- /* if an error occured we have to close the server side pipe ends too */
+ /* if an error occurred we have to close the server side pipe ends too */
if (hInputWrite)
CloseHandle(hInputWrite);
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index c568782ec901..b108657a4182 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -2497,7 +2497,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
rtl_uString_release(strTmp);
- /* seperate path from filename */
+ /* separate path from filename */
if ((nPos = rtl_ustr_lastIndexOfChar(strExecutable->buffer, L'\\')) == -1)
{
if ((nPos = rtl_ustr_lastIndexOfChar(strExecutable->buffer, L':')) == -1)
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index 20fd39048c0b..a3e3c189528b 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -246,7 +246,7 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security)
{
if (Security != NULL)
{
- /* ts: on Window 95 systems any user seems to be an adminstrator */
+ /* ts: on Window 95 systems any user seems to be an administrator */
if (!isWNT())
{
return(sal_True);
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 6514ea37f01b..af369787776a 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -1561,7 +1561,7 @@ sal_Int32 SAL_CALL osl_readSocket( oslSocket pSocket, void *pBuffer, sal_Int32 n
OSL_ASSERT( pSocket);
- /* loop until all desired bytes were read or an error occured */
+ /* loop until all desired bytes were read or an error occurred */
sal_uInt32 BytesRead= 0;
sal_uInt32 BytesToRead= n;
while (BytesToRead > 0)
@@ -1572,7 +1572,7 @@ sal_Int32 SAL_CALL osl_readSocket( oslSocket pSocket, void *pBuffer, sal_Int32 n
BytesToRead,
osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
@@ -1593,7 +1593,7 @@ sal_Int32 SAL_CALL osl_writeSocket( oslSocket pSocket, const void *pBuffer, sal_
{
OSL_ASSERT( pSocket );
- /* loop until all desired bytes were send or an error occured */
+ /* loop until all desired bytes were send or an error occurred */
sal_uInt32 BytesSend= 0;
sal_uInt32 BytesToSend= n;
sal_uInt8 *Ptr = ( sal_uInt8 * )pBuffer;
@@ -1603,7 +1603,7 @@ sal_Int32 SAL_CALL osl_writeSocket( oslSocket pSocket, const void *pBuffer, sal_
RetVal= osl_sendSocket( pSocket,Ptr,BytesToSend,osl_Socket_MsgNormal);
- /* error occured? */
+ /* error occurred? */
if(RetVal <= 0)
{
break;
diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index ddc6b105fde1..4b568a8c7c73 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -1,4 +1,4 @@
-sa sal : xml2cmp stlport external BOOST:boost NULL
+sa sal : xml2cmp stlport external BOOST:boost GTEST:gtest NULL
sa sal usr1 - all sa_mkout NULL
sa sal\inc nmake - all sa_inc NULL
sa sal\typesconfig nmake - u sa_tc sa_inc NULL
@@ -10,15 +10,18 @@ sa sal\systools\win32\kill nmake - n sa_kill sa_uwinapi.n sa_inc NULL
sa sal\systools\win32\onlineupdate nmake - n sa_onlineupdate sa_uwinapi.n sa_inc NULL
sa sal\osl\w32 nmake - n sa_osln sa_inc NULL
sa sal\osl\os2 nmake - p sa_oslp sa_inc NULL
-sa sal\qa nmake - all sa_qa sa_util NULL
+sa sal\qa nmake - all sa_qa sa_util sa_cpprt.u NULL
sa sal\osl\unx nmake - u sa_oslu sa_tc.u sa_inc NULL
sa sal\osl\all nmake - all sa_oslall sa_tc.u sa_inc NULL
sa sal\util nmake - all sa_util sa_tc.u sa_oslall sa_uwinapi.n sa_kill.n sa_onlineupdate.n sa_osln.n sa_oslp.p sa_oslu.u sa_rtl sa_textenc NULL
+sa sal\qa\sal nmake - all sa_qa_sal sa_util sa_cpprt.u NULL
+sa sal\qa\osl\condition nmake - all sa_qa_osl_condition sa_util sa_cpprt.u NULL
+sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_util sa_cpprt.u NULL
+
sa sal\cppunittester nmake - all sa_cppunittester sa_cpprt.u sa_util NULL
sa sal\qa\ByteSequence nmake - all sa_qa_ByteSequence sa_cppunittester sa_util NULL
sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util NULL
sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL
-sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL
sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL
sa sal\qa\osl\setthreadname nmake - all sa_qa_osl_setthreadname sa_cppunittester sa_util NULL
sa sal\qa\rtl\math nmake - all sa_qa_rtl_math sa_cppunittester sa_util NULL
diff --git a/sal/qa/buildall.pl b/sal/qa/buildall.pl
index 9f54718d1d78..a1d20654d614 100644
--- a/sal/qa/buildall.pl
+++ b/sal/qa/buildall.pl
@@ -154,7 +154,7 @@ sub initEnvironment()
$g_sTempDir = $ENV{TMP} ? "$ENV{TMP}${FS}" : "${FS}tmp${FS}";
last SWITCH;
}
- print STDERR "buildall.pl: unkown platform\n";
+ print STDERR "buildall.pl: unknown platform\n";
exit(1);
}
}
@@ -266,7 +266,7 @@ sub giveOutFailures($$)
if ($nFailures > 0)
{
# extra return for a better output
- print "\nFailures occured: $nFailures\n";
+ print "\nFailures occurred: $nFailures\n";
print "The whole output can be found in $sFailureFile\n";
print "\n";
@@ -292,7 +292,7 @@ sub runASingleTest($$)
my $sLogFile = $sLogPath . "/" . $sTarget . ".out";
# due to the fact, a library name in one project is distinct, we should remember all already run through libraries and
- # supress same libraries, if they occur one more.
+ # suppress same libraries, if they occur one more.
if (exists $libraryRunThrough{getLibName($sTarget)})
{
@@ -482,7 +482,7 @@ $/)
if ($nGlobalFailures > 0)
{
- print "\nFailures over all occured: $nGlobalFailures\n";
+ print "\nFailures over all occurred: $nGlobalFailures\n";
print "\nPASSED FAILED.\n";
}
else
diff --git a/sal/qa/helper/gcov/deprecated.txt b/sal/qa/helper/gcov/deprecated.txt
index 036dcf2b3e2f..76099c3ae223 100644
--- a/sal/qa/helper/gcov/deprecated.txt
+++ b/sal/qa/helper/gcov/deprecated.txt
@@ -58,7 +58,7 @@
# B. untested functions:
# functions need Client/Server model and blocking mode of transmission. some of the functions
-# can not run through on testshl2 env while the same code can run successfully in normal seperate
+# can not run through on testshl2 env while the same code can run successfully in normal separate
# files.
# 1) in DatagramSocket class:
# osl_receiveFromSocket;
@@ -210,7 +210,7 @@
# LLA:
# marked as deprecated, due to the fact there is no access from outside
-# so this functions are not really accessable
+# so this functions are not really accessible
# They are used in rtl/source/locale.c
rtl_hashentry_destroy;
rtl_hashfunc;
diff --git a/sal/qa/osl/condition/makefile.mk b/sal/qa/osl/condition/makefile.mk
index 2c8c8e996791..0b80bedbd0ea 100644
--- a/sal/qa/osl/condition/makefile.mk
+++ b/sal/qa/osl/condition/makefile.mk
@@ -24,7 +24,7 @@
PRJ=..$/..$/..
PRJNAME=sal
-TARGET=qa_osl_condition
+TARGET=sal_ut_osl_condition
ENABLE_EXCEPTIONS=TRUE
@@ -35,22 +35,19 @@ ENABLE_EXCEPTIONS=TRUE
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Condition by codegen.pl
-SHL1OBJS= \
- $(SLO)$/osl_Condition.obj
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
-SHL1TARGET= osl_Condition
-SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
+.ELSE
-SHL1IMPLIB= i$(SHL1TARGET)
+APP1OBJS = $(OBJ)/osl_Condition.obj
+APP1RPATH = NONE
+APP1STDLIBS = $(GTESTLIB) $(SALLIB)
+APP1TARGET = sal_ut_osl_condition
+APP1TEST = enabled
+#APP1TEST = disabled
-DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-# auto generated Target:Condition
-# END ------------------------------------------------------------------
+.INCLUDE: target.mk
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
+.ENDIF
diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx
index 0e5f080d00eb..7231d0538d44 100644
--- a/sal/qa/osl/condition/osl_Condition.cxx
+++ b/sal/qa/osl/condition/osl_Condition.cxx
@@ -29,6 +29,12 @@
//------------------------------------------------------------------------
#include <osl_Condition_Const.h>
+#ifdef WNT
+#include <Windows.h>
+#endif
+
+#include "gtest/gtest.h"
+
using namespace osl;
using namespace rtl;
@@ -41,8 +47,8 @@ using namespace rtl;
*/
inline void printBool( sal_Bool bOk )
{
- t_print("#printBool# " );
- ( sal_True == bOk ) ? t_print("TRUE!\n" ): t_print("FALSE!\n" );
+ printf("#printBool# " );
+ ( sal_True == bOk ) ? printf("TRUE!\n" ): printf("FALSE!\n" );
}
/** print a UNI_CODE String.
@@ -51,9 +57,9 @@ inline void printUString( const ::rtl::OUString & str )
{
rtl::OString aString;
- t_print("#printUString_u# " );
+ printf("#printUString_u# " );
aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
- t_print("%s\n", aString.getStr( ) );
+ printf("%s\n", aString.getStr( ) );
}
/** wait _nSec seconds.
@@ -61,7 +67,7 @@ inline void printUString( const ::rtl::OUString & str )
void thread_sleep( sal_Int32 _nSec )
{
/// print statement in thread process must use fflush() to force display.
- t_print("# wait %d seconds. ", _nSec );
+ printf("# wait %d seconds. ", _nSec );
fflush( stdout );
#ifdef WNT //Windows
@@ -70,7 +76,7 @@ void thread_sleep( sal_Int32 _nSec )
#if ( defined UNX ) || ( defined OS2 ) //Unix
sleep( _nSec );
#endif
- t_print("# done\n" );
+ printf("# done\n" );
}
enum ConditionType
@@ -121,260 +127,175 @@ protected:
namespace osl_Condition
{
-
/** testing the method:
Condition()
*/
- class ctors : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void ctors_001( )
- {
- ::osl::Condition aCond;
- bRes = aCond.check( );
+ TEST(Sal_Test_Condition, ctors_001) {
+ ::osl::Condition aCond;
+ sal_Bool bRes = aCond.check( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: create a condition its initial check state should be sal_False.",
- sal_False == bRes );
- }
-
- void ctors_002( )
- {
- ::osl::Condition aCond;
- aCond.set( );
- bRes = aCond.check( );
+ // #test comment#: create a condition its initial check state should be sal_False.
+ ASSERT_TRUE( !bRes );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: create a condition and set it.",
- sal_True == bRes );
- }
+ TEST(Sal_Test_Condition, ctors_002) {
+ ::osl::Condition aCond;
+ aCond.set( );
+ sal_Bool bRes = aCond.check( );
- CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
- CPPUNIT_TEST( ctors_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class ctors
+ // #test comment#: create a condition and set it.
+ ASSERT_TRUE( bRes );
+ }
/** testing the method:
void set()
*/
- class set : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1, bRes2;
+ TEST(Sal_Test_Condition, set_001) {
+ ::osl::Condition aCond;
+ aCond.set( );
+ sal_Bool bRes = aCond.check( );
- void set_001( )
- {
- ::osl::Condition aCond;
- aCond.set( );
- bRes = aCond.check( );
+ // #test comment#: check state should be sal_True after set.
+ ASSERT_TRUE( bRes );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: check state should be sal_True after set.",
- sal_True == bRes );
- }
+ TEST(Sal_Test_Condition, set_002) {
+ ::osl::Condition aCond;
+ ConditionThread myThread1( aCond, thread_type_wait );
+ myThread1.create();
+ sal_Bool bRes = myThread1.isRunning( );
- void set_002( )
- {
- ::osl::Condition aCond;
- ConditionThread myThread1( aCond, thread_type_wait );
- myThread1.create();
- bRes = myThread1.isRunning( );
-
- ConditionThread myThread2( aCond, thread_type_set );
- myThread2.create();
- thread_sleep(1);
- bRes1 = myThread1.isRunning( );
- bRes2 = aCond.check( );
-
- myThread1.join( );
- myThread2.join( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: use one thread to set the condition in order to release another thread.",
- sal_True == bRes && sal_False == bRes1 && sal_True == bRes2 );
- }
+ ConditionThread myThread2( aCond, thread_type_set );
+ myThread2.create();
+ thread_sleep(1);
+ sal_Bool bRes1 = myThread1.isRunning( );
+ sal_Bool bRes2 = aCond.check( );
+ myThread1.join( );
+ myThread2.join( );
- CPPUNIT_TEST_SUITE( set );
- CPPUNIT_TEST( set_001 );
- CPPUNIT_TEST( set_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class set
+ // #test comment#: use one thread to set the condition in order to release another thread."
+ ASSERT_TRUE( bRes && !bRes1 && bRes2 );
+ }
/** testing the method:
void reset()
*/
- class reset : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1, bRes2;
-
- void reset_001( )
- {
- ::osl::Condition aCond;
- aCond.reset( );
+ TEST(Sal_Test_Condition, reset_001) {
+ ::osl::Condition aCond;
+ aCond.reset( );
- ConditionThread myThread( aCond, thread_type_wait );
- myThread.create();
- bRes = myThread.isRunning( );
- bRes2 = aCond.check( );
+ ConditionThread myThread( aCond, thread_type_wait );
+ myThread.create();
+ sal_Bool bRes = myThread.isRunning( );
+ sal_Bool bRes2 = aCond.check( );
- aCond.set( );
- myThread.join( );
- bRes1 = myThread.isRunning( );
+ aCond.set( );
+ myThread.join( );
+ sal_Bool bRes1 = myThread.isRunning( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: wait will cause a reset thread block, use set to release it.",
- sal_True == bRes && sal_False == bRes1 && sal_False == bRes2 );
- }
+ // #test comment#: wait will cause a reset thread block, use set to release it.
+ ASSERT_TRUE( bRes && !bRes1 && !bRes2 );
+ }
- void reset_002( )
- {
- ::osl::Condition aCond;
- aCond.reset( );
- bRes = aCond.check( );
- aCond.set( );
- bRes1 = aCond.check( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: create a condition and reset/set it.",
- ( sal_False == bRes && sal_True == bRes1 ) );
- }
+ TEST(Sal_Test_Condition, reset_002) {
+ ::osl::Condition aCond;
+ aCond.reset( );
+ sal_Bool bRes = aCond.check( );
+ aCond.set( );
+ sal_Bool bRes1 = aCond.check( );
- CPPUNIT_TEST_SUITE( reset );
- CPPUNIT_TEST( reset_001 );
- CPPUNIT_TEST( reset_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class reset
+ // #test comment#: create a condition and reset/set it.
+ ASSERT_TRUE( sal_False == bRes && sal_True == bRes1 );
+ }
/** testing the method:
Result wait(const TimeValue *pTimeout = 0)
*/
- class wait : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1, bRes2;
- TimeValue *tv1;
+ TEST(Sal_Test_Condition, wait_001) {
+ TimeValue tv1 = {1,0};
- void setUp( )
- {
- tv1 = (TimeValue*)malloc(sizeof(TimeValue));
- tv1->Seconds = 1;
+ ::osl::Condition cond1;
+ ::osl::Condition cond2;
+ ::osl::Condition cond3;
- }
+ cond1.set();
+ cond2.set();
- void tearDown( )
- {
- free( tv1 );
- }
-
-
- void wait_001( )
- {
- ::osl::Condition cond1;
- ::osl::Condition cond2;
- ::osl::Condition cond3;
-
- cond1.set();
- cond2.set();
-
-osl::Condition::Result r1=cond1.wait(tv1);
-osl::Condition::Result r2=cond2.wait();
-osl::Condition::Result r3=cond3.wait(tv1);
-fprintf(stderr,"%d %d %d\n",r1,r2,r3);
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test three types of wait.",
- (cond1.wait(tv1) == ::osl::Condition::result_ok) &&
- (cond2.wait() == ::osl::Condition::result_ok) &&
- (cond3.wait(tv1) == ::osl::Condition::result_timeout) );
+ osl::Condition::Result r1=cond1.wait(&tv1);
+ osl::Condition::Result r2=cond2.wait();
+ osl::Condition::Result r3=cond3.wait(&tv1);
+ fprintf(stderr,"%d %d %d\n",r1,r2,r3);
- }
+ // #test comment#: test three types of wait.
+ ASSERT_TRUE( cond1.wait(&tv1) == ::osl::Condition::result_ok );
+ ASSERT_TRUE( cond2.wait() == ::osl::Condition::result_ok );
+ ASSERT_TRUE( cond3.wait(&tv1) == ::osl::Condition::result_timeout );
+ }
- void wait_002( )
- {
- ::osl::Condition aCond;
- ::osl::Condition::Result wRes, wRes1;
+ TEST(Sal_Test_Condition, wait_002) {
+ TimeValue tv1 = {1,0};
- aCond.reset( );
- bRes = aCond.check( );
- wRes = aCond.wait( tv1 );
+ ::osl::Condition aCond;
+ ::osl::Condition::Result wRes, wRes1;
- aCond.set( );
- wRes1 = aCond.wait( tv1 );
- bRes1 = aCond.check( );
+ aCond.reset( );
+ sal_Bool bRes = aCond.check( );
+ wRes = aCond.wait( &tv1 );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: wait a condition after set/reset.",
- ( sal_False == bRes ) && ( sal_True == bRes1 ) &&
- ( ::osl::Condition::result_timeout == wRes ) &&
- ( ::osl::Condition::result_ok == wRes1 ) );
- }
+ aCond.set( );
+ wRes1 = aCond.wait( &tv1 );
+ sal_Bool bRes1 = aCond.check( );
- CPPUNIT_TEST_SUITE( wait );
- CPPUNIT_TEST( wait_001 );
- CPPUNIT_TEST( wait_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class wait
+ // #test comment#: wait a condition after set/reset.
+ ASSERT_TRUE( !bRes );
+ ASSERT_TRUE( bRes1 );
+ ASSERT_TRUE( ::osl::Condition::result_timeout == wRes );
+ ASSERT_TRUE( ::osl::Condition::result_ok == wRes1 );
+ }
/** testing the method:
sal_Bool check()
*/
- class check : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1, bRes2;
-
- void check_001( )
- {
- ::osl::Condition aCond;
-
- aCond.reset( );
- bRes = aCond.check( );
- aCond.set( );
- bRes1 = aCond.check( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: check the condition states.",
- ( sal_False == bRes && sal_True == bRes1 ) );
- }
-
- void check_002( )
- {
- ::osl::Condition aCond;
- aCond.reset( );
-
- ConditionThread myThread( aCond, thread_type_set );
- myThread.create( );
- myThread.join( );
- bRes = aCond.check( );
-
- ConditionThread myThread1( aCond, thread_type_reset );
- myThread1.create( );
- myThread1.join( );
- bRes1 = aCond.check( );
+ TEST(Sal_Test_Condition, check_001) {
+ ::osl::Condition aCond;
+ aCond.reset( );
+ sal_Bool bRes = aCond.check( );
+ aCond.set( );
+ sal_Bool bRes1 = aCond.check( );
+
+ // #test comment#: check the condition states.
+ ASSERT_TRUE( !bRes && bRes1 );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: use threads to set/reset Condition and check it in main routine.",
- ( sal_True == bRes && sal_False == bRes1 ) );
- }
+ TEST(Sal_Test_Condition, check_002) {
+ ::osl::Condition aCond;
+ aCond.reset( );
- CPPUNIT_TEST_SUITE( check );
- CPPUNIT_TEST( check_001 );
- CPPUNIT_TEST( check_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class check
+ ConditionThread myThread( aCond, thread_type_set );
+ myThread.create( );
+ myThread.join( );
+ sal_Bool bRes = aCond.check( );
+ ConditionThread myThread1( aCond, thread_type_reset );
+ myThread1.create( );
+ myThread1.join( );
+ sal_Bool bRes1 = aCond.check( );
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Condition::ctors, "osl_Condition");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Condition::set, "osl_Condition");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Condition::reset, "osl_Condition");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Condition::wait, "osl_Condition");
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Condition::check, "osl_Condition");
-// -----------------------------------------------------------------------------
+ // #test comment#: use threads to set/reset Condition and check it in main routine.
+ ASSERT_TRUE( bRes );
+ ASSERT_TRUE( !bRes1 );
+ }
} // namespace osl_Condition
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-NOADDITIONAL;
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/sal/qa/osl/condition/osl_Condition_Const.h b/sal/qa/osl/condition/osl_Condition_Const.h
index df08c9e2a28a..8ab1470df2fb 100644
--- a/sal/qa/osl/condition/osl_Condition_Const.h
+++ b/sal/qa/osl/condition/osl_Condition_Const.h
@@ -52,7 +52,7 @@
#include <unistd.h>
#endif
-#include <testshl/simpleheader.hxx>
+//#include <testshl/simpleheader.hxx>
#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \
::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value )
@@ -62,7 +62,7 @@
//------------------------------------------------------------------------
OSLTEST_DECLARE_USTRING( TestCon, "testcondition" );
-const char pTestString[17] = "Sun Microsystems";
+const char pTestString[27] = "Apache Software Foundation";
#endif /* _OSL_CONDITION_CONST_H_ */
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 8985ba90c0f0..eee364acc76d 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -347,7 +347,7 @@ inline sal_Bool isURL( const ::rtl::OUString pathname )
return ( ( pathname.indexOf( aPreURL ) == 0 ) ? sal_True : sal_False );
}
-/** concat two part to form a URL or system path, add PATH_SEPERATOR between them if necessary, add "file:///" to begining if necessary.
+/** concat two part to form a URL or system path, add PATH_SEPERATOR between them if necessary, add "file:///" to beginning if necessary.
*/
inline void concatURL( ::rtl::OUString & pathname1, const ::rtl::OUString & pathname2 )
{
@@ -588,7 +588,7 @@ inline sal_Bool ifFileExist( const ::rtl::OUString & str )
}
-//check if the file can be writen
+//check if the file can be written
inline sal_Bool ifFileCanWrite( const ::rtl::OUString & str )
{
sal_Bool bCheckResult = sal_False;
@@ -1284,7 +1284,7 @@ namespace osl_FileBase
the second only on windows based systems
the first parameter are a file URL where we want to get the system path of,
the second parameter is the assumed error of the osl_getSystemPathFromFileURL() function,
- the thrid parameter is the assumed result string, the string will only test, if it's length is greater 0
+ the third parameter is the assumed result string, the string will only test, if it's length is greater 0
*/
void SystemPath_FileURL::getSystemPathFromFileURL_001_1()
@@ -1461,7 +1461,7 @@ namespace osl_FileBase
}
- //CJK charactors case
+ //CJK characters case
void SystemPath_FileURL::getSystemPathFromFileURL_005( )
{
::rtl::OUString aUStr;
@@ -4497,7 +4497,7 @@ namespace osl_File
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",
+ CPPUNIT_ASSERT_MESSAGE( "test for read function: read from a special position in the file",
( 52 == nFilePointer ) && ( 26 == nCount_read ) && ( 0 == strncmp( buffer_read, &pBuffer_Char[26], 26 ) ) );
}
@@ -4546,7 +4546,7 @@ namespace osl_File
//get the current pointer;
nError1 = testFile.getPos( nFilePointer );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
- //reset pointer to the begining;
+ //reset pointer to the beginning;
nError1 = testFile.setPos( Pos_Absolut, 0 );
CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
nError1 = testFile.read( buffer_read, 10, nCount_read );
@@ -6747,7 +6747,7 @@ 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.
- to simplify the initialize work, we seperate it into UNIX section and Windows section, the main task
+ to simplify the initialize work, we separate 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.
@@ -6808,7 +6808,7 @@ class GlobalObject
}
// LLA: t_print("after deleteTestDirectory\n");
- //~ special clean up task in Windows and Unix seperately;
+ //~ special clean up task in Windows and Unix separately;
#if ( defined UNX ) || ( defined OS2 )
//~ some clean up task for UNIX OS
;
diff --git a/sal/qa/osl/module/osl_Module_Const.h b/sal/qa/osl/module/osl_Module_Const.h
index 13e99d2ee744..d3268ee78ec5 100644
--- a/sal/qa/osl/module/osl_Module_Const.h
+++ b/sal/qa/osl/module/osl_Module_Const.h
@@ -44,7 +44,7 @@
# define FILE_PREFIX "file:///"
-//Korea charactors
+//Korea characters
::rtl::OUString aKname(
RTL_CONSTASCII_STRINGPARAM(
"/\xEC\x95\x88\xEB\x85\x95\xED\x95\x98\xEC\x84\xB8\xEC\x9A\x94"),
diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx
index fcd00e6927c9..ad91d75cf187 100644
--- a/sal/qa/osl/mutex/osl_Mutex.cxx
+++ b/sal/qa/osl/mutex/osl_Mutex.cxx
@@ -500,7 +500,7 @@ namespace osl_Mutex
if ( bRes2 == sal_True )
aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE( "release Mutex: try to aquire before and after the mutex has been released",
+ CPPUNIT_ASSERT_MESSAGE( "release Mutex: try to acquire before and after the mutex has been released",
bRes1 == sal_False && bRes2 == sal_True && bRunning == sal_True );
}
@@ -514,7 +514,7 @@ namespace osl_Mutex
sal_Bool bRes1 = aMutex.release( );
sal_Bool bRes2 = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE( "release Mutex: mutex should not be released without aquire, should not release twice. although the behaviour is still under discussion, this test is passed on (LINUX), not passed on (SOLARIS)&(WINDOWS)",
+ CPPUNIT_ASSERT_MESSAGE( "release Mutex: mutex should not be released without acquire, should not release twice. although the behaviour is still under discussion, this test is passed on (LINUX), not passed on (SOLARIS)&(WINDOWS)",
bRes1 == sal_False && bRes2 == sal_False );
#endif
}
@@ -655,7 +655,7 @@ namespace osl_Guard
aMutex.release( );
myThread.join( );
- CPPUNIT_ASSERT_MESSAGE("GuardThread constructor: reference initialization, aquire the mutex before running the thread, then check if it is blocking.",
+ CPPUNIT_ASSERT_MESSAGE("GuardThread constructor: reference initialization, acquire the mutex before running the thread, then check if it is blocking.",
bRes == sal_True);
}
@@ -719,7 +719,7 @@ namespace osl_ClearableGuard
/// it will return sal_False if the aMutex has not been Guarded.
sal_Bool bRes = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE("ClearableMutexGuard constructor, test the aquire operation when initilized.",
+ CPPUNIT_ASSERT_MESSAGE("ClearableMutexGuard constructor, test the acquire operation when initilized.",
bRes == sal_True );
}
@@ -733,7 +733,7 @@ namespace osl_ClearableGuard
/// it will return sal_False if the aMutex has not been Guarded.
sal_Bool bRes = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE("ClearableMutexGuard constructor, test the aquire operation when initilized, we use reference constructor this time.",
+ CPPUNIT_ASSERT_MESSAGE("ClearableMutexGuard constructor, test the acquire operation when initilized, we use reference constructor this time.",
bRes == sal_True );
}
@@ -858,7 +858,7 @@ namespace osl_ResettableGuard
/// it will return sal_False if the aMutex has not been Guarded.
sal_Bool bRes = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE("ResettableMutexGuard constructor, test the aquire operation when initilized.",
+ CPPUNIT_ASSERT_MESSAGE("ResettableMutexGuard constructor, test the acquire operation when initilized.",
bRes == sal_True );
}
@@ -872,7 +872,7 @@ namespace osl_ResettableGuard
/// it will return sal_False if the aMutex has not been Guarded.
sal_Bool bRes = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE( "ResettableMutexGuard constructor, test the aquire operation when initilized, we use reference constructor this time.",
+ CPPUNIT_ASSERT_MESSAGE( "ResettableMutexGuard constructor, test the acquire operation when initilized, we use reference constructor this time.",
bRes == sal_True );
}
@@ -920,7 +920,7 @@ namespace osl_ResettableGuard
myMutexGuard.reset( );
sal_Bool bRes1 = aMutex.release( );
- CPPUNIT_ASSERT_MESSAGE( "ResettableMutexGuard method: reset, release after clear and reset, on Solaris, the mutex can be release without aquire, so it can not passed on (SOLARIS), but not the reason for reset_002",
+ CPPUNIT_ASSERT_MESSAGE( "ResettableMutexGuard method: reset, release after clear and reset, on Solaris, the mutex can be release without acquire, so it can not passed on (SOLARIS), but not the reason for reset_002",
( sal_False == bRes ) && ( sal_True == bRes1 ) );
}
diff --git a/sal/qa/osl/pipe/makefile.mk b/sal/qa/osl/pipe/makefile.mk
index 4378a5101672..776470cf9efd 100644
--- a/sal/qa/osl/pipe/makefile.mk
+++ b/sal/qa/osl/pipe/makefile.mk
@@ -20,15 +20,10 @@
#**************************************************************
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
PRJ=..$/..$/..
PRJNAME=sal
-TARGET=qa_osl_pipe
+TARGET=sal_ut_osl_pipe
ENABLE_EXCEPTIONS=TRUE
@@ -39,28 +34,20 @@ ENABLE_EXCEPTIONS=TRUE
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Pipe by codegen.pl
-SHL1OBJS= \
- $(SLO)$/osl_Pipe.obj
-
-SHL1TARGET= osl_Pipe
-SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTLIB)
-
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+.ELSE
-DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-SHL1RPATH = NONE
-# auto generated Target:Pipe
-# END ------------------------------------------------------------------
+APP1OBJS = $(OBJ)/osl_Pipe.obj
+APP1RPATH = NONE
+APP1STDLIBS = $(GTESTLIB) $(SALLIB)
+APP1TARGET = sal_ut_osl_pipe
+APP1TEST = enabled
+#APP1TEST = disabled
-# --- Targets ------------------------------------------------------
+.INCLUDE: target.mk
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
+.ENDIF
-.END
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index 12f6d059c484..dd0bed9c1186 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -28,11 +28,10 @@
// include files
//------------------------------------------------------------------------
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
-#include "test/uniquepipename.hxx"
+#ifdef WNT
+#include <Windows.h>
+#endif
+
#include <sal/types.h>
#include <rtl/ustring.hxx>
@@ -48,12 +47,15 @@
#include <osl/pipe.hxx>
#endif
#include <osl/time.h>
+#include <osl/process.h>
#ifdef UNX
#include <unistd.h>
#endif
#include <string.h>
+#include "gtest/gtest.h"
+
using namespace osl;
using namespace rtl;
@@ -61,6 +63,16 @@ using namespace rtl;
// helper functions
//------------------------------------------------------------------------
+
+/** helper function for unique pipe names
+ */
+OUString uniquePipeName(OUString const & name) {
+ oslProcessInfo info;
+ info.Size = sizeof info;
+ EXPECT_TRUE( osl_Process_E_None == osl_getProcessInfo(0, osl_Process_IDENTIFIER, &info) );
+ return name + OUString::valueOf((sal_Int32)info.Ident);
+}
+
/** print Boolean value.
*/
inline void printBool( sal_Bool bOk )
@@ -133,9 +145,9 @@ inline void printPipeError( ::osl::Pipe aPipe )
//------------------------------------------------------------------------
const rtl::OUString aTestPipeName = rtl::OUString::createFromAscii( "testpipe2" );
const rtl::OUString aTestPipe1 = rtl::OUString::createFromAscii( "testpipe1" );
-const rtl::OUString aTestString = rtl::OUString::createFromAscii( "Sun Microsystems" );
+const rtl::OUString aTestString = rtl::OUString::createFromAscii( "Apache Software Foundation" );
-const OString m_pTestString1("Sun Microsystems");
+const OString m_pTestString1("Apache Software Foundation");
const OString m_pTestString2("test pipe PASS/OK");
//------------------------------------------------------------------------
@@ -158,159 +170,119 @@ namespace osl_Pipe
inline Pipe(oslPipe pipe, __sal_NoAcquire noacquire );
inline Pipe(oslPipe Pipe);
*/
- class ctors : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void setUp( )
- {
- }
+ TEST(Sal_Test_Pipe, ctors_none) {
+ ::osl::Pipe aPipe;
+ sal_Bool bRes = aPipe.is( );
- 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.",
- sal_False == bRes );
- }
-
- void ctors_name_option( )
- {
- /// create a named pipe.
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- ::osl::Pipe aAssignPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ // #test comment#: test constructor with no parameter, yet no case to test.
+ ASSERT_TRUE( !bRes );
+ }
- bRes = aPipe.is( ) && aAssignPipe.is( );
+ TEST(Sal_Test_Pipe, ctors_name_option) {
+ /// create a named pipe.
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ ::osl::Pipe aAssignPipe( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name and option.",
- sal_True == bRes );
- }
+ sal_Bool bRes = aPipe.is( ) && aAssignPipe.is( );
- void ctors_name_option_security( )
- {
- /// create a security pipe.
- const ::osl::Security rSecurity;
- ::osl::Pipe aSecurityPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSecurity );
+ // #test comment#: test constructor with name and option.
+ ASSERT_TRUE( bRes );
+ }
- bRes = aSecurityPipe.is( );
+ TEST(Sal_Test_Pipe, ctors_name_option_security) {
+ /// create a security pipe.
+ const ::osl::Security rSecurity;
+ ::osl::Pipe aSecurityPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSecurity );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
- sal_True == bRes );
- }
+ sal_Bool bRes = aSecurityPipe.is( );
- void ctors_copy( )
- {
- /// create a pipe.
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- /// create a pipe using copy constructor.
- ::osl::Pipe aCopyPipe( aPipe );
+ // #test comment#: test constructor with name, option and security, the test of security is not implemented yet.
+ ASSERT_TRUE( bRes );
+ }
- bRes = aCopyPipe.is( ) && aCopyPipe == aPipe;
+ TEST(Sal_Test_Pipe, ctors_copy) {
+ /// create a pipe.
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ /// create a pipe using copy constructor.
+ ::osl::Pipe aCopyPipe( aPipe );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
- sal_True == bRes );
- }
+ sal_Bool bRes = aCopyPipe.is( ) && aCopyPipe == aPipe;
- /** tester comment:
+ // #test comment#: test copy constructor.
+ ASSERT_TRUE( bRes );
+ }
- 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)).
- */
- void ctors_no_acquire( )
- {
- /// create a pipe.
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- /// constructs a pipe reference without acquiring the handle.
- ::osl::Pipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
+ /** tester comment:
- bRes = aNoAcquirePipe.is( );
- ///aPipe.clear( );
- ///bRes1 = aNoAcquirePipe.is( );
+ 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)).
+ */
+ TEST(Sal_Test_Pipe, ctors_no_acquire) {
+ /// create a pipe.
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ /// constructs a pipe reference without acquiring the handle.
+ ::osl::Pipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
+ sal_Bool 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 );
- }
- void ctors_acquire( )
- {
- /// create a base pipe.
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- /// constructs two pipes without acquiring the handle on the base pipe.
- ::osl::Pipe aAcquirePipe( aPipe.getHandle( ) );
- ::osl::Pipe aAcquirePipe1( NULL );
+ // #test comment#: test constructor with no acquire of handle, only validation test, do not know how to test no acquire.
+ ASSERT_TRUE( bRes );
+ }
- bRes = aAcquirePipe.is( );
- bRes1 = aAcquirePipe1.is( );
+ TEST(Sal_Test_Pipe, ctors_acquire) {
+ /// create a base pipe.
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ /// constructs two pipes without acquiring the handle on the base pipe.
+ ::osl::Pipe aAcquirePipe( aPipe.getHandle( ) );
+ ::osl::Pipe aAcquirePipe1( NULL );
- 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 );
- }
+ sal_Bool bRes = aAcquirePipe.is( );
+ sal_Bool bRes1 = aAcquirePipe1.is( );
- CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_none );
- CPPUNIT_TEST( ctors_name_option );
- CPPUNIT_TEST( ctors_name_option_security );
- CPPUNIT_TEST( ctors_copy );
- CPPUNIT_TEST( ctors_no_acquire );
- CPPUNIT_TEST( ctors_acquire );
- CPPUNIT_TEST_SUITE_END( );
- }; // class ctors
+ // #test comment#: test constructor with no acquire of handle.only validation test, do not know how to test no acquire.
+ ASSERT_TRUE( bRes && !bRes1 );
+ }
/** testing the method:
inline sal_Bool SAL_CALL is() const;
*/
- class is : public CppUnit::TestFixture
- {
- public:
- 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( ) );
- }
+ TEST(Sal_Test_Pipe, is_001) {
+ ::osl::Pipe aPipe;
- void is_002( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // #test comment#: test is(), check if the pipe is a valid one.
+ ASSERT_TRUE( !aPipe.is( ) );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), a normal pipe creation.", sal_True == aPipe.is( ) );
- }
+ TEST(Sal_Test_Pipe, is_002) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- void is_003( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe.clear( );
+ // #test comment#: test is(), a normal pipe creation.
+ ASSERT_TRUE( aPipe.is( ) );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), an invalid case.", sal_False == aPipe.is( ) );
- }
+ TEST(Sal_Test_Pipe, is_003) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe.clear( );
- void is_004( )
- {
- ::osl::Pipe aPipe( NULL );
+ // #test comment#: test is(), an invalid case
+ ASSERT_TRUE( !aPipe.is( ) );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), an invalid constructor.", sal_False == aPipe.is( ) );
- }
+ TEST(Sal_Test_Pipe, is_004) {
+ ::osl::Pipe aPipe( NULL );
- CPPUNIT_TEST_SUITE( is );
- CPPUNIT_TEST( is_001 );
- CPPUNIT_TEST( is_002 );
- CPPUNIT_TEST( is_003 );
- CPPUNIT_TEST( is_004 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class is
+ // #test comment#: test is(), an invalid constructor.
+ ASSERT_TRUE( !aPipe.is( ) );
+ }
/** testing the methods:
@@ -319,387 +291,244 @@ namespace osl_Pipe
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:
+ TEST(Sal_Test_Pipe, create_named_security_001) {
+ const Security rSec;
+ ::osl::Pipe aPipe;
+ sal_Bool bRes = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
+ sal_Bool bRes1 = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
+ aPipe.clear( );
+
+ // #test comment#: test creation.
+ ASSERT_TRUE( bRes && !bRes1 );
+ }
- security create only be tested creation, security section is
- untested yet.
- */
+ TEST(Sal_Test_Pipe, create_named_security_002) {
+ const Security rSec;
+ ::osl::Pipe aPipe, aPipe1;
+ sal_Bool bRes = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
+ sal_Bool bRes1 = aPipe1.create( uniquePipeName(aTestPipeName), osl_Pipe_OPEN, rSec );
+ aPipe.clear( );
- void create_named_security_001( )
- {
- const Security rSec;
- ::osl::Pipe aPipe;
- bRes = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
- bRes1 = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
- aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
- sal_True == bRes && sal_False == bRes1);
- }
-
- void create_named_security_002( )
- {
- const Security rSec;
- ::osl::Pipe aPipe, aPipe1;
- bRes = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSec );
- bRes1 = aPipe1.create( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN, rSec );
- aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
- sal_True == bRes && sal_True == bRes1);
- }
+ // #test comment#: test creation and open.
+ ASSERT_TRUE( bRes && bRes1 );
+ }
- void create_named_001( )
- {
- ::osl::Pipe aPipe;
- bRes = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- bRes1 = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe.clear( );
+ TEST(Sal_Test_Pipe, create_named_001) {
+ ::osl::Pipe aPipe;
+ sal_Bool bRes = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ sal_Bool bRes1 = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe.clear( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation.",
- sal_True == bRes && sal_False == bRes1);
- }
-
- void create_named_002( )
- {
- ::osl::Pipe aPipe, aPipe1;
- bRes = aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- bRes1 = aPipe1.create( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
- aPipe.clear( );
+ // #test comment#: test creation.
+ ASSERT_TRUE( bRes && !bRes1);
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test creation and open.",
- sal_True == bRes && sal_True == bRes1);
- }
+ TEST(Sal_Test_Pipe, create_named_002) {
+ ::osl::Pipe aPipe, aPipe1;
+ sal_Bool bRes = aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ sal_Bool bRes1 = aPipe1.create( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ aPipe.clear( );
- void create_named_003( )
- {
- ::osl::Pipe aPipe;
- bRes = aPipe.create( test::uniquePipeName(aTestPipeName) );
- aPipe.clear( );
+ // #test comment#: test creation and open.
+ ASSERT_TRUE( bRes && bRes1);
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test default option is open.",
- sal_False == bRes );
- }
+ TEST(Sal_Test_Pipe, create_named_003) {
+ ::osl::Pipe aPipe;
+ sal_Bool bRes = aPipe.create( uniquePipeName(aTestPipeName) );
+ aPipe.clear( );
- 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( );
- }; // class create
+ // #test comment#: test default option is open.
+ ASSERT_TRUE( !bRes );
+ }
/** testing the method:
inline void SAL_CALL clear();
*/
- class clear : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void clear_001( )
- {
- ::osl::Pipe aPipe;
- aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe.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( );
- }; // class clear
+ TEST(Sal_Test_Pipe, clear_001) {
+ ::osl::Pipe aPipe;
+ aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe.clear( );
+ sal_Bool bRes = aPipe.is( );
+
+ // #test comment#: test clear.
+ ASSERT_TRUE( !bRes );
+ }
/** testing the methods:
inline Pipe& SAL_CALL operator= (const Pipe& pipe);
inline Pipe& SAL_CALL operator= (const oslPipe pipe );
*/
- class assign : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void assign_ref( )
- {
- ::osl::Pipe aPipe, aPipe1;
- aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe1 = aPipe;
- bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
- aPipe.close( );
- 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( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe1 = aPipe.getHandle( );
- bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
- aPipe.close( );
- aPipe1.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test assign with handle.",
- sal_True == bRes && sal_True == bRes1 );
- }
+ TEST(Sal_Test_Pipe, assign_ref) {
+ ::osl::Pipe aPipe, aPipe1;
+ aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe1 = aPipe;
+ sal_Bool bRes = aPipe1.is( );
+ sal_Bool bRes1 = aPipe == aPipe1;
+ aPipe.close( );
+ aPipe1.close( );
+
+ // #test comment#: test assign with reference.
+ ASSERT_TRUE( bRes && bRes1 );
+ }
- CPPUNIT_TEST_SUITE( assign );
- CPPUNIT_TEST( assign_ref );
- CPPUNIT_TEST( assign_handle );
- CPPUNIT_TEST_SUITE_END( );
- }; // class assign
+ TEST(Sal_Test_Pipe, assign_handle) {
+ ::osl::Pipe aPipe, aPipe1;
+ aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe1 = aPipe.getHandle( );
+ sal_Bool bRes = aPipe1.is( );
+ sal_Bool bRes1 = aPipe == aPipe1;
+ aPipe.close( );
+ aPipe1.close( );
+
+ // #test comment#: test assign with handle.
+ ASSERT_TRUE( bRes && bRes1 );
+ }
/** 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
*/
- /*class isValid : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void isValid_001( )
- {
- 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( );
- };*/ // class isValid
+ // TEST(Sal_Test_Pipe, isValid_001) {
+ // ...
+ // // #test comment#: isValid() has not been implemented on all platforms.
+ // ASSERT_TRUE( ... );
+ // }
/** testing the method:
inline sal_Bool SAL_CALL operator==( const Pipe& rPipe ) const;
*/
- class isEqual : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void isEqual_001( )
- {
- ::osl::Pipe aPipe;
- aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- bRes = aPipe == aPipe;
- aPipe.close( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(), compare its self.",
- sal_True == bRes );
- }
-
- void isEqual_002( )
- {
- ::osl::Pipe aPipe, aPipe1, aPipe2;
- aPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
-
- aPipe1 = aPipe;
- aPipe2.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ TEST(Sal_Test_Pipe, isEqual_001) {
+ ::osl::Pipe aPipe;
+ aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ sal_Bool bRes = aPipe == aPipe;
+ aPipe.close( );
+
+ // #test comment#: test isEqual(), compare its self.
+ ASSERT_TRUE( bRes );
+ }
- bRes = aPipe == aPipe1;
- bRes1 = aPipe == aPipe2;
- aPipe.close( );
- aPipe1.close( );
- aPipe2.close( );
+ TEST(Sal_Test_Pipe, isEqual_002) {
+ ::osl::Pipe aPipe, aPipe1, aPipe2;
+ aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ aPipe1 = aPipe;
+ aPipe2.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test isEqual(),create one copy instance, and compare.",
- sal_True == bRes && sal_False == bRes1 );
- }
+ sal_Bool bRes = aPipe == aPipe1;
+ sal_Bool bRes1 = aPipe == aPipe2;
+ aPipe.close( );
+ aPipe1.close( );
+ aPipe2.close( );
- CPPUNIT_TEST_SUITE( isEqual );
- CPPUNIT_TEST( isEqual_001 );
- CPPUNIT_TEST( isEqual_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class isEqual
+ // #test comment#: test isEqual(),create one copy instance, and compare.
+ ASSERT_TRUE( bRes && !bRes1 );
+ }
/** testing the method:
inline void SAL_CALL close();
*/
- class close : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void close_001( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipe1), osl_Pipe_CREATE );
- aPipe.close( );
- bRes = aPipe.is( );
+ TEST(Sal_Test_Pipe, close_001) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipe1), osl_Pipe_CREATE );
+ aPipe.close( );
+ sal_Bool bRes = aPipe.is( );
- aPipe.clear( );
- bRes1 = aPipe.is( );
+ aPipe.clear( );
+ sal_Bool bRes1 = aPipe.is( );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: difference between close and clear.",
- sal_True == bRes && sal_False == bRes1);
- }
-
- void close_002( )
- {
- ::osl::StreamPipe aPipe( test::uniquePipeName(aTestPipe1), osl_Pipe_CREATE );
- aPipe.close( );
- int nRet = aPipe.send( m_pTestString1.getStr(), 3 );
+ // #test comment#: difference between close and clear.
+ ASSERT_TRUE( bRes && !bRes1);
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: use after close.",
- OSL_PIPE_FAIL == nRet );
- }
+ TEST(Sal_Test_Pipe, close_002) {
+ ::osl::StreamPipe aPipe( uniquePipeName(aTestPipe1), osl_Pipe_CREATE );
+ aPipe.close( );
+ int nRet = aPipe.send( m_pTestString1.getStr(), 3 );
- CPPUNIT_TEST_SUITE( close );
- CPPUNIT_TEST( close_001 );
- CPPUNIT_TEST( close_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class close
+ // #test comment#: use after close.
+ ASSERT_EQ( nRet, OSL_PIPE_FAIL );
+ }
/** testing the method:
inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
please refer to StreamPipe::recv
*/
- /* class accept : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void accept_001( )
- {
-
- // CPPUNIT_ASSERT_MESSAGE( "#test comment#: accept, untested.", 1 == 1 );
- //CPPUNIT_ASSERT_STUB();
- }
-
- CPPUNIT_TEST_SUITE( accept );
- CPPUNIT_TEST( accept_001 );
- CPPUNIT_TEST_SUITE_END( );
- };*/ // class accept
/** testing the method:
inline oslPipeError SAL_CALL getError() const;
*/
- class getError : public CppUnit::TestFixture
- {
- public:
- 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
- { EAFNOSUPPORT, osl_Pipe_E_NoProtocol }, // Address family not supported by
- // 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
- { -1, osl_Pipe_E_invalidError }
- };
- did not define osl_Pipe_E_NotFound, osl_Pipe_E_AlreadyExists
- */
-
- void getError_001( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
- oslPipeError nError = aPipe.getError( );
- printPipeError( aPipe );
- aPipe.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe.",
- nError != osl_Pipe_E_None );
- }
+ /*
+ 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
+ { EAFNOSUPPORT, osl_Pipe_E_NoProtocol }, // Address family not supported by
+ // 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
+ { -1, osl_Pipe_E_invalidError }
+ };
+ did not define osl_Pipe_E_NotFound, osl_Pipe_E_AlreadyExists
+ */
+ TEST(Sal_Test_Pipe, getError_001) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ oslPipeError nError = aPipe.getError( );
+ printPipeError( aPipe );
+ aPipe.clear( );
+
+ // #test comment#: open a non-exist pipe.
+ ASSERT_NE( nError, osl_Pipe_E_None );
+ }
- void getError_002( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- ::osl::Pipe aPipe1( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- oslPipeError nError = aPipe.getError( );
- printPipeError( aPipe );
- aPipe.clear( );
- aPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.",
- nError != osl_Pipe_E_None );
- }
+ TEST(Sal_Test_Pipe, getError_002) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ ::osl::Pipe aPipe1( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ oslPipeError nError = aPipe.getError( );
+ printPipeError( aPipe );
+ aPipe.clear( );
+ aPipe1.clear( );
- CPPUNIT_TEST_SUITE( getError );
- CPPUNIT_TEST( getError_001 );
- CPPUNIT_TEST( getError_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class getError
+ // #test comment#: create an already exist pipe.
+ ASSERT_NE( nError, osl_Pipe_E_None );
+ }
/** testing the method:
inline oslPipe SAL_CALL getHandle() const;
*/
- class getHandle : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
+ TEST(Sal_Test_Pipe, getHandle_001) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ sal_Bool bRes = aPipe == aPipe.getHandle( );
+ aPipe.clear( );
- void getHandle_001( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
- bRes = aPipe == aPipe.getHandle( );
- aPipe.clear( );
+ // #test comment#: one pipe should equal to its handle.
+ ASSERT_TRUE( bRes );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: one pipe should equal to its handle.",
- sal_True == bRes );
- }
+ TEST(Sal_Test_Pipe, getHandle_002) {
+ ::osl::Pipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ ::osl::Pipe aPipe1( aPipe.getHandle( ) );
+ sal_Bool bRes = aPipe == aPipe1;
+ aPipe.clear( );
+ aPipe1.clear( );
- void getHandle_002( )
- {
- ::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- ::osl::Pipe aPipe1( aPipe.getHandle( ) );
- bRes = aPipe == aPipe1;
- aPipe.clear( );
- aPipe1.clear( );
-
- 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( );
- }; // class getHandle
-
-
-// -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::ctors);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::is);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::create);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::clear);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::assign);
-//CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isValid);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isEqual);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::close);
- //CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::accept);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getError);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getHandle);
-// -----------------------------------------------------------------------------
+ // #test comment#: one pipe derived from another pipe's handle.
+ ASSERT_TRUE( bRes );
+ }
} // namespace osl_Pipe
@@ -715,166 +544,130 @@ namespace osl_StreamPipe
inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security &rSec );
inline StreamPipe( oslPipe pipe, __sal_NoAcquire noacquire );
*/
- class ctors : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
-
- void ctors_none( )
- {
- // create a pipe.
- ::osl::StreamPipe aStreamPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- // create an unattached pipe.
- ::osl::StreamPipe aStreamPipe1;
- bRes = aStreamPipe1.is( );
-
- // 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.",
- sal_False == bRes && sal_True == bRes1 );
- }
-
- void ctors_handle( )
- {
- // create a pipe.
- ::osl::StreamPipe aStreamPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- // create a pipe with last handle.
- ::osl::StreamPipe aStreamPipe1( aStreamPipe.getHandle( ) );
- bRes = aStreamPipe1.is( ) && aStreamPipe == aStreamPipe1;
- aStreamPipe.clear( );
- aStreamPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with other's handle.",
- sal_True == bRes );
- }
- void ctors_copy( )
- {
- // create a pipe.
- ::osl::StreamPipe aStreamPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- // create an unattached pipe.
- ::osl::StreamPipe aStreamPipe1( aStreamPipe );
- bRes = aStreamPipe1.is( ) && aStreamPipe == aStreamPipe1;
- aStreamPipe.clear( );
- aStreamPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test copy constructor.",
- sal_True == bRes );
- }
-
- void ctors_name_option( )
- {
- // create a pipe.
- ::osl::StreamPipe aStreamPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- // create an unattached pipe.
- ::osl::StreamPipe aStreamPipe1( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
- bRes = aStreamPipe1.is( ) && aStreamPipe.is( );
- aStreamPipe.clear( );
- aStreamPipe1.clear( );
-
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name and option.",
- sal_True == bRes );
- }
-
- void ctors_name_option_security( )
- {
- /// create a security pipe.
- const ::osl::Security rSecurity;
- ::osl::StreamPipe aSecurityPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSecurity );
-
- bRes = aSecurityPipe.is( );
- aSecurityPipe.clear( );
+ TEST(Sal_Test_StreamPipe, ctors_none) {
+ // create a pipe.
+ ::osl::StreamPipe aStreamPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // create an unattached pipe.
+ ::osl::StreamPipe aStreamPipe1;
+ sal_Bool bRes = aStreamPipe1.is( );
+
+ // assign it and check.
+ aStreamPipe1 = aStreamPipe;
+ sal_Bool bRes1 = aStreamPipe1.is( );
+ aStreamPipe.clear( );
+ aStreamPipe1.clear( );
+
+ // #test comment#: test constructor with no parameter, before and after assign.
+ ASSERT_TRUE( !bRes && bRes1 );
+ }
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor with name, option and security, the test of security is not implemented yet.",
- sal_True == bRes );
- }
+ TEST(Sal_Test_StreamPipe, ctors_handle) {
+ // create a pipe.
+ ::osl::StreamPipe aStreamPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // create a pipe with last handle.
+ ::osl::StreamPipe aStreamPipe1( aStreamPipe.getHandle( ) );
+ sal_Bool bRes = aStreamPipe1.is( ) && aStreamPipe == aStreamPipe1;
+ aStreamPipe.clear( );
+ aStreamPipe1.clear( );
+
+ // #test comment#: test constructor with other's handle.
+ ASSERT_TRUE( bRes );
+ }
- /** tester comment:
+ TEST(Sal_Test_StreamPipe, ctors_copy) {
+ // create a pipe.
+ ::osl::StreamPipe aStreamPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // create an unattached pipe.
+ ::osl::StreamPipe aStreamPipe1( aStreamPipe );
+ sal_Bool bRes = aStreamPipe1.is( ) && aStreamPipe == aStreamPipe1;
+ aStreamPipe.clear( );
+ aStreamPipe1.clear( );
+
+ // #test comment#: test copy constructor.
+ ASSERT_TRUE( bRes );
+ }
- 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)).
- */
+ TEST(Sal_Test_StreamPipe, ctors_name_option) {
+ // create a pipe.
+ ::osl::StreamPipe aStreamPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // create an unattached pipe.
+ ::osl::StreamPipe aStreamPipe1( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ sal_Bool bRes = aStreamPipe1.is( ) && aStreamPipe.is( );
+ aStreamPipe.clear( );
+ aStreamPipe1.clear( );
+
+ // #test comment#: test constructor with name and option.
+ ASSERT_TRUE( bRes );
+ }
- void ctors_no_acquire( )
- {
- // create a pipe.
- ::osl::StreamPipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- // constructs a pipe reference without acquiring the handle.
- ::osl::StreamPipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
+ TEST(Sal_Test_StreamPipe, ctors_name_option_security) {
+ // create a security pipe.
+ const ::osl::Security rSecurity;
+ ::osl::StreamPipe aSecurityPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE, rSecurity );
- bRes = aNoAcquirePipe.is( );
- aPipe.clear( );
- // bRes1 = aNoAcquirePipe.is( );
+ sal_Bool bRes = aSecurityPipe.is( );
+ aSecurityPipe.clear( );
- 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 );
- }
+ // #test comment#: test constructor with name, option and security, the test of security is not implemented yet.
+ ASSERT_TRUE( bRes );
+ }
- CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_none );
- CPPUNIT_TEST( ctors_handle );
- CPPUNIT_TEST( ctors_copy );
- CPPUNIT_TEST( ctors_name_option );
- CPPUNIT_TEST( ctors_name_option_security );
- CPPUNIT_TEST( ctors_no_acquire );
- CPPUNIT_TEST_SUITE_END( );
- }; // class ctors
+ /** tester comment:
+ 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)).
+ */
+ TEST(Sal_Test_StreamPipe, ctors_no_acquire) {
+ // create a pipe.
+ ::osl::StreamPipe aPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // constructs a pipe reference without acquiring the handle.
+ ::osl::StreamPipe aNoAcquirePipe( aPipe.getHandle( ), SAL_NO_ACQUIRE );
+
+ sal_Bool bRes = aNoAcquirePipe.is( );
+ aPipe.clear( );
+ // bRes1 = aNoAcquirePipe.is( );
+
+ // #test comment#: test constructor with no acquire of handle, only validation test, do not know how to test no acquire.
+ ASSERT_TRUE( bRes );
+ }
/** testing the methods:
inline StreamPipe & SAL_CALL operator=(oslPipe Pipe);
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( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- aPipe1 = aPipe;
- bRes = aPipe1.is( );
- bRes1 = aPipe == aPipe1;
- aPipe.close( );
- 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( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- ::osl::StreamPipe * pAssignPipe = new ::osl::StreamPipe;
- *pAssignPipe = pPipe->getHandle( );
-
- bRes = pAssignPipe->is( );
- bRes1 = ( *pPipe == *pAssignPipe );
- pPipe->close( );
-
- delete pAssignPipe;
-
- 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( );
- };*/ // class assign
+ // TEST(Sal_Test_StreamPipe, assign_ref) {
+ // ::osl::StreamPipe aPipe, aPipe1;
+ // aPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // aPipe1 = aPipe;
+ // sal_Bool bRes = aPipe1.is( );
+ // sal_Bool bRes1 = aPipe == aPipe1;
+ // aPipe.close( );
+ // aPipe1.close( );
+
+ // // #test comment#: test assign with reference.
+ // ASSERT_TRUE( bRes && bRes1 );
+ // }
+
+ // TEST(Sal_Test_StreamPipe, assign_ref) {
+ // ::osl::StreamPipe * pPipe = new ::osl::StreamPipe( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ // ::osl::StreamPipe * pAssignPipe = new ::osl::StreamPipe;
+ // *pAssignPipe = pPipe->getHandle( );
+
+ // bRes = pAssignPipe->is( );
+ // bRes1 = ( *pPipe == *pAssignPipe );
+ // pPipe->close( );
+
+ // delete pAssignPipe;
+
+ // // #test comment#: test assign with handle., seems not implemented under (LINUX)(W32)
+ // ASSERT_TRUE( bRes && bRes1 );
+ // }
/** wait _nSec seconds.
@@ -893,7 +686,8 @@ namespace osl_StreamPipe
#endif
// printf("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,39 +697,39 @@ namespace osl_StreamPipe
Pipe_DataSink_Thread( ) { }
~Pipe_DataSink_Thread( )
- {
- }
+ {
+ }
protected:
void SAL_CALL run( )
- {
- sal_Int32 nChars = 0;
+ {
+ sal_Int32 nChars = 0;
- printf("open pipe\n");
- ::osl::StreamPipe aSenderPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_OPEN ); // test::uniquePipeName(aTestPipeName) is a string = "TestPipe"
- if ( aSenderPipe.is() == sal_False )
+ printf("open pipe\n");
+ // uniquePipeName(aTestPipeName) is a string = "TestPipe"
+ ::osl::StreamPipe aSenderPipe( uniquePipeName(aTestPipeName), osl_Pipe_OPEN );
+ if ( aSenderPipe.is() == sal_False )
+ {
+ printf("pipe open failed! \n");
+ }
+ else
+ {
+ printf("read\n");
+ nChars = aSenderPipe.read( buf, m_pTestString1.getLength() + 1 );
+ if ( nChars < 0 )
{
- printf("pipe open failed! \n");
+ printf("read failed! \n");
+ return;
}
- else
+ printf("buffer is %s \n", buf);
+ printf("send\n");
+ nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 );
+ if ( nChars < 0 )
{
- printf("read\n");
- nChars = aSenderPipe.read( buf, m_pTestString1.getLength() + 1 );
- if ( nChars < 0 )
- {
- printf("read failed! \n");
- return;
- }
- printf("buffer is %s \n", buf);
- printf("send\n");
- nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 );
- if ( nChars < 0 )
- {
- printf("client send failed! \n");
- return;
- }
+ printf("client send failed! \n");
+ return;
}
}
-
+ }
};
// -----------------------------------------------------------------------------
@@ -944,113 +738,89 @@ namespace osl_StreamPipe
{
public:
sal_Char buf[256];
- //::osl::StreamPipe aListenPipe; //( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ //::osl::StreamPipe aListenPipe; //( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
::osl::Pipe aListenPipe;
::osl::StreamPipe aConnectionPipe;
Pipe_DataSource_Thread( )
- {
- printf("create pipe\n");
- aListenPipe.create( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- }
+ {
+ printf("create pipe\n");
+ aListenPipe.create( uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ }
~Pipe_DataSource_Thread( )
- {
- aListenPipe.close();
- }
+ {
+ aListenPipe.close();
+ }
protected:
void SAL_CALL run( )
+ {
+ //create pipe.
+ sal_Int32 nChars;
+ //::osl::StreamPipe aListenPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ printf("listen\n");
+ if ( aListenPipe.is() == sal_False )
{
- //create pipe.
- sal_Int32 nChars;
- //::osl::StreamPipe aListenPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
- printf("listen\n");
- if ( aListenPipe.is() == sal_False )
+ printf("pipe create failed! \n");
+ }
+ else
+ {
+ //::osl::StreamPipe aConnectionPipe;
+
+ //start server and wait for connection.
+ printf("accept\n");
+ if ( osl_Pipe_E_None != aListenPipe.accept( aConnectionPipe ) )
{
- printf("pipe create failed! \n");
+ printf("pipe accept failed!");
+ return;
}
- else
+ printf("write\n");
+ // write to pipe
+ nChars = aConnectionPipe.write( m_pTestString1.getStr(), m_pTestString1.getLength() + 1 );
+ if ( nChars < 0)
{
- //::osl::StreamPipe aConnectionPipe;
-
- //start server and wait for connection.
- printf("accept\n");
- if ( osl_Pipe_E_None != aListenPipe.accept( aConnectionPipe ) )
- {
- printf("pipe accept failed!");
- return;
- }
- printf("write\n");
- // write to pipe
- nChars = aConnectionPipe.write( m_pTestString1.getStr(), m_pTestString1.getLength() + 1 );
- if ( nChars < 0)
- {
- printf("server write failed! \n");
- return;
- }
- printf("recv\n");
- nChars = aConnectionPipe.recv( buf, 256 );
-
- if ( nChars < 0)
- {
- printf("server receive failed! \n");
- return;
- }
- //thread_sleep( 2 );
- printf("received message is: %s\n", buf );
- //aConnectionPipe.close();
+ printf("server write failed! \n");
+ return;
}
+ printf("recv\n");
+ nChars = aConnectionPipe.recv( buf, 256 );
+
+ if ( nChars < 0)
+ {
+ printf("server receive failed! \n");
+ return;
+ }
+ //thread_sleep( 2 );
+ printf("received message is: %s\n", buf );
+ //aConnectionPipe.close();
}
+ }
};
+
/** testing the method: read/write/send/recv and Pipe::accept
*/
- class recv : public CppUnit::TestFixture
- {
- public:
- sal_Bool bRes, bRes1;
+ TEST(Sal_Test_StreamPipe, recv_001) {
+ //launch threads.
+ Pipe_DataSource_Thread myDataSourceThread;
+ Pipe_DataSink_Thread myDataSinkThread;
+ myDataSourceThread.create( );
+ thread_sleep( 1 );
+ myDataSinkThread.create( );
- void recv_001( )
- {
- //launch threads.
- Pipe_DataSource_Thread myDataSourceThread;
- Pipe_DataSink_Thread myDataSinkThread;
- myDataSourceThread.create( );
- thread_sleep( 1 );
- myDataSinkThread.create( );
-
- //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 );
- }
- //close pipe when accept
- void recv_002()
- {
- thread_sleep( 1 );
-
- Pipe_DataSource_Thread myDataSourceThread;
- Pipe_DataSink_Thread myDataSinkThread;
- myDataSourceThread.create( );
- thread_sleep( 1 );
- myDataSourceThread.aListenPipe.close();
- myDataSourceThread.join( );
- //no condition judgement here, if the case could finish excuting within 1 or 2 seconds, it passes.
- }
+ //wait until the thread terminate
+ myDataSinkThread.join( );
+ myDataSourceThread.join( );
- CPPUNIT_TEST_SUITE( recv );
- CPPUNIT_TEST( recv_001 );
- CPPUNIT_TEST( recv_002 );
- CPPUNIT_TEST_SUITE_END( );
- }; // class recv
+ int nCompare1 = strcmp( myDataSinkThread.buf, m_pTestString1.getStr() );
+ int nCompare2 = strcmp( myDataSourceThread.buf, m_pTestString2.getStr() );
-// -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::ctors);
-//CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::assign);
- CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::recv);
-// -----------------------------------------------------------------------------
+ // test send/recv/write/read.
+ ASSERT_TRUE( nCompare1 == 0 && nCompare2 == 0 );
+ }
} // namespace osl_StreamPipe
-CPPUNIT_PLUGIN_IMPLEMENT();
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index a5e90ca3b8f7..36bf0cceb2f0 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -581,7 +581,7 @@ namespace osl_Thread
myThread* newthread = new myThread();
sal_Bool res1 = newthread->create();
sal_Bool res2 = newthread->create();
- t_print("In non pro, an assertion should occured. This behaviour is right.\n");
+ t_print("In non pro, an assertion should occurred. This behaviour is right.\n");
termAndJoinThread(newthread);
delete newthread;
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 5dfd829ea744..be19ef03a4f2 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -44,8 +44,6 @@
#include <tools/postwin.h>
#endif
-#include "rtl/allocator.hxx"
-
#include <iostream>
#include <fstream>
#include <vector>
@@ -296,7 +294,7 @@ public:
//#########################################################
-typedef std::vector<std::string, rtl::Allocator<std::string> > string_container_t;
+typedef std::vector<std::string> string_container_t;
typedef string_container_t::const_iterator string_container_const_iter_t;
typedef string_container_t::iterator string_container_iter_t;
diff --git a/sal/qa/osl/socket/osl_ConnectorSocket.cxx b/sal/qa/osl/socket/osl_ConnectorSocket.cxx
index 12754023e75f..ad16b3e9ee15 100644
--- a/sal/qa/osl/socket/osl_ConnectorSocket.cxx
+++ b/sal/qa/osl/socket/osl_ConnectorSocket.cxx
@@ -205,7 +205,7 @@ namespace osl_ConnectorSocket
sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) ;
}
// really an error or just delayed
- // how to design senarios that will return osl_Socket_Interrupted, osl_Socket_TimedOut
+ // how to design scenarios that will return osl_Socket_Interrupted, osl_Socket_TimedOut
void connect_003()
{
::osl::SocketAddr saTargetSocketAddr1( rtl::OUString::createFromAscii("127.0.0.1"), IP_PORT_MYPORT3 );
diff --git a/sal/qa/osl/socket/osl_Socket.cxx b/sal/qa/osl/socket/osl_Socket.cxx
index e503dd812240..825d3abf12aa 100644
--- a/sal/qa/osl/socket/osl_Socket.cxx
+++ b/sal/qa/osl/socket/osl_Socket.cxx
@@ -1511,7 +1511,7 @@ namespace osl_Socket
/// 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 occurred",
1 == 1 );
}
@@ -3060,7 +3060,7 @@ protected:
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 */
+ /* set socket option SO_LINGER 0, so close immediately */
linger aLingerSet;
sal_Int32 nBufferLen = sizeof( struct linger );
aLingerSet.l_onoff = 0;
@@ -3285,7 +3285,7 @@ namespace osl_ConnectorSocket
sal_True == compareSocketAddr( saPeerSocketAddr, saLocalSocketAddr ) ) ;
}
// really an error or just delayed
- // how to design senarios that will return osl_Socket_Interrupted, osl_Socket_TimedOut
+ // how to design scenarios that will return osl_Socket_Interrupted, osl_Socket_TimedOut
void connect_003()
{
::osl::SocketAddr saTargetSocketAddr1( aHostIp1, IP_PORT_MYPORT3 );
diff --git a/sal/qa/osl/socket/osl_Socket2.cxx b/sal/qa/osl/socket/osl_Socket2.cxx
index 4004a1b5d496..b449333ec169 100644
--- a/sal/qa/osl/socket/osl_Socket2.cxx
+++ b/sal/qa/osl/socket/osl_Socket2.cxx
@@ -176,7 +176,7 @@ namespace osl_Socket
/// 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 occurred",
1 == 1 );
}
diff --git a/sal/qa/osl/socket/osl_StreamSocket.cxx b/sal/qa/osl/socket/osl_StreamSocket.cxx
index 29a4ddbbe510..c595548b58c8 100644
--- a/sal/qa/osl/socket/osl_StreamSocket.cxx
+++ b/sal/qa/osl/socket/osl_StreamSocket.cxx
@@ -819,7 +819,7 @@ namespace osl_StreamSocket
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 */
+ /* set socket option SO_LINGER 0, so close immediately */
linger aLingerSet;
sal_Int32 nBufferLen = sizeof( struct linger );
aLingerSet.l_onoff = 0;
@@ -1037,7 +1037,7 @@ namespace osl_StreamSocket
{
t_print("read()\n");
m_nReadCount = aSocket.read( m_pBuffer, m_nBufferSize );
- t_print("%d bytes recived.\n", m_nReadCount);
+ t_print("%d bytes received.\n", m_nReadCount);
}
}
else
@@ -1108,12 +1108,12 @@ namespace osl_StreamSocket
if (! aSocketAddr.setPort(IP_PORT_TEST))
{
- t_print("# cant set port\n" );
+ t_print("# can't set port\n" );
}
if (! aSocketAddr.setHostname(rtl::OUString::createFromAscii(_sAddr.getStr())))
{
- t_print("# cant set hostname/ip\n" );
+ t_print("# can't set hostname/ip\n" );
}
rtl::OUString aHostname = aSocketAddr.getHostname();
diff --git a/sal/qa/osl/socket/sockethelper.cxx b/sal/qa/osl/socket/sockethelper.cxx
index 8830dcd515d7..929fecb687a4 100644
--- a/sal/qa/osl/socket/sockethelper.cxx
+++ b/sal/qa/osl/socket/sockethelper.cxx
@@ -283,7 +283,7 @@ sal_Bool ifIpv4is( const ::rtl::ByteSequence Ipaddr, sal_Int8 seq1, sal_Int8 seq
return sal_False;
}
-/** if the IP or hostname is availble( alive )
+/** if the IP or hostname is available( alive )
*/
/*sal_Bool ifAvailable( const char * stringAddrOrHostName )
{
diff --git a/sal/qa/osl/socket/sockethelper.hxx b/sal/qa/osl/socket/sockethelper.hxx
index d7faa11cfd34..99c7f5f95c48 100644
--- a/sal/qa/osl/socket/sockethelper.hxx
+++ b/sal/qa/osl/socket/sockethelper.hxx
@@ -143,7 +143,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 the IP or hostname is availble( alive )
+/** if the IP or hostname is available( alive )
*/
//sal_Bool ifAvailable( const char * stringAddrOrHostName );
sal_Bool ifAvailable( rtl::OUString const& strAddrOrHostName );
diff --git a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
index efd7e495ba4e..c5eed78a13e6 100644
--- a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
+++ b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx
@@ -191,7 +191,7 @@ namespace rtl_Bootstrap
// but try to use ${file::KEYVALUE} than 'file' will only used out of the 'executable path'/file
// not from the path given from the absolute path.
- // Due to the fact, we create at this position a file (createTestshl2rc() ), we check for existance
+ // Due to the fact, we create at this position a file (createTestshl2rc() ), we check for existence
bool bFileExist = t_fileExist( suGetname );
CPPUNIT_ASSERT_MESSAGE("ctor error with initial file.", bFileExist == true );
}
diff --git a/sal/qa/rtl_strings/rtl_OUString.cxx b/sal/qa/rtl_strings/rtl_OUString.cxx
index 9967e4354d53..5a447ff47288 100644
--- a/sal/qa/rtl_strings/rtl_OUString.cxx
+++ b/sal/qa/rtl_strings/rtl_OUString.cxx
@@ -744,7 +744,7 @@ extern "C" void /* sal_Bool */ SAL_CALL test_rtl_OUString_op_eq(
{"null and Ustr1", new OUString, new OUString(aUStr1)},
{"Ustr2 and Ustr1", new OUString(aUStr2),
new OUString(aUStr1)},
- {""" and Ustr1 from bit charactor buffer",
+ {""" and Ustr1 from bit character buffer",
new OUString(aUStr1),
new OUString( "",
0,
diff --git a/sal/qa/sal/makefile.mk b/sal/qa/sal/makefile.mk
index f7c5bab30ba1..c3ae3468a547 100644
--- a/sal/qa/sal/makefile.mk
+++ b/sal/qa/sal/makefile.mk
@@ -20,27 +20,27 @@
#**************************************************************
+PRJ = ..$/..
+PRJNAME = sal
+TARGET = sal_ut_types
-PRJ := ..$/..
-PRJNAME := sal
-TARGET := qa_sal
-
-ENABLE_EXCEPTIONS := TRUE
+ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
-SHL1TARGET = $(TARGET)_types
-SHL1OBJS = $(SLO)$/test_types.obj
-SHL1STDLIBS = $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-SHL1VERSIONMAP = version.map
-SHL1IMPLIB = i$(SHL1TARGET)
-DEF1NAME = $(SHL1TARGET)
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
-SLOFILES = $(SHL1OBJS)
+.ELSE
-.INCLUDE: target.mk
+APP1OBJS = $(OBJ)/test_types.obj
+APP1RPATH = NONE
+APP1STDLIBS = $(GTESTLIB) $(SALLIB)
+APP1TARGET = sal_ut_test
+APP1TEST = enabled
+#APP1TEST = disabled
-ALLTAR: test
+.INCLUDE: target.mk
-test .PHONY: $(SHL1TARGETN)
- testshl2 $(SHL1TARGETN)
+.ENDIF
diff --git a/sal/qa/sal/test_types.cxx b/sal/qa/sal/test_types.cxx
index 4c69e16329ca..7cac0152545e 100644
--- a/sal/qa/sal/test_types.cxx
+++ b/sal/qa/sal/test_types.cxx
@@ -28,9 +28,10 @@
#include <stdio.h> // C99 snprintf not necessarily in <cstdio>
#include <string.h> // wntmsci10 does not know <cstring> std::strcmp
-#include "testshl/simpleheader.hxx"
#include "sal/types.h"
+#include "gtest/gtest.h"
+
namespace {
template< typename T > void testPrintf(
@@ -39,20 +40,11 @@ template< typename T > void testPrintf(
std::size_t const bufsize = 1000;
char buf[bufsize];
int n = snprintf(buf, bufsize, format, argument);
- CPPUNIT_ASSERT(n >= 0 && sal::static_int_cast< unsigned int >(n) < bufsize);
- CPPUNIT_ASSERT(strcmp(buf, result) == 0);
+ ASSERT_TRUE(n >= 0 && sal::static_int_cast< unsigned int >(n) < bufsize);
+ ASSERT_TRUE(strcmp(buf, result) == 0);
}
-class Test: public CppUnit::TestFixture {
-public:
- void test();
-
- CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(test);
- CPPUNIT_TEST_SUITE_END();
-};
-
-void Test::test() {
+TEST(Sal_Test, Types_Test) {
testPrintf("-2147483648", "%" SAL_PRIdINT32, SAL_MIN_INT32);
testPrintf("4294967295", "%" SAL_PRIuUINT32, SAL_MAX_UINT32);
testPrintf("ffffffff", "%" SAL_PRIxUINT32, SAL_MAX_UINT32);
@@ -70,8 +62,10 @@ void Test::test() {
testPrintf("ABC", "%" SAL_PRIXUINTPTR, static_cast< sal_uIntPtr >(0xabc));
}
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
-
}
-NOADDITIONAL;
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 2c93d9897f13..b219c5c5442a 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -41,7 +41,6 @@
#include <rtl/instance.hxx>
#include <rtl/malformeduriexception.hxx>
#include <rtl/uri.hxx>
-#include "rtl/allocator.hxx"
#include "macro.hxx"
@@ -134,10 +133,7 @@ struct rtl_bootstrap_NameValue
{}
};
-typedef std::list<
- rtl_bootstrap_NameValue,
- rtl::Allocator< rtl_bootstrap_NameValue >
-> NameValueList;
+typedef std::list<rtl_bootstrap_NameValue> NameValueList;
bool find(
NameValueList const & list, rtl::OUString const & key,
@@ -605,10 +601,7 @@ void Bootstrap_Impl::expandValue(
namespace {
struct bootstrap_map {
- typedef std::hash_map<
- rtl::OUString, Bootstrap_Impl *,
- rtl::OUStringHash, std::equal_to< rtl::OUString >,
- rtl::Allocator< OUString > > t;
+ typedef std::hash_map< const rtl::OUString, Bootstrap_Impl*, rtl::OUStringHash > t;
// get and release must only be called properly synchronized via some mutex
// (e.g., osl::Mutex::getGlobalMutex()):
diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx
index 6d22c3dd76fc..db7243bf931b 100644
--- a/sal/rtl/source/hash.cxx
+++ b/sal/rtl/source/hash.cxx
@@ -23,12 +23,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "rtl/allocator.hxx"
#include "hash.h"
#include "strimp.h"
-
#include <hash_set>
namespace {
@@ -53,8 +51,7 @@ struct UStringEqual
}
};
-typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual,
- rtl::Allocator<rtl_uString *> > StringHashTable;
+typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual > StringHashTable;
StringHashTable *
getHashTable ()
diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx
index 81672ce7f373..f33d34dd44d1 100644
--- a/sal/rtl/source/unload.cxx
+++ b/sal/rtl/source/unload.cxx
@@ -28,7 +28,6 @@
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
#include <hash_map>
-#include "rtl/allocator.hxx"
#include <functional>
#include <list>
@@ -153,11 +152,10 @@ struct hashModule
};
typedef std::hash_map<
- oslModule,
+ const oslModule,
std::pair<sal_uInt32, component_canUnloadFunc>,
hashModule,
- std::equal_to<oslModule>,
- rtl::Allocator<oslModule>
+ std::equal_to<oslModule>
> ModuleMap;
typedef ModuleMap::iterator Mod_IT;
@@ -243,7 +241,7 @@ extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused)
{
MutexGuard guard( getUnloadingMutex());
- typedef std::list< oslModule, rtl::Allocator<oslModule> > list_type;
+ typedef std::list< oslModule > list_type;
list_type unloadedModulesList;
ModuleMap& moduleMap= getModuleMap();
@@ -302,11 +300,10 @@ struct hashListener
};
typedef std::hash_map<
- sal_Int32,
+ const sal_Int32,
std::pair<rtl_unloadingListenerFunc, void*>,
hashListener,
- std::equal_to<sal_Int32>,
- rtl::Allocator<sal_Int32>
+ std::equal_to<sal_Int32>
> ListenerMap;
typedef ListenerMap::iterator Lis_IT;
@@ -330,13 +327,10 @@ static ListenerMap& getListenerMap()
// This queue contains cookies which have been passed out by rtl_addUnloadingListener and
// which have been regainded by rtl_removeUnloadingListener. When rtl_addUnloadingListener
// is called then a cookie has to be returned. First we look into the set if there is one
-// availabe. Otherwise a new cookie will be provided.
+// available. Otherwise a new cookie will be provided.
// not a new value is returned.
-typedef std::deque<
- sal_Int32,
- rtl::Allocator<sal_Int32>
-> queue_type;
+typedef std::deque< sal_Int32 > queue_type;
static queue_type& getCookieQueue()
{
diff --git a/sal/systools/win32/kill/kill.cxx b/sal/systools/win32/kill/kill.cxx
index 25587d9f124c..76f0b2669d35 100644
--- a/sal/systools/win32/kill/kill.cxx
+++ b/sal/systools/win32/kill/kill.cxx
@@ -67,7 +67,7 @@ static inline bool IsValidHandle( HANDLE handle )
#define elementsof( a ) (sizeof(a) / sizeof( (a)[0] ))
/////////////////////////////////////////////////////////////////////////////
-// Retrieves function adress in another process
+// Retrieves function address in another process
/////////////////////////////////////////////////////////////////////////////
#if 1
diff --git a/sal/systools/win32/uwinapi/MoveFileExA.cpp b/sal/systools/win32/uwinapi/MoveFileExA.cpp
index 3d41327651a2..9b5831d6aa03 100644
--- a/sal/systools/win32/uwinapi/MoveFileExA.cpp
+++ b/sal/systools/win32/uwinapi/MoveFileExA.cpp
@@ -76,7 +76,7 @@ IMPLEMENT_THUNK( kernel32, WINDOWS, BOOL, WINAPI, MoveFileExA, ( LPCSTR lpExisti
fSuccess = CopyFileA( lpExistingFileNameA, lpNewFileNameA, bFailIfExist );
- // In case of successfull copy do not return FALSE if delete fails.
+ // In case of successful copy do not return FALSE if delete fails.
// Error detection is done by GetLastError()
if ( fSuccess )
diff --git a/sal/test/bootstrap b/sal/test/bootstrap
index 57a5d9e4a9c9..74e915026a2f 100644
--- a/sal/test/bootstrap
+++ b/sal/test/bootstrap
@@ -72,7 +72,7 @@ echo 13
./testbootstrap TheKeysValue -env:ININAME=./bootstraptest.ini \
-env:'MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}'
-# test no infinit recursion
+# test no infinite recursion
echo 14
./testbootstrap "***RECURSION DETECTED***" -env:'MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE'
diff --git a/sal/test/bootstrap.bat b/sal/test/bootstrap.bat
index 34c14792bc05..76951e0d9e01 100755
--- a/sal/test/bootstrap.bat
+++ b/sal/test/bootstrap.bat
@@ -70,7 +70,7 @@ rem ini access with complex macro expansion
echo 13
.\testbootstrap TheKeysValue -env:ININAME=./bootstraptest.ini -env:MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}
-rem test no infinit recursion
+rem test no infinite recursion
echo 14
.\testbootstrap "***RECURSION DETECTED***" -env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE
diff --git a/sal/test/bootstrap.pl b/sal/test/bootstrap.pl
index 2bf6de574e04..32386cba62b8 100755
--- a/sal/test/bootstrap.pl
+++ b/sal/test/bootstrap.pl
@@ -217,7 +217,7 @@ if (!$rc) {
$state = 0;
}
-# test no infinit recursion
+# test no infinite recursion
if ($ENV{GUI} eq "WNT") {
$rc = system "./testbootstrap",
'"***RECURSION DETECTED***"',
@@ -229,7 +229,7 @@ else {
'-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
}
if (!$rc) {
- $comment = $comment . "no infinit recursion test not passed\n";
+ $comment = $comment . "no infinite recursion test not passed\n";
$state = 0;
}
diff --git a/sal/textenc/generate/cns116431992.pl b/sal/textenc/generate/cns116431992.pl
index dfed86b3451c..cb882d1c5ab5 100644
--- a/sal/textenc/generate/cns116431992.pl
+++ b/sal/textenc/generate/cns116431992.pl
@@ -322,7 +322,7 @@ for ($cns_plane = 1; $cns_plane <= 16; ++$cns_plane)
$cns1_row = ($cns1 >> 8) & 0xFF;
$cns1_column = $cns1 & 0xFF;
- # Do not map from Unicode to Fictious Character Set
+ # Do not map from Unicode to Fictitious Character Set
# Extensions (Lunde, p. 131), if possible:
if ($cns_plane == 3
&& ($cns_row == 66 && $cns_column > 38
@@ -330,7 +330,7 @@ for ($cns_plane = 1; $cns_plane <= 16; ++$cns_plane)
{
print " (",
printUtf32($utf32),
- " to fictious ",
+ " to fictitious ",
printCns116431992($cns_plane,
$cns_row,
$cns_column),
@@ -350,7 +350,7 @@ for ($cns_plane = 1; $cns_plane <= 16; ++$cns_plane)
| $cns_column;
print " (",
printUtf32($utf32),
- " to fictious ",
+ " to fictitious ",
printCns116431992($cns1_plane,
$cns1_row,
$cns1_column),
diff --git a/sal/textenc/tcvtkr1.tab b/sal/textenc/tcvtkr1.tab
index ca0cc4ff3360..bf82f0e18616 100644
--- a/sal/textenc/tcvtkr1.tab
+++ b/sal/textenc/tcvtkr1.tab
@@ -35,7 +35,7 @@
range 0x81 to 0xA0, extra second byte ranges 0x41 to 0x5A, 0x61 to 0x7A,
and 0x81 to 0xA0, even within the original EUC-KR area).
- The mappings are also used for the HangulTalk encoding (Macintosh), altough
+ The mappings are also used for the HangulTalk encoding (Macintosh), although
this contains some other EUC-KR extensions (that are thus not supported):
special single byte characters 0x81, 0x82, 0x83, 0xFE, and 0xFF; extra
double byte characters within first byte range 0xA1 to 0xAD and second byte
diff --git a/sal/textenc/tcvtmb.c b/sal/textenc/tcvtmb.c
index 432f5d7d5b3c..c30fd381a823 100644
--- a/sal/textenc/tcvtmb.c
+++ b/sal/textenc/tcvtmb.c
@@ -30,7 +30,7 @@
/* DBCS to Unicode conversion routine use a lead table for the first byte, */
/* where we determine the trail table or for single byte chars the unicode */
/* value. We have for all lead byte a separate table, because we can */
-/* then share many tables for diffrent charset encodings. */
+/* then share many tables for different charset encodings. */
/* ======================================================================= */
diff --git a/sal/textenc/tcvtutf8.c b/sal/textenc/tcvtutf8.c
index d137836bad70..dca0e434d872 100644
--- a/sal/textenc/tcvtutf8.c
+++ b/sal/textenc/tcvtutf8.c
@@ -141,7 +141,7 @@ sal_Size ImplConvertUtf8ToUnicode(ImplTextConverterData const * pData,
else
{
/*
- This byte is preceeded by a broken UTF-8 sequence; if this byte
+ This byte is preceded by a broken UTF-8 sequence; if this byte
is neither in the range [0x80..0xBF] nor in the range
[0xFE..0xFF], assume that this byte does not belong to that
broken sequence, but instead starts a new, legal UTF-8 sequence:
diff --git a/sal/typesconfig/typesconfig.c b/sal/typesconfig/typesconfig.c
index 25e6c6e84d43..7ef0130efed8 100644
--- a/sal/typesconfig/typesconfig.c
+++ b/sal/typesconfig/typesconfig.c
@@ -379,7 +379,7 @@ void Description_Print( struct Description* pThis, char* name )
fprintf( f, "#define SAL_TYPES_SIZEOFLONGLONG\t%d\n", (int) sizeof( long long ) );
fprintf( f, "#define SAL_TYPES_SIZEOFPOINTER\t%d\n", (int) sizeof( void* ) );
-/* Disabled for now, becuase OOo code assumes sizeof(double) == 8 and this is not
+/* Disabled for now, because OOo code assumes sizeof(double) == 8 and this is not
* likely to change any time soon. fa (2004-03-15)
*/
/* fprintf( f, "#define SAL_TYPES_SIZEOFDOUBLE\t%d\n", sizeof( double ) );*/
diff --git a/sal/workben/tgetpwnam.cxx b/sal/workben/tgetpwnam.cxx
index 9bb134f90a38..a8e1a0699517 100644
--- a/sal/workben/tgetpwnam.cxx
+++ b/sal/workben/tgetpwnam.cxx
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
}
else
{
- printf("failed to detect non existant host\n");
+ printf("failed to detect non existent host\n");
}
free(phostent);