summaryrefslogtreecommitdiff
path: root/sal/qa/rtl
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/rtl
parent5bbdb9423e15b68438bb8397c15635e044129e28 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
Diffstat (limited to 'sal/qa/rtl')
-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
12 files changed, 102 insertions, 102 deletions
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 );