summaryrefslogtreecommitdiff
path: root/sal/qa/osl
diff options
context:
space:
mode:
Diffstat (limited to 'sal/qa/osl')
-rw-r--r--sal/qa/osl/condition/makefile.mk12
-rw-r--r--sal/qa/osl/file/makefile.mk6
-rw-r--r--sal/qa/osl/file/osl_File.cxx10
-rw-r--r--sal/qa/osl/file/osl_File_Const.h6
-rw-r--r--sal/qa/osl/file/osl_old_test_file.cxx4
-rw-r--r--sal/qa/osl/file/test_cpy_wrt_file.cxx8
-rw-r--r--sal/qa/osl/getsystempathfromfileurl/makefile.mk6
-rw-r--r--sal/qa/osl/module/makefile.mk7
-rw-r--r--sal/qa/osl/module/osl_Module_DLL.cxx4
-rw-r--r--sal/qa/osl/process/makefile.mk15
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx11
-rw-r--r--sal/qa/osl/process/osl_process.cxx13
-rwxr-xr-xsal/qa/osl/security/makefile.mk10
-rw-r--r--sal/qa/osl/security/osl_Security.cxx16
-rw-r--r--sal/qa/osl/security/osl_Security_Const.h13
15 files changed, 66 insertions, 75 deletions
diff --git a/sal/qa/osl/condition/makefile.mk b/sal/qa/osl/condition/makefile.mk
index 89a4fb363..9683f20a7 100644
--- a/sal/qa/osl/condition/makefile.mk
+++ b/sal/qa/osl/condition/makefile.mk
@@ -36,13 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Condition by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Condition.obj
@@ -53,10 +53,8 @@ SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-# auto generated Target:Condition
-# END ------------------------------------------------------------------
-
-.ENDIF
+# ------------------------------------------------------------------
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/osl/file/makefile.mk b/sal/qa/osl/file/makefile.mk
index 4cb2ffebc..de85e5e5e 100644
--- a/sal/qa/osl/file/makefile.mk
+++ b/sal/qa/osl/file/makefile.mk
@@ -36,8 +36,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
-
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
@@ -79,9 +77,7 @@ SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
#------------------------------- All object files -------------------------------
# do this here, so we get right dependencies
-SLOFILES=$(SHL1OBJS)
-
-.ENDIF
+SLOFILES=$(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 024619d74..e38da907e 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -29,6 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_qa_osl_File
+#endif
+
//------------------------------------------------------------------------
// include files
//------------------------------------------------------------------------
@@ -2176,7 +2180,7 @@ namespace osl_VolumeInfo
}
-#if ( defined UNX )
+#if defined(UNX) && !defined(ANDROID)
void getMaxNameLength_002( )
{
struct statvfs aStatFS;
@@ -5819,7 +5823,7 @@ namespace osl_Directory
nError1 = ::osl::Directory::getVolumeInfo( aTmpName3, aVolumeInfo );
// LLA: in Windows, it reply no error, it did not pass in (W32).
-#ifdef UNX
+#if defined(UNX) && !defined(IOS)
CPPUNIT_ASSERT_MESSAGE( "test for getVolumeInfo function: non-existence test. ",
( osl::FileBase::E_NOENT == nError1 ) );
#endif
@@ -6051,7 +6055,7 @@ namespace osl_Directory
if (tmp_x.lastIndexOf('/') != (tmp_x.getLength() - 1))
tmp_x += rtl::OString('/');
-#ifndef WNT
+#if !defined(WNT) && !defined(ANDROID)
// FIXME would be nice to create unique dir even on Windows
tmp_x += rtl::OString("XXXXXX");
char *out = mkdtemp(const_cast<char*>(tmp_x.getStr()));
diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h
index ed2b6824e..88df98ef0 100644
--- a/sal/qa/osl/file/osl_File_Const.h
+++ b/sal/qa/osl/file/osl_File_Const.h
@@ -89,13 +89,15 @@ const sal_Char pBuffer_Blank[] = "";
# include <errno.h>
# include <fcntl.h>
# include <sys/stat.h>
-# if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY)
+# if !defined(MACOSX) && !defined(IOS) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY)
# include <sys/statfs.h>
# else
# include <sys/param.h>
# include <sys/mount.h>
# endif
-# include <sys/statvfs.h>
+# if !defined(ANDROID)
+# include <sys/statvfs.h>
+# endif
# include <sys/types.h>
# define TEST_PLATFORM ""
# define TEST_PLATFORM_ROOT "/"
diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx
index 80e9e077b..e18649055 100644
--- a/sal/qa/osl/file/osl_old_test_file.cxx
+++ b/sal/qa/osl/file/osl_old_test_file.cxx
@@ -29,6 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_old_test_file
+#endif
+
// LLA:
// this file is converted to use with testshl2
// original was placed in sal/test/textenc.cxx
diff --git a/sal/qa/osl/file/test_cpy_wrt_file.cxx b/sal/qa/osl/file/test_cpy_wrt_file.cxx
index 891163120..56135301e 100644
--- a/sal/qa/osl/file/test_cpy_wrt_file.cxx
+++ b/sal/qa/osl/file/test_cpy_wrt_file.cxx
@@ -29,6 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_tcwf
+#endif
+
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
@@ -43,7 +47,7 @@ using ::rtl::OUStringToOString;
using ::rtl::OString;
//Use to silence OSL_ warnings for a deliberate error
-extern "C" void SAL_CALL suppressOslDebugMessage( const sal_Char *, sal_Int32, const sal_Char * )
+extern "C" void SAL_CALL suppressOslDebugMessage2( const sal_Char *, sal_Int32, const sal_Char * )
{
}
@@ -71,7 +75,7 @@ public:
//deliberate errors, suppress run-time warning for operations on
//un-opened File
pfunc_osl_printDetailedDebugMessage pOldDebugMessageFunc =
- osl_setDetailedDebugMessageFunc( &suppressOslDebugMessage );
+ osl_setDetailedDebugMessageFunc( &suppressOslDebugMessage2 );
char buffer[1];
sal_uInt64 written = 0;
diff --git a/sal/qa/osl/getsystempathfromfileurl/makefile.mk b/sal/qa/osl/getsystempathfromfileurl/makefile.mk
index 769313aad..71597ba07 100644
--- a/sal/qa/osl/getsystempathfromfileurl/makefile.mk
+++ b/sal/qa/osl/getsystempathfromfileurl/makefile.mk
@@ -37,7 +37,9 @@ ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
CFLAGSCXX += $(CPPUNIT_CFLAGS)
@@ -53,8 +55,6 @@ DEF1NAME = $(SHL1TARGET)
SLOFILES = $(SHL1OBJS)
-.ENDIF
-
.INCLUDE: target.mk
.INCLUDE: _cppunit.mk
diff --git a/sal/qa/osl/module/makefile.mk b/sal/qa/osl/module/makefile.mk
index 22a4811ea..7fdf0ca43 100644
--- a/sal/qa/osl/module/makefile.mk
+++ b/sal/qa/osl/module/makefile.mk
@@ -36,7 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
@@ -72,9 +74,8 @@ SHL2DEF= $(MISC)$/$(SHL2TARGET).def
DEF2NAME =$(SHL2TARGET)
SHL2VERSIONMAP= $(PRJ)$/qa$/export.map
-# END ------------------------------------------------------------------
-.ENDIF
+SLOFILES = $(SHL2OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/osl/module/osl_Module_DLL.cxx b/sal/qa/osl/module/osl_Module_DLL.cxx
index aa436a354..fa4cdaf82 100644
--- a/sal/qa/osl/module/osl_Module_DLL.cxx
+++ b/sal/qa/osl/module/osl_Module_DLL.cxx
@@ -43,9 +43,5 @@ extern "C" sal_Bool SAL_CALL firstfunc( sal_Bool bRes )
{
return ( bRes = sal_True );
}
-extern "C" void SAL_CALL secondfunc()
-{
- printf("second func called.\n");
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk
index 17bac5faf..73360cbd0 100644
--- a/sal/qa/osl/process/makefile.mk
+++ b/sal/qa/osl/process/makefile.mk
@@ -35,15 +35,10 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
-
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:testjob by codegen.pl
-
-.IF "$(GUI)" == "WNT"
+.IF "$(COM)" == "MSC"
CFLAGS+=/Ob1
.ENDIF
@@ -54,8 +49,6 @@ SHL1IMPLIB=i$(SHL1TARGET)
DEF1NAME=$(SHL1TARGET)
SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-# END ------------------------------------------------------------------
-
SHL2OBJS=$(SLO)$/osl_process.obj
SHL2TARGET=osl_process
SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB)
@@ -63,8 +56,6 @@ SHL2IMPLIB=i$(SHL2TARGET)
DEF2NAME=$(SHL2TARGET)
SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
-# END ------------------------------------------------------------------
-
OBJ3FILES=$(OBJ)$/osl_process_child.obj
APP3TARGET=osl_process_child
APP3OBJS=$(OBJ3FILES)
@@ -75,12 +66,8 @@ SHL2DEPN=$(APP3TARGETN) \
$(BIN)/batch.bat
#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-
SLOFILES=$(SHL1OBJS) $(SHL2OBJS)
-.ENDIF
-
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 3b021a497..de0589f45 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -29,6 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_Thread
+#endif
+
#ifdef WNT
#define NOMINMAX
#include <windows.h>
@@ -1097,9 +1101,11 @@ namespace osl_Thread
case osl_Thread_PriorityAboveNormal:
sPrioStr = "AboveNormal";
+ break;
case osl_Thread_PriorityNormal:
sPrioStr = "Normal";
+ break;
case osl_Thread_PriorityBelowNormal:
sPrioStr = "BelowNormal";
@@ -2097,9 +2103,6 @@ namespace osl_ThreadData
"ThreadData setData: ",
cData1 == 'a' && cData2 == 'b' && aChar == 'o'
);
-
- delete [] pc2;
- delete [] pc;
}
CPPUNIT_TEST_SUITE(setData);
@@ -2147,8 +2150,6 @@ namespace osl_ThreadData
"ThreadData setData: ",
cData1 == 'c' && cData2 == 'd' && aChar == 'i'
);
-
- delete [] pc;
}
// setData then change the value in the address data pointer points,
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 2535c4cd6..573a12241 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -29,6 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_process
+#endif
+
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
@@ -76,14 +80,6 @@
const rtl::OUString EXECUTABLE_NAME (RTL_CONSTASCII_USTRINGPARAM("osl_process_child"));
#endif
-
-//########################################
-std::string OUString_to_std_string(const rtl::OUString& oustr)
-{
- rtl::OString ostr = rtl::OUStringToOString(oustr, osl_getThreadTextEncoding());
- return std::string(ostr.getStr());
-}
-
//########################################
using namespace osl;
@@ -477,6 +473,7 @@ public:
);
std::string line;
+ line.reserve(1024);
while (std::getline(file, line, '\0'))
env_container->push_back(line);
tidy_container(*env_container);
diff --git a/sal/qa/osl/security/makefile.mk b/sal/qa/osl/security/makefile.mk
index e6fbed4ab..85d9beb44 100755
--- a/sal/qa/osl/security/makefile.mk
+++ b/sal/qa/osl/security/makefile.mk
@@ -36,13 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
-# BEGIN ----------------------------------------------------------------
-# auto generated Target:Security by codegen.pl
SHL1OBJS= \
$(SLO)$/osl_Security.obj
@@ -57,10 +57,8 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME =$(SHL1TARGET)
SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
-# auto generated Target:Security
-# END ------------------------------------------------------------------
-.ENDIF
+SLOFILES = $(SHL1OBJS)
# --- Targets ------------------------------------------------------
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index faa009750..230b27e96 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -126,12 +126,12 @@ namespace osl_Security
CPPUNIT_TEST_SUITE( logonUser );
- if ( !aStringForward.equals( aNullURL ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) == aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
+ if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) == aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
/// if user name and passwd are forwarded
{
CPPUNIT_TEST( logonUser_user_pwd );
}
- if ( !aStringForward.equals( aNullURL ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) != aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
+ if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) != aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
/// if user name and passwd and file server are forwarded
{
CPPUNIT_TEST( logonUser_user_pwd_server );
@@ -587,31 +587,31 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
t_print("#\n#Retrived system information is below:\n");
t_print("Computer Name: ");
- if ( strComputerName == aNullURL )
+ if ( strComputerName == aNullUrl )
t_print("Not retrived\n" );
else
printUString( strComputerName );
t_print("Current User Name: ");
- if ( strUserName == aNullURL )
+ if ( strUserName == aNullUrl )
t_print("Not retrived\n" );
else
printUString( strUserName );
t_print("Current User Home Directory:");
- if ( strHomeDirectory == aNullURL )
+ if ( strHomeDirectory == aNullUrl )
t_print("Not retrived\n" );
else
printUString( strHomeDirectory );
t_print("Current Config Directory: ");
- if ( strConfigDirectory == aNullURL )
+ if ( strConfigDirectory == aNullUrl )
t_print("Not retrived\n" );
else
printUString( strConfigDirectory );
t_print("Current UserID: ");
- if ( strUserID == aNullURL )
+ if ( strUserID == aNullUrl )
t_print("Not retrived\n" );
else
printUString( strUserID );
@@ -624,7 +624,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
/// get and display forwarded text if available.
aStringForward = ::rtl::OUString::createFromAscii( parameters.getCommandLine().c_str() );
- if ( !aStringForward.equals( aNullURL ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
+ if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
{
sal_Int32 nFirstSpacePoint = aStringForward.indexOf( (sal_Unicode)' ' );;
sal_Int32 nLastSpacePoint = aStringForward.lastIndexOf( (sal_Unicode)' ' );;
diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h
index 74e068e25..197745f7d 100644
--- a/sal/qa/osl/security/osl_Security_Const.h
+++ b/sal/qa/osl/security/osl_Security_Const.h
@@ -63,12 +63,15 @@ const char pTestString[17] = "Sun Microsystems";
//------------------------------------------------------------------------
// condition names
//------------------------------------------------------------------------
-OSLTEST_DECLARE_USTRING( TestSec, "testsecurity" );
-OSLTEST_DECLARE_USTRING( NullURL, "" );
-::rtl::OUString aLogonUser( aNullURL ), aLogonPasswd( aNullURL ), aFileServer( aNullURL ), aStringForward( aNullURL );
-::rtl::OUString strUserName( aNullURL ) , strComputerName( aNullURL ) , strHomeDirectory( aNullURL );
-::rtl::OUString strConfigDirectory( aNullURL ), strUserID( aNullURL );
+// Intentionally different from the aNullURL in osl_File_Const.h to avoid
+// duplicate symbols as all the unit tests here get linked together for iOS...
+
+OSLTEST_DECLARE_USTRING( NullUrl, "" );
+
+::rtl::OUString aLogonUser( aNullUrl ), aLogonPasswd( aNullUrl ), aFileServer( aNullUrl ), aStringForward( aNullUrl );
+::rtl::OUString strUserName( aNullUrl ) , strComputerName( aNullUrl ) , strHomeDirectory( aNullUrl );
+::rtl::OUString strConfigDirectory( aNullUrl ), strUserID( aNullUrl );
sal_Bool isAdmin = sal_False;