diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-09 09:10:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-09 08:45:46 +0000 |
commit | 87def0e248cef61e5be8acfb66c191f8552db344 (patch) | |
tree | 9cd2327d392d16fc60c536c2fb901fe60a647689 /sal/qa/osl | |
parent | 5e7564dc6917d65d8b5f30534b78c1fe58cf4463 (diff) |
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>
Diffstat (limited to 'sal/qa/osl')
-rw-r--r-- | sal/qa/osl/file/osl_old_test_file.cxx | 6 | ||||
-rw-r--r-- | sal/qa/osl/process/osl_Thread.cxx | 12 | ||||
-rw-r--r-- | sal/qa/osl/security/osl_Security.cxx | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx index 4bbc70d7b073..ea4f52f7fe26 100644 --- a/sal/qa/osl/file/osl_old_test_file.cxx +++ b/sal/qa/osl/file/osl_old_test_file.cxx @@ -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] ) ); diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx index 1e3c12ca1f14..ebce318f11c4 100644 --- a/sal/qa/osl/process/osl_Thread.cxx +++ b/sal/qa/osl/process/osl_Thread.cxx @@ -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 ); } diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx index 33c093b8d7ea..396959be6e8a 100644 --- a/sal/qa/osl/security/osl_Security.cxx +++ b/sal/qa/osl/security/osl_Security.cxx @@ -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); |