[Libreoffice-commits] core.git: 10 commits - basegfx/source cppu/source extensions/source l10ntools/inc l10ntools/source sal/CppunitTest_sal_rtl_ostringbuffer.mk sal/inc sal/Library_sal.mk sal/osl sal/qa sal/rtl store/source
Stephan Bergmann
sbergman at redhat.com
Fri Apr 4 01:06:35 PDT 2014
basegfx/source/polygon/b2dpolygon.cxx | 46
basegfx/source/polygon/b3dpolygon.cxx | 15
basegfx/source/polygon/b3dpolypolygon.cxx | 8
basegfx/source/polygon/b3dpolypolygontools.cxx | 28
basegfx/source/range/b2dpolyrange.cxx | 18
basegfx/source/range/b2drangeclipper.cxx | 1
basegfx/source/tools/b2dclipstate.cxx | 10
cppu/source/uno/cascade_mapping.cxx | 1
extensions/source/macosx/spotlight/GetMetadataForFile.h | 29
extensions/source/macosx/spotlight/GetMetadataForFile.m | 1
extensions/source/macosx/spotlight/main.m | 9
l10ntools/inc/cfglex.hxx | 32
l10ntools/inc/srclex.hxx | 35
l10ntools/source/cfglex.l | 6
l10ntools/source/cfgmerge.cxx | 4
l10ntools/source/export.cxx | 2
l10ntools/source/srclex.l | 9
sal/CppunitTest_sal_rtl_ostringbuffer.mk | 1
sal/Library_sal.mk | 4
sal/inc/getexecutablefile.hxx | 44
sal/osl/unx/asm/interlck_x86.s | 82
sal/osl/unx/file.cxx | 6
sal/osl/unx/file_path_helper.cxx | 21
sal/osl/unx/interlck.c | 70
sal/osl/unx/nlsupport.c | 4
sal/osl/unx/nlsupport.h | 44
sal/osl/unx/osxlocale.cxx | 4
sal/osl/unx/process_impl.cxx | 18
sal/osl/unx/salinit.cxx | 5
sal/osl/unx/saltime.h | 37
sal/osl/unx/socket.c | 5
sal/osl/unx/system.c | 30
sal/osl/unx/time.c | 3
sal/osl/w32/process.cxx | 1
sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 319 ---
sal/qa/OStringBuffer/rtl_String_Const.h | 2
sal/qa/OStringBuffer/rtl_String_Utils.cxx | 169 -
sal/qa/OStringBuffer/rtl_String_Utils.hxx | 62
sal/qa/osl/condition/osl_Condition.cxx | 21
sal/qa/osl/file/osl_File.cxx | 1486 ++--------------
sal/qa/osl/module/osl_Module.cxx | 96 -
sal/qa/osl/mutex/osl_Mutex.cxx | 23
sal/qa/osl/process/osl_Thread.cxx | 92
sal/qa/osl/process/osl_process.cxx | 257 --
sal/qa/osl/security/osl_Security.cxx | 10
sal/qa/rtl/oustring/rtl_OUString2.cxx | 60
sal/qa/rtl/uri/rtl_Uri.cxx | 159 -
sal/qa/rtl/uuid/rtl_Uuid.cxx | 31
sal/rtl/bootstrap.cxx | 5
sal/rtl/ustring.cxx | 34
store/source/lockbyte.cxx | 25
store/source/storbase.cxx | 9
store/source/storbios.cxx | 20
store/source/storcach.cxx | 8
54 files changed, 498 insertions(+), 3023 deletions(-)
New commits:
commit c5a518936d7fa6a37864b86e172a1edec1415836
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:54:08 2014 +0200
Clean up unreferenced functions
Change-Id: Ie6560c806369a2d1698b4df43710f3aebb10ed6a
diff --git a/extensions/source/macosx/spotlight/GetMetadataForFile.h b/extensions/source/macosx/spotlight/GetMetadataForFile.h
new file mode 100644
index 0000000..e0447f0
--- /dev/null
+++ b/extensions/source/macosx/spotlight/GetMetadataForFile.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_EXTENSIONS_SOURCE_MACOSX_SPOTLIGHT_GETMETADATAFORFILE_H
+#define INCLUDED_EXTENSIONS_SOURCE_MACOSX_SPOTLIGHT_GETMETADATAFORFILE_H
+
+Boolean GetMetadataForFile(
+ void * thisInterface, CFMutableDictionaryRef attributes,
+ CFStringRef contentTypeUTI, CFStringRef pathToFile);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/macosx/spotlight/GetMetadataForFile.m b/extensions/source/macosx/spotlight/GetMetadataForFile.m
index 82f8977..a1dcdbe 100644
--- a/extensions/source/macosx/spotlight/GetMetadataForFile.m
+++ b/extensions/source/macosx/spotlight/GetMetadataForFile.m
@@ -21,6 +21,7 @@
#include <CoreServices/CoreServices.h>
#include <Foundation/Foundation.h>
+#include "GetMetadataForFile.h"
#import "OOoSpotlightImporter.h"
/* -----------------------------------------------------------------------------
diff --git a/extensions/source/macosx/spotlight/main.m b/extensions/source/macosx/spotlight/main.m
index e231f69..6457ff7 100644
--- a/extensions/source/macosx/spotlight/main.m
+++ b/extensions/source/macosx/spotlight/main.m
@@ -35,6 +35,8 @@
#include <CoreFoundation/CFPlugInCOM.h>
#include <CoreServices/CoreServices.h>
+#include "GetMetadataForFile.h"
+
// -----------------------------------------------------------------------------
// constants
// -----------------------------------------------------------------------------
@@ -54,12 +56,6 @@
// typedefs
// -----------------------------------------------------------------------------
-// The import function to be implemented in GetMetadataForFile.c
-Boolean GetMetadataForFile(void *thisInterface,
- CFMutableDictionaryRef attributes,
- CFStringRef contentTypeUTI,
- CFStringRef pathToFile);
-
// The layout for an instance of MetaDataImporterPlugIn
typedef struct __MetadataImporterPluginType
{
commit c8c6c8319f07b960c30e05d0a730ea8f3f7583cc
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:53:59 2014 +0200
Clean up unreferenced functions
Change-Id: Id2c90088298d389bd1cd8efad9aa26100965d6a2
diff --git a/l10ntools/inc/cfglex.hxx b/l10ntools/inc/cfglex.hxx
new file mode 100644
index 0000000..f55477d
--- /dev/null
+++ b/l10ntools/inc/cfglex.hxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_L10NTOOLS_INC_CFGLEX_HXX
+#define INCLUDED_L10NTOOLS_INC_CFGLEX_HXX
+
+#include <sal/config.h>
+
+#include <stdio.h>
+
+extern "C" void workOnTokenSet( int, char* );
+extern "C" FILE * init(int, char **);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/inc/srclex.hxx b/l10ntools/inc/srclex.hxx
new file mode 100644
index 0000000..0789d97
--- /dev/null
+++ b/l10ntools/inc/srclex.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_L10NTOOLS_INC_SRCLEX_HXX
+#define INCLUDED_L10NTOOLS_INC_SRCLEX_HXX
+
+#include <sal/config.h>
+
+#include <stdio.h>
+
+extern "C" int WorkOnTokenSet( int, char* );
+extern "C" FILE * init(int, char **);
+extern "C" int SetError();
+extern "C" int GetError();
+extern "C" void Close();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l
index 7313527..f87baf4 100644
--- a/l10ntools/source/cfglex.l
+++ b/l10ntools/source/cfglex.l
@@ -42,6 +42,8 @@
#include "sal/main.h"
+#include "cfglex.hxx"
+
#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-label"
@@ -56,10 +58,6 @@
int yycolumn = 1;
#define YY_USER_ACTION yycolumn += yyleng;
-/* external functions (C++ code, declared as extern "C" */
-extern "C" void workOnTokenSet( int, char* );
-extern "C" FILE * init(int, char **);
-
int bText=0;
%}
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index cc44dd3..cfd471b 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -17,9 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "common.hxx"
#include "sal/config.h"
+#include "cfglex.hxx"
+#include "common.hxx"
+
#include <cstdio>
#include <cstdlib>
#include <cstring>
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 37f34f9..2fff37c 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -23,6 +23,8 @@
#include <cstring>
#include "helper.hxx"
+#include "srclex.hxx"
+
#include "boost/scoped_ptr.hpp"
#include <stdio.h>
#include <stdlib.h>
diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l
index c97dcaa..b484881 100644
--- a/l10ntools/source/srclex.l
+++ b/l10ntools/source/srclex.l
@@ -43,6 +43,8 @@
#include "sal/main.h"
+#include "srclex.hxx"
+
#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-label"
@@ -54,13 +56,6 @@
#endif
#define YY_NO_UNISTD_H
-/* external functions (C++ code, declared as extern "C" */
-extern "C" int WorkOnTokenSet( int, char* );
-extern "C" FILE * init(int, char **);
-extern "C" int SetError();
-extern "C" int GetError();
-extern "C" void Close();
-
/* forwards */
void YYWarning();
%}
commit 705d69a925d5723a5c0b2a62dd41f67f2fe8a217
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:53:44 2014 +0200
Clean up unreferenced functions
Change-Id: I5abc0e587cfd81f1f94c604cb58725a2f84ed33d
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx
index 34eddd7..e8acddd 100644
--- a/basegfx/source/polygon/b2dpolygon.cxx
+++ b/basegfx/source/polygon/b2dpolygon.cxx
@@ -204,38 +204,6 @@ public:
aStart->transform(rMatrix);
}
}
-
- const basegfx::B2DPoint* begin() const
- {
- if(maVector.empty())
- return 0;
- else
- return &maVector.front();
- }
-
- const basegfx::B2DPoint* end() const
- {
- if(maVector.empty())
- return 0;
- else
- return (&maVector.back())+1;
- }
-
- basegfx::B2DPoint* begin()
- {
- if(maVector.empty())
- return 0;
- else
- return &maVector.front();
- }
-
- basegfx::B2DPoint* end()
- {
- if(maVector.empty())
- return 0;
- else
- return (&maVector.back())+1;
- }
};
@@ -681,19 +649,7 @@ public:
}
}
- ImplB2DPolygon& operator=( const ImplB2DPolygon& rToBeCopied )
- {
- maPoints = rToBeCopied.maPoints;
- mpControlVector.reset();
- mpBufferedData.reset();
- mbIsClosed = rToBeCopied.mbIsClosed;
-
- // complete initialization using copy
- if(rToBeCopied.mpControlVector && rToBeCopied.mpControlVector->isUsed())
- mpControlVector.reset( new ControlVectorArray2D(*rToBeCopied.mpControlVector) );
-
- return *this;
- }
+ ImplB2DPolygon& operator=( const ImplB2DPolygon& ) SAL_DELETED_FUNCTION;
sal_uInt32 count() const
{
diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx
index 9e40980..ac231e0 100644
--- a/basegfx/source/polygon/b3dpolygon.cxx
+++ b/basegfx/source/polygon/b3dpolygon.cxx
@@ -295,11 +295,6 @@ public:
{
}
- sal_uInt32 count() const
- {
- return maVector.size();
- }
-
bool operator==(const BColorArray& rCandidate) const
{
return (maVector == rCandidate.maVector);
@@ -459,11 +454,6 @@ public:
{
}
- sal_uInt32 count() const
- {
- return maVector.size();
- }
-
bool operator==(const NormalsArray3D& rCandidate) const
{
return (maVector == rCandidate.maVector);
@@ -633,11 +623,6 @@ public:
{
}
- sal_uInt32 count() const
- {
- return maVector.size();
- }
-
bool operator==(const TextureCoordinate2D& rCandidate) const
{
return (maVector == rCandidate.maVector);
diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx
index b237bcc..ae90a94 100644
--- a/basegfx/source/polygon/b3dpolypolygon.cxx
+++ b/basegfx/source/polygon/b3dpolypolygon.cxx
@@ -107,14 +107,6 @@ public:
return maPolygons.size();
}
- void setClosed(bool bNew)
- {
- for(sal_uInt32 a(0L); a < maPolygons.size(); a++)
- {
- maPolygons[a].setClosed(bNew);
- }
- }
-
void flip()
{
std::for_each( maPolygons.begin(),
diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx
index 33c0c67..b93a9c4 100644
--- a/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -484,34 +484,6 @@ namespace basegfx
}
}
-
- // comparators with tolerance for 3D PolyPolygons
-
- bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB, const double& rfSmallValue)
- {
- const sal_uInt32 nPolygonCount(rCandidateA.count());
-
- if(nPolygonCount != rCandidateB.count())
- return false;
-
- for(sal_uInt32 a(0); a < nPolygonCount; a++)
- {
- const B3DPolygon aCandidate(rCandidateA.getB3DPolygon(a));
-
- if(!equal(aCandidate, rCandidateB.getB3DPolygon(a), rfSmallValue))
- return false;
- }
-
- return true;
- }
-
- bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB)
- {
- const double fSmallValue(fTools::getSmallValue());
-
- return equal(rCandidateA, rCandidateB, fSmallValue);
- }
-
/// converters for com::sun::star::drawing::PolyPolygonShape3D
B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DSource,
diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx
index 90a24d8..3722ca4 100644
--- a/basegfx/source/range/b2dpolyrange.cxx
+++ b/basegfx/source/range/b2dpolyrange.cxx
@@ -33,18 +33,6 @@ namespace basegfx
{
class ImplB2DPolyRange
{
- void updateBounds()
- {
- maBounds.reset();
- std::for_each(maRanges.begin(),
- maRanges.end(),
- boost::bind(
- (void (B2DRange::*)(const B2DRange&))(
- &B2DRange::expand),
- boost::ref(maBounds),
- _1));
- }
-
public:
ImplB2DPolyRange() :
maBounds(),
@@ -52,12 +40,6 @@ namespace basegfx
maOrient()
{}
- explicit ImplB2DPolyRange( const B2DRange& rRange, B2VectorOrientation eOrient ) :
- maBounds( rRange ),
- maRanges( 1, rRange ),
- maOrient( 1, eOrient )
- {}
-
bool operator==(const ImplB2DPolyRange& rRHS) const
{
return maRanges == rRHS.maRanges && maOrient == rRHS.maOrient;
diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index 5d198fb..4a1725a 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -21,6 +21,7 @@
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/b2drangeclipper.hxx>
#include <basegfx/range/b2dpolyrange.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
diff --git a/basegfx/source/tools/b2dclipstate.cxx b/basegfx/source/tools/b2dclipstate.cxx
index bf77c25..ddb2318 100644
--- a/basegfx/source/tools/b2dclipstate.cxx
+++ b/basegfx/source/tools/b2dclipstate.cxx
@@ -103,16 +103,6 @@ namespace tools
ORIENTATION_POSITIVE);
}
- void addPolygon(B2DPolygon aPoly, Operation eOp)
- {
- commitPendingRanges();
- if( mePendingOps != eOp )
- commitPendingPolygons();
-
- mePendingOps = eOp;
- maPendingPolygons.append(aPoly);
- }
-
void addPolyPolygon(B2DPolyPolygon aPoly, Operation eOp)
{
commitPendingRanges();
commit b323e635eefe093edbf463a9d117a17639e11127
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:53:33 2014 +0200
Clean up unreferenced functions
Change-Id: I1dbb864d030b61417f6d137fc967f158e9243ed7
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index be7a4aa..e875d1b 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -19,6 +19,7 @@
#include "lockbyte.hxx"
+#include "boost/noncopyable.hpp"
#include "sal/types.h"
#include "osl/diagnose.h"
#include "osl/file.h"
@@ -276,7 +277,8 @@ struct FileHandle
class FileLockBytes :
public store::OStoreObject,
- public store::ILockBytes
+ public store::ILockBytes,
+ private boost::noncopyable
{
/** Representation.
*/
@@ -301,11 +303,6 @@ class FileLockBytes :
virtual storeError flush_Impl() SAL_OVERRIDE;
- /** Not implemented.
- */
- FileLockBytes (FileLockBytes const &);
- FileLockBytes & operator= (FileLockBytes const &);
-
public:
/** Construction.
*/
@@ -516,7 +513,8 @@ struct FileMapping
class MappedLockBytes :
public store::OStoreObject,
public store::PageData::Allocator,
- public store::ILockBytes
+ public store::ILockBytes,
+ private boost::noncopyable
{
/** Representation.
*/
@@ -545,11 +543,6 @@ class MappedLockBytes :
virtual storeError flush_Impl() SAL_OVERRIDE;
- /** Not implemented.
- */
- MappedLockBytes (MappedLockBytes const &);
- MappedLockBytes & operator= (MappedLockBytes const &);
-
public:
/** Construction.
*/
@@ -674,7 +667,8 @@ namespace store
class MemoryLockBytes :
public store::OStoreObject,
- public store::ILockBytes
+ public store::ILockBytes,
+ private boost::noncopyable
{
/** Representation.
*/
@@ -697,11 +691,6 @@ class MemoryLockBytes :
virtual storeError flush_Impl() SAL_OVERRIDE;
- /** Not implemented.
- */
- MemoryLockBytes (MemoryLockBytes const &);
- MemoryLockBytes& operator= (MemoryLockBytes const &);
-
public:
/** Construction.
*/
diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx
index e6e8deb..0843098 100644
--- a/store/source/storbase.cxx
+++ b/store/source/storbase.cxx
@@ -19,6 +19,7 @@
#include "storbase.hxx"
+#include "boost/noncopyable.hpp"
#include "sal/types.h"
#include "rtl/alloc.h"
#include "rtl/ref.hxx"
@@ -73,7 +74,8 @@ namespace store
class PageData::Allocator_Impl :
public store::OStoreObject,
- public store::PageData::Allocator
+ public store::PageData::Allocator,
+ private boost::noncopyable
{
public:
/** Construction (two phase).
@@ -108,11 +110,6 @@ private:
*/
virtual void allocate_Impl (void ** ppPage, sal_uInt16 * pnSize) SAL_OVERRIDE;
virtual void deallocate_Impl (void * pPage) SAL_OVERRIDE;
-
- /** Not implemented.
- */
- Allocator_Impl (Allocator_Impl const &);
- Allocator_Impl & operator= (Allocator_Impl const &);
};
} // namespace store
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 719b32e..3a4e37f 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -76,26 +76,6 @@ struct OStoreSuperBlock
m_aUnused (0)
{}
- OStoreSuperBlock (const OStoreSuperBlock & rhs)
- : m_aGuard (rhs.m_aGuard),
- m_aDescr (rhs.m_aDescr),
- m_nMarked (rhs.m_nMarked),
- m_aMarked (rhs.m_aMarked),
- m_nUnused (rhs.m_nUnused),
- m_aUnused (rhs.m_aUnused)
- {}
-
- OStoreSuperBlock& operator= (const OStoreSuperBlock & rhs)
- {
- m_aGuard = rhs.m_aGuard;
- m_aDescr = rhs.m_aDescr;
- m_nMarked = rhs.m_nMarked;
- m_aMarked = rhs.m_aMarked;
- m_nUnused = rhs.m_nUnused;
- m_aUnused = rhs.m_aUnused;
- return *this;
- }
-
/** Comparison.
*/
bool operator== (const OStoreSuperBlock & rhs) const
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index 8acb930..f7738f1 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -19,6 +19,7 @@
#include "sal/config.h"
+#include "boost/noncopyable.hpp"
#include "boost/static_assert.hpp"
#include "storcach.hxx"
@@ -224,7 +225,8 @@ namespace store
class PageCache_Impl :
public store::OStoreObject,
- public store::PageCache
+ public store::PageCache,
+ private boost::noncopyable
{
// Representation
static size_t const theTableSize = 32;
@@ -268,10 +270,6 @@ class PageCache_Impl :
virtual storeError removePageAt_Impl (
sal_uInt32 nOffset) SAL_OVERRIDE;
- // Not implemented
- PageCache_Impl (PageCache_Impl const &);
- PageCache_Impl & operator= (PageCache_Impl const &);
-
public:
// Construction
explicit PageCache_Impl (sal_uInt16 nPageSize);
commit 104096f17558bc57ac87004a0fdc032c8ff402bf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:53:21 2014 +0200
Missing include
Change-Id: Ifbb916e72a00a9e9925fd12e7945f178d7ae200b
diff --git a/cppu/source/uno/cascade_mapping.cxx b/cppu/source/uno/cascade_mapping.cxx
index 7a8f859..1402be5 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -26,6 +26,7 @@
#include "cppu/EnvDcp.hxx"
+#include "cascade_mapping.hxx"
#ifdef LOG_LIFECYLE_MediatorMapping
# include <iostream>
commit b0200601d41aad7e8b177249bd71aca1c4b233d6
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:51:04 2014 +0200
Clean up unreferenced functions
Change-Id: Id9cb4dbeb6b3313974b881efd6a7c43cb5e314ce
diff --git a/sal/inc/getexecutablefile.hxx b/sal/inc/getexecutablefile.hxx
new file mode 100644
index 0000000..9ebf872
--- /dev/null
+++ b/sal/inc/getexecutablefile.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_SAL_INC_GETEXECUTABLEFILE_HXX
+#define INCLUDED_SAL_INC_GETEXECUTABLEFILE_HXX
+
+#include <sal/config.h>
+
+#include <osl/process.h>
+#include <rtl/ustring.h>
+#include <sal/types.h>
+
+/***************************************
+ osl_bootstrap_getExecutableFile_Impl().
+
+ @internal
+ @see rtl_bootstrap
+ @see #i37371#
+
+ **************************************/
+
+extern "C" oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
+ rtl_uString ** ppFileURL
+) SAL_THROW_EXTERN_C();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 3efa1a0..792345d 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -19,6 +19,7 @@
#include <config_features.h>
+#include "boost/noncopyable.hpp"
#include "osl/file.hxx"
#include "osl/detail/file.h"
@@ -147,14 +148,11 @@ struct FileHandle_Impl
/** Buffer cache / allocator.
*/
- class Allocator
+ class Allocator: private boost::noncopyable
{
rtl_cache_type * m_cache;
size_t m_bufsiz;
- Allocator (Allocator const &);
- Allocator & operator= (Allocator const &);
-
public:
static Allocator & get();
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index 71c3c32..6c8dab1 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -21,6 +21,7 @@
#include "file_path_helper.hxx"
#include "uunxapi.hxx"
+#include <boost/noncopyable.hpp>
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
@@ -154,7 +155,7 @@ sal_Bool SAL_CALL osl_systemPathIsLocalOrParentDirectoryEntry(
the specified character
**********************************************/
-class path_list_iterator
+class path_list_iterator: private boost::noncopyable
{
public:
@@ -214,24 +215,6 @@ private:
const sal_Unicode m_separator;
const sal_Unicode* m_path_segment_begin;
const sal_Unicode* m_path_segment_end;
-
-// prevent copy and assignment
-private:
- /******************************************
- copy constructor
- remember: do not simply copy m_path_begin
- and m_path_end because they point to
- the memory of other.m_path_list!
- *****************************************/
- path_list_iterator(const path_list_iterator& other);
-
- /******************************************
- assignment operator
- remember: do not simply copy m_path_begin
- and m_path_end because they point to
- the memory of other.m_path_list!
- *****************************************/
- path_list_iterator& operator=(const path_list_iterator& other);
};
sal_Bool SAL_CALL osl_searchPath(
diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c
index 943aa36..29eef0a 100644
--- a/sal/osl/unx/nlsupport.c
+++ b/sal/osl/unx/nlsupport.c
@@ -21,6 +21,8 @@
#include <osl/diagnose.h>
#include <osl/process.h>
+#include "nlsupport.h"
+
#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || \
defined(FREEBSD) || defined(MACOSX) || defined(IOS) || defined(OPENBSD) || \
defined(DRAGONFLY)
@@ -840,8 +842,6 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
return the current process locale
*****************************************************************************/
-int macosx_getLocale(char *locale, sal_uInt32 bufferLen);
-
void _imp_getProcessLocale( rtl_Locale ** ppLocale )
{
static char *locale = NULL;
diff --git a/sal/osl/unx/nlsupport.h b/sal/osl/unx/nlsupport.h
new file mode 100644
index 0000000..6e24385
--- /dev/null
+++ b/sal/osl/unx/nlsupport.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_SAL_OSL_UNX_NLSUPPORT_H
+#define INCLUDED_SAL_OSL_UNX_NLSUPPORT_H
+
+#include <sal/config.h>
+
+#include <rtl/locale.h>
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+void _imp_getProcessLocale( rtl_Locale ** );
+int _imp_setProcessLocale( rtl_Locale * );
+
+#if defined IOS || defined MACOSX
+int macosx_getLocale(char *locale, sal_uInt32 bufferLen);
+#endif
+
+#if defined __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/osxlocale.cxx b/sal/osl/unx/osxlocale.cxx
index 7618970..a64238e 100644
--- a/sal/osl/unx/osxlocale.cxx
+++ b/sal/osl/unx/osxlocale.cxx
@@ -27,6 +27,8 @@
#include <CoreFoundation/CoreFoundation.h>
#include <postmac.h>
+#include <nlsupport.h>
+
namespace
{
template <typename T>
@@ -61,7 +63,6 @@ namespace
/** Grab current locale from system.
*/
-extern "C" {
int macosx_getLocale(char *locale, sal_uInt32 bufferLen)
{
CFStringRef sref = getProcessLocale();
@@ -93,6 +94,5 @@ int macosx_getLocale(char *locale, sal_uInt32 bufferLen)
return noErr;
}
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index ed79616..d28f46d 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -34,24 +34,13 @@
#include "file_path_helper.h"
#include "uunxapi.h"
+#include "getexecutablefile.hxx"
+#include "nlsupport.h"
#ifdef ANDROID
#include <osl/detail/android-bootstrap.h>
#endif
-/***************************************
- osl_bootstrap_getExecutableFile_Impl().
-
- @internal
- @see rtl_bootstrap
- @see #i37371#
-
- **************************************/
-
-extern "C" oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
- rtl_uString ** ppFileURL
-) SAL_THROW_EXTERN_C();
-
#if defined(MACOSX) || defined(IOS)
#include <mach-o/dyld.h>
@@ -458,9 +447,6 @@ static struct ProcessLocale_Impl g_process_locale =
0
};
-extern "C" void _imp_getProcessLocale( rtl_Locale ** );
-extern "C" int _imp_setProcessLocale( rtl_Locale * );
-
/**********************************************
osl_getProcessLocale().
*********************************************/
diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx
index 07c0955..832fa8b 100644
--- a/sal/osl/unx/salinit.cxx
+++ b/sal/osl/unx/salinit.cxx
@@ -32,6 +32,8 @@
#include "sal/main.h"
#include "sal/types.h"
+#include <saltime.h>
+
#if HAVE_SYSLOG_H
#include <string.h>
#include <syslog.h>
@@ -41,9 +43,6 @@ extern bool sal_use_syslog;
extern "C" {
-//From time.c
-void sal_initGlobalTimer();
-
void sal_detail_initialize(int argc, char ** argv) {
#if defined MACOSX && !HAVE_FEATURE_MACOSX_SANDBOX
// On OS X when not sandboxed, soffice can restart itself via exec (see
diff --git a/sal/osl/unx/saltime.h b/sal/osl/unx/saltime.h
new file mode 100644
index 0000000..001944f
--- /dev/null
+++ b/sal/osl/unx/saltime.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * 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 .
+ */
+
+#ifndef INCLUDED_SAL_OSL_UNX_SALTIME_H
+#define INCLUDED_SAL_OSL_UNX_SALTIME_H
+
+#include <sal/config.h>
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+void sal_initGlobalTimer();
+
+#if defined __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index acb42ff..170a594 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -402,11 +402,6 @@ static oslSocketError osl_SocketErrorFromNative(int nativeType)
oslSocketAddr SAL_CALL osl_psz_createInetSocketAddr (
const sal_Char* pszDottedAddr, sal_Int32 Port);
-oslSocketAddr SAL_CALL osl_psz_createIpxSocketAddr (
- const sal_Char NetNumber[4],
- const sal_Char NodeNumber[6],
- sal_uInt32 SocketNumber);
-
oslHostAddr SAL_CALL osl_psz_createHostAddr (
const sal_Char *pszHostname, const oslSocketAddr Addr);
diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index 15a3e43..e80fd41 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include "saltime.h"
#include "system.h"
#include <osl/diagnose.h>
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index 830e411..3dd0e77 100644
--- a/sal/osl/w32/process.cxx
+++ b/sal/osl/w32/process.cxx
@@ -34,6 +34,7 @@
#include <osl/mutex.h>
#include <osl/thread.h>
+#include "getexecutablefile.hxx"
#include "procimpl.h"
#include "sockimpl.h"
#include "file_url.h"
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index a6f5702..8e92f13 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -43,6 +43,8 @@
#include <boost/unordered_map.hpp>
#include <list>
+#include "getexecutablefile.hxx"
+
#ifdef ANDROID
#include <osl/detail/android-bootstrap.h>
#endif
@@ -215,9 +217,6 @@ static bool getFromCommandLineArgs(
return found;
}
-extern "C" oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
- rtl_uString ** ppFileURL) SAL_THROW_EXTERN_C();
-
inline void getExecutableFile_Impl (rtl_uString ** ppFileURL)
{
osl_bootstrap_getExecutableFile_Impl (ppFileURL);
commit 883844f21af50f2a395fddc6fe86fdced6832c14
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 4 08:49:11 2014 +0200
Remove dead test code
Change-Id: Id03246fa9eefce718c36d73f84875f26d58caeba
diff --git a/sal/CppunitTest_sal_rtl_ostringbuffer.mk b/sal/CppunitTest_sal_rtl_ostringbuffer.mk
index 27946a6..30d9466 100644
--- a/sal/CppunitTest_sal_rtl_ostringbuffer.mk
+++ b/sal/CppunitTest_sal_rtl_ostringbuffer.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_CppunitTest_CppunitTest,sal_rtl_ostringbuffer))
$(eval $(call gb_CppunitTest_add_exception_objects,sal_rtl_ostringbuffer,\
sal/qa/OStringBuffer/rtl_OStringBuffer \
- sal/qa/OStringBuffer/rtl_String_Utils \
))
$(eval $(call gb_CppunitTest_use_libraries,sal_rtl_ostringbuffer,\
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 7491bcf..d31488b 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -20,7 +20,6 @@
#include <sal/types.h>
#include <rtl/string.hxx>
#include <rtl_String_Const.h>
-#include <rtl_String_Utils.hxx>
#include <rtl/strbuf.hxx>
#include "cppunit/TestAssert.h"
@@ -15112,165 +15111,6 @@ namespace rtl_OStringBuffer
}
- void append_026()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("3.141592");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append 3.141592",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_027()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("3.5025255");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append 3.5025255",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_028()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("3.00390625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append 3.0039062",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_029()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.0");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.0",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_030()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.5");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.5",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_031()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.0625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.0625",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_032()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.502525");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.502525",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_033()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.141592");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.141592",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_034()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.5025255");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.5025255",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_035()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("3.00390625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append 3.0039062",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
#ifdef WITH_CORE
void append_036()
{
@@ -15844,165 +15684,6 @@ namespace rtl_OStringBuffer
}
- void append_026()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("-3.141592");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append -3.141592",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_027()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("-3.5025255");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append -3.5025255",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_028()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
- float input = (float)atof("-3.00390625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[3] append -3.0039062",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_029()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.0");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.0",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_030()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.5");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.5",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_031()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.0625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.0625",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_032()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.502525");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.502525",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_033()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.141592");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.141592",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_034()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.5025255");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.5025255",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
-
- void append_035()
- {
- ::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
- float input = (float)atof("-3.00390625");
-
- sal_Int32 nLen = aStrBuf.getLength();
- aStrBuf.append( input );
-
- CPPUNIT_ASSERT_MESSAGE
- (
- "arrOUS[4] append -3.0039062",
- checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)
- );
-
- }
#ifdef WITH_CORE
void append_036()
{
diff --git a/sal/qa/OStringBuffer/rtl_String_Const.h b/sal/qa/OStringBuffer/rtl_String_Const.h
index c0c647e..7cc3837 100644
--- a/sal/qa/OStringBuffer/rtl_String_Const.h
+++ b/sal/qa/OStringBuffer/rtl_String_Const.h
@@ -20,8 +20,6 @@
#ifndef _RTL_STRING_CONST_H_
#define _RTL_STRING_CONST_H_
-#include <rtl_String_Utils.hxx>
-
#include <limits.h>
#include <sal/types.h>
#include <rtl/textenc.h>
diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.cxx b/sal/qa/OStringBuffer/rtl_String_Utils.cxx
deleted file mode 100644
index 0440466..0000000
--- a/sal/qa/OStringBuffer/rtl_String_Utils.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * 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 .
- */
-
-#include <math.h>
-#include <stdlib.h>
-
-#include <sal/types.h>
-
-#include <rtl/ustring.h>
-#include <rtl/string.hxx>
-#include <rtl_String_Utils_Const.h>
-
-using ::rtl::OString;
-sal_uInt32 AStringLen( const sal_Char *pAStr )
-{
- sal_uInt32 nStrLen = 0;
-
- if ( pAStr != NULL )
- {
- const sal_Char *pTempStr = pAStr;
-
- while( *pTempStr )
- {
- pTempStr++;
- } // while
-
- nStrLen = (sal_uInt32)( pTempStr - pAStr );
- } // if
-
- return nStrLen;
-} // AStringLen
-
-sal_Char* cpystr( sal_Char* dst, const sal_Char* src )
-{
- const sal_Char* psrc = src;
- sal_Char* pdst = dst;
-
- while( (*pdst++ = *psrc++) ) {}
-
- return dst;
-}
-
-sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt )
-{
-
- const sal_Char* psrc = src;
- sal_Char* pdst = dst;
- sal_uInt32 len = cnt;
- sal_uInt32 i;
-
- if ( len >= AStringLen(src) )
- {
- return( cpystr( dst, src ) );
- }
-
- // copy string by char
- for( i = 0; i < len; i++ )
- *pdst++ = *psrc++;
- *pdst = '\0';
-
- return ( dst );
-}
-
-bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len )
-{
- const sal_Char* pBuf1 = str1;
- const sal_Char* pBuf2 = str2;
- sal_uInt32 i = 0;
-
- while ( (*pBuf1 == *pBuf2) && i < len )
- {
- (pBuf1)++;
- (pBuf2)++;
- i++;
- }
- return( i == len );
-}
-
-bool cmpstr( const sal_Char* str1, const sal_Char* str2 )
-{
- const sal_Char* pBuf1 = str1;
- const sal_Char* pBuf2 = str2;
- bool res = true;
-
- while ( (*pBuf1 == *pBuf2) && *pBuf1 !='\0' && *pBuf2 != '\0')
- {
- (pBuf1)++;
- (pBuf2)++;
- }
- if (*pBuf1 == '\0' && *pBuf2 == '\0')
- res = true;
- else
- res = false;
- return (res);
-}
-
-bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len )
-{
- const sal_Unicode* pBuf1 = str1;
- const sal_Unicode* pBuf2 = str2;
- sal_uInt32 i = 0;
-
- while ( (*pBuf1 == *pBuf2) && i < len )
- {
- (pBuf1)++;
- (pBuf2)++;
- i++;
- }
- return( i == len );
-}
-
-bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 )
-{
- const sal_Unicode* pBuf1 = str1;
- const sal_Unicode* pBuf2 = str2;
- bool res = true;
-
- while ( (*pBuf1 == *pBuf2) && *pBuf1 !='\0' && *pBuf2 != '\0')
- {
- (pBuf1)++;
- (pBuf2)++;
- }
- if (*pBuf1 == '\0' && *pBuf2 == '\0')
- res = true;
- else
- res = false;
- return (res);
-}
-
-sal_Char* createName( sal_Char* dst, const sal_Char* meth, sal_uInt32 cnt )
-{
- sal_Char* pdst = dst;
- sal_Char nstr[16];
- sal_Char* pstr = nstr;
- rtl_str_valueOfInt32( pstr, cnt, 10 );
-
- cpystr( pdst, meth );
- cpystr( pdst+ AStringLen(meth), "_" );
-
- if ( cnt < 100 )
- {
- cpystr(pdst + AStringLen(pdst), "0" );
- }
- if ( cnt < 10 )
- {
- cpystr(pdst + AStringLen(pdst), "0" );
- }
-
- cpystr( pdst + AStringLen(pdst), nstr );
- return( pdst );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.hxx b/sal/qa/OStringBuffer/rtl_String_Utils.hxx
deleted file mode 100644
index 3a674a8..0000000
--- a/sal/qa/OStringBuffer/rtl_String_Utils.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * 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 .
- */
-
-#ifndef _RTL_STRING_UTILS_HXX_
-#define _RTL_STRING_UTILS_HXX_
-
-#ifdef __cplusplus
-
-#include <math.h>
-#include <stdlib.h>
-
-#include <sal/types.h>
-#include <rtl/ustring.h>
-#include <rtl/string.hxx>
-
-sal_Char* cpystr( sal_Char* dst, const sal_Char* src );
-sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
-
-bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len );
-bool cmpstr( const sal_Char* str1, const sal_Char* str2 );
-bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len );
-bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 );
-
-sal_Char* createName( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
-
-sal_uInt32 AStringLen( const sal_Char *pAStr );
-
-bool AStringNIsValid( const sal_Char *pAStr,
- const sal_uInt32 nStrLen
- );
-
-sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr,
- const sal_Char *pAStr
- );
-
-sal_Int32 AStringToUStringNCompare( const sal_Unicode *pUStr,
- const sal_Char *pAStr,
- const sal_uInt32 nAStrCount
- );
-
-#endif /* __cplusplus */
-
-#endif /* _RTL_STRING_UTILS_HXX */
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx
index 1f1a14b..160a4d5 100644
--- a/sal/qa/osl/condition/osl_Condition.cxx
+++ b/sal/qa/osl/condition/osl_Condition.cxx
@@ -25,27 +25,6 @@
using namespace osl;
using namespace rtl;
-// helper functions and classes
-
-/** print Boolean value.
-*/
-inline void printBool( bool bOk )
-{
- printf("#printBool# " );
- bOk ? printf("TRUE!\n" ): printf("FALSE!\n" );
-}
-
-/** print a UNI_CODE String.
-*/
-inline void printUString( const ::rtl::OUString & str )
-{
- rtl::OString aString;
-
- printf("#printUString_u# " );
- aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
- printf("%s\n", aString.getStr( ) );
-}
-
enum ConditionType
{
thread_type_set,
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index fcf3a8b..8a16c60 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -100,133 +100,6 @@ rtl::OString errorToStr( ::osl::FileBase::RC const& nError)
return suBuf;
}
-/** print a file type name.
-*/
-inline void printFileType( const ::osl::FileStatus::Type nType )
-{
- printf( "#printFileType# " );
- switch ( nType ) {
- case ::osl::FileStatus::Directory:
- printf( "This file is a: Directory.\n" );
- break;
- case ::osl::FileStatus::Volume:
- printf( "This file is a: volume device.\n" );
- break;
- case ::osl::FileStatus::Regular:
- printf( "This file is a: regular file.\n" );
- break;
- case ::osl::FileStatus::Fifo:
- printf( "This file is a: fifo.\n" );
- break;
- case ::osl::FileStatus::Socket:
- printf( "This file is a: socket.\n" );
- break;
- case ::osl::FileStatus::Link:
- printf( "This file is a: link file.\n" );
- break;
- case ::osl::FileStatus::Special:
- printf( "This file is a: special.\n" );
- break;
- case ::osl::FileStatus::Unknown:
- printf( "The file type is unknown %d \n", nType );
- break;
- }
-}
-
-/** print a file attributes.
-*/
-inline void printFileAttributes( const sal_Int64 nAttributes )
-{
- printf( "#printFileAttributes# This file is a: (" );
- if ( ( nAttributes | osl_File_Attribute_ReadOnly ) == nAttributes )
- printf( " ReadOnly " );
- if ( ( nAttributes | osl_File_Attribute_Hidden ) == nAttributes )
- printf( " Hidden " );
- if ( ( nAttributes | osl_File_Attribute_Executable ) == nAttributes )
- printf( " Executable " );
- if ( ( nAttributes | osl_File_Attribute_GrpWrite ) == nAttributes )
- printf( " GrpWrite " );
- if ( ( nAttributes | osl_File_Attribute_GrpRead ) == nAttributes )
- printf( " GrpRead " );
- if ( ( nAttributes | osl_File_Attribute_GrpExe ) == nAttributes )
- printf( " GrpExe " );
- if ( ( nAttributes | osl_File_Attribute_OwnWrite ) == nAttributes )
- printf( " OwnWrite " );
- if ( ( nAttributes | osl_File_Attribute_OwnRead ) == nAttributes )
- printf( " OwnRead " );
- if ( ( nAttributes | osl_File_Attribute_OwnExe ) == nAttributes )
- printf( " OwnExe " );
- if ( ( nAttributes | osl_File_Attribute_OthWrite ) == nAttributes )
- printf( " OthWrite " );
- if ( ( nAttributes | osl_File_Attribute_OthRead ) == nAttributes )
- printf( " OthRead " );
- if ( ( nAttributes | osl_File_Attribute_OthExe ) == nAttributes )
- printf( " OthExe " );
- printf( ") file!\n" );
-}
-
-/** print an output wrong message.
-*/
-inline void printError( const ::osl::FileBase::RC nError )
-{
- printf( "#printError# " );
- printf( "%s\n", errorToStr(nError).getStr() );
-}
-
-/** print an signed Integer Number.
-*/
-inline void printInt( sal_Int64 i )
-{
- printf( "#printInt_i64# " );
- printf( "The Integer64 is %" SAL_PRIdINT64 "\n", i);
-}
-
-/** print an unsigned Integer Number.
-*/
-inline void printInt( sal_uInt64 i )
-{
- printf( "#printInt_u64# " );
- printf( "The unsigned Integer64 is %" SAL_PRIuUINT64 "\n", i);
-}
-
-/** print Boolean value.
-*/
-inline void printBool( bool bOk )
-{
- printf( "#printBool# " );
- bOk ? printf( "YES!\n" ): printf( "NO!\n" );
-}
-
-/** print struct TimeValue in local time format.
-*/
-inline void printTime( TimeValue *tv )
-{
- oslDateTime *pDateTime = ( oslDateTime* )malloc( sizeof( oslDateTime ) ) ;
- CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,malloc ", pDateTime != NULL );
- TimeValue *pLocalTV = ( TimeValue* )malloc( sizeof( TimeValue ) );
- CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,malloc ", pLocalTV != NULL );
-
- CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,osl_getLocalTimeFromSystemTime ",sal_True == osl_getLocalTimeFromSystemTime( tv, pLocalTV ) );
- CPPUNIT_ASSERT_MESSAGE( "Error in printTime() function,osl_gepDateTimeFromTimeValue ",sal_True == osl_getDateTimeFromTimeValue( pLocalTV, pDateTime ) );
-
- printf( "#printTime# " );
- printf( " Time is: %d/%d/%d ", pDateTime->Month, pDateTime->Day, pDateTime->Year);
- switch ( pDateTime->DayOfWeek )
- {
- case 0: printf("Sun. "); break;
- case 1: printf("Mon. "); break;
- case 2: printf("Tue. "); break;
- case 3: printf("Wed. "); break;
- case 4: printf("Thu. "); break;
- case 5: printf("Fri. "); break;
- case 6: printf("Sat. "); break;
- }
- printf( " %d:%d:%d %d nsecs\n", pDateTime->Hours, pDateTime->Minutes, pDateTime->Seconds, (int) pDateTime->NanoSeconds);
-
- free( pDateTime );
- free( pLocalTV );
-}
-
/** compare two TimeValue, unit is "ms", since Windows time precision is better than UNX.
*/
/* FIXME: the above assertion is bogus */
@@ -237,20 +110,6 @@ inline void printTime( TimeValue *tv )
# define delta 1800 //time precision, 1.8s
#endif
-inline sal_Int64 t_abs64(sal_Int64 _nValue)
-{
- // std::abs() seems to have some ambiguity problems (so-texas)
- // return abs(_nValue);
- printf("t_abs64(%ld)\n", (long) _nValue);
- // CPPUNIT_ASSERT(_nValue < 2147483647);
-
- if (_nValue < 0)
- {
- _nValue = -_nValue;
- }
- return _nValue;
-}
-
inline bool t_compareTime( TimeValue *m_aEndTime, TimeValue *m_aStartTime, sal_Int32 nDelta)
{
// sal_uInt64 uTimeValue;
@@ -296,25 +155,6 @@ inline bool compareFileName( const ::rtl::OUString & ustr1, const ::rtl::OUStrin
return bOk;
}
-/** compare a OUString and an ASCII file name.
-*/
-inline bool compareFileName( const ::rtl::OUString & ustr, const sal_Char *astr )
-{
- (void)ustr;
- ::rtl::OUString ustr1 = rtl::OUString::createFromAscii( astr );
- bool bOk = ustr1.equalsIgnoreAsciiCase( ustr1 ); // TODO: does it really compare with the same var?
-
- return bOk;
-}
-
-/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
- is start with "file:///";.
-*/
-inline bool isURL( const sal_Char *pathname )
-{
- return ( 0 == strncmp( pathname, FILE_PREFIX, sizeof( FILE_PREFIX ) - 1 ) );
-}
-
/** simple version to judge if a file name or directory name is a URL or a system path, just to see if it
is start with "file:///";.
*/
@@ -464,49 +304,6 @@ typedef enum {
osl_Check_Mode_WriteAccess
} oslCheckMode;
-// not used here
-inline bool checkFile( const ::rtl::OUString & str, oslCheckMode nCheckMode )
-{
- ::osl::FileBase::RC nError1, nError2;
- ::osl::File testFile( str );
- bool bCheckResult;
-
- bCheckResult = false;
- nError1 = testFile.open ( osl_File_OpenFlag_Read );
- if ( ( ::osl::FileBase::E_NOENT != nError1 ) && ( ::osl::FileBase::E_ACCES != nError1 ) ){
-
- switch ( nCheckMode ) {
- case osl_Check_Mode_Exist:
- /// check if the file is exist.
- if ( ::osl::FileBase::E_None == nError1 )
- bCheckResult = true;
- break;
- case osl_Check_Mode_OpenAccess:
- /// check if the file is openable.
- if ( ::osl::FileBase::E_None == nError1 )
- bCheckResult = true;
- break;
- case osl_Check_Mode_WriteAccess:
- /// check the file name and whether it can be written.
- /// write chars into the file.
- sal_uInt64 nCount_write;
- nError2 = testFile.write( pBuffer_Char, 10, nCount_write );
- if ( ::osl::FileBase::E_None == nError2 )
- bCheckResult = true;
- break;
-
- default:
- bCheckResult = false;
- }/// swith
-
- nError2 = testFile.close();
- CPPUNIT_ASSERT_MESSAGE( " in CheckFile() function, close file ", nError2 == FileBase::E_None );
-
- }
-
- return bCheckResult;
-}
-
//check if the file exist
inline bool ifFileExist( const ::rtl::OUString & str )
{
@@ -1187,1130 +984,257 @@ namespace osl_FileBase
class searchFileURL:public CppUnit::TestFixture
{
- //::osl::FileBase aFileBase;
- ::rtl::OUString aUStr;
- ::osl::FileBase::RC nError1, nError2, nError3,nError4;
-
- public:
-
- searchFileURL()
- : nError1(FileBase::E_None)
- , nError2(FileBase::E_None)
- , nError3(FileBase::E_None)
- , nError4(FileBase::E_None) {}
- // test code.
- void searchFileURL_001()
- {
- /* search file is passed by system filename */
- nError1 = ::osl::FileBase::searchFileURL( aTmpName1, aUserDirectorySys, aUStr );
- /* search file is passed by full qualified file URL */
- nError2 = ::osl::FileBase::searchFileURL( aCanURL1, aUserDirectorySys, aUStr );
- /* search file is passed by relative file path */
- nError3 = ::osl::FileBase::searchFileURL( aRelURL4, aUserDirectorySys, aUStr );
-
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: system filename/URL filename/relative path, system directory, searched files that is not exist, but it reply invalid error, did not pass in (W32) ",
- ( osl::FileBase::E_NOENT == nError1 ) &&
- ( osl::FileBase::E_NOENT == nError2 ) &&
- ( osl::FileBase::E_NOENT == nError3 ));
- }
-
- void searchFileURL_002()
- {
- /* search file is passed by system filename */
- nError1 = ::osl::FileBase::searchFileURL( aTempDirectorySys, aRootSys, aUStr );
- bool bOk1 = compareFileName( aUStr, aTempDirectoryURL );
- /* search file is passed by full qualified file URL */
- nError2 = ::osl::FileBase::searchFileURL( aTempDirectoryURL, aRootSys, aUStr );
- bool bOk2 = compareFileName( aUStr, aTempDirectoryURL );
- /* search file is passed by relative file path */
- nError3 = ::osl::FileBase::searchFileURL( aRelURL5, aRootSys, aUStr );
- bool bOk3 = compareFileName( aUStr, aTempDirectoryURL );
- /* search file is passed by an exist file */
- createTestFile( aCanURL1 );
- nError4 = ::osl::FileBase::searchFileURL( aCanURL4, aUserDirectorySys, aUStr );
- bool bOk4 = compareFileName( aUStr, aCanURL1 );
- deleteTestFile( aCanURL1 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: system filename/URL filename/relative path, system directory, searched file already exist.",
- ( osl::FileBase::E_None == nError1 ) &&
- ( osl::FileBase::E_None == nError2 ) &&
- ( osl::FileBase::E_None == nError3 ) &&
- ( osl::FileBase::E_None == nError4 ) &&
- bOk1 && bOk2 && bOk3 && bOk4 );
- }
-
- void searchFileURL_003()
- {
- OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT ":" TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP ":" TEST_PLATFORM_ROOT "system/path" );
- nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aSystemPathList, aUStr );
- bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
- ( osl::FileBase::E_None == nError1 ) &&
- bOk );
- }
-
- void searchFileURL_004()
- {
- OSLTEST_DECLARE( SystemPathList, TEST_PLATFORM_ROOT PATH_LIST_DELIMITER TEST_PLATFORM_ROOT TEST_PLATFORM_TEMP PATH_LIST_DELIMITER TEST_PLATFORM_ROOT "system/path/../name" );
- nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aSystemPathList, aUStr );
- bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is a list of system paths",
- ( osl::FileBase::E_None == nError1 ) &&
- bOk );
- }
-
- void searchFileURL_005()
- {
- nError1 = ::osl::FileBase::searchFileURL( aUserDirectoryURL, aNullURL, aUStr );
- bool bOk = compareFileName( aUStr, aUserDirectoryURL );
- CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: search directory is NULL",
- ( osl::FileBase::E_None == nError1 ) &&
- bOk );
- }
-
- CPPUNIT_TEST_SUITE( searchFileURL );
- CPPUNIT_TEST( searchFileURL_001 );
- CPPUNIT_TEST( searchFileURL_002 );
- CPPUNIT_TEST( searchFileURL_003 );
- CPPUNIT_TEST( searchFileURL_004 );
- CPPUNIT_TEST( searchFileURL_005 );
- CPPUNIT_TEST_SUITE_END();
- };// class searchFileURL
-
- // testing the method
- // static inline RC getTempDirURL( ::rtl::OUString& ustrTempDirURL )
-
- class getTempDirURL:public CppUnit::TestFixture
- {
- //::osl::FileBase aFileBase;
- ::rtl::OUString aUStr;
- ::osl::FileBase::RC nError;
-
- public:
- getTempDirURL() :nError(FileBase::E_None) {}
- // initialization
- void setUp() SAL_OVERRIDE
- {
- nError = FileBase::getTempDirURL( aUStr );
- }
-
- void tearDown() SAL_OVERRIDE
- {
- }
-
- // test code.
- void getTempDirURL_001()
- {
-
- CPPUNIT_ASSERT_MESSAGE( "test for getTempDirURL function: excution",
- ( osl::FileBase::E_None == nError ) );
- }
-
- void getTempDirURL_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getTempDirURL function: test for open and write access rights",
- checkDirectory( aUStr, osl_Check_Mode_OpenAccess ) &&
- checkDirectory( aUStr, osl_Check_Mode_ReadAccess ) &&
- checkDirectory( aUStr,osl_Check_Mode_WriteAccess ) );
- }
-
- CPPUNIT_TEST_SUITE( getTempDirURL );
- CPPUNIT_TEST( getTempDirURL_001 );
- CPPUNIT_TEST( getTempDirURL_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getTempDirURL
-
- // testing the method
- // static inline RC createTempFile( ::rtl::OUString* pustrDirectoryURL,
- // oslFileHandle* pHandle,
- // ::rtl::OUString* pustrTempFileURL)
-
- class createTempFile:public CppUnit::TestFixture
- {
- //::osl::FileBase aFileBase;
- ::osl::FileBase::RC nError1, nError2;
- bool bOK;
-
- oslFileHandle *pHandle;
- ::rtl::OUString *pUStr_DirURL;
- ::rtl::OUString *pUStr_FileURL;
-
- public:
- createTempFile()
- : nError1(FileBase::E_None)
- , nError2(FileBase::E_None)
- , bOK(false)
- , pHandle(NULL)
- , pUStr_DirURL(NULL)
- , pUStr_FileURL(NULL)
- {
- }
-
- // initialization
- void setUp() SAL_OVERRIDE
- {
- pHandle = new oslFileHandle();
- pUStr_DirURL = new ::rtl::OUString( aUserDirectoryURL );
- pUStr_FileURL = new ::rtl::OUString();
- //*pUStr_DirURL = aUserDirectoryURL; /// create temp file in /tmp/PID or c:\temp\PID.*/
- }
-
- void tearDown() SAL_OVERRIDE
- {
- delete pUStr_DirURL;
- delete pUStr_FileURL;
- delete pHandle;
- }
-
- // test code.
- void createTempFile_001()
- {
- nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, pUStr_FileURL );
- ::osl::File testFile( *pUStr_FileURL );
- nError2 = testFile.open( osl_File_OpenFlag_Create );
- if ( osl::FileBase::E_EXIST == nError2 ) {
- osl_closeFile( *pHandle );
- deleteTestFile( *pUStr_FileURL );
- }
-
- CPPUNIT_ASSERT_MESSAGE( "test for createTempFile function: create temp file and test the existence",
- ( osl::FileBase::E_None == nError1 ) && ( pHandle != NULL ) && ( osl::FileBase::E_EXIST== nError2 ) );
- }
-
- void createTempFile_002()
- {
- bOK = false;
- nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, pUStr_FileURL );
- ::osl::File testFile( *pUStr_FileURL );
- nError2 = testFile.open( osl_File_OpenFlag_Create );
-
- CPPUNIT_ASSERT_MESSAGE( "createTempFile function: create a temp file, but it does not exist",
- ( osl::FileBase::E_None == nError1 ) && ( pHandle != NULL ) &&
- ( osl::FileBase::E_EXIST == nError2 ) );
-
- //check file if have the write permission
- if ( osl::FileBase::E_EXIST == nError2 ) {
- bOK = ifFileCanWrite( *pUStr_FileURL );
- osl_closeFile( *pHandle );
- deleteTestFile( *pUStr_FileURL );
- }
-
- CPPUNIT_ASSERT_MESSAGE( "test for open and write access rights, in (W32), it did not have write access right, but it should be writtenable.",
- bOK );
- }
-
- void createTempFile_003()
- {
- nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, 0 );
- //the temp file will be removed when return from createTempFile
- bOK = (pHandle != NULL && nError1 == osl::FileBase::E_None);
- if ( bOK )
- osl_closeFile( *pHandle );
-
- CPPUNIT_ASSERT_MESSAGE( "test for createTempFile function: set pUStrFileURL to 0 to let it remove the file after call.",
- ( ::osl::FileBase::E_None == nError1 ) && bOK );
- }
- void createTempFile_004()
- {
- nError1 = FileBase::createTempFile( pUStr_DirURL, 0, pUStr_FileURL );
- bOK = ( pUStr_FileURL != 0);
- CPPUNIT_ASSERT(bOK);
- ::osl::File testFile( *pUStr_FileURL );
- nError2 = testFile.open( osl_File_OpenFlag_Create );
- deleteTestFile( *pUStr_FileURL );
- CPPUNIT_ASSERT_MESSAGE( "createTempFile function: create a temp file, but it does not exist",
- ( osl::FileBase::E_None == nError1 ) && ( osl::FileBase::E_EXIST == nError2 ) && bOK );
-
- }
-
- CPPUNIT_TEST_SUITE( createTempFile );
- CPPUNIT_TEST( createTempFile_001 );
- CPPUNIT_TEST( createTempFile_002 );
- CPPUNIT_TEST( createTempFile_003 );
- CPPUNIT_TEST( createTempFile_004 );
- CPPUNIT_TEST_SUITE_END();
- };// class createTempFile
-
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::getAbsoluteFileURL, "osl_FileBase" );
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::SystemPath_FileURL, "osl_FileBase" );
- // CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::getFileURLFromSystemPath, "osl_FileBase" );
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::searchFileURL, "osl_FileBase" );
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::getTempDirURL, "osl_FileBase" );
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_FileBase::createTempFile, "osl_FileBase" );
-}// namespace osl_FileBase
-
-// Beginning of the test cases for VolumeInfo class
-
-namespace osl_VolumeInfo
-{
-
- // testing the method
- // VolumeInfo( sal_uInt32 nMask ): _nMask( nMask )
-
- class ctors : public CppUnit::TestFixture
- {
- ::rtl::OUString aUStr;
- ::osl::FileBase::RC nError1, nError2;
-
- ::osl::VolumeDevice aVolumeDevice1;
-
- public:
- ctors() :nError1(FileBase::E_None),nError2(FileBase::E_None) {}
- // initialization
- void setUp() SAL_OVERRIDE
- {
- }
-
- void tearDown() SAL_OVERRIDE
- {
- }
-
- // test code.
- void ctors_001()
- {
- ::osl::VolumeInfo aVolumeInfo( 0 );
- nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace();
- sal_uInt32 uiMaxPathLength = aVolumeInfo.getMaxPathLength();
- aUStr = aVolumeInfo.getFileSystemName();
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is empty",
- ( 0 == uiTotalSpace ) &&
- ( 0 == uiMaxPathLength ) &&
- compareFileName( aUStr, aNullURL ) );
- }
-
-#if ( defined UNX )
- void ctors_002()
- {
- ::osl::VolumeInfo aVolumeInfo( osl_VolumeInfo_Mask_TotalSpace |
- osl_VolumeInfo_Mask_UsedSpace |
- osl_VolumeInfo_Mask_FileSystemName );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- //CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace();
- sal_uInt64 uiUsedSpace = aVolumeInfo.getUsedSpace();
- aUStr = aVolumeInfo.getFileSystemName();
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, and get the masked fields",
- ( 0 != uiTotalSpace ) &&
- ( 0 != uiUsedSpace ) &&
- compareFileName( aUStr, "nfs" ) );
- }
-#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
- void ctors_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, and get the masked fields( Windows version )",
- 1 == 1 );
- }
-#endif
-
- void ctors_003()
- {
-
- sal_Int32 mask1 = osl_VolumeInfo_Mask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo1( mask1 );
- nError1 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo1 );
- CPPUNIT_ASSERT( aVolumeInfo1.isValid( mask1 ) );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
- sal_uInt64 uiTotalSpace1 = aVolumeInfo1.getTotalSpace();
- aUStr = aVolumeInfo1.getFileSystemName();
-
- sal_Int32 mask2 = osl_VolumeInfo_Mask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo2( mask2 );
- nError2 = ::osl::Directory::getVolumeInfo( aRootURL, aVolumeInfo2 );
- CPPUNIT_ASSERT( aVolumeInfo2.isValid( mask2 ) );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError2 );
-
- sal_uInt64 uiTotalSpace2 = aVolumeInfo2.getTotalSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for ctors function: mask is specified as certain valid fields, but get unmasked fields, use mask to FreeSpace, but I can get TotalSpace, did not pass in (UNX)(W32)",
- ( 0 == uiTotalSpace1 ) && ( 0 != uiTotalSpace2 ) &&
- compareFileName( aUStr, aNullURL ) );
- }
-
- CPPUNIT_TEST_SUITE( ctors );
- CPPUNIT_TEST( ctors_001 );
- CPPUNIT_TEST( ctors_002 );
- CPPUNIT_TEST( ctors_003 );
- CPPUNIT_TEST_SUITE_END();
- };// class ctors
-
- // testing the method
- // inline sal_Bool isValid( sal_uInt32 nMask ) const
-
- class isValid : public CppUnit::TestFixture
- {
- ::osl::VolumeDevice aVolumeDevice;
- ::rtl::OUString aUStr;
- ::osl::FileBase::RC nError1;
-
- public:
- isValid() :nError1(FileBase::E_None) {}
- // initialization
- void setUp() SAL_OVERRIDE
- {
- }
-
- void tearDown() SAL_OVERRIDE
- {
-
- }
-
- // test code.
- void isValid_001()
- {
- sal_Int32 mask = 0;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isValid function: no fields specified.",
- aVolumeInfo.isValid( mask ) );
- }
-
-#if ( defined UNX )
- void isValid_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes | osl_VolumeInfo_Mask_TotalSpace | osl_VolumeInfo_Mask_UsedSpace |
- osl_VolumeInfo_Mask_FreeSpace | osl_VolumeInfo_Mask_MaxNameLength |
- osl_VolumeInfo_Mask_MaxPathLength | osl_VolumeInfo_Mask_FileSystemName;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isValid function: all valid fields specified for a nfs volume.",
- aVolumeInfo.isValid( mask ) );
- }
-#else /// Windows version,here we can not determine whichvolume in Windows is serve as an nfs volume.
- void isValid_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for isValid function: all valid fields specified for a nfs volume.( Windows version )",
- 1 == 1 );
- }
-#endif
-
- void isValid_003()
- {
- ::osl::VolumeDevice aVolumeDevice1;
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk1 = aVolumeInfo.isValid( mask );
-
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk2 = aVolumeInfo.isValid( mask );
-
- CPPUNIT_ASSERT_MESSAGE( "test for isValid function: osl_VolumeInfo_Mask_Attributes, it should be valid for some volume such as /, floppy, cdrom, etc. but it did not pass",
- bOk1 && bOk2 );
- }
-
- CPPUNIT_TEST_SUITE( isValid );
- CPPUNIT_TEST( isValid_001 );
- CPPUNIT_TEST( isValid_002 );
- CPPUNIT_TEST( isValid_003 );
- CPPUNIT_TEST_SUITE_END();
- };// class isValid
-
- // testing the method
- // inline sal_Bool getRemoteFlag() const
-
- class getRemoteFlag : public CppUnit::TestFixture
- {
- ::osl::VolumeDevice aVolumeDevice;
- ::rtl::OUString aUStr;
- ::osl::FileBase::RC nError1;
-
- public:
- getRemoteFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getRemoteFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRemoteFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRemoteFlag function: get a volume device which is not remote.",
- !bOk );
- }
-
- #if ( defined UNX ) //remote Volume is different in Solaris and Windows
- void getRemoteFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL4, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRemoteFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRemoteFlag function: get a volume device which is remote( Solaris version ).",
- bOk );
- }
-#else //Windows version
- void getRemoteFlag_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getRemoteFlag function: get a volume device which is remote( Windows version )",
- 1 == 1 );
- }
-#endif
-
- CPPUNIT_TEST_SUITE( getRemoteFlag );
- CPPUNIT_TEST( getRemoteFlag_001 );
- CPPUNIT_TEST( getRemoteFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getRemoteFlag
-
- // testing the method
- // inline sal_Bool getRemoveableFlag() const
-
- class getRemoveableFlag : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getRemoveableFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getRemoveableFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRemoveableFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRemoveableFlag function: get a volume device which is not removable.",
- !bOk );
- }
-
- void getRemoveableFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRemoveableFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRemoveableFlag function: get a volume device which is removable, not sure, here we use floppy disk, but it did not pass.",
- bOk );
- }
- CPPUNIT_TEST_SUITE( getRemoveableFlag );
- CPPUNIT_TEST( getRemoveableFlag_001 );
- CPPUNIT_TEST( getRemoveableFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getRemoveableFlag
-
- // testing the method
- // inline sal_Bool getCompactDiscFlag() const
-
- class getCompactDiscFlag : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getCompactDiscFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getCompactDiscFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getCompactDiscFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getCompactDiscFlag function: get a volume device which is not a cdrom.",
- !bOk );
- }
-
- void getCompactDiscFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL6, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getCompactDiscFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getCompactDiscFlag function: get a cdrom volume device flag, it did not pass.",
- bOk );
- }
- CPPUNIT_TEST_SUITE( getCompactDiscFlag );
- CPPUNIT_TEST( getCompactDiscFlag_001 );
- CPPUNIT_TEST( getCompactDiscFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getCompactDiscFlag
-
- // testing the method
- // inline sal_Bool getFloppyDiskFlag() const
-
- class getFloppyDiskFlag : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getFloppyDiskFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getFloppyDiskFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getFloppyDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFloppyDiskFlag function: get a volume device which is not a floppy disk.",
- !bOk );
- }
-
- void getFloppyDiskFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getFloppyDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFloppyDiskFlag function: get a floppy volume device flag, it did not pass.",
- bOk );
- }
- CPPUNIT_TEST_SUITE( getFloppyDiskFlag );
- CPPUNIT_TEST( getFloppyDiskFlag_001 );
- CPPUNIT_TEST( getFloppyDiskFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getFloppyDiskFlag
-
- // testing the method
- // inline sal_Bool getFixedDiskFlag() const
-
- class getFixedDiskFlag : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getFixedDiskFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getFixedDiskFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL2, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getFixedDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFixedDiskFlag function: get a volume device which is not a fixed disk.",
- !bOk );
- }
-
- void getFixedDiskFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getFixedDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFixedDiskFlag function: get a fixed disk volume device flag, it did not pass.",
- bOk );
- }
- CPPUNIT_TEST_SUITE( getFixedDiskFlag );
- CPPUNIT_TEST( getFixedDiskFlag_001 );
- CPPUNIT_TEST( getFixedDiskFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getFixedDiskFlag
-
- // testing the method
- // inline sal_Bool getRAMDiskFlag() const
-
- class getRAMDiskFlag : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getRAMDiskFlag() :nError1(FileBase::E_None) {}
- // test code.
- void getRAMDiskFlag_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRAMDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRAMDiskFlag function: get a volume device which is not a RAM disk.",
- !bOk );
- }
-
- void getRAMDiskFlag_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_Attributes;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- bool bOk = aVolumeInfo.getRAMDiskFlag();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getRAMDiskFlag function: FIX ME, don't know how to get a RAM disk flag, perhaps Windows 98 boot disk can create a RAM disk, it did not pass in (UNX)(W32).",
- bOk );
- }
- CPPUNIT_TEST_SUITE( getRAMDiskFlag );
- CPPUNIT_TEST( getRAMDiskFlag_001 );
- CPPUNIT_TEST( getRAMDiskFlag_002 );
- CPPUNIT_TEST_SUITE_END();
- };// class getRAMDiskFlag
-
- // testing the method
- // inline sal_uInt64 getTotalSpace() const
-
- class getTotalSpace : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getTotalSpace() :nError1(FileBase::E_None) {}
- // test code.
- void getTotalSpace_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function: get total space of Fixed disk volume mounted on /, it should not be 0",
- 0 != uiTotalSpace );
- }
-
- #if defined( UNX )
- void getTotalSpace_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function: get total space of /proc, it should be 0",
- 0 == uiTotalSpace );
- }
-#else /// Windows version, in Windows, there is no /proc directory
- void getTotalSpace_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function:not applicable for /proc( Windows version )",
- 1 == 1 );
- }
-#endif
-
-#if defined(SOLARIS)
- void getTotalSpace_003()
- {
- struct statvfs aStatFS;
- static const sal_Char name[] = "/";
-
- memset (&aStatFS, 0, sizeof(aStatFS));
- statvfs( name, &aStatFS);
- sal_uInt64 TotalSpace = aStatFS.f_frsize * aStatFS.f_blocks ;
-
- sal_Int32 mask = osl_VolumeInfo_Mask_TotalSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiTotalSpace = aVolumeInfo.getTotalSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function: get total space by hand, then compare with getTotalSpace, it did not pass",
- uiTotalSpace == TotalSpace );
- }
-#else /// Windows version
- void getTotalSpace_003()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getTotalSpace function:not implemented yet( Windows version )",
- 1 == 1 );
- }
-#endif
-
- CPPUNIT_TEST_SUITE( getTotalSpace );
- CPPUNIT_TEST( getTotalSpace_001 );
- CPPUNIT_TEST( getTotalSpace_002 );
- CPPUNIT_TEST( getTotalSpace_003 );
- CPPUNIT_TEST_SUITE_END();
- };// class getTotalSpace
-
- // testing the method
- // inline sal_uInt64 getFreeSpace() const
-
- class getFreeSpace : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
-
- public:
- getFreeSpace() :nError1(FileBase::E_None) {}
- // test code.
- void getFreeSpace_001()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiFreeSpace = aVolumeInfo.getFreeSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: get free space of Fixed disk volume mounted on /, it should not be 0, suggestion: returned value, -1 is better, since some times the free space may be 0",
- 0 != uiFreeSpace );
- }
-
-#if defined( UNX )
- void getFreeSpace_002()
- {
- sal_Int32 mask = osl_VolumeInfo_Mask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiFreeSpace = aVolumeInfo.getFreeSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: get free space of /proc, it should be 0",
- 0 == uiFreeSpace );
- }
-#else /// Windows version, in Windows, there is no /proc directory
- void getFreeSpace_002()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: not applicable for /proc( Windows version )",
- 1 == 1 );
- }
-#endif
-
-#if defined(SOLARIS)
- void getFreeSpace_003()
- {
- struct statvfs aStatFS;
- static const sal_Char name[] = "/";
-
- memset (&aStatFS, 0, sizeof(aStatFS));
- statvfs( name, &aStatFS);
- sal_uInt64 FreeSpace = aStatFS.f_bfree * aStatFS.f_frsize ;
-
- sal_Int32 mask = osl_VolumeInfo_Mask_FreeSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( sal_True == aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiFreeSpace = aVolumeInfo.getFreeSpace();
-
- CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: get free space by hand, then compare with getFreeSpace, it did not pass",
- uiFreeSpace == FreeSpace );
- }
-#else //Windows version
- void getFreeSpace_003()
- {
- CPPUNIT_ASSERT_MESSAGE( "test for getFreeSpace function: not implemented yet( Windows version )",
- 1 == 1 );
- }
-#endif
-
- CPPUNIT_TEST_SUITE( getFreeSpace );
- CPPUNIT_TEST( getFreeSpace_001 );
- CPPUNIT_TEST( getFreeSpace_002 );
- CPPUNIT_TEST( getFreeSpace_003 );
- CPPUNIT_TEST_SUITE_END();
- };// class getFreeSpace
-
- // testing the method
- // inline sal_uInt64 getUsedSpace() const
-
- class getUsedSpace : public CppUnit::TestFixture
- {
- ::osl::FileBase::RC nError1;
+ //::osl::FileBase aFileBase;
+ ::rtl::OUString aUStr;
+ ::osl::FileBase::RC nError1, nError2, nError3,nError4;
public:
- getUsedSpace() :nError1(FileBase::E_None) {}
+
+ searchFileURL()
+ : nError1(FileBase::E_None)
+ , nError2(FileBase::E_None)
+ , nError3(FileBase::E_None)
+ , nError4(FileBase::E_None) {}
// test code.
- void getUsedSpace_001()
+ void searchFileURL_001()
{
- sal_Int32 mask = osl_VolumeInfo_Mask_UsedSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL1, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiUsedSpace = aVolumeInfo.getUsedSpace();
+ /* search file is passed by system filename */
+ nError1 = ::osl::FileBase::searchFileURL( aTmpName1, aUserDirectorySys, aUStr );
+ /* search file is passed by full qualified file URL */
+ nError2 = ::osl::FileBase::searchFileURL( aCanURL1, aUserDirectorySys, aUStr );
+ /* search file is passed by relative file path */
+ nError3 = ::osl::FileBase::searchFileURL( aRelURL4, aUserDirectorySys, aUStr );
- CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: get used space of Fixed disk volume mounted on /, it should not be 0, suggestion: returned value, -1 is better, since some times the used space may be 0",
- 0 != uiUsedSpace );
+ CPPUNIT_ASSERT_MESSAGE( "test for searchFileURL function: system filename/URL filename/relative path, system directory, searched files that is not exist, but it reply invalid error, did not pass in (W32) ",
+ ( osl::FileBase::E_NOENT == nError1 ) &&
+ ( osl::FileBase::E_NOENT == nError2 ) &&
+ ( osl::FileBase::E_NOENT == nError3 ));
}
-#if defined( UNX )
- void getUsedSpace_002()
+ void searchFileURL_002()
{
- sal_Int32 mask = osl_VolumeInfo_Mask_UsedSpace;
- ::osl::VolumeInfo aVolumeInfo( mask );
- nError1 = ::osl::Directory::getVolumeInfo( aVolURL3, aVolumeInfo );
- CPPUNIT_ASSERT( osl::FileBase::E_None == nError1 );
- CPPUNIT_ASSERT( aVolumeInfo.isValid( mask ) );
- sal_uInt64 uiUsedSpace = aVolumeInfo.getUsedSpace();
+ /* search file is passed by system filename */
+ nError1 = ::osl::FileBase::searchFileURL( aTempDirectorySys, aRootSys, aUStr );
+ bool bOk1 = compareFileName( aUStr, aTempDirectoryURL );
+ /* search file is passed by full qualified file URL */
+ nError2 = ::osl::FileBase::searchFileURL( aTempDirectoryURL, aRootSys, aUStr );
+ bool bOk2 = compareFileName( aUStr, aTempDirectoryURL );
+ /* search file is passed by relative file path */
+ nError3 = ::osl::FileBase::searchFileURL( aRelURL5, aRootSys, aUStr );
+ bool bOk3 = compareFileName( aUStr, aTempDirectoryURL );
+ /* search file is passed by an exist file */
+ createTestFile( aCanURL1 );
+ nError4 = ::osl::FileBase::searchFileURL( aCanURL4, aUserDirectorySys, aUStr );
+ bool bOk4 = compareFileName( aUStr, aCanURL1 );
+ deleteTestFile( aCanURL1 );
- CPPUNIT_ASSERT_MESSAGE( "test for getUsedSpace function: get used space of /proc, it should be 0",
- 0 == uiUsedSpace );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list