CppunitTest_sal_osl_old_test_file: fix loplugin:cppunitassertequals warnings
Also in: - CppunitTest_sal_osl_security - CppunitTest_sal_rtl_crc32 - CppunitTest_sal_osl_thread - CppunitTest_sal_rtl_locale - CppunitTest_sal_rtl_process - CppunitTest_sal_rtl_random Change-Id: I853457f4ddc387728ea4fa201c278c361369a591 Reviewed-on: https://gerrit.libreoffice.org/26085 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
parent
5e7564dc69
commit
87def0e248
7 changed files with 39 additions and 39 deletions
|
@ -90,7 +90,7 @@ void oldtestfile::test_file_001()
|
|||
OUString target;
|
||||
OUString rel = OUString::createFromAscii( aSource1[i] );
|
||||
oslFileError e = osl_getAbsoluteFileURL( base1.pData, rel.pData , &target.pData );
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #1", osl_File_E_None == e );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("failure #1", osl_File_E_None, e );
|
||||
if( osl_File_E_None == e )
|
||||
{
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #1.1", target.equalsAscii( aSource1[i+1] ) );
|
||||
|
@ -109,7 +109,7 @@ void oldtestfile::test_file_002()
|
|||
OUString target;
|
||||
OUString rel = OUString::createFromAscii( aSource2[i] );
|
||||
oslFileError e = osl_getAbsoluteFileURL( base2.pData, rel.pData , &target.pData );
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #2", osl_File_E_None == e );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("failure #2", osl_File_E_None, e );
|
||||
if( osl_File_E_None == e )
|
||||
{
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #2.1", target.equalsAscii( aSource2[i+1] ) );
|
||||
|
@ -128,7 +128,7 @@ void oldtestfile::test_file_004()
|
|||
OUString target;
|
||||
OUString rel = OUString::createFromAscii( aSource1[i] );
|
||||
oslFileError e = osl_getAbsoluteFileURL( base4.pData, rel.pData , &target.pData );
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #10", osl_File_E_None == e );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("failure #10", osl_File_E_None, e );
|
||||
if( osl_File_E_None == e )
|
||||
{
|
||||
CPPUNIT_ASSERT_MESSAGE("failure #10.1", target.equalsAscii( aSource1[i+1] ) );
|
||||
|
|
|
@ -1382,9 +1382,9 @@ namespace osl_Thread
|
|||
#else
|
||||
// LLA: Linux
|
||||
// NO_PTHREAD_PRIORITY ???
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
"getPriority",
|
||||
aPriority == osl_Thread_PriorityNormal
|
||||
osl_Thread_PriorityNormal, aPriority
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
@ -1538,9 +1538,9 @@ namespace osl_Thread
|
|||
t_print("later value = %d\n", (int) nLaterValue);
|
||||
// if value and latervalue not equal, than the thread would not suspended
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
"Schedule: suspend works.",
|
||||
nLaterValue == nValue
|
||||
nValue, nLaterValue
|
||||
);
|
||||
|
||||
aThread->resume();
|
||||
|
@ -1611,9 +1611,9 @@ namespace osl_Thread
|
|||
|
||||
t_print(" value term = %d\n", (int) nValue_term);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
"Schedule: don't schedule in thread run method, terminate failed.",
|
||||
nValue_term == 10
|
||||
static_cast<sal_Int32>(10), nValue_term
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -208,8 +208,8 @@ namespace osl_Security
|
|||
::osl::Security aSec;
|
||||
bRes = aSec.isAdministrator( );
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE( "#test comment#: check if the user is administrator at beginning, compare here.",
|
||||
bRes == isAdmin );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "#test comment#: check if the user is administrator at beginning, compare here.",
|
||||
isAdmin, bRes );
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE( isAdministrator );
|
||||
|
@ -278,7 +278,7 @@ namespace osl_Security
|
|||
|
||||
oslSecurityError erg = osl_loginUserOnFileServer(suUserName.pData, suPassword.pData, suFileServer.pData, &pSec);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE( "empty function.", erg == osl_Security_E_UserUnknown );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "empty function.", osl_Security_E_UserUnknown, erg );
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE( loginUserOnFileServer );
|
||||
|
@ -339,8 +339,8 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
|
|||
char *pw_dir = pw->pw_dir;
|
||||
if( getenv( "FAKEROOTKEY" ) )
|
||||
pw_dir = getenv("HOME");
|
||||
CPPUNIT_ASSERT_MESSAGE( "#Convert from system path to URL failed.",
|
||||
::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw_dir ), strHomeDirectory ) );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "#Convert from system path to URL failed.",
|
||||
::osl::File::E_None, ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw_dir ), strHomeDirectory ) );
|
||||
|
||||
/// get config directory;
|
||||
strConfigDirectory = strHomeDirectory.copy(0);
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
nCRC = rtl_crc32(nCRC, buf, num);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE("empty crc buffer", nCRC == 0);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("empty crc buffer", static_cast<sal_uInt32>(0), nCRC);
|
||||
}
|
||||
|
||||
void rtl_crc32_002()
|
||||
|
@ -111,7 +111,7 @@ public:
|
|||
|
||||
nCRC2 = rtl_crc32(nCRC2, buf2, num2);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE("checksum leave it's bounds", nCRC1 == nCRC2);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("checksum leave it's bounds", nCRC2, nCRC1);
|
||||
}
|
||||
|
||||
/** check if the crc32 differ at same content in reverse order
|
||||
|
|
|
@ -108,13 +108,13 @@ public:
|
|||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suLanguage = pData->Language;
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale language must be 'de'", suLanguage == "de" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale language must be 'de'", OUString("de"), suLanguage );
|
||||
}
|
||||
void getLanguage_002()
|
||||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suLanguage(rtl_locale_getLanguage(pData), SAL_NO_ACQUIRE);
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale language must be 'de'", suLanguage == "de" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale language must be 'de'", OUString("de"), suLanguage );
|
||||
}
|
||||
|
||||
// Change the following lines only, if you add, remove or rename
|
||||
|
@ -142,13 +142,13 @@ public:
|
|||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suCountry = pData->Country;
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale country must be 'DE'", suCountry == "DE" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale country must be 'DE'", OUString("DE"), suCountry );
|
||||
}
|
||||
void getCountry_002()
|
||||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suCountry(rtl_locale_getCountry(pData), SAL_NO_ACQUIRE);
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale country must be 'DE'", suCountry == "DE" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale country must be 'DE'", OUString("DE"), suCountry );
|
||||
}
|
||||
|
||||
// Change the following lines only, if you add, remove or rename
|
||||
|
@ -176,13 +176,13 @@ public:
|
|||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suVariant = pData->Variant;
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale variant must be 'hochdeutsch'", suVariant == "hochdeutsch" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale variant must be 'hochdeutsch'", OUString("hochdeutsch"), suVariant );
|
||||
}
|
||||
void getVariant_002()
|
||||
{
|
||||
rtl_Locale* pData = rtl_locale_getDefault();
|
||||
rtl::OUString suVariant(rtl_locale_getVariant(pData), SAL_NO_ACQUIRE);
|
||||
CPPUNIT_ASSERT_MESSAGE( "locale variant must be 'hochdeutsch'", suVariant == "hochdeutsch" );
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE( "locale variant must be 'hochdeutsch'", OUString("hochdeutsch"), suVariant );
|
||||
}
|
||||
|
||||
// Change the following lines only, if you add, remove or rename
|
||||
|
|
|
@ -107,10 +107,10 @@ public:
|
|||
0,
|
||||
&hProcess );
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE
|
||||
(
|
||||
"osl_createProcess failed",
|
||||
osl_error == osl_Process_E_None
|
||||
osl_Process_E_None, osl_error
|
||||
);
|
||||
//we could get return value only after the process terminated
|
||||
osl_joinProcess(hProcess);
|
||||
|
@ -124,14 +124,14 @@ public:
|
|||
//you will get unknown error when call osl_getProcessInfo
|
||||
pInfo->Size = sizeof(oslProcessInfo);
|
||||
osl_error = osl_getProcessInfo( hProcess, osl_Process_EXITCODE, pInfo );
|
||||
CPPUNIT_ASSERT_MESSAGE
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE
|
||||
(
|
||||
"osl_getProcessInfo returned with failure",
|
||||
osl_Process_E_None == osl_error
|
||||
osl_error, osl_Process_E_None
|
||||
);
|
||||
|
||||
printf("the exit code is %" SAL_PRIuUINT32 ".\n", pInfo->Code );
|
||||
CPPUNIT_ASSERT_MESSAGE("rtl_getAppCommandArg or rtl_getAppCommandArgCount error.", pInfo->Code == 2);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("rtl_getAppCommandArg or rtl_getAppCommandArgCount error.", static_cast<oslProcessExitCode>(2), pInfo->Code);
|
||||
delete pInfo;
|
||||
}
|
||||
|
||||
|
@ -229,10 +229,10 @@ public:
|
|||
pChildOutputRead,
|
||||
nullptr);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE
|
||||
(
|
||||
"osl_createProcess failed",
|
||||
osl_error == osl_Process_E_None
|
||||
osl_Process_E_None, osl_error
|
||||
);
|
||||
//we could get return value only after the process terminated
|
||||
osl_joinProcess(hProcess);
|
||||
|
|
|
@ -102,13 +102,13 @@ public:
|
|||
memset(pBuffer, 0, nBufLen);
|
||||
|
||||
rtlRandomError aError = rtl_random_addBytes(nullptr, nullptr, 0);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_Argument);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_Argument, aError);
|
||||
|
||||
/* rtlRandomError */ aError = rtl_random_addBytes(aPool, nullptr, 0);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_Argument);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_Argument, aError);
|
||||
|
||||
/* rtlRandomError */ aError = rtl_random_addBytes(aPool, pBuffer, nBufLen);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_None);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_None, aError);
|
||||
|
||||
rtl_random_destroyPool(aPool);
|
||||
delete [] pBuffer;
|
||||
|
@ -225,13 +225,13 @@ public:
|
|||
memset(pBuffer, 0, nBufLen);
|
||||
|
||||
rtlRandomError aError = rtl_random_getBytes(nullptr, nullptr, 0);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_Argument);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_Argument, aError);
|
||||
|
||||
/* rtlRandomError */ aError = rtl_random_getBytes(aPool, nullptr, 0);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_Argument);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_Argument, aError);
|
||||
|
||||
/* rtlRandomError */ aError = rtl_random_getBytes(aPool, pBuffer, nBufLen);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_None);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_None, aError);
|
||||
|
||||
rtl_random_destroyPool(aPool);
|
||||
delete [] pBuffer;
|
||||
|
@ -246,7 +246,7 @@ public:
|
|||
memset(pBuffer, 0, nBufLen);
|
||||
|
||||
rtlRandomError aError = rtl_random_getBytes(aPool, pBuffer, nBufLen);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_None);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_None, aError);
|
||||
|
||||
printf("%2x %2x %2x %2x\n", pBuffer[0], pBuffer[1], pBuffer[2], pBuffer[3]);
|
||||
|
||||
|
@ -265,7 +265,7 @@ public:
|
|||
CPPUNIT_ASSERT_MESSAGE("memset failed", pBuffer[4] == 0 && pBuffer[5] == 0 && pBuffer[6] == 0 && pBuffer[7] == 0);
|
||||
|
||||
rtlRandomError aError = rtl_random_getBytes(aPool, pBuffer, nBufLen);
|
||||
CPPUNIT_ASSERT_MESSAGE("wrong parameter", aError == rtl_Random_E_None);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong parameter", rtl_Random_E_None, aError);
|
||||
|
||||
printf("%2x %2x %2x %2x %2x %2x %2x %2x\n", pBuffer[0], pBuffer[1], pBuffer[2], pBuffer[3], pBuffer[4], pBuffer[5], pBuffer[6], pBuffer[7]);
|
||||
|
||||
|
@ -285,7 +285,7 @@ public:
|
|||
|
||||
Statistics aStat;
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE("memset failed", pBuffer[0] == 0);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("memset failed", static_cast<sal_uInt8>(0), pBuffer[0]);
|
||||
|
||||
int nCount = 0;
|
||||
|
||||
|
@ -317,7 +317,7 @@ public:
|
|||
|
||||
Statistics aStat;
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE("memset failed", pBuffer[0] == 0);
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("memset failed", static_cast<sal_uInt8>(0), pBuffer[0]);
|
||||
|
||||
int nCount = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue