summaryrefslogtreecommitdiff
path: root/sal/workben
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-03 10:00:55 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-03 10:00:55 +0300
commit335cd830b0bd430d282687df58a91a69dac2c528 (patch)
tree3d49d43ed0c07d643b9fd081e6eb0522b57851c2 /sal/workben
parentc04f4393f5ec63dbd546b5c503ddc82d9cd2377e (diff)
Kill superfluous vertical whitespace
Change-Id: I8c37b9ec45836f9c0e2dc0cf232f96f23c7c36d3
Diffstat (limited to 'sal/workben')
-rw-r--r--sal/workben/clipboardwben/testcopy/StdAfx.h2
-rw-r--r--sal/workben/clipboardwben/testcopy/XTDataObject.cxx57
-rw-r--r--sal/workben/clipboardwben/testcopy/XTDataObject.hxx4
-rw-r--r--sal/workben/clipboardwben/testcopy/cbcpytest.cxx23
-rw-r--r--sal/workben/clipboardwben/testpaste/StdAfx.h2
-rw-r--r--sal/workben/clipboardwben/testpaste/cbptest.cxx11
-rw-r--r--sal/workben/clipboardwben/testviewer/StdAfx.h2
-rw-r--r--sal/workben/clipboardwben/testviewer/cbvtest.cxx7
-rw-r--r--sal/workben/getlocaleinfotest.cxx2
-rw-r--r--sal/workben/t_cipher.c1
-rw-r--r--sal/workben/t_digest.c5
-rw-r--r--sal/workben/t_ojp_exe.cxx2
-rw-r--r--sal/workben/test.cxx2
-rw-r--r--sal/workben/testfile.cxx233
-rw-r--r--sal/workben/testpip2.cxx7
-rw-r--r--sal/workben/testpipe.cxx6
-rw-r--r--sal/workben/testproc.cxx2
17 files changed, 0 insertions, 368 deletions
diff --git a/sal/workben/clipboardwben/testcopy/StdAfx.h b/sal/workben/clipboardwben/testcopy/StdAfx.h
index 480916b75367..25b59fe0ec1a 100644
--- a/sal/workben/clipboardwben/testcopy/StdAfx.h
+++ b/sal/workben/clipboardwben/testcopy/StdAfx.h
@@ -3,7 +3,6 @@
// oder projektspezifische Include-Dateien, die hufig benutzt, aber
// in unregelmigen Abstnden gendert werden.
-
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
@@ -13,7 +12,6 @@
#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden
-
// Windows-Header-Dateien:
#include <windows.h>
diff --git a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
index df80774bcb84..ac7b60e27e3e 100644
--- a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
+++ b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
@@ -24,36 +24,25 @@
#include <windows.h>
#include <ole2.h>
-
// namespace directives
-
-
-
// OTWrapperDataObject
-
-
// ctor
-
CXTDataObject::CXTDataObject( LONG nRefCntInitVal ) :
m_nRefCnt( nRefCntInitVal )
{
}
-
// dtor
-
CXTDataObject::~CXTDataObject( )
{
}
-
// IUnknown->QueryInterface
-
STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject )
{
OSL_ASSERT( NULL != ppvObject );
@@ -75,19 +64,15 @@ STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject )
return hr;
}
-
// IUnknown->AddRef
-
STDMETHODIMP_(ULONG) CXTDataObject::AddRef( )
{
return static_cast< ULONG >( InterlockedIncrement( &m_nRefCnt ) );
}
-
// IUnknown->Release
-
STDMETHODIMP_(ULONG) CXTDataObject::Release( )
{
// we need a helper variable because it's
@@ -103,11 +88,9 @@ STDMETHODIMP_(ULONG) CXTDataObject::Release( )
return nRefCnt;
}
-
// IDataObject->GetData
// warning: 'goto' ahead (to easy error handling without using exceptions)
-
STDMETHODIMP CXTDataObject::GetData(LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium )
{
OSL_ASSERT( ( NULL != pFormatetc ) &&
@@ -178,10 +161,8 @@ STDMETHODIMP CXTDataObject::GetData(LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium
return hr;
}
-
// IDataObject->EnumFormatEtc
-
STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc )
{
if ( ( NULL == ppenumFormatetc ) || ( DATADIR_SET == dwDirection ) )
@@ -201,88 +182,66 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** p
return hr;
}
-
// IDataObject->QueryGetData
-
STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc )
{
return E_NOTIMPL;
}
-
// IDataObject->GetDataHere
-
STDMETHODIMP CXTDataObject::GetDataHere( LPFORMATETC, LPSTGMEDIUM )
{
return E_NOTIMPL;
}
-
// IDataObject->GetCanonicalFormatEtc
-
STDMETHODIMP CXTDataObject::GetCanonicalFormatEtc( LPFORMATETC, LPFORMATETC )
{
return E_NOTIMPL;
}
-
// IDataObject->SetData
-
STDMETHODIMP CXTDataObject::SetData( LPFORMATETC, LPSTGMEDIUM, BOOL )
{
return E_NOTIMPL;
}
-
// IDataObject->DAdvise
-
STDMETHODIMP CXTDataObject::DAdvise( LPFORMATETC, DWORD, LPADVISESINK, DWORD * )
{
return E_NOTIMPL;
}
-
// IDataObject->DUnadvise
-
STDMETHODIMP CXTDataObject::DUnadvise( DWORD )
{
return E_NOTIMPL;
}
-
// IDataObject->EnumDAdvise
-
STDMETHODIMP CXTDataObject::EnumDAdvise( LPENUMSTATDATA * )
{
return E_NOTIMPL;
}
-
// for our convenience
-
CXTDataObject::operator IDataObject*( )
{
return static_cast< IDataObject* >( this );
}
-
-
// CEnumFormatEtc
-
-
-
// ctor
-
CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) :
m_nRefCnt( 0 ),
m_pUnkDataObj( pUnkDataObj ),
@@ -292,18 +251,14 @@ CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) :
m_cfFormats[1] = CF_TEXT;
}
-
// dtor
-
CEnumFormatEtc::~CEnumFormatEtc( )
{
}
-
// IUnknown->QueryInterface
-
STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject )
{
if ( NULL == ppvObject )
@@ -323,10 +278,8 @@ STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject )
return hr;
}
-
// IUnknown->AddRef
-
STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( )
{
// keep the dataobject alive
@@ -334,10 +287,8 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( )
return InterlockedIncrement( &m_nRefCnt );
}
-
// IUnknown->Release
-
STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( )
{
// release the outer dataobject
@@ -353,10 +304,8 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( )
return nRefCnt;
}
-
// IEnumFORMATETC->Next
-
STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFetched )
{
OSL_ASSERT( ( ( celt > 0 ) && ( NULL != rgelt ) ) ||
@@ -397,10 +346,8 @@ STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFe
return hr;
}
-
// IEnumFORMATETC->Skip
-
STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt )
{
HRESULT hr = S_FALSE;
@@ -414,20 +361,16 @@ STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt )
return hr;
}
-
// IEnumFORMATETC->Reset
-
STDMETHODIMP CEnumFormatEtc::Reset( )
{
m_nCurrentPos = 0;
return S_OK;
}
-
// IEnumFORMATETC->Clone
-
STDMETHODIMP CEnumFormatEtc::Clone( IEnumFORMATETC** ppenum )
{
OSL_ASSERT( NULL != ppenum );
diff --git a/sal/workben/clipboardwben/testcopy/XTDataObject.hxx b/sal/workben/clipboardwben/testcopy/XTDataObject.hxx
index 6595e9a03a62..b899344142f1 100644
--- a/sal/workben/clipboardwben/testcopy/XTDataObject.hxx
+++ b/sal/workben/clipboardwben/testcopy/XTDataObject.hxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#ifndef _XTDATAOBJECT_HXX_
#define _XTDATAOBJECT_HXX_
@@ -39,10 +38,8 @@ public:
CXTDataObject( LONG nRefCntInitVal = 0);
~CXTDataObject( );
-
// ole interface implementation
-
//IUnknown
STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObject);
STDMETHODIMP_( ULONG ) AddRef( );
@@ -104,7 +101,6 @@ private:
CLIPFORMAT m_cfFormats[2];
};
-
typedef CEnumFormatEtc *PCEnumFormatEtc;
#endif
diff --git a/sal/workben/clipboardwben/testcopy/cbcpytest.cxx b/sal/workben/clipboardwben/testcopy/cbcpytest.cxx
index b545d414334d..27f0fe204dd0 100644
--- a/sal/workben/clipboardwben/testcopy/cbcpytest.cxx
+++ b/sal/workben/clipboardwben/testcopy/cbcpytest.cxx
@@ -17,10 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
// TestWin32.cpp : Defines the entry point for the application.
-
#define _WIN32_DCOM
#undef _UNICODE
@@ -58,7 +56,6 @@ void FlushClipboard( );
void PasteData( HWND hWnd );
void SetLocale();
-
LPSTREAM g_pStm = NULL;
char* pTextBuff = NULL;
DWORD lData = 0;
@@ -67,10 +64,8 @@ HWND g_hWnd;
HANDLE g_hEvent;
BOOL g_bEnd;
-
// a thread function
-
unsigned int _stdcall ThreadProc(LPVOID pParam)
{
while( !g_bEnd )
@@ -82,10 +77,8 @@ unsigned int _stdcall ThreadProc(LPVOID pParam)
return 0;
}
-
// WinMain
-
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
@@ -104,7 +97,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
hr = OleInitialize( NULL );
#endif
-
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_TESTWIN32, szWindowClass, MAX_LOADSTRING);
@@ -140,9 +132,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
return msg.wParam;
}
-
-
-
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
@@ -153,7 +142,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
// function, which was added to Windows 95. If it important to call
// this function to allow the use of small icons in the correct proportions.
-
ATOM MyRegisterClass( HINSTANCE hInstance )
{
WNDCLASSEX wcex;
@@ -175,7 +163,6 @@ ATOM MyRegisterClass( HINSTANCE hInstance )
return RegisterClassEx(&wcex);
}
-
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance access number and creates main window
@@ -184,7 +171,6 @@ ATOM MyRegisterClass( HINSTANCE hInstance )
// In this function, the instance access number is stored in a global variable
// and the main program window is displayed.
-
BOOL InitInstance( HINSTANCE hInstance, int nCmdShow )
{
hInst = hInstance; // Store instance access number in our global variable.
@@ -203,7 +189,6 @@ BOOL InitInstance( HINSTANCE hInstance, int nCmdShow )
return TRUE;
}
-
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
@@ -212,7 +197,6 @@ BOOL InitInstance( HINSTANCE hInstance, int nCmdShow )
// WM_PAINT - Display main windows
// WM_DESTROY - Output completion message and return
-
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId;
@@ -220,7 +204,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
-
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch( message )
@@ -279,10 +262,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0;
}
-
// copy data into the clipboard
-
void CopyClipboardData( HWND hWnd )
{
g_xtDo = new CXTDataObject( 1 );
@@ -293,10 +274,8 @@ void CopyClipboardData( HWND hWnd )
#endif
}
-
// flush the content into the clipboard
-
void FlushClipboard( )
{
if ( NULL != g_xtDo )
@@ -315,7 +294,6 @@ void FlushClipboard( )
}
}
-
void PasteData(HWND hWnd)
{
IDataObject* pDataObj;
@@ -362,7 +340,6 @@ void PasteData(HWND hWnd)
}
}
-
void SetLocale()
{
LCID threadLcid = GetThreadLocale();
diff --git a/sal/workben/clipboardwben/testpaste/StdAfx.h b/sal/workben/clipboardwben/testpaste/StdAfx.h
index 480916b75367..25b59fe0ec1a 100644
--- a/sal/workben/clipboardwben/testpaste/StdAfx.h
+++ b/sal/workben/clipboardwben/testpaste/StdAfx.h
@@ -3,7 +3,6 @@
// oder projektspezifische Include-Dateien, die hufig benutzt, aber
// in unregelmigen Abstnden gendert werden.
-
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
@@ -13,7 +12,6 @@
#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden
-
// Windows-Header-Dateien:
#include <windows.h>
diff --git a/sal/workben/clipboardwben/testpaste/cbptest.cxx b/sal/workben/clipboardwben/testpaste/cbptest.cxx
index f41698743447..5a5faeafa88e 100644
--- a/sal/workben/clipboardwben/testpaste/cbptest.cxx
+++ b/sal/workben/clipboardwben/testpaste/cbptest.cxx
@@ -17,10 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
// TestWin32.cpp : Defines the entry point for the application
-
#define _WIN32_DCOM
#include "stdafx.h"
@@ -55,10 +53,8 @@ LPSTREAM g_pStm = NULL;
char* pTextBuff = NULL;
DWORD lData = 0;
-
// a thread function
-
unsigned int _stdcall ThreadProc(LPVOID pParam)
{
IDataObject* pIDataObj = NULL;
@@ -119,10 +115,8 @@ unsigned int _stdcall ThreadProc(LPVOID pParam)
return 0;
}
-
// WinMain
-
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
@@ -169,8 +163,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
return msg.wParam;
}
-
-
//
// FUNCTION: MyRegisterClass()
//
@@ -249,7 +241,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
-
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch( message )
@@ -348,10 +339,8 @@ void PasteClipboardData2(HWND hwndParent)
}
}
-
// clipboard handling
-
/*
void PasteClipboardData(HWND hwndParent)
{
diff --git a/sal/workben/clipboardwben/testviewer/StdAfx.h b/sal/workben/clipboardwben/testviewer/StdAfx.h
index 480916b75367..25b59fe0ec1a 100644
--- a/sal/workben/clipboardwben/testviewer/StdAfx.h
+++ b/sal/workben/clipboardwben/testviewer/StdAfx.h
@@ -3,7 +3,6 @@
// oder projektspezifische Include-Dateien, die hufig benutzt, aber
// in unregelmigen Abstnden gendert werden.
-
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
@@ -13,7 +12,6 @@
#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden
-
// Windows-Header-Dateien:
#include <windows.h>
diff --git a/sal/workben/clipboardwben/testviewer/cbvtest.cxx b/sal/workben/clipboardwben/testviewer/cbvtest.cxx
index 9eda0fbd94e7..f6057c86909a 100644
--- a/sal/workben/clipboardwben/testviewer/cbvtest.cxx
+++ b/sal/workben/clipboardwben/testviewer/cbvtest.cxx
@@ -17,10 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
// TestWin32.cpp : Defines the entry point for the application.
-
#define _WIN32_DCOM
#include "stdafx.h"
@@ -65,10 +63,8 @@ void CALLBACK OnClipboardContentChange( void );
LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
LRESULT CALLBACK About( HWND, UINT, WPARAM, LPARAM );
-
// WinMain
-
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
@@ -116,8 +112,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
return msg.wParam;
}
-
-
//
// FUNCTION: MyRegisterClass()
//
@@ -194,7 +188,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
WCHAR szHello[MAX_LOADSTRING];
-
LoadStringW(g_hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch( message )
diff --git a/sal/workben/getlocaleinfotest.cxx b/sal/workben/getlocaleinfotest.cxx
index 388fa24cc035..d1f3db5328f7 100644
--- a/sal/workben/getlocaleinfotest.cxx
+++ b/sal/workben/getlocaleinfotest.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <rtl/locale.h>
#include <osl/nlsupport.h>
#include <rtl/ustring.hxx>
@@ -37,5 +36,4 @@ int _cdecl main( int argc, char * argv[] )
return(0);
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/workben/t_cipher.c b/sal/workben/t_cipher.c
index 335d48583cd4..dd802e08c441 100644
--- a/sal/workben/t_cipher.c
+++ b/sal/workben/t_cipher.c
@@ -130,7 +130,6 @@ unsigned long ciphertext_r[NUM_VARIABLE_KEY_TESTS + NUM_SET_KEY_TESTS] = {
0x8CE2D14Bl, 0x469FF67Bl, 0xC1BC96A8l, 0x3858DA9Fl, 0x9B9DB21Fl,
0xFD36B46Fl, 0x5A5479ADl, 0xFA52D080l };
-
static sal_uInt8 cbc_key[16] =
{
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
diff --git a/sal/workben/t_digest.c b/sal/workben/t_digest.c
index f2bbf62fe6a2..499c7e927539 100644
--- a/sal/workben/t_digest.c
+++ b/sal/workben/t_digest.c
@@ -82,7 +82,6 @@ static const char *digest_bigout_SHA_0=
static const char *digest_bigout_SHA_1=
"34aa973cd4c4daa4f61eeb2bdbad27316534016f";
-
static const char digest_key_HMAC_MD5_1[] =
{
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
@@ -144,7 +143,6 @@ static const char *digest_out_HMAC_SHA1[] =
NULL
};
-
static char *pt (unsigned char *md, int length)
{
int i;
@@ -291,7 +289,6 @@ int SAL_CALL main (void)
else
printf("test (SHA-1) n ok\n");
-
P=digest_in_HMAC_MD5;
Q=digest_key_HMAC_MD5;
R=digest_out_HMAC_MD5;
@@ -319,7 +316,6 @@ int SAL_CALL main (void)
}
rtl_digest_destroyHMAC_MD5 (Digest);
-
P=digest_in_HMAC_MD5;
Q=digest_key_HMAC_MD5;
R=digest_out_HMAC_SHA1;
@@ -347,7 +343,6 @@ int SAL_CALL main (void)
}
rtl_digest_destroyHMAC_SHA1 (Digest);
-
P=digest_in_HMAC_MD5;
Q=digest_key_HMAC_MD5;
rtl_digest_PBKDF2 (
diff --git a/sal/workben/t_ojp_exe.cxx b/sal/workben/t_ojp_exe.cxx
index a3066c554bcc..a0ea3ab67231 100644
--- a/sal/workben/t_ojp_exe.cxx
+++ b/sal/workben/t_ojp_exe.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-
#ifdef WNT
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/sal/workben/test.cxx b/sal/workben/test.cxx
index a21759e97e76..de7fc035358e 100644
--- a/sal/workben/test.cxx
+++ b/sal/workben/test.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <stdio.h>
#if (defined UNX)
@@ -53,5 +52,4 @@ int _cdecl main( int argc, char * argv[] )
return(0);
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index b4392a4136b1..0148a22f5b8a 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -17,10 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#define UNICODE
-
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/time.h>
@@ -30,7 +28,6 @@
#include <string.h>
#include <time.h>
-
#ifdef UNX
#include <wchar.h>
#endif
@@ -57,8 +54,6 @@ rtl::OUString file3;
rtl::OUString file_on_server;
rtl::OUString file_not_exist;
-
-
void print_error(const ::rtl::OString& str, FileBase::RC rc);
void PressKey()
@@ -78,10 +73,8 @@ void printFileName(const ::rtl::OUString& str)
return;
}
-
// Initialization
-
sal_Bool testLineBreak( sal_Char *pCount , sal_uInt64 nLen , sal_uInt32 *cLineBreak )
{
sal_Bool fSuccess=sal_False;
@@ -188,7 +181,6 @@ sal_Bool Initialize( void )
if ( rc!=FileBase::E_None )
return sal_False;
-
pBegin=pBuffer;
pCount=pBegin;
@@ -229,7 +221,6 @@ sal_Bool Initialize( void )
rtl_freeMemory( pBuffer );
-
// Create directories
rc=Directory::create( dir1 );
if ( rc!=FileBase::E_None )
@@ -267,10 +258,8 @@ sal_Bool Initialize( void )
return sal_True;
}
-
// Shutdown
-
sal_Bool Shutdown( void )
{
sal_Bool fSuccess=sal_True;
@@ -318,10 +307,8 @@ sal_Bool Shutdown( void )
return fSuccess;
}
-
// helper functions
-
// Show FileType
void showFileType( FileStatus::Type aType )
{
@@ -408,7 +395,6 @@ void showTime( TimeValue aTime )
else
printf ("Verify : TimeValue : Error! \n");
-
if ( osl_getSystemTimeFromLocalTime( &aLocalTimeVal , &aSysTimeVal ) )
{
if ( ( aSysTimeVal.Seconds == aTime.Seconds ) && ( aSysTimeVal.Nanosec == aTime.Nanosec ))
@@ -439,11 +425,8 @@ TimeValue getSystemTime()
return aTime;
}
-
-
// DirectoryOpenAndCloseTest
-
void DirectoryOpenAndCloseTest( void )
{
FileBase::RC rc;
@@ -453,10 +436,8 @@ void DirectoryOpenAndCloseTest( void )
printf( "Directory-Open-And-Close-Test\n");
printf( "--------------------------------------------\n\n");
-
// open an existing directory
-
pDir=new Directory( dir1 );
printf( "Open an existing directory: ");
printFileName( dir1 );
@@ -477,10 +458,8 @@ void DirectoryOpenAndCloseTest( void )
delete pDir;
printf( "\n" );
-
// open a not existing directory
-
pDir=new Directory( dir_not_exist );
printf( "Open a not existing directory: ");
@@ -495,7 +474,6 @@ void DirectoryOpenAndCloseTest( void )
printf( "\n" );
-
// open a directory with a wrong semantic
pDir=new Directory( dir_wrong_semantic );
@@ -511,10 +489,8 @@ void DirectoryOpenAndCloseTest( void )
printf( "\n" );
-
// open an existing directory on a server
-
pDir=new Directory( dir_on_server );
printf( "Open an existing directory on a server: ");
@@ -531,10 +507,8 @@ void DirectoryOpenAndCloseTest( void )
delete pDir;
printf( "\n" );
-
// open a not existing directory on a server
-
pDir=new Directory( dir_not_exist_on_server );
printf( "Open a not existing directory on a server: ");
@@ -547,10 +521,8 @@ void DirectoryOpenAndCloseTest( void )
delete pDir;
printf( "\n" );
-
// Close a not existing directory
-
pDir=new Directory( dir_not_exist );
printf( "Close a not existing directory: ");
printFileName( dir_not_exist );
@@ -564,10 +536,8 @@ void DirectoryOpenAndCloseTest( void )
}
-
// DirectoryCreateAndRemoveTest
-
void DirectoryCreateAndRemoveTest( void )
{
FileBase::RC rc,rc1;
@@ -577,7 +547,6 @@ void DirectoryCreateAndRemoveTest( void )
printf( "Directory-Create-And-Remove-Test\n" );
printf( "--------------------------------------------\n\n" );
-
// Create directory
printf( "Create a not existing directory: ");
@@ -597,10 +566,8 @@ void DirectoryCreateAndRemoveTest( void )
printf( "\n" );
-
// Create a directory on a server
-
printf( "Create a not existing directory on a server: ");
printFileName( dir_not_exist_on_server );
printf( "\n" );
@@ -617,10 +584,8 @@ void DirectoryCreateAndRemoveTest( void )
printf( "\n" );
-
// Remove Directories
-
printf( "Remove the created directories: \n" );
rc=Directory::remove( dir_not_exist );
@@ -636,10 +601,8 @@ void DirectoryCreateAndRemoveTest( void )
printf( "\n" );
-
// Remove a not existing directory
-
printf( "Remove a not existing directory: ");
printFileName( dir_not_exist );
printf( "\n" );
@@ -651,10 +614,8 @@ void DirectoryCreateAndRemoveTest( void )
return;
}
-
// FileOpenAndCloseTest
-
static void FileOpenAndCloseTest( void )
{
FileBase::RC rc;
@@ -671,42 +632,32 @@ static void FileOpenAndCloseTest( void )
printFileName( file1 );
printf( "\n" );
-
// open an existing file (Read)
-
rc=pFile->open( osl_File_OpenFlag_Read );
print_error( rtl::OString( "Open File (Read)" ), rc );
-
// close the file
-
rc=pFile->close();
print_error( rtl::OString( "Close File" ), rc );
printf( "\n" );
-
// open an existing file (Write)
-
rc=pFile->open( osl_File_OpenFlag_Write );
print_error( rtl::OString( "Open File (Write)" ), rc );
-
// close the file
-
rc=pFile->close();
print_error( rtl::OString( "Close File" ), rc );
printf( "\n" );
-
// close the file a second time
-
rc=pFile->close();
print_error( rtl::OString( "Close the file a second time" ), rc );
@@ -714,10 +665,8 @@ static void FileOpenAndCloseTest( void )
PressKey();
}
-
// FileCreateAndRemoveTest
-
void FileCreateAndRemoveTest()
{
FileBase::RC rc;
@@ -733,40 +682,31 @@ void FileCreateAndRemoveTest()
printFileName( file_not_exist );
printf( "\n" );
-
// open (create) a not existing file (Read and write)
-
rc = pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
print_error( rtl::OString( "Create and Open File (Read & Write)" ), rc );
-
// close the file
-
rc=pFile->close();
print_error( rtl::OString( "Close File" ), rc );
-
// remove the file
-
rc=pFile->remove( file_not_exist );
print_error( rtl::OString(" Remove File" ), rc );
printf( "\n" );
-
// remove the same file a second time
rc=pFile->remove( file_not_exist );
print_error( rtl::OString( "Remove a not existing File" ), rc );
-
// remove an open file
-
pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
rc=pFile->remove( file_not_exist );
@@ -780,10 +720,8 @@ void FileCreateAndRemoveTest()
return;
}
-
// FileWriteAndReadTest
-
void FileWriteAndReadTest( void )
{
FileBase::RC rc;
@@ -806,17 +744,14 @@ void FileWriteAndReadTest( void )
printFileName( file_not_exist );
printf("\n");
-
// open (create) a not existing file (Read and write)
-
rc = pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
print_error( rtl::OString( "Create and Open File (Read & Write)" ), rc );
printf( "\n" );
-
// write a string to the file
rc=pFile->write( pWriteBuffer , nLen , uWritten );
@@ -829,19 +764,15 @@ void FileWriteAndReadTest( void )
printf( "\n" );
-
// move the filepointer to the beginning
-
rc=pFile->setPos( osl_Pos_Absolut , 0 );
print_error( rtl::OString( "Set FilePointer to the beginning of the file" ), rc );
printf( "\n" );
-
// read the string
-
pReadBuffer=(sal_Char*) rtl_allocateMemory( (sal_uInt32)(nLen+1)*sizeof(sal_Char) );
memset( pReadBuffer, 0, (sal_uInt32)(nLen+1)*sizeof(sal_Char) );
rc=pFile->read( pReadBuffer , nLen,uRead );
@@ -873,10 +804,8 @@ void FileWriteAndReadTest( void )
}
-
// FileCopyMoveTest
-
void FileCopyAndMoveTest( void )
{
FileBase::RC rc;
@@ -885,14 +814,11 @@ void FileCopyAndMoveTest( void )
printf( "File-Copy-Move-Test\n" );
printf( "--------------------------------------------\n\n" );
-
File *pFile;
rtl::OUString destPath(dir2);
-
// FileCopyTest
-
destPath+=rtl::OUString("/");
destPath+=file3;
@@ -902,7 +828,6 @@ void FileCopyAndMoveTest( void )
printFileName( destPath );
printf( "\n" );
-
rc=File::copy( file1 , destPath );
print_error( rtl::OString( "FileCopy" ), rc );
@@ -922,10 +847,8 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
// Copy a file to a not existing directory
-
destPath=rtl::OUString( dir_not_exist );
destPath+=rtl::OUString("/");
destPath+=file3;
@@ -940,10 +863,8 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
// Copy a directory
-
printf( "Copy the directory: ");
printFileName( dir1 );
printf( " to ");
@@ -955,10 +876,8 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
// FileMoveTest
-
destPath=rtl::OUString( dir2 );
destPath+=rtl::OUString("/");
destPath+=file3;
@@ -1003,11 +922,8 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
-
// Move a file to a not existing directory
-
destPath=rtl::OUString( dir_not_exist );
destPath+=rtl::OUString("/");
destPath+=file3;
@@ -1024,10 +940,8 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
// Move a directory
-
printf( "Move a directory: \n");
printf( "Move the directory ");
@@ -1036,7 +950,6 @@ void FileCopyAndMoveTest( void )
printFileName( dir_not_exist );
printf( "\n" );
-
rc=File::move( dir1 , dir_not_exist);
print_error( rtl::OString( "FileMove" ), rc );
@@ -1045,15 +958,12 @@ void FileCopyAndMoveTest( void )
printf( "\n" );
-
PressKey();
return;
}
-
// FileSizeTest
-
void FileSizeTest( void )
{
FileBase::RC rc;
@@ -1064,7 +974,6 @@ void FileSizeTest( void )
printf( "File-Size-Test\n" );
printf( "--------------------------------------------\n\n" );
-
File aFile( file_not_exist );
printf( "Create File: ");
@@ -1080,7 +989,6 @@ void FileSizeTest( void )
// Set Filesize to 5000
-
printf( "Set FileSize to 5000\n" );
rc=aFile.setSize( 5000 );
print_error( rtl::OString( "Set FileSize" ), rc );
@@ -1088,10 +996,8 @@ void FileSizeTest( void )
printf( "\n" );
printf( "Verify:\n" );
-
// Check whether Filesize is set to 5000
-
rc=DirectoryItem::get( file_not_exist, aItem );
print_error( rtl::OString( "Get DirectoryItem" ), rc );
@@ -1114,10 +1020,8 @@ void FileSizeTest( void )
printf( "\n" );
-
// Set Filesize to -1
-
printf( "Set FileSize to -1\n" );
rc=aFile.setSize( -1 );
print_error( rtl::OString( "Set FileSize" ), rc );
@@ -1138,11 +1042,8 @@ void FileSizeTest( void )
return;
}
-
-
// FilePointerTest
-
void FilePointerTest( void )
{
FileBase::RC rc;
@@ -1152,7 +1053,6 @@ void FilePointerTest( void )
printf( "File-Pointer-Test\n" );
printf( "--------------------------------------------\n\n" );
-
File rFile( file_not_exist );
printf( "Create File: ");
@@ -1166,20 +1066,16 @@ void FilePointerTest( void )
if ( rc==FileBase::E_None )
{
-
// get the position of the filepointer
-
rc =rFile.getPos( filepointer );
print_error( rtl::OString( "GetPos" ), rc );
printf( "Position of the FilePointer: %" SAL_PRIuUINT64 "\n", filepointer );
printf( "\n" );
-
// set the filepointer at the end of a file
-
printf( "Set FileSize to 5000\n" );
rFile.setSize( 5000 );
@@ -1218,10 +1114,8 @@ void FilePointerTest( void )
return;
}
-
// FileAttributesTest
-
void verifyFileAttributes( void )
{
FileBase::RC rc;
@@ -1264,7 +1158,6 @@ void FileAttributesTest( void )
printFileName( file1 );
printf( "\n\n" );
-
rc=File::setAttributes( file1, osl_File_Attribute_GrpWrite );
print_error( rtl::OString( "Set Attribute: GrpWrite" ), rc );
@@ -1346,7 +1239,6 @@ void FileAttributesTest( void )
if ( rc!=FileBase::E_None )
print_error( rtl::OString( "Reset Attributes" ), rc );
-
rc=File::setAttributes( file1, osl_File_Attribute_GrpWrite | osl_File_Attribute_GrpRead | osl_File_Attribute_GrpExe | osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnRead | osl_File_Attribute_OwnExe | osl_File_Attribute_OthWrite | osl_File_Attribute_OthRead | osl_File_Attribute_OthExe );
print_error( rtl::OString( "Set all Attributes" ), rc );
@@ -1371,7 +1263,6 @@ void FileAttributesTest( void )
printFileName( file1 );
printf( "\n\n" );
-
rc=File::setAttributes( file1, osl_File_Attribute_ReadOnly );
print_error( rtl::OString( "Set Attribute: ReadOnly" ), rc );
@@ -1408,10 +1299,8 @@ void FileAttributesTest( void )
}
#endif
-
// FileTimeTest
-
void FileTimeTest( void )
{
FileBase::RC rc;
@@ -1454,7 +1343,6 @@ void FileTimeTest( void )
TimeValue aAccessTimeRead;
TimeValue aModifyTimeRead;
-
printf( "--------------------------------------------\n" );
printf( "File-Time-Test\n" );
printf( "--------------------------------------------\n\n" );
@@ -1472,18 +1360,14 @@ void FileTimeTest( void )
printf( "\nModifyTime \t : ");
showTime( aModifyTime );
-
// setTime
-
printf( "\n" );
rc=File::setTime( file1 , aCreationTime , aAccessTime , aModifyTime );
print_error( rtl::OString( "SetTime" ), rc );
-
// Verify
-
FileStatus rStatus( osl_FileStatus_Mask_CreationTime | osl_FileStatus_Mask_AccessTime | osl_FileStatus_Mask_ModifyTime);
printf( "\nVerify:\n" );
@@ -1502,7 +1386,6 @@ void FileTimeTest( void )
// GetCreationTime
-
aCreationTimeRead=rStatus.getCreationTime();
#ifdef WNT
if ( aCreationTime.Seconds == aCreationTimeRead.Seconds && aCreationTime.Nanosec == aCreationTimeRead.Nanosec )
@@ -1516,7 +1399,6 @@ void FileTimeTest( void )
// GetAccessTime
-
aAccessTimeRead=rStatus.getAccessTime();
if ( aAccessTime.Seconds == aAccessTimeRead.Seconds && aAccessTime.Nanosec == aAccessTimeRead.Nanosec )
@@ -1527,10 +1409,8 @@ void FileTimeTest( void )
showTime( aAccessTimeRead );
printf( "\n" );
-
// GetModifyTime
-
aModifyTimeRead=rStatus.getModifyTime();
if ( aModifyTime.Seconds == aModifyTimeRead.Seconds && aModifyTime.Nanosec == aModifyTimeRead.Nanosec )
@@ -1547,11 +1427,8 @@ void FileTimeTest( void )
return;
}
-
-
// DirectoryItemTest
-
void DirectoryItemTest( void )
{
FileBase::RC rc;
@@ -1564,10 +1441,8 @@ void DirectoryItemTest( void )
printf( "Directory-Item-Test\n" );
printf( "--------------------------------------------\n\n" );
-
// get DirectoryItem from an existing directory
-
printf( "Get DirectoryItem from an existing Directory: ");
printFileName( dir1 );
printf( "\n");
@@ -1589,10 +1464,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem from a not existing directory
-
printf( "Get DirectoryItem from a not existing Directory: ");
printFileName( dir_not_exist );
printf( "\n" );
@@ -1602,10 +1475,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem from an existing file
-
printf( "Get DirectoryItem from an existing File: ");
printFileName( file1 );
printf( "\n" );
@@ -1627,10 +1498,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem from a not existing file
-
printf( "Get DirectoryItem from a not existing File: ");
printFileName( file_not_exist );
printf( "\n" );
@@ -1640,10 +1509,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem from a directory with a wrong semantic
-
printf( "Get DirectoryItem from a Directory with a wrong semantic: ");
printFileName( dir_not_exist );
printf( "\n" );
@@ -1653,10 +1520,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem from a file-handle
-
pFile=new File( file1 );
rc=pFile->open( osl_File_OpenFlag_Read );
@@ -1688,20 +1553,16 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// get DirectoryItem
-
printf( "Get DirectoryItem from an empty File-Handle\n" );
rc=DirectoryItem::get( file1 , aItem );
print_error( rtl::OString( "GetDirectoryItem" ), rc );
printf( "\n" );
-
// GetNextItem from a directory
-
pDir=new Directory( dir1 );
printf( "Get next DirectoryItem from a directory: ");
printFileName( dir1);
@@ -1717,7 +1578,6 @@ void DirectoryItemTest( void )
// get all files from the directory
-
rtl::OUString str;
rtl::OUString str1[2];
@@ -1743,10 +1603,8 @@ void DirectoryItemTest( void )
printf( "\n" );
-
// Reset-Test
-
for (int i=0; i<2; i++)
{
aItem=DirectoryItem();
@@ -1759,7 +1617,6 @@ void DirectoryItemTest( void )
str1[i]=rStatus.getFileName();
}
-
if ( str1[0] == str1[1] )
print_error( rtl::OString( "Reset" ),FileBase::E_None );
else
@@ -1774,10 +1631,8 @@ void DirectoryItemTest( void )
printf( "\n");
-
// GetNextItem from a closed directory
-
printf( "Get next DirectoryItem from a closed directory: ");
printFileName( dir1 );
printf( "\n" );
@@ -1792,36 +1647,29 @@ void DirectoryItemTest( void )
return;
}
-
// FileStatusTest (for different types)
-
void FileStatusTest( FileStatus *pStatus )
{
// GetFileType of the directory
-
FileStatus::Type aType;
printf( "\ngetFileType:\n" );
aType=pStatus->getFileType();
showFileType( aType );
-
// GetAttributes
-
sal_uInt64 uAttributes;
printf( "\ngetAttributes:\n" );
uAttributes=pStatus->getAttributes();
showAttributes( uAttributes );
-
// GetCreationTime
-
TimeValue aCreationTime;
printf( "\ngetCreationTime:\n" );
@@ -1830,10 +1678,8 @@ void FileStatusTest( FileStatus *pStatus )
printf( "CreationTime: " );
showTime( aCreationTime );
-
// GetAccessTime
-
TimeValue aAccessTime;
printf( "\ngetAccessTime:\n" );
@@ -1842,10 +1688,8 @@ void FileStatusTest( FileStatus *pStatus )
printf( "AccessTime: " );
showTime( aAccessTime );
-
// GetModifyTime
-
TimeValue aModifyTime;
printf( "\ngetModifyTime:\n" );
@@ -1854,10 +1698,8 @@ void FileStatusTest( FileStatus *pStatus )
printf( "ModifyTime: " );
showTime( aModifyTime );
-
// GetFileSize
-
sal_uInt64 FileSize;
printf( "\ngetFileSize:\n" );
@@ -1865,10 +1707,8 @@ void FileStatusTest( FileStatus *pStatus )
FileSize=pStatus->getFileSize();
printf( "FileSize: %" SAL_PRIuUINT64 "\n", FileSize);
-
// GetFileName
-
rtl::OUString FileName;
printf( "\ngetFileName:\n" );
@@ -1878,10 +1718,8 @@ void FileStatusTest( FileStatus *pStatus )
printFileName( FileName );
printf( "\n" );
-
// GetFileURL
-
rtl::OUString FileURL;
printf( "\ngetFileURL:\n" );
@@ -1891,10 +1729,8 @@ void FileStatusTest( FileStatus *pStatus )
printFileName( FileURL );
printf( "\n" );
-
// GetLinkTargetURL
-
rtl::OUString LinkTargetURL;
printf( "\ngetLinkTargetURL:\n");
@@ -1907,10 +1743,8 @@ void FileStatusTest( FileStatus *pStatus )
return;
}
-
// DirectoryFileStatusTest
-
void DirectoryFileStatusTest( void )
{
FileBase::RC rc;
@@ -1946,10 +1780,8 @@ void DirectoryFileStatusTest( void )
return;
}
-
// FileFileStatusTest
-
void FileFileStatusTest( void )
{
FileBase::RC rc;
@@ -1985,10 +1817,8 @@ void FileFileStatusTest( void )
return;
}
-
// VolumeFileStatusTest
-
void VolumeFileStatusTest( void )
{
FileBase::RC rc;
@@ -2024,11 +1854,8 @@ void VolumeFileStatusTest( void )
return;
}
-
-
// VolumeInfoTest
-
void VolumeInfoTest( void )
{
FileBase::RC rc;
@@ -2048,68 +1875,52 @@ void VolumeInfoTest( void )
printf( "\n" );
-
// getRemoteFlag
-
if ( rInfo.getRemoteFlag() )
printf( "RemoteFlag: Yes\n" );
else
printf( "RemoteFlag: No\n" );
-
// getRemoveableFlag
-
if ( rInfo.getRemoveableFlag() )
printf( "RemoveableFlag: Yes\n" );
else
printf( "RemoveableFlag: No\n" );
-
// getTotalSpace
-
sal_uInt64 TotalSpace;
TotalSpace=rInfo.getTotalSpace();
printf( "Total Space: %" SAL_PRIuUINT64 "\n",TotalSpace );
-
// getFreeSpace
-
sal_uInt64 FreeSpace;
FreeSpace=rInfo.getFreeSpace();
printf( "Free Space: %" SAL_PRIuUINT64 "\n",FreeSpace );
-
// getUsedSpace
-
sal_uInt64 UsedSpace;
UsedSpace=rInfo.getUsedSpace();
printf( "Used Space: %" SAL_PRIuUINT64 "\n",UsedSpace );
-
// getMaxNameLength
-
sal_uInt32 MaxNameLength;
MaxNameLength=rInfo.getMaxNameLength();
printf( "MaxNameLength: %" SAL_PRIuUINT32 "\n",MaxNameLength );
-
// getMaxPathLength
-
sal_uInt32 MaxPathLength;
MaxPathLength=rInfo.getMaxPathLength();
printf( "MaxPathLength: %" SAL_PRIuUINT32 "\n",MaxPathLength );
-
// getFileSystemName
-
rtl::OUString FileSystemName;
FileSystemName=rInfo.getFileSystemName();
printf( "File-System-Name: ");
@@ -2120,10 +1931,8 @@ void VolumeInfoTest( void )
return;
}
-
// FileBaseTest
-
void ConvertPathTest(rtl::OUString& strPath)
{
FileBase::RC rc;
@@ -2133,10 +1942,8 @@ void ConvertPathTest(rtl::OUString& strPath)
rtl::OUString strNormPathFromFileURL;
rtl::OUString strSystemPath;
-
// normalizePath
-
rc=FileBase::getFileURLFromSystemPath( strPath, strNormPath );
if ( rc == FileBase::E_None )
@@ -2148,10 +1955,8 @@ void ConvertPathTest(rtl::OUString& strPath)
else
printf( "normalizePath: Error \n" );
-
// getFileURLFromSystemPath
-
if ( !strNormPath.isEmpty() )
{
rc=FileBase::getFileURLFromSystemPath( strNormPath, strFileURL );
@@ -2168,10 +1973,8 @@ void ConvertPathTest(rtl::OUString& strPath)
else
printf( "getFileURLFromSystemPath: not tested \n" );
-
// getNormalizedPathFromFileURL
-
if ( !strFileURL.isEmpty() )
{
rc=FileBase::getSystemPathFromFileURL( strFileURL, strNormPathFromFileURL );
@@ -2188,11 +1991,8 @@ void ConvertPathTest(rtl::OUString& strPath)
else
printf( "getNormalizedPathFromFileURL: not tested \n" );
-
-
// getSystemPathFromFileURL
-
if ( !strNormPath.isEmpty() )
{
rc=FileBase::getSystemPathFromFileURL( strNormPath, strSystemPath );
@@ -2209,10 +2009,8 @@ void ConvertPathTest(rtl::OUString& strPath)
else
printf( "getSystemPathFromFileURL: not tested \n" );
-
// Verify
-
if ( strNormPathFromFileURL == strNormPath )
printf( "\nVerify: OK ! ( Normalized-Path == Normalized-Path-From-File-URL )\n" );
else
@@ -2227,20 +2025,16 @@ void FileBaseTest()
printf( "FileBase-Test\n" );
printf( "--------------------------------------------\n\n" );
-
// ConvertPath-Test (Local File)
-
printf( "- Local File: ");
printFileName( file1 );
printf( "\n\n" );
ConvertPathTest(file1);
-
// ConvertPath-Test (File on a server)
-
printf( "\n- File on server: ");
printFileName( file_on_server );
printf( "\n\n" );
@@ -2251,8 +2045,6 @@ void FileBaseTest()
return;
}
-
-
// AbsolutePathTest
void DoAbsolutePathTest(rtl::OUString strDirBase, rtl::OUString strRelative)
@@ -2303,11 +2095,8 @@ void AbsolutePathTest(void)
return;
}
-
-
// searchPathTest
-
void SearchPathTest(void)
{
FileBase::RC rc;
@@ -2321,16 +2110,13 @@ void SearchPathTest(void)
printf( "SearchPath-Test\n" );
printf( "--------------------------------------------\n\n" );
-
rc=FileBase::getFileURLFromSystemPath( strNormPath, strFileURL );
print_error( rtl::OString( "getFileURLFromSystemPath" ), rc );
rc=FileBase::getSystemPathFromFileURL( strNormPath, strSystemPath );
print_error( rtl::OString( "getSystemPathFromFileURL" ), rc );
-
// searchFileURL (with a normalized path)
-
if ( !strNormPath.isEmpty() )
{
printf( "\nSearch-Normalized-Path (with a normalized path) : ");
@@ -2351,10 +2137,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL (with a normalized path): not tested\n" );
-
// searchFileURL (with a File-URL)
-
if ( !strFileURL.isEmpty() )
{
printf( "\nSearch-Normalized-Path (with a FileURL) : ");
@@ -2375,10 +2159,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL (with a FileURL path): not tested\n" );
-
// searchFileURL (with a systempath)
-
if ( !strSystemPath.isEmpty() )
{
printf( "\nSearch-Normalized-Path (with a SystemPath) : ");
@@ -2399,10 +2181,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL (with a systempath): not tested\n" );
-
// searchFileURL (File and no searchpath)
-
printf( "\nsearchFileURL: File (no searchpath) : ");
printFileName( file3 );
printf( "\n" );
@@ -2418,10 +2198,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL: File not found: OK ! \n" );
-
// searchFileURL (File and Path)
-
printf( "\nsearchFileURL: File : ");
printFileName( file3 );
printf( "\tSearchPath ");
@@ -2439,10 +2217,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL: File not found: Error\n" );
-
// searchFileURL (File and searchpath with two entries)
-
rtl::OUString strSearchPath( dir_not_exist );
strSearchPath+=rtl::OUString(";");
strSearchPath+=dir_on_server;
@@ -2464,10 +2240,8 @@ void SearchPathTest(void)
else
printf( "searchFileURL: File not found: Error\n" );
-
// searchFileURL (File and searchpath (with a wrong semantic))
-
strSearchPath=rtl::OUString( dir_wrong_semantic );
printf( "\nsearchFileURL: File : ");
@@ -2486,10 +2260,8 @@ void SearchPathTest(void)
return;
}
-
// CanonicalNameTest
-
void getCanonicalNameTest(rtl::OUString strPath)
{
FileBase::RC rc;
@@ -2531,10 +2303,8 @@ void CanonicalNameTest(void)
return;
}
-
// print_error
-
void print_error( const ::rtl::OString& str, FileBase::RC rc )
{
@@ -2680,7 +2450,6 @@ void print_error( const ::rtl::OString& str, FileBase::RC rc )
return;
}
-
// main
#if defined WNT
@@ -2701,7 +2470,6 @@ int MAIN( int argc, char* argv[] )
return -1;
}
-
if (argc==1)
{
DirectoryOpenAndCloseTest();
@@ -2786,5 +2554,4 @@ int MAIN( int argc, char* argv[] )
return 0;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/workben/testpip2.cxx b/sal/workben/testpip2.cxx
index 21dc18cc50d8..e16d3b03ed63 100644
--- a/sal/workben/testpip2.cxx
+++ b/sal/workben/testpip2.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <stdio.h>
#include <stdlib.h>
@@ -28,7 +27,6 @@ const char pszPipeName[] = "TestPipe";
oslPipe Pipe;
-
void fail( const char * pszText, int retval )
{
fprintf( stderr, "TestPipe Client: %s", pszText );
@@ -36,8 +34,6 @@ void fail( const char * pszText, int retval )
exit( retval );
}
-
-
/*
* Teste die Pipe-Implementation in osl
*/
@@ -57,7 +53,6 @@ int main (void)
fail( "unable to open pipe.\n",
osl_getLastPipeError(NULL));
-
// empfange Daten vom Server
nChars = osl_receivePipe( Pipe, szBuffer, 256 );
@@ -81,6 +76,4 @@ int main (void)
return 0;
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/workben/testpipe.cxx b/sal/workben/testpipe.cxx
index 10ccbe337676..2e405aaa81e0 100644
--- a/sal/workben/testpipe.cxx
+++ b/sal/workben/testpipe.cxx
@@ -50,8 +50,6 @@ void fail( const char * pszText, int retval )
exit( retval );
}
-
-
/*
* Test the Pipe-Implementation in osl
*/
@@ -62,7 +60,6 @@ int main (int argc, const char *argv[])
rtl_uString* ustrPipeName=0;
rtl_uString* ustrExeName=0;
-
rtl_uString_newFromAscii(&ustrPipeName,pszPipeName);
rtl_uString_newFromAscii(&ustrExeName, "//./tmp/testpip2.exe");
@@ -93,7 +90,6 @@ int main (int argc, const char *argv[])
fail( "unable to connect to client.\n",
osl_getLastPipeError( Pipe ));
-
if( argc > 1 )
{
cp = argv[1];
@@ -151,6 +147,4 @@ int main (int argc, const char *argv[])
return 0;
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/workben/testproc.cxx b/sal/workben/testproc.cxx
index 09d477747b04..928ccce60f59 100644
--- a/sal/workben/testproc.cxx
+++ b/sal/workben/testproc.cxx
@@ -20,7 +20,6 @@
#include <osl/process.h>
#include <stdio.h>
-
#if defined WNT
#define MAIN _cdecl main
#else
@@ -53,5 +52,4 @@ int MAIN (void)
return 0;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */