summaryrefslogtreecommitdiff
path: root/tools/workben
diff options
context:
space:
mode:
Diffstat (limited to 'tools/workben')
-rw-r--r--tools/workben/fstest.cxx5
-rw-r--r--tools/workben/hashtbl.cxx7
-rw-r--r--tools/workben/hashtbl.hxx2
-rw-r--r--tools/workben/helloworld.c3
-rw-r--r--tools/workben/inetmimetest.cxx9
-rw-r--r--tools/workben/makefile.mk4
-rw-r--r--tools/workben/mempooltest.cxx3
-rw-r--r--tools/workben/solar.c19
-rw-r--r--tools/workben/tldem.cxx82
-rw-r--r--tools/workben/urltest.cxx30
10 files changed, 45 insertions, 119 deletions
diff --git a/tools/workben/fstest.cxx b/tools/workben/fstest.cxx
index 8048f2c166b0..1feb2871af55 100644
--- a/tools/workben/fstest.cxx
+++ b/tools/workben/fstest.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#define _FSTEST_CXX "$Revision: 1.5 $"
+#define _FSTEST_CXX
#include <tools/solar.h>
#include <stdio.h>
@@ -92,3 +93,5 @@ void CheckTimes(DirEntry aDE)
return;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/hashtbl.cxx b/tools/workben/hashtbl.cxx
index bcd9f903ab64..c431ea159160 100644
--- a/tools/workben/hashtbl.cxx
+++ b/tools/workben/hashtbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,7 +138,7 @@ void* HashTable::GetObjectAt(ULONG lPos) const
void HashTable::OnDeleteObject(void*)
{
- DBG_ERROR("HashTable::OnDeleteObject(void*) nicht berladen");
+ OSL_FAIL("HashTable::OnDeleteObject(void*) nicht berladen");
}
ULONG HashTable::Hash(String const& Key) const
@@ -221,7 +222,7 @@ BOOL HashTable::Insert(String const& Key, void* pObject)
if (IsFull())
{
- DBG_ERROR("HashTable::Insert() is full");
+ OSL_FAIL("HashTable::Insert() is full");
return FALSE;
}
@@ -513,3 +514,5 @@ void* HashTableIterator::FindValidObject(BOOL bForward)
return pObject;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/hashtbl.hxx b/tools/workben/hashtbl.hxx
index f4593b8148cf..7c1b89c873cf 100644
--- a/tools/workben/hashtbl.hxx
+++ b/tools/workben/hashtbl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -201,3 +202,4 @@ public:
#endif // _HASHTBL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/helloworld.c b/tools/workben/helloworld.c
index 5d86cf2db21b..d26d986ba594 100644
--- a/tools/workben/helloworld.c
+++ b/tools/workben/helloworld.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,3 +32,5 @@ main( )
printf( "%s\n", "hello world");
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/inetmimetest.cxx b/tools/workben/inetmimetest.cxx
index e380fb7f6fbe..30b00a9373c3 100644
--- a/tools/workben/inetmimetest.cxx
+++ b/tools/workben/inetmimetest.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,14 +55,12 @@ bool testDecode(char const * input, char const * expected) {
}
-int
-#if defined WNT
-__cdecl
-#endif
-main() {
+int SAL_CALL main() {
bool success = true;
success &= testDecode("=?iso-8859-1?B?QQ==?=", "A");
success &= testDecode("=?iso-8859-1?B?QUI=?=", "AB");
success &= testDecode("=?iso-8859-1?B?QUJD?=", "ABC");
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/makefile.mk b/tools/workben/makefile.mk
index d97156c7f66c..129360e70fba 100644
--- a/tools/workben/makefile.mk
+++ b/tools/workben/makefile.mk
@@ -42,7 +42,7 @@ OBJFILES = \
APP1TARGET = solar
APP1OBJS = $(OBJ)$/solar.obj
-.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+.IF "$(GUI)" == "UNX"
APP1STDLIBS = $(TOOLSLIB)
.ELSE
APP1LIBS = $(LB)$/itools.lib
@@ -50,7 +50,7 @@ APP1LIBS = $(LB)$/itools.lib
APP2TARGET = urltest
APP2OBJS = $(OBJ)$/urltest.obj
-.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+.IF "$(GUI)" == "UNX"
APP2STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
.ELSE
APP2STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
diff --git a/tools/workben/mempooltest.cxx b/tools/workben/mempooltest.cxx
index bf00343bc9d6..e99e2175d372 100644
--- a/tools/workben/mempooltest.cxx
+++ b/tools/workben/mempooltest.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "tools/mempool.hxx"
struct MempoolTest
@@ -16,3 +17,5 @@ int main()
delete p;
return 1;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/solar.c b/tools/workben/solar.c
index 06c4a787ec72..934278f7ae2c 100644
--- a/tools/workben/solar.c
+++ b/tools/workben/solar.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,7 @@ int GetStackAlignment(void);
void PrintArgs( int p, ... );
int check( TestFunc func, Type eT, void* p );
-#if defined (UNX) || defined (WNT) || defined (OS2)
+#if defined (UNX) || defined (WNT)
#ifdef UNX
#include <unistd.h>
@@ -122,7 +123,7 @@ int GetStackAlignment()
-#if defined (UNX) || defined (WNT) || defined (OS2)
+#if defined (UNX) || defined (WNT)
#ifdef I_STDARG
void PrintArgs( int p, ... )
@@ -153,11 +154,7 @@ va_dcl
#ifndef USE_FORK_TO_CHECK
static jmp_buf check_env;
static int bSignal;
-#if defined (UNX) || defined (OS2)
-void SignalHandler( int sig )
-#else
-void __cdecl SignalHandler( int sig )
-#endif
+void SAL_CALL SignalHandler( int sig )
{
bSignal = 1;
/*
@@ -353,11 +350,7 @@ void Description_Print( struct Description* pThis, char* name )
fclose(f);
}
-int
-#ifdef WNT
-__cdecl
-#endif
-main( int argc, char* argv[] )
+int SAL_CALL main( int argc, char* argv[] )
{
printTypeSign( char, "char" );
printTypeSign( short, "short" );
@@ -425,3 +418,5 @@ main( int argc, char* argv[] )
exit( 0 );
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/workben/tldem.cxx b/tools/workben/tldem.cxx
deleted file mode 100644
index 9571d3ff9b94..000000000000
--- a/tools/workben/tldem.cxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_tools.hxx"
-
-#include <tools/fsys.hxx>
-#include <tools/stream.hxx>
-#include <sstring.hxx>
-
-int
-#ifdef WNT
-__cdecl
-#endif
-main( int argc, char **argv )
-{
- String aString;
- aString = "*.*";
- Dir aDir(aString);
- SvFileStream aFile;
- SvFileStream aSortedFile;
-
- StringList *pList = new StringList;
- SStringList *pSortedList = new SStringList;
- ULONG nCount = aDir.Count();
-
- for ( ULONG i=0; i<nCount; i++ )
- {
- aString = aDir[i].GetName();
- pList->Insert( new String( aString ), LIST_APPEND );
- pSortedList->PutString( new String( aString ));
- }
-
- aFile.Open( "test.dir", STREAM_WRITE );
- for ( ULONG j=0; j<nCount; j++ )
- {
- aFile.WriteLine( *pList->GetObject(j) );
- }
- aFile.Close();
-
-
- aSortedFile.Open( "stest.dir", STREAM_WRITE );
- for ( ULONG k=0; k<nCount; k++ )
- {
- aSortedFile.WriteLine( *pSortedList->GetObject(k) );
- }
- if ( pSortedList->IsString( new String("bloedString")) != NOT_THERE )
- aSortedFile.WriteLine( "Fehler !" );
- if ( pSortedList->IsString( new String(".")) == NOT_THERE )
- aSortedFile.WriteLine( "Fehler ?!?" );
- aSortedFile.Close();
-
- delete pList;
- delete pSortedList;
- return 0;
-}
-
-
diff --git a/tools/workben/urltest.cxx b/tools/workben/urltest.cxx
index 0930dfcc5239..69a53950507c 100644
--- a/tools/workben/urltest.cxx
+++ b/tools/workben/urltest.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,6 +39,7 @@
#include "rtl/textenc.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include <sal/macros.h>
#include <cstddef>
#include <cstdlib>
@@ -288,11 +290,7 @@ bool test_removeSegment(
}
-int
-#if defined WNT
-__cdecl
-#endif // WNT
-main()
+int SAL_CALL main()
{
bool bSuccess = true;
@@ -496,7 +494,7 @@ main()
{ "vnd.sun.star.help://swriter?foo",
"vnd.sun.star.help://swriter/?foo" },
{ "vnd.sun.star.help://swriter/?foo", 0 } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i].in);
if (aUrl.HasError())
@@ -530,7 +528,7 @@ main()
/*TODO "wfs:///c|/xyz/",*/
/*TODO "wfs://xxx/yyy?zzz",*/
/*TODO "wfs:///x/y/z"*/ };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(aTest); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -565,7 +563,7 @@ main()
"vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx",
/*TODO "vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx;yy",*/
"vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx//yy" };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(aTest); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -590,7 +588,7 @@ main()
"vnd.sun.star.cmd:log/out",
/*TODO "vnd.sun.star.cmd:[logout]",*/
"vnd.sun.star.cmd:log[out]" };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -609,7 +607,7 @@ main()
if (true)
{
rtl::OUString
- aParameters(rtl::OUString::createFromAscii("; CharSet=UTF-8 ; Blubber=Blob"));
+ aParameters(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "; CharSet=UTF-8 ; Blubber=Blob" )));
sal_Unicode const * pBegin = aParameters.getStr();
sal_Unicode const * pEnd = pBegin + aParameters.getLength();
INetContentTypeParameterList aList;
@@ -1219,7 +1217,7 @@ main()
{ "smb://foo", "smb://foo/" },
{ "smb://x;foo:bar@baz.xyz:12345/ab?cd",
"smb://x;foo:bar@baz.xyz:12345/ab?cd" } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i].m_pInput);
if (aTest[i].m_pOutput == 0
@@ -1249,7 +1247,7 @@ main()
static Test const aTest[]
= { { "file://d:\\dir1\\file1", "file:///d:/dir1/file1" },
{ "http://as@alaska:8000/test/test.sxw", 0 } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl = INetURLObject(
String(aTest[i].m_pInput, RTL_TEXTENCODING_UTF8),
@@ -1378,7 +1376,7 @@ main()
{ INET_PROT_NEWS, "abc@def.ghi@", 0 },
{ INET_PROT_NEWS, "!\"#@def", "news:!%22%23@def" },
{ INET_PROT_NEWS, " @def", "news:%20@def" } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUri;
bool bOk = aUri.ConcatData(aTest[i].eScheme, String(), String(),
@@ -1449,7 +1447,7 @@ main()
}
if (true) { // #112130#
- INetURLObject url1(rtl::OUString::createFromAscii(".uno:abc%3Fdef"));
+ INetURLObject url1(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:abc%3Fdef" )));
if (url1.GetProtocol() != INET_PROT_UNO) {
printf("BAD .uno:abc%%3Fdef\n");
bSuccess = false;
@@ -1467,7 +1465,7 @@ main()
printf("BAD HasParam(.uno:abc%%3Fdef)\n");
bSuccess = false;
}
- INetURLObject url2(rtl::OUString::createFromAscii(".uno:abc?def?ghi"));
+ INetURLObject url2(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:abc?def?ghi" )));
if (url2.GetProtocol() != INET_PROT_UNO) {
printf("BAD .uno:abc?def?ghi\n");
bSuccess = false;
@@ -1904,3 +1902,5 @@ main()
return bSuccess ? EXIT_SUCCESS : EXIT_FAILURE;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */