[Libreoffice-commits] core.git: sal/qa
Miklos Vajna
vmiklos at collabora.co.uk
Fri Jun 17 10:36:19 UTC 2016
sal/qa/osl/pipe/osl_Pipe.cxx | 4 ++--
sal/qa/rtl/cipher/rtl_cipher.cxx | 36 ++++++++++++++++++------------------
2 files changed, 20 insertions(+), 20 deletions(-)
New commits:
commit be4dd3954a57518168647c18af298ecda0fb2428
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jun 17 08:49:04 2016 +0200
CppunitTest_sal_rtl_cipher: fix loplugin:cppunitassertequals warnings
Change-Id: I94e79ae616d5cb9287e69544e283ce4d288a19ef
Reviewed-on: https://gerrit.libreoffice.org/26401
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index a2fad9f..af5f947 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -485,8 +485,8 @@ namespace osl_Pipe
aPipe.close( );
int nRet = aPipe.send( m_pTestString1.getStr(), 3 );
- CPPUNIT_ASSERT_MESSAGE( "#test comment#: use after close.",
- OSL_PIPE_FAIL == nRet );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "#test comment#: use after close.",
+ nRet, OSL_PIPE_FAIL );
}
CPPUNIT_TEST_SUITE( close );
diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx
index e24e6c5..a2a55ff 100644
--- a/sal/qa/rtl/cipher/rtl_cipher.cxx
+++ b/sal/qa/rtl/cipher/rtl_cipher.cxx
@@ -43,7 +43,7 @@ public:
void create_002()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeECB);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
}
void create_003()
{
@@ -54,7 +54,7 @@ public:
void create_004()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeCBC);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
}
void create_005()
{
@@ -65,17 +65,17 @@ public:
void create_006()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeStream);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
}
void create_007()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
}
void create_008()
{
rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
}
// Change the following lines only, if you add, remove or rename
@@ -119,7 +119,7 @@ public:
void createBF_004()
{
rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeInvalid);
- CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == nullptr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("create provide wrong object.", static_cast<rtlCipher>(nullptr), aCipher);
// rtl_cipher_destroy(aCipher);
}
// Change the following lines only, if you add, remove or rename
@@ -154,7 +154,7 @@ public:
pArgBuffer[0] = _nArgValue;
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
sal_uInt32 nPlainTextLen = 16;
sal_uInt8 *pPlainTextBuffer = new sal_uInt8[ nPlainTextLen ];
@@ -166,7 +166,7 @@ public:
memset(pCipherBuffer, 0, nCipherLen);
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen);
- CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong encode", rtl_Cipher_E_None, aError);
sal_uInt32 nPlainText2Len = 16;
sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ];
@@ -202,7 +202,7 @@ public:
pArgBuffer[0] = _nArgValue;
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionBoth, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
sal_uInt32 nPlainTextLen = 16;
sal_uInt8 *pPlainTextBuffer = new sal_uInt8[ nPlainTextLen ];
@@ -214,18 +214,18 @@ public:
memset(pCipherBuffer, 0, nCipherLen);
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen);
- CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong encode", rtl_Cipher_E_None, aError);
sal_uInt32 nPlainText2Len = 16;
sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ];
memset(pPlainText2Buffer, 0, nPlainText2Len);
/* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len);
- CPPUNIT_ASSERT_MESSAGE("wrong decode", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong decode", rtl_Cipher_E_None, aError);
sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16);
- CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("compare between plain and decoded plain failed", static_cast<sal_Int32>(0), nCompare);
delete [] pPlainText2Buffer;
@@ -339,7 +339,7 @@ public:
pArgBuffer[0] = _nArgValue;
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
sal_uInt32 nDataLen = 16;
sal_uInt8 *pDataBuffer = new sal_uInt8[ nDataLen ];
@@ -351,7 +351,7 @@ public:
memset(pBuffer, 0, nLen);
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pDataBuffer, nDataLen, pBuffer, nLen);
- CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong encode", rtl_Cipher_E_None, aError);
delete [] pBuffer;
delete [] pDataBuffer;
@@ -418,7 +418,7 @@ public:
memset(pArgBuffer, 0, nArgLen);
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -441,7 +441,7 @@ public:
memset(pArgBuffer, 0, nArgLen);
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -463,7 +463,7 @@ public:
pArgBuffer[0] = 1;
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -486,7 +486,7 @@ public:
pArgBuffer[0] = 1;
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
- CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong init", rtl_Cipher_E_None, aError);
delete [] pArgBuffer;
delete [] pKeyBuffer;
More information about the Libreoffice-commits
mailing list