summaryrefslogtreecommitdiff
path: root/sal/qa
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
parent5bbdb9423e15b68438bb8397c15635e044129e28 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/ByteSequence/ByteSequence.cxx2
-rw-r--r--sal/qa/OStringBuffer/rtl_OStringBuffer.cxx2
-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
-rw-r--r--sal/qa/rtl/alloc/rtl_alloc.cxx12
-rw-r--r--sal/qa/rtl/cipher/rtl_cipher.cxx42
-rw-r--r--sal/qa/rtl/digest/rtl_digest.cxx46
-rw-r--r--sal/qa/rtl/locale/rtl_locale.cxx4
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx2
-rw-r--r--sal/qa/rtl/process/rtl_Process.cxx22
-rw-r--r--sal/qa/rtl/strings/test_ostring_concat.cxx6
-rw-r--r--sal/qa/rtl/strings/test_oustring_concat.cxx6
-rw-r--r--sal/qa/rtl/strings/test_oustring_convert.cxx8
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx44
-rw-r--r--sal/qa/rtl/uri/rtl_testuri.cxx8
-rw-r--r--sal/qa/rtl/uuid/rtl_Uuid.cxx4
24 files changed, 154 insertions, 154 deletions
diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx
index c742337748be..abe5e8fc4a6e 100644
--- a/sal/qa/ByteSequence/ByteSequence.cxx
+++ b/sal/qa/ByteSequence/ByteSequence.cxx
@@ -60,7 +60,7 @@ public:
}
void test_elem0() {
- rtl::ByteSequence s(0, 0);
+ rtl::ByteSequence s(nullptr, 0);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), s.getLength());
}
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index ad5bbaae49b3..809665f74665 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -1515,7 +1515,7 @@ namespace rtl_OStringBuffer
CPPUNIT_ASSERT_MESSAGE
(
"test empty string",
- pstr != 0 &&
+ pstr != nullptr &&
pstr[0] == '\0'
);
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.
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index 1a588653edf7..f567aa32ed4d 100644
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -52,7 +52,7 @@ class Memory : public CppUnit::TestFixture
public:
Memory()
- : m_pMemory(NULL)
+ : m_pMemory(nullptr)
, m_nSizeOfMemory(1024)
{
}
@@ -66,12 +66,12 @@ public:
void tearDown() override
{
rtl_freeMemory(m_pMemory);
- m_pMemory = NULL;
+ m_pMemory = nullptr;
}
void rtl_allocateMemory_001()
{
- CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pMemory != NULL);
+ CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pMemory != nullptr);
memset(m_pMemory, 1, m_nSizeOfMemory);
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, m_nSizeOfMemory, 1));
}
@@ -81,7 +81,7 @@ public:
sal_uInt32 nSize = 2 * 1024;
m_pMemory = static_cast<char*>(rtl_reallocateMemory(m_pMemory, nSize));
- CPPUNIT_ASSERT_MESSAGE( "Can reallocate memory.", m_pMemory != NULL);
+ CPPUNIT_ASSERT_MESSAGE( "Can reallocate memory.", m_pMemory != nullptr);
memset(m_pMemory, 2, nSize);
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, nSize, 2));
}
@@ -100,7 +100,7 @@ class TestZeroMemory : public CppUnit::TestFixture
public:
TestZeroMemory()
- : m_pZeroMemory(NULL)
+ : m_pZeroMemory(nullptr)
, m_nSizeOfZeroMemory( 50 * 1024 * 1024 )
{
}
@@ -122,7 +122,7 @@ public:
void rtl_allocateZeroMemory_001()
{
- CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pZeroMemory != NULL);
+ CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pZeroMemory != nullptr);
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 0));
memset(m_pZeroMemory, 3, m_nSizeOfZeroMemory);
diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx
index 842ce97c9d93..0a477699f464 100644
--- a/sal/qa/rtl/cipher/rtl_cipher.cxx
+++ b/sal/qa/rtl/cipher/rtl_cipher.cxx
@@ -45,45 +45,45 @@ public:
void create_001()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void create_002()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
}
void create_003()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void create_004()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeCBC);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
}
void create_005()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void create_006()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeStream);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
}
void create_007()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
}
void create_008()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
}
// Change the following lines only, if you add, remove or rename
@@ -117,25 +117,25 @@ public:
void createBF_001()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void createBF_002()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeCBC);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void createBF_003()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeStream);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
void createBF_004()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
// rtl_cipher_destroy(aCipher);
}
// Change the following lines only, if you add, remove or rename
@@ -165,7 +165,7 @@ public:
void test_encode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr)
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -213,7 +213,7 @@ public:
void test_encode_and_decode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr)
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -326,7 +326,7 @@ public:
void destroy_001()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroy(aCipher);
}
// Change the following lines only, if you add, remove or rename
@@ -353,7 +353,7 @@ public:
void destroyBF_001()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
rtl_cipher_destroyBF(aCipher);
// more proforma
// should not GPF
@@ -382,7 +382,7 @@ public:
void test_encode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, sal_uInt8 _nDataValue)
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -479,7 +479,7 @@ public:
void init_001()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -501,7 +501,7 @@ public:
void init_002()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -523,7 +523,7 @@ public:
void init_003()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
@@ -545,7 +545,7 @@ public:
void init_004()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != nullptr);
sal_uInt32 nKeyLen = 16;
sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ];
diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx
index 52ebb81ffb12..4a1b2276c727 100644
--- a/sal/qa/rtl/digest/rtl_digest.cxx
+++ b/sal/qa/rtl/digest/rtl_digest.cxx
@@ -114,12 +114,12 @@ public:
for (int i = 0; i < aAlgorithmSize; i++)
{
rtlDigest handle = rtl_digest_create( constDigestAlgorithms[i] );
- CPPUNIT_ASSERT_MESSAGE("create digest", handle != NULL);
+ CPPUNIT_ASSERT_MESSAGE("create digest", handle != nullptr);
rtl_digest_destroy( handle );
}
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmInvalid );
- CPPUNIT_ASSERT_MESSAGE("create invalid digest", handle == NULL);
+ CPPUNIT_ASSERT_MESSAGE("create invalid digest", handle == nullptr);
rtl_digest_destroy( handle );
}
@@ -162,12 +162,12 @@ public:
rtlDigestError aError;
rtlDigest handle;
- handle = NULL;
- aError = rtl_digest_init(handle, NULL, 0);
+ handle = nullptr;
+ aError = rtl_digest_init(handle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("init(NULL, 0, 0)", aError == rtl_Digest_E_Argument);
handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
- aError = rtl_digest_init(handle, NULL, 0);
+ aError = rtl_digest_init(handle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("init(handle, 0, 0)", aError == rtl_Digest_E_None);
rtl_digest_destroy( handle );
@@ -285,24 +285,24 @@ public:
rtlDigestError aError;
rtlDigest aHandle;
- aHandle = NULL;
- aError = rtl_digest_update(aHandle, NULL, 0);
+ aHandle = nullptr;
+ aError = rtl_digest_update(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument);
- aHandle = NULL;
- aError = rtl_digest_updateMD2(aHandle, NULL, 0);
+ aHandle = nullptr;
+ aError = rtl_digest_updateMD2(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument);
- aError = rtl_digest_updateMD5(aHandle, NULL, 0);
+ aError = rtl_digest_updateMD5(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument);
aHandle = rtl_digest_create( rtl_Digest_AlgorithmMD2 );
- CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != 0);
+ CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != nullptr);
const sal_uInt8* pData = reinterpret_cast<const sal_uInt8*>(sSampleString.getStr());
sal_uInt32 nSize = sSampleString.getLength();
- aError = rtl_digest_updateMD2(aHandle, NULL, 0);
+ aError = rtl_digest_updateMD2(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("handle parameter 'pData' wrong", aError == rtl_Digest_E_Argument);
aError = rtl_digest_updateMD2(aHandle, pData, 0);
@@ -312,7 +312,7 @@ public:
// use wrong Algorithm!!! This is volitional!
aHandle = rtl_digest_create(rtl_Digest_AlgorithmMD2);
- CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != 0);
+ CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != nullptr);
aError = rtl_digest_updateMD5(aHandle, pData, nSize);
CPPUNIT_ASSERT_MESSAGE("handle parameter 'handle' wrong", aError == rtl_Digest_E_Algorithm);
@@ -320,9 +320,9 @@ public:
rtl_digest_destroyMD5(aHandle);
aHandle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
- CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", aHandle != 0);
+ CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", aHandle != nullptr);
- aError = rtl_digest_updateMD5(aHandle, NULL, 0);
+ aError = rtl_digest_updateMD5(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("handle parameter 'pData' wrong", aError == rtl_Digest_E_Argument);
aError = rtl_digest_updateMD5(aHandle, pData, 0);
@@ -336,22 +336,22 @@ public:
rtlDigest aHandle;
rtlDigestError aError;
- aHandle = NULL;
- aError = rtl_digest_get(aHandle, NULL, 0);
+ aHandle = nullptr;
+ aError = rtl_digest_get(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument);
- aHandle = NULL;
- aError = rtl_digest_getMD5(aHandle, NULL, 0);
+ aHandle = nullptr;
+ aError = rtl_digest_getMD5(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("does not handle wrong parameter", aError == rtl_Digest_E_Argument);
// test with wrong algorithm
aHandle = rtl_digest_create(rtl_Digest_AlgorithmMD2);
- CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != 0);
+ CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD2", aHandle != nullptr);
sal_uInt32 nKeyLen = rtl_digest_queryLength(aHandle);
std::unique_ptr<sal_uInt8[]> pKeyBuffer(new sal_uInt8[nKeyLen]);
- aError = rtl_digest_getMD5(aHandle, NULL, 0);
+ aError = rtl_digest_getMD5(aHandle, nullptr, 0);
CPPUNIT_ASSERT_MESSAGE("handle 2. parameter wrong", aError == rtl_Digest_E_Argument);
aError = rtl_digest_getMD5(aHandle, pKeyBuffer.get(), 0);
@@ -360,9 +360,9 @@ public:
rtl_digest_destroyMD2(aHandle);
aHandle = rtl_digest_create(rtl_Digest_AlgorithmMD5);
- CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", aHandle != 0);
+ CPPUNIT_ASSERT_MESSAGE("create with rtl_Digest_AlgorithmMD5", aHandle != nullptr);
- aError = rtl_digest_getMD5(aHandle, NULL, nKeyLen);
+ aError = rtl_digest_getMD5(aHandle, nullptr, nKeyLen);
CPPUNIT_ASSERT_MESSAGE("handle parameter 'pData' wrong", aError == rtl_Digest_E_Argument );
aError = rtl_digest_getMD5(aHandle, pKeyBuffer.get(), 0);
diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx
index 44f6996b8056..fc99838ee573 100644
--- a/sal/qa/rtl/locale/rtl_locale.cxx
+++ b/sal/qa/rtl/locale/rtl_locale.cxx
@@ -51,7 +51,7 @@ public:
void getDefault_001()
{
rtl_Locale* pData = rtl_locale_getDefault();
- CPPUNIT_ASSERT_MESSAGE("locale must not null", pData != NULL);
+ CPPUNIT_ASSERT_MESSAGE("locale must not null", pData != nullptr);
}
// Change the following lines only, if you add, remove or rename
@@ -83,7 +83,7 @@ public:
{
rtl_locale_setDefault(rtl::OUString("en").getStr(), rtl::OUString("US").getStr(), rtl::OUString().getStr());
rtl_Locale* pData = rtl_locale_getDefault();
- CPPUNIT_ASSERT_MESSAGE("locale must not null", pData != NULL);
+ CPPUNIT_ASSERT_MESSAGE("locale must not null", pData != nullptr);
// be sure to not GPF
}
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 2f0b366bccc9..7868b98c6464 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -995,7 +995,7 @@ public:
void createFromCodePoints::test() {
CPPUNIT_ASSERT_EQUAL(
sal_Int32(0),
- rtl::OUString(static_cast< sal_uInt32 const * >(NULL), 0).getLength());
+ rtl::OUString(static_cast< sal_uInt32 const * >(nullptr), 0).getLength());
static sal_uInt32 const cp[] = { 0, 0xD800, 0xFFFF, 0x10000, 0x10FFFF };
rtl::OUString s(cp, sizeof cp / sizeof (sal_uInt32));
CPPUNIT_ASSERT_EQUAL(sal_Int32(7), s.getLength());
diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx
index ee8dcfa7dd29..d4d7c86b7df5 100644
--- a/sal/qa/rtl/process/rtl_Process.cxx
+++ b/sal/qa/rtl/process/rtl_Process.cxx
@@ -42,9 +42,9 @@ using ::rtl::OUStringToOString;
/** print a UNI_CODE String. And also print some comments of the string.
*/
-inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = NULL )
+inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = nullptr )
{
- if ( msg != NULL )
+ if ( msg != nullptr )
{
printf("#%s #printUString_u# ", msg );
}
@@ -93,7 +93,7 @@ public:
printUString(suCWD, "path to the current module");
// printUString(suCWD2, "suCWD2");
- oslProcess hProcess = NULL;
+ oslProcess hProcess = nullptr;
const int nParameterCount = 4;
rtl_uString* pParameters[ nParameterCount ];
@@ -110,9 +110,9 @@ public:
pParameters,
nParameterCount,
osl_Process_WAIT,
- 0, /* osl_getCurrentSecurity() */
+ nullptr, /* osl_getCurrentSecurity() */
suCWD.pData,
- NULL,
+ nullptr,
0,
&hProcess );
@@ -229,22 +229,22 @@ public:
printf("# UUID to String is %s\n", pUUID1);
rtl::OUString suCWD = getModulePath();
- oslProcess hProcess = NULL;
+ oslProcess hProcess = nullptr;
rtl::OUString suFileURL = suCWD + "/" + EXEC_NAME;
oslFileHandle* pChildOutputRead = new oslFileHandle();
oslProcessError osl_error = osl_executeProcess_WithRedirectedIO(
suFileURL.pData,
- NULL,
+ nullptr,
0,
osl_Process_WAIT,
- 0,
+ nullptr,
suCWD.pData,
- NULL,
+ nullptr,
0,
&hProcess,
- NULL,
+ nullptr,
pChildOutputRead,
- NULL);
+ nullptr);
CPPUNIT_ASSERT_MESSAGE
(
diff --git a/sal/qa/rtl/strings/test_ostring_concat.cxx b/sal/qa/rtl/strings/test_ostring_concat.cxx
index 0a54c96ae4e0..ba46d9f76397 100644
--- a/sal/qa/rtl/strings/test_ostring_concat.cxx
+++ b/sal/qa/rtl/strings/test_ostring_concat.cxx
@@ -86,7 +86,7 @@ void test::ostring::StringConcat::checkConcat()
void test::ostring::StringConcat::checkEnsureCapacity()
{
- rtl_String* str = NULL;
+ rtl_String* str = nullptr;
rtl_string_newFromLiteral( &str, "test", strlen( "test" ), 0 );
CPPUNIT_ASSERT_EQUAL( sal_Int32( 4 ), str->length );
CPPUNIT_ASSERT_EQUAL( 1, int( str->refCount ));
@@ -145,8 +145,8 @@ void test::ostring::StringConcat::checkInvalid()
CPPUNIT_ASSERT( INVALID_CONCAT( OString( "a" ) + OUStringBuffer( "b" )));
CPPUNIT_ASSERT( INVALID_CONCAT( OString( "a" ) + OUStringLiteral( "b" )));
CPPUNIT_ASSERT( INVALID_CONCAT( OString( "a" ) + 1 ));
- rtl_String* rs = NULL;
- rtl_uString* rus = NULL;
+ rtl_String* rs = nullptr;
+ rtl_uString* rus = nullptr;
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "b" ) + rs ));
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "b" ) + rus ));
}
diff --git a/sal/qa/rtl/strings/test_oustring_concat.cxx b/sal/qa/rtl/strings/test_oustring_concat.cxx
index 3bc69e17cfe8..b319c089d35f 100644
--- a/sal/qa/rtl/strings/test_oustring_concat.cxx
+++ b/sal/qa/rtl/strings/test_oustring_concat.cxx
@@ -87,7 +87,7 @@ void test::oustring::StringConcat::checkConcatAsciiL()
void test::oustring::StringConcat::checkEnsureCapacity()
{
- rtl_uString* str = NULL;
+ rtl_uString* str = nullptr;
rtl_uString_newFromLiteral( &str, "test", strlen( "test" ), 0 );
CPPUNIT_ASSERT_EQUAL( sal_Int32( 4 ), str->length );
CPPUNIT_ASSERT_EQUAL( 1, int( str->refCount ));
@@ -154,8 +154,8 @@ void test::oustring::StringConcat::checkInvalid()
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "a" ) + static_cast<char*>(d) ));
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "a" ) + OStringLiteral( "b" )));
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "a" ) + 1 ));
- rtl_String* rs = NULL;
- rtl_uString* rus = NULL;
+ rtl_String* rs = nullptr;
+ rtl_uString* rus = nullptr;
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "b" ) + rs ));
CPPUNIT_ASSERT( INVALID_CONCAT( OUString( "b" ) + rus ));
}
diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx
index 363c0ffa3516..639d9b744555 100644
--- a/sal/qa/rtl/strings/test_oustring_convert.cxx
+++ b/sal/qa/rtl/strings/test_oustring_convert.cxx
@@ -79,7 +79,7 @@ void testConvertToString(TestConvertToString const & rTest)
if (bSuccess)
{
- if (rTest.pStrict == 0 || !aStrict.equals(rTest.pStrict))
+ if (rTest.pStrict == nullptr || !aStrict.equals(rTest.pStrict))
{
rtl::OStringBuffer aMessage(aPrefix);
aMessage.append(RTL_CONSTASCII_STRINGPARAM("strict = \""));
@@ -96,7 +96,7 @@ void testConvertToString(TestConvertToString const & rTest)
aMessage.append(RTL_CONSTASCII_STRINGPARAM("modified output"));
CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false);
}
- if (rTest.pStrict != 0)
+ if (rTest.pStrict != nullptr)
{
rtl::OStringBuffer aMessage(aPrefix);
aMessage.append(RTL_CONSTASCII_STRINGPARAM("failed"));
@@ -149,7 +149,7 @@ void test::oustring::Convert::convertToString()
RTL_TEXTENCODING_ISO_2022_JP,
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR,
- 0,
+ nullptr,
"" },
{ { 0x3001, 0xB800 },
2,
@@ -162,7 +162,7 @@ void test::oustring::Convert::convertToString()
RTL_TEXTENCODING_ISO_8859_1,
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR,
- 0,
+ nullptr,
"A" },
{ { 0x0041,0x0100,0x0042 },
3,
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 75a6fb7507a3..8a6b4837b39d 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -57,10 +57,10 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) {
= rtl_createTextToUnicodeConverter(rSet.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_TextToUnicodeContext aContext
= rtl_createTextToUnicodeContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
@@ -103,10 +103,10 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) {
= rtl_createUnicodeToTextConverter(rSet.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_UnicodeToTextContext aContext
= rtl_createUnicodeToTextContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
@@ -147,10 +147,10 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) {
= rtl_createTextToUnicodeConverter(rSet.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_TextToUnicodeContext aContext
= rtl_createTextToUnicodeContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
@@ -195,10 +195,10 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
= rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_TextToUnicodeContext aContext
= rtl_createTextToUnicodeContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
@@ -235,10 +235,10 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
= rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_TextToUnicodeContext aContext
= rtl_createTextToUnicodeContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
if (aContext != reinterpret_cast<rtl_TextToUnicodeContext>(1)) {
sal_Size nInput = 0;
sal_Size nOutput = 0;
@@ -289,7 +289,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
= rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
for (sal_Size i = 0;;) {
if (i == rTest.m_nTextSize) {
goto done;
@@ -299,7 +299,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
sal_uInt32 nInfo = 0;
sal_Size nCvtBytes;
sal_Size nChars = rtl_convertTextToUnicode(
- aConverter, 0, &c1, 1, aUC, 2,
+ aConverter, nullptr, &c1, 1, aUC, 2,
(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
| RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
| RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
@@ -319,7 +319,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
c1 = rTest.m_pText[i++];
sBuffer[nLen++] = c1;
nChars = rtl_convertTextToUnicode(
- aConverter, 0, sBuffer, nLen, aUC, 2,
+ aConverter, nullptr, sBuffer, nLen, aUC, 2,
(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
| RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
| RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
@@ -370,10 +370,10 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
= rtl_createUnicodeToTextConverter(rTest.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
rtl_UnicodeToTextContext aContext
= rtl_createUnicodeToTextContext(aConverter);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
@@ -413,12 +413,12 @@ void doComplexCharSetCutTest(ComplexCharSetTest const & rTest) {
= rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUString("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
RTL_TEXTENCODING_UTF8).getStr(),
- aConverter != NULL);
+ aConverter != nullptr);
sal_Size nSize;
sal_uInt32 nInfo;
sal_Size nConverted;
nSize = rtl_convertTextToUnicode(
- aConverter, 0, reinterpret_cast< sal_Char const * >(rTest.m_pText),
+ aConverter, nullptr, reinterpret_cast< sal_Char const * >(rTest.m_pText),
rTest.m_nTextSize, aUnicode, TEST_STRING_SIZE,
(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
| RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
@@ -2668,9 +2668,9 @@ void Test::testSRCBUFFERTOSMALL() {
rtl_TextToUnicodeConverter cv = rtl_createTextToUnicodeConverter(
RTL_TEXTENCODING_EUC_JP);
CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeConverter(EUC-JP) failed",
- cv != NULL);
+ cv != nullptr);
rtl_TextToUnicodeContext cx = rtl_createTextToUnicodeContext(cv);
- CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", cx != NULL);
+ CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", cx != nullptr);
char src = '\xA1';
sal_Unicode dst[10];
sal_uInt32 info;
@@ -2774,7 +2774,7 @@ void Test::testMime() {
{ "KSC_5601", RTL_TEXTENCODING_MS_949, false },
{ "korean", RTL_TEXTENCODING_MS_949, false },
{ "csKSC56011987", RTL_TEXTENCODING_MS_949, false },
- { 0, RTL_TEXTENCODING_MS_949, true },
+ { nullptr, RTL_TEXTENCODING_MS_949, true },
{ "Adobe-Standard-Encoding", RTL_TEXTENCODING_ADOBE_STANDARD, false },
{ "csAdobeStandardEncoding", RTL_TEXTENCODING_ADOBE_STANDARD, false },
@@ -2788,10 +2788,10 @@ void Test::testMime() {
{ "Cyrillic-Asian", RTL_TEXTENCODING_PT154, false }
};
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
- if (data[i].mime == 0) {
+ if (data[i].mime == nullptr) {
OSL_ASSERT(data[i].reverse);
CPPUNIT_ASSERT_EQUAL(
- static_cast< char const * >(0),
+ static_cast< char const * >(nullptr),
rtl_getMimeCharsetFromTextEncoding(data[i].encoding));
} else {
CPPUNIT_ASSERT_EQUAL(
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index 191bf5dc2b53..00e8dd56b7db 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -323,7 +323,7 @@ void Test::test_Uri() {
{ "http://a/b/c/d;p?q", "http:g", "http:g" },
{ "http!://a/b/c/d;p?q", "g:h", "g:h" },
- { "http!://a/b/c/d;p?q", "g", 0 },
+ { "http!://a/b/c/d;p?q", "g", nullptr },
{ "http:b/c/d;p?q", "g:h", "g:h" },
{ "http:b/c/d;p?q", "g", "http:b/c/g" },
{ "http://a/b/../", "../c", "http://a/c" },
@@ -347,8 +347,8 @@ void Test::test_Uri() {
bMalformed = true;
}
if (bMalformed
- ? aRelToAbsTest[i].pAbs != 0
- : (aRelToAbsTest[i].pAbs == 0
+ ? aRelToAbsTest[i].pAbs != nullptr
+ : (aRelToAbsTest[i].pAbs == nullptr
|| !aAbs.equalsAscii(aRelToAbsTest[i].pAbs)))
{
printf(
@@ -358,7 +358,7 @@ void Test::test_Uri() {
? "<MALFORMED>"
: rtl::OUStringToOString(
aAbs, RTL_TEXTENCODING_UTF8).getStr()),
- (aRelToAbsTest[i].pAbs == 0
+ (aRelToAbsTest[i].pAbs == nullptr
? "<MALFORMED>" : aRelToAbsTest[i].pAbs));
CPPUNIT_ASSERT(false);
}
diff --git a/sal/qa/rtl/uuid/rtl_Uuid.cxx b/sal/qa/rtl/uuid/rtl_Uuid.cxx
index f568d03702c2..ba20eadec53d 100644
--- a/sal/qa/rtl/uuid/rtl_Uuid.cxx
+++ b/sal/qa/rtl/uuid/rtl_Uuid.cxx
@@ -60,7 +60,7 @@ public:
sal_Int32 i,i2;
for( i = 0 ; i < TEST_UUID ; i ++ )
{
- rtl_createUuid( aNode[i], 0, sal_False );
+ rtl_createUuid( aNode[i], nullptr, sal_False );
}
bool bRes = true;
for( i = 0 ; i < TEST_UUID ; i ++ )
@@ -137,7 +137,7 @@ public:
sal_uInt8 pNamedUUID[16], pNamedUUID2[16];
// Same name does generate the same uuid
- rtl_String *pName = 0;
+ rtl_String *pName = nullptr;
rtl_string_newFromStr( &pName , "this is a bla.blubs.DNS-Name" );
rtl_createNamedUuid( pNamedUUID , NameSpace_DNS , pName );
rtl_createNamedUuid( pNamedUUID2 , NameSpace_DNS , pName );