summaryrefslogtreecommitdiff
path: root/sal/qa/osl
diff options
context:
space:
mode:
Diffstat (limited to 'sal/qa/osl')
-rw-r--r--sal/qa/osl/file/osl_File.cxx34
-rw-r--r--sal/qa/osl/file/osl_File_Const.h2
-rw-r--r--sal/qa/osl/getsystempathfromfileurl/test-getsystempathfromfileurl.cxx6
-rw-r--r--sal/qa/osl/module/osl_Module.cxx2
-rw-r--r--sal/qa/osl/module/osl_Module_Const.h5
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx20
-rw-r--r--sal/qa/osl/process/osl_process.cxx10
-rw-r--r--sal/qa/osl/process/osl_process_child.cxx6
-rw-r--r--sal/qa/osl/security/osl_Security.cxx6
-rw-r--r--sal/qa/osl/security/osl_Security_Const.h2
-rw-r--r--sal/qa/osl/setthreadname/test-setthreadname.cxx2
11 files changed, 47 insertions, 48 deletions
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 7d65b5089f07..7a3913c5d545 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -34,7 +34,7 @@
#include <memory>
-#ifdef WNT
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -135,7 +135,7 @@ inline bool compareFileName( const ::rtl::OUString & ustr1, const ::rtl::OUStrin
{
bool bOk;
//on Windows, the separator is '\', so here change to '/', then compare
-#if defined (WNT )
+#if defined(_WIN32)
::rtl::OUString ustr1new,ustr2new;
sal_Unicode reverseSlash = (sal_Unicode)'\\';
@@ -314,7 +314,7 @@ inline bool ifFileExist( const ::rtl::OUString & str )
inline bool ifFileCanWrite( const ::rtl::OUString & str )
{
//on Windows, the file has no write right, but can be written
-#ifdef WNT
+#ifdef _WIN32
bool bCheckResult = false;
::rtl::OUString aUStr = str.copy( 0 );
if ( isURL( str ) )
@@ -707,7 +707,7 @@ namespace osl_FileBase
}
void SystemPath_FileURL::checkWNTBehaviour_getSystemPathFromFileURL(rtl::OString const& _sURL, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sWNTAssumeResultString)
{
-#if ( defined WNT )
+#if defined(_WIN32)
check_SystemPath_FileURL(_sURL, _nAssumeError, _sWNTAssumeResultString);
#else
(void)_sURL;
@@ -729,7 +729,7 @@ namespace osl_FileBase
void SystemPath_FileURL::checkWNTBehaviour_getFileURLFromSystemPath(rtl::OString const& _sSysPath, ::osl::FileBase::RC _nAssumeError, rtl::OString const& _sWNTAssumeResultString)
{
-#if ( defined WNT )
+#if defined(_WIN32)
check_SystemPath_FileURL(_sSysPath, _nAssumeError, _sWNTAssumeResultString, sal_False );
#else
(void)_sSysPath;
@@ -2232,7 +2232,7 @@ namespace osl_File
nError1 = testFile.open( osl_File_OpenFlag_Create );
bool bOK = ( File::E_ACCES == nError1 );
-#ifdef WNT
+#ifdef _WIN32
bOK = true; /// in Windows, you can create file in c:/ any way.
testFile.close();
deleteTestFile( aTestFile);
@@ -3039,7 +3039,7 @@ namespace osl_File
{
//copy $TEMP/tmpdir/tmpname to $ROOT/tmpname.
nError1 = ::osl::File::copy( aTmpName4, aTmpName7 );
-#if defined (WNT )
+#if defined(_WIN32)
nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
deleteTestFile( aTmpName7);
#endif
@@ -3169,7 +3169,7 @@ namespace osl_File
{
//move $TEMP/tmpdir/tmpname to $ROOT/tmpname.
nError1 = ::osl::File::move( aTmpName4, aTmpName7 );
-#if defined (WNT )
+#if defined(_WIN32)
nError1 = ::osl::FileBase::E_ACCES; /// for Windows, c:/ is writtenable any way.
deleteTestFile( aTmpName7);
#endif
@@ -3204,7 +3204,7 @@ namespace osl_File
//move file $TEMP/tmpdir/tmpname to $TEMP/tmpname
nError2 = ::osl::File::move( aTmpName4, aTmpName6 );
deleteTestDirectory( aTmpName6 );
-#if defined ( WNT )
+#if defined(_WIN32)
deleteTestDirectory( aTmpName4 );// in Windows, it can be moved!!!!! this is only for not influence the following test.
deleteTestFile( aTmpName6 );
nError1 = ::osl::FileBase::E_NOTDIR;
@@ -3398,7 +3398,7 @@ namespace osl_File
void setAttributes_002()
{
//on UNX, can not set hidden attribute to file, rename file can set the attribute
-#ifdef WNT
+#ifdef _WIN32
//set the file to hidden
nError2 = ::osl::File::setAttributes( aTmpName6, osl_File_Attribute_Hidden);
@@ -3489,7 +3489,7 @@ namespace osl_File
CPPUNIT_ASSERT_MESSAGE( "test for setTime function: set access time then get it. time precision is still a problem for it cut off the nanosec.",
t_compareTime( pTV_access, pTV_current, delta ) );
-#if defined ( WNT )
+#if defined(_WIN32)
//Unfortunately there is no way to get the creation time of a file under Unix (its a Windows only feature).
//That means the flag osl_FileStatus_Mask_CreationTime should be deprecated under Unix.
CPPUNIT_ASSERT_MESSAGE( "test for setTime function: set creation time then get it. ",
@@ -4661,7 +4661,7 @@ namespace osl_Directory
void create_002()
{
-#if !defined (WNT) && !defined (MACOSX) && defined (SAL_UNX)
+#if !defined(_WIN32) && !defined(MACOSX) && defined(SAL_UNX)
if (geteuid() == 0) //don't test if building as root
return;
@@ -4807,7 +4807,7 @@ namespace osl_Directory
// TEST Directory::createPath
- #ifdef WNT
+ #ifdef _WIN32
# define PATH_BUFFER_SIZE MAX_PATH
#else
# define PATH_BUFFER_SIZE PATH_MAX
@@ -4842,7 +4842,7 @@ namespace osl_Directory
if (tmp_x.lastIndexOf('/') != (tmp_x.getLength() - 1))
tmp_x += rtl::OString('/');
-#if !defined(WNT) && !defined(ANDROID) && !defined(AIX)
+#if !defined(_WIN32) && !defined(ANDROID) && !defined(AIX)
// 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()));
@@ -4965,7 +4965,7 @@ namespace osl_Directory
}
-#ifdef WNT
+#ifdef _WIN32
const char* get_unused_drive_letter()
{
@@ -5012,7 +5012,7 @@ namespace osl_Directory
CPPUNIT_TEST(with_relative_path);
CPPUNIT_TEST(without_callback);
CPPUNIT_TEST(with_callback);
-#ifdef WNT
+#ifdef _WIN32
CPPUNIT_TEST(at_invalid_logical_drive);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -5039,7 +5039,7 @@ inline ::rtl::OUString getCurrentPID( )
{
//~ Get current PID and turn it into OUString;
int nPID = 0;
-#ifdef WNT
+#ifdef _WIN32
nPID = GetCurrentProcessId();
#else
nPID = getpid();
diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h
index 05bb1d275b9b..cd39fb4e0202 100644
--- a/sal/qa/osl/file/osl_File_Const.h
+++ b/sal/qa/osl/file/osl_File_Const.h
@@ -82,7 +82,7 @@ const sal_Char pBuffer_Blank[] = "";
# define PATH_SEPARATOR "/"
#endif
-#if (defined WNT ) // Windows
+#if defined(_WIN32) // Windows
# include <tchar.h>
# include <io.h>
# include <stdio.h>
diff --git a/sal/qa/osl/getsystempathfromfileurl/test-getsystempathfromfileurl.cxx b/sal/qa/osl/getsystempathfromfileurl/test-getsystempathfromfileurl.cxx
index 6c16a3e5bd48..5d8d24962e0a 100644
--- a/sal/qa/osl/getsystempathfromfileurl/test-getsystempathfromfileurl.cxx
+++ b/sal/qa/osl/getsystempathfromfileurl/test-getsystempathfromfileurl.cxx
@@ -26,7 +26,7 @@
#include <osl/file.hxx>
-#if defined WNT
+#if defined(_WIN32)
#define MY_PATH_IN "/c:/foo/bar"
#define MY_PATH_OUT "c:\\foo\\bar"
#define MY_PATH_OUT_CONT MY_PATH_OUT "\\"
@@ -91,7 +91,7 @@ void Test::testBadScheme() {
}
void Test::testNoScheme() {
-#if !defined WNT //TODO
+#if !defined(_WIN32) //TODO
OUString p;
auto e = osl::FileBase::getSystemPathFromFileURL("//" MY_PATH_IN, p);
CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, e);
@@ -134,7 +134,7 @@ void Test::testLocalhost3Authority() {
}
void Test::testNoAuthority() {
-#if !defined WNT //TODO
+#if !defined(_WIN32) //TODO
OUString p;
auto e = osl::FileBase::getSystemPathFromFileURL("file:" MY_PATH_IN, p);
CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, e);
diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx
index 571523e55e9b..e51a80904b8d 100644
--- a/sal/qa/osl/module/osl_Module.cxx
+++ b/sal/qa/osl/module/osl_Module.cxx
@@ -31,7 +31,7 @@ using ::rtl::OString;
*/
inline ::rtl::OUString getDllURL()
{
-#if ( defined WNT ) // lib in Unix and lib in Windows are not same in file name.
+#if defined(_WIN32) // lib in Unix and lib in Windows are not same in file name.
::rtl::OUString libPath( "test_Module_DLL.dll" );
#else
::rtl::OUString libPath( "libtest_Module_DLL.so" );
diff --git a/sal/qa/osl/module/osl_Module_Const.h b/sal/qa/osl/module/osl_Module_Const.h
index 40b33218d047..3434d439f2a3 100644
--- a/sal/qa/osl/module/osl_Module_Const.h
+++ b/sal/qa/osl/module/osl_Module_Const.h
@@ -29,10 +29,9 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
-#if ( defined UNX ) //Unix
+#if defined(UNX) // Unix
# include <unistd.h>
-#endif
-#if ( defined WNT ) // Windows
+#elif defined(_WIN32) // Windows
# include <io.h>
#endif
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 29687f8c938b..245c5baca750 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -18,7 +18,7 @@
*/
#include <algorithm>
-#ifdef WNT
+#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
@@ -181,7 +181,7 @@ namespace ThreadHelper
{
void thread_sleep_tenth_sec(sal_Int32 _nTenthSec)
{
-#ifdef WNT
+#ifdef _WIN32
Sleep(_nTenthSec * 100 );
#else
TimeValue nTV;
@@ -421,7 +421,7 @@ namespace osl_Thread
// Note: on UNX, after createSuspended, and then terminate the thread, it performs well;
// while on Windows, after createSuspended, the thread can not terminate, wait endlessly,
// so here call resume at first, then call terminate.
-#ifdef WNT
+#ifdef _WIN32
t_print("resumeAndWaitThread\n");
_pThread->resume();
ThreadHelper::thread_sleep_tenth_sec(1);
@@ -436,7 +436,7 @@ namespace osl_Thread
_pThread->terminate();
// LLA: Windows feature???, a suspended thread can not terminated, so we have to weak it up
-#ifdef WNT
+#ifdef _WIN32
_pThread->resume();
ThreadHelper::thread_sleep_tenth_sec(1);
#endif
@@ -1154,7 +1154,7 @@ namespace osl_Thread
t_print("nValue in AboveNormal Prio Thread is %d\n", (int) nValueAboveNormal);
t_print("nValue in Normal Prio Thread is %d\n", (int) nValueNormal);
-#ifndef WNT
+#ifndef _WIN32
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
nValueHighest > 0 &&
@@ -1237,7 +1237,7 @@ namespace osl_Thread
delete pBelowNormalThread;
delete pLowestThread;
-#ifndef WNT
+#ifndef _WIN32
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
nValueHighest > 0 &&
@@ -1321,7 +1321,7 @@ namespace osl_Thread
delete pBelowNormalThread;
delete pLowestThread;
-#ifndef WNT
+#ifndef _WIN32
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
/* nValueHighest > 0 && */
@@ -1401,7 +1401,7 @@ namespace osl_Thread
delete pBelowNormalThread;
delete pLowestThread;
-#ifndef WNT
+#ifndef _WIN32
CPPUNIT_ASSERT_MESSAGE(
"SetPriority",
/* nValueHighest > 0 && */
@@ -1454,7 +1454,7 @@ namespace osl_Thread
ThreadHelper::outputPriority(aPriority);
// LLA: Priority settings may not work within some OS versions.
-#if ( defined WNT ) || ( defined SOLARIS )
+#if defined(_WIN32) || defined(SOLARIS)
CPPUNIT_ASSERT_MESSAGE(
"getPriority",
aPriority == osl_Thread_PriorityHighest
@@ -1683,7 +1683,7 @@ namespace osl_Thread
t_print("later value = %d\n", (int) nLaterValue);
//On windows, suspend works, so the values are same
-#ifdef WNT
+#ifdef _WIN32
CPPUNIT_ASSERT_MESSAGE(
"Schedule: don't schedule in thread run method, suspend works.",
nLaterValue == nValue
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 59bd74f44073..280e87302ac0 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -43,7 +43,7 @@
#define RUNNING_ON_VALGRIND false
#endif
-#if ( defined WNT ) // Windows
+#if defined(_WIN32) // Windows
# include <windows.h>
# include <tchar.h>
#else
@@ -66,7 +66,7 @@
# endif
#endif
-#if defined(WNT)
+#if defined(_WIN32)
const rtl::OUString EXECUTABLE_NAME ("osl_process_child.exe");
#else
const rtl::OUString EXECUTABLE_NAME ("osl_process_child");
@@ -154,7 +154,7 @@ namespace
}
}
-#ifdef WNT
+#ifdef _WIN32
void read_parent_environment(string_container_t* env_container)
{
LPTSTR env = reinterpret_cast<LPTSTR>(GetEnvironmentStrings());
@@ -435,7 +435,7 @@ public:
void osl_execProc_test_batch()
{
oslProcess process;
-#if defined(WNT)
+#if defined(_WIN32)
rtl::OUString suBatch = suCWD + "/batch.bat";
#else
rtl::OUString suBatch = suCWD + "/batch.sh";
@@ -470,7 +470,7 @@ public:
CPPUNIT_TEST_SUITE(Test_osl_executeProcess);
//TODO: Repair these (at least under Windows)
-#if !defined(WNT)
+#if !defined(_WIN32)
CPPUNIT_TEST(osl_execProc_parent_equals_child_environment);
CPPUNIT_TEST(osl_execProc_merged_child_environment);
#endif
diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx
index f709de940c51..22ab319873a3 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#if ( defined WNT ) // Windows
+#if defined(_WIN32) // Windows
# define UNICODE
# define _UNICODE
# define WIN32_LEAN_AND_MEAN
@@ -42,7 +42,7 @@
# endif
#endif
-#ifdef WNT
+#ifdef _WIN32
# define SLEEP(t) (Sleep((t)*1000))
#else
# define SLEEP(t) (sleep((t)))
@@ -53,7 +53,7 @@ void wait_for_seconds(char* time)
SLEEP(atoi(time));
}
-#ifdef WNT
+#ifdef _WIN32
void w_to_a(LPCTSTR _strW, LPSTR strA, DWORD size)
{
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index 693137fd9ab9..33c093b8d7ea 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -18,7 +18,7 @@
*/
#include <algorithm>
-#ifdef WNT
+#ifdef _WIN32
#include <windows.h>
#undef min
#endif
@@ -152,7 +152,7 @@ namespace osl_Security
void getUserName_001( )
{
::osl::Security aSec;
-#ifdef WNT
+#ifdef _WIN32
::rtl::OUString strName( strUserName ), strGetName;
#else
::rtl::OUString strName( strUserName ), strGetName;
@@ -350,7 +350,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
isAdmin = true;
#endif
-#if defined ( WNT )
+#if defined(_WIN32)
/// some initialization work for Windows OS
/// Get the user name, computer name, user home directory.
diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h
index 1dfa2422e7cb..84619f0964b2 100644
--- a/sal/qa/osl/security/osl_Security_Const.h
+++ b/sal/qa/osl/security/osl_Security_Const.h
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SAL_QA_OSL_SECURITY_OSL_SECURITY_CONST_H
#define INCLUDED_SAL_QA_OSL_SECURITY_OSL_SECURITY_CONST_H
-#if ( defined WNT ) // Windows
+#if defined(_WIN32) // Windows
#include <io.h>
#endif
diff --git a/sal/qa/osl/setthreadname/test-setthreadname.cxx b/sal/qa/osl/setthreadname/test-setthreadname.cxx
index 02e6eb76855a..be0b030d61dc 100644
--- a/sal/qa/osl/setthreadname/test-setthreadname.cxx
+++ b/sal/qa/osl/setthreadname/test-setthreadname.cxx
@@ -37,7 +37,7 @@ private:
};
void TestThread::run() {
-#if defined WNT
+#if defined(_WIN32)
if (std::getenv("URE_TEST_SETTHREADNAME") != 0) {
// On Windows, setting thread names appears to only take effect when the
// process is being debugged, so attach a debugger now: