summaryrefslogtreecommitdiff
path: root/sal/qa/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:21:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:35 +0100
commit26f05d59bc1c25b8a0d19be7f4738fd12e557001 (patch)
tree560cccfaacf4b63385aa52ac4b3912248e87cbef /sal/qa/osl
parent5bbdb9423e15b68438bb8397c15635e044129e28 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
Diffstat (limited to 'sal/qa/osl')
-rw-r--r--sal/qa/osl/file/osl_File.cxx56
-rw-r--r--sal/qa/osl/file/osl_old_test_file.cxx4
-rw-r--r--sal/qa/osl/file/test_cpy_wrt_file.cxx2
-rw-r--r--sal/qa/osl/module/osl_Module.cxx6
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx4
-rw-r--r--sal/qa/osl/process/osl_process.cxx16
-rw-r--r--sal/qa/osl/process/osl_process_child.cxx2
-rw-r--r--sal/qa/osl/profile/osl_old_testprofile.cxx4
-rw-r--r--sal/qa/osl/security/osl_Security.cxx4
-rw-r--r--sal/qa/osl/setthreadname/test-setthreadname.cxx2
10 files changed, 50 insertions, 50 deletions
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index a0c5fc53d658..221fd4cc893f 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1132,9 +1132,9 @@ namespace osl_FileBase
: nError1(FileBase::E_None)
, nError2(FileBase::E_None)
, bOK(false)
- , pHandle(NULL)
- , pUStr_DirURL(NULL)
- , pUStr_FileURL(NULL)
+ , pHandle(nullptr)
+ , pUStr_DirURL(nullptr)
+ , pUStr_FileURL(nullptr)
{
}
@@ -1166,7 +1166,7 @@ namespace osl_FileBase
}
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 ) );
+ ( osl::FileBase::E_None == nError1 ) && ( pHandle != nullptr ) && ( osl::FileBase::E_EXIST== nError2 ) );
}
void createTempFile_002()
@@ -1177,7 +1177,7 @@ namespace osl_FileBase
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_None == nError1 ) && ( pHandle != nullptr ) &&
( osl::FileBase::E_EXIST == nError2 ) );
//check file if have the write permission
@@ -1193,9 +1193,9 @@ namespace osl_FileBase
void createTempFile_003()
{
- nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, 0 );
+ nError1 = FileBase::createTempFile( pUStr_DirURL, pHandle, nullptr );
//the temp file will be removed when return from createTempFile
- bOK = (pHandle != NULL && nError1 == osl::FileBase::E_None);
+ bOK = (pHandle != nullptr && nError1 == osl::FileBase::E_None);
if ( bOK )
osl_closeFile( *pHandle );
@@ -1204,8 +1204,8 @@ namespace osl_FileBase
}
void createTempFile_004()
{
- nError1 = FileBase::createTempFile( pUStr_DirURL, 0, pUStr_FileURL );
- bOK = ( pUStr_FileURL != 0);
+ nError1 = FileBase::createTempFile( pUStr_DirURL, nullptr, pUStr_FileURL );
+ bOK = ( pUStr_FileURL != nullptr);
CPPUNIT_ASSERT(bOK);
::osl::File testFile( *pUStr_FileURL );
nError2 = testFile.open( osl_File_OpenFlag_Create );
@@ -1314,7 +1314,7 @@ namespace osl_FileStatus
public:
isValid()
- : pDir(NULL)
+ : pDir(nullptr)
{
}
@@ -1792,10 +1792,10 @@ namespace osl_FileStatus
// test code.
void getAccessTime_001()
{
- TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
- TimeValue *pTV_access = NULL;
- CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
+ TimeValue *pTV_current = nullptr;
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
+ TimeValue *pTV_access = nullptr;
+ CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
::osl::FileStatus rFileStatus( osl_FileStatus_Mask_AccessTime );
nError = rItem.getFileStatus( rFileStatus );
@@ -1832,8 +1832,8 @@ namespace osl_FileStatus
// test code.
void getModifyTime_001()
{
- TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
+ TimeValue *pTV_current = nullptr;
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
//create file
aTypeURL = aUserDirectoryURL.copy( 0 );
@@ -1852,8 +1852,8 @@ namespace osl_FileStatus
CPPUNIT_ASSERT( nError == FileBase::E_None );
//get modify time
- TimeValue* pTV_modify = NULL;
- CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
+ TimeValue* pTV_modify = nullptr;
+ CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
*pTV_modify = rFileStatus.getModifyTime();
bool bOK = t_compareTime( pTV_modify, pTV_current, delta );
@@ -3451,14 +3451,14 @@ namespace osl_File
// test code.
void setTime_001()
{
- TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
- TimeValue *pTV_creation = NULL;
- CPPUNIT_ASSERT( ( pTV_creation = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
- TimeValue *pTV_access = NULL;
- CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
- TimeValue *pTV_modify = NULL;
- CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
+ TimeValue *pTV_current = nullptr;
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
+ TimeValue *pTV_creation = nullptr;
+ CPPUNIT_ASSERT( ( pTV_creation = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
+ TimeValue *pTV_access = nullptr;
+ CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
+ TimeValue *pTV_modify = nullptr;
+ CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != nullptr );
//get current time
bool bOk = osl_getSystemTime( pTV_current );
@@ -4666,7 +4666,7 @@ namespace osl_Directory
return;
rtl::OUString aTmpDir;
- nError1 = FileBase::createTempFile(NULL, NULL, &aTmpDir);
+ nError1 = FileBase::createTempFile(nullptr, nullptr, &aTmpDir);
CPPUNIT_ASSERT_MESSAGE("temp File creation failed", osl::FileBase::E_None == nError1);
nError1 = ::osl::File::remove(aTmpDir);
@@ -4850,7 +4850,7 @@ namespace osl_Directory
CPPUNIT_ASSERT_MESSAGE
(
"mkdtemp call failed",
- out != NULL
+ out != nullptr
);
tmp_x += rtl::OString('/');
diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx
index 402bbfb483d1..647083201213 100644
--- a/sal/qa/osl/file/osl_old_test_file.cxx
+++ b/sal/qa/osl/file/osl_old_test_file.cxx
@@ -64,7 +64,7 @@ const char * const aSource1[] =
"a/b/c/d" , "file:///" TEST_VOLUME "bla/a/b/c/d",
"a/./c" , "file:///" TEST_VOLUME "bla/a/c",
"file:///bla/blub", "file:///" "bla/blub",
- 0 , 0
+ nullptr , nullptr
};
const char * const aSource2[ ] =
@@ -76,7 +76,7 @@ const char * const aSource2[ ] =
"../../a", "file:///" TEST_VOLUME "bla/a",
"../../../a", "file:///" TEST_VOLUME "a",
"../../../a/b/c/d", "file:///" TEST_VOLUME "a/b/c/d",
- 0,0
+ nullptr,nullptr
};
using ::rtl::OUString;
diff --git a/sal/qa/osl/file/test_cpy_wrt_file.cxx b/sal/qa/osl/file/test_cpy_wrt_file.cxx
index 4dc3fe19a489..2addac8cf9ef 100644
--- a/sal/qa/osl/file/test_cpy_wrt_file.cxx
+++ b/sal/qa/osl/file/test_cpy_wrt_file.cxx
@@ -40,7 +40,7 @@ public:
//create a tempfile
rtl::OUString aTmpFile;
- err = FileBase::createTempFile(NULL, NULL, &aTmpFile);
+ err = FileBase::createTempFile(nullptr, nullptr, &aTmpFile);
CPPUNIT_ASSERT_MESSAGE("temp File creation failed", err == osl::FileBase::E_None);
//now attempt to open with Create flag an existing file, should get E_EXIST
diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx
index 171e9d61b6b9..571523e55e9b 100644
--- a/sal/qa/osl/module/osl_Module.cxx
+++ b/sal/qa/osl/module/osl_Module.cxx
@@ -200,7 +200,7 @@ namespace osl_Module
::osl::Module aMod( getDllURL( ) );
aMod.unload( );
- bRes = oslModule(aMod) ==NULL;
+ bRes = oslModule(aMod) ==nullptr;
CPPUNIT_ASSERT_MESSAGE( "#test comment#: unload function should do the same thing as destructor.",
bRes );
@@ -287,10 +287,10 @@ namespace osl_Module
#if !defined( MACOSX )
// TODO: Find out why this fails on Mac OS X
::osl::Module aMod;
- bRes = ( static_cast<oslModule>(aMod) == NULL );
+ bRes = ( static_cast<oslModule>(aMod) == nullptr );
aMod.load( getDllURL( ) );
- bRes1 = static_cast<oslModule>(aMod) != NULL;
+ bRes1 = static_cast<oslModule>(aMod) != nullptr;
aMod.unload( );
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index 9f04b503014f..529c113ced76 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -208,7 +208,7 @@ namespace osl_Pipe
::osl::Pipe aPipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
/// constructs two pipes without acquiring the handle on the base pipe.
::osl::Pipe aAcquirePipe( aPipe.getHandle( ) );
- ::osl::Pipe aAcquirePipe1( NULL );
+ ::osl::Pipe aAcquirePipe1( nullptr );
bRes = aAcquirePipe.is( );
bRes1 = aAcquirePipe1.is( );
@@ -257,7 +257,7 @@ namespace osl_Pipe
void is_004( )
{
- ::osl::Pipe aPipe( NULL );
+ ::osl::Pipe aPipe( nullptr );
CPPUNIT_ASSERT_MESSAGE( "#test comment#: test is(), an invalid constructor.", !aPipe.is( ) );
}
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 07440dd27a90..7b29a84c667b 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -171,7 +171,7 @@ namespace
#else
void read_parent_environment(string_container_t* env_container)
{
- for (int i = 0; NULL != environ[i]; i++)
+ for (int i = 0; nullptr != environ[i]; i++)
env_container->push_back(OString(environ[i]));
tidy_container(*env_container);
}
@@ -213,7 +213,7 @@ public:
OUString create_temp_file(OUString &temp_file_url)
{
- FileBase::RC rc = FileBase::createTempFile(0, 0, &temp_file_url);
+ FileBase::RC rc = FileBase::createTempFile(nullptr, nullptr, &temp_file_url);
CPPUNIT_ASSERT_EQUAL_MESSAGE("createTempFile failed", FileBase::E_None, rc);
OUString temp_file_path;
@@ -349,9 +349,9 @@ public:
parameters_,
parameters_count_,
osl_Process_NORMAL,
- NULL,
+ nullptr,
suCWD.pData,
- NULL,
+ nullptr,
0,
&process);
@@ -398,7 +398,7 @@ public:
parameters_,
parameters_count_,
osl_Process_NORMAL,
- NULL,
+ nullptr,
suCWD.pData,
child_env,
SAL_N_ELEMENTS(child_env),
@@ -442,12 +442,12 @@ public:
#endif
oslProcessError osl_error = osl_executeProcess(
suBatch.pData,
- NULL,
+ nullptr,
0,
osl_Process_NORMAL,
- NULL,
+ nullptr,
suCWD.pData,
- NULL,
+ nullptr,
0,
&process);
diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx
index feabd1dc6e7d..f709de940c51 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -82,7 +82,7 @@ void w_to_a(LPCTSTR _strW, LPSTR strA, DWORD size)
void dump_env(char* file_path)
{
std::ofstream file(file_path);
- for (int i = 0; NULL != environ[i]; ++i)
+ for (int i = 0; nullptr != environ[i]; ++i)
file << environ[i] << '\0';
}
#endif
diff --git a/sal/qa/osl/profile/osl_old_testprofile.cxx b/sal/qa/osl/profile/osl_old_testprofile.cxx
index 3cfba1247d65..5389c0cdb100 100644
--- a/sal/qa/osl/profile/osl_old_testprofile.cxx
+++ b/sal/qa/osl/profile/osl_old_testprofile.cxx
@@ -45,14 +45,14 @@ void oldtests::test_profile()
// successful write
oslProfile hProfile = osl_openProfile( rtl::OUString(baseUrl + "/soffice.ini").pData, osl_Profile_WRITELOCK );
- CPPUNIT_ASSERT(hProfile != 0);
+ CPPUNIT_ASSERT(hProfile != nullptr);
CPPUNIT_ASSERT_MESSAGE(
"cannot write into init file",
osl_writeProfileBool( hProfile, "testsection", "testbool", 1 ));
CPPUNIT_ASSERT(osl_closeProfile( hProfile ));
// unsuccessful open
- CPPUNIT_ASSERT_EQUAL(oslProfile(0), osl_openProfile( rtl::OUString(baseUrl + "/not_existing_path/soffice.ini").pData, osl_Profile_WRITELOCK ));
+ CPPUNIT_ASSERT_EQUAL(oslProfile(nullptr), osl_openProfile( rtl::OUString(baseUrl + "/not_existing_path/soffice.ini").pData, osl_Profile_WRITELOCK ));
}
} // namespace osl_Profile
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index a5cc2a03238d..693137fd9ab9 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -59,7 +59,7 @@ namespace osl_Security
::osl::Security aSec;
CPPUNIT_ASSERT_MESSAGE( "#test comment#: create a security its handle should not be NULL.",
- aSec.getHandle( ) != NULL );
+ aSec.getHandle( ) != nullptr );
}
CPPUNIT_TEST_SUITE( ctors );
@@ -327,7 +327,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
/// some initialization work for UNIX OS
struct passwd* pw;
- CPPUNIT_ASSERT_MESSAGE( "getpwuid: no password entry\n",( pw = getpwuid( getuid() ) ) != NULL );
+ CPPUNIT_ASSERT_MESSAGE( "getpwuid: no password entry\n",( pw = getpwuid( getuid() ) ) != nullptr );
/// get user ID;
strUserID = OUString::number( getuid( ) );
diff --git a/sal/qa/osl/setthreadname/test-setthreadname.cxx b/sal/qa/osl/setthreadname/test-setthreadname.cxx
index 3b05e392c20d..02e6eb76855a 100644
--- a/sal/qa/osl/setthreadname/test-setthreadname.cxx
+++ b/sal/qa/osl/setthreadname/test-setthreadname.cxx
@@ -46,7 +46,7 @@ void TestThread::run() {
}
#endif
setName("TestThread");
- if (std::getenv("URE_TEST_SETTHREADNAME") != 0) {
+ if (std::getenv("URE_TEST_SETTHREADNAME") != nullptr) {
// On Linux, the thread name can now be observed with "ps -L"; on
// Windows with the Microsoft compiler, the thread name can now be
// observed in a debugger.