diff options
-rw-r--r-- | sal/osl/w32/procimpl.cxx | 6 | ||||
-rw-r--r-- | sal/qa/osl/file/osl_File.cxx | 58 | ||||
-rw-r--r-- | sal/qa/osl/process/osl_process.cxx | 28 |
3 files changed, 46 insertions, 46 deletions
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index 0cdfa58ddff6..9dc0959b7742 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -60,8 +60,8 @@ extern "C" oslFileHandle SAL_CALL osl_createFileHandleFromOSHandle( HANDLE hFile //################################################# const sal_Unicode NAME_VALUE_SEPARATOR = TEXT('='); const sal_Char* SPACE = " "; -const rtl::OUString ENV_COMSPEC (RTL_CONSTASCII_USTRINGPARAM("COMSPEC")); -const rtl::OUString QUOTE(RTL_CONSTASCII_USTRINGPARAM("\"")); +const rtl::OUString ENV_COMSPEC ("COMSPEC"); +const rtl::OUString QUOTE("\""); namespace /* private */ { @@ -358,7 +358,7 @@ namespace /* private */ if (osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL(exe_url, exe_path)) return rtl::OUString(); - exe_path = getShortPath(exe_path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".exe"))); + exe_path = getShortPath(exe_path, rtl::OUString(".exe")); if (exe_path.indexOf(' ') != -1) exe_path = quote_string(exe_path); diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index f2ad580670d3..100f7eca2af8 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -750,52 +750,52 @@ namespace osl_FileBase void getAbsoluteFileURL::getAbsoluteFileURL_001_1() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/relative/file1")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/relative/file1") ); check_getAbsoluteFileURL( aUserDirectoryURL, "relative/file1",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_2() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/relative/file2")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/relative/file2") ); check_getAbsoluteFileURL( aUserDirectoryURL, "relative/./file2",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_3() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/file3")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/file3") ); check_getAbsoluteFileURL( aUserDirectoryURL, "relative/../file3",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_4() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/file4")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/file4") ); check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/../file4",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_5() { rtl::OUString suAssume; #if ( defined UNX ) - suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/relative/")) ); + suAssume = aUserDirectoryURL.concat( rtl::OUString("/relative/") ); #else - suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/relative")) ); + suAssume = aUserDirectoryURL.concat( rtl::OUString("/relative") ); #endif check_getAbsoluteFileURL( aUserDirectoryURL, "././relative/.",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_6() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/.relative")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/.relative") ); check_getAbsoluteFileURL( aUserDirectoryURL, "./.relative",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_7() { rtl::OUString suAssume; #if (defined UNX ) - suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/.a/")) ); + suAssume = aUserDirectoryURL.concat( rtl::OUString("/.a/") ); #else //windows - suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/.a")) ); + suAssume = aUserDirectoryURL.concat( rtl::OUString("/.a") ); #endif check_getAbsoluteFileURL( aUserDirectoryURL, "./.a/mydir/..",::osl::FileBase::E_None, suAssume ); } void getAbsoluteFileURL::getAbsoluteFileURL_001_8() { - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmp/ok")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/tmp/ok") ); #if ( defined UNX ) check_getAbsoluteFileURL( aUserDirectoryURL, "tmp//ok",::osl::FileBase::E_None, suAssume ); #else @@ -806,8 +806,8 @@ namespace osl_FileBase { #if ( defined UNX ) //Link is not defined in Windows ::rtl::OUString aUStr_AbsURL, aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys ); - ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/link.file")); - ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/canonical.name")); + ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/link.file"); + ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/canonical.name"); rtl::OString strLinkFileName, strSrcFileName; strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US ); @@ -817,7 +817,7 @@ namespace osl_FileBase sal_Int32 fd = symlink( strSrcFileName.getStr(), strLinkFileName.getStr() ); CPPUNIT_ASSERT( fd == 0 ); rtl::OString sLnkURL = OUStringToOString( aLnkURL1, RTL_TEXTENCODING_ASCII_US ); - rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/canonical.name")) ); + rtl::OUString suAssume = aUserDirectoryURL.concat( rtl::OUString("/canonical.name") ); check_getAbsoluteFileURL( aUserDirectoryURL, sLnkURL, ::osl::FileBase::E_None, suAssume ); deleteTestFile( aCanURL1 ); fd = remove( strLinkFileName.getStr() ); @@ -831,12 +831,12 @@ namespace osl_FileBase void getAbsoluteFileURL::getAbsoluteFileURL_004() { //create two level directories under $Temp/PID/ - ::rtl::OUString aUStrUpBase = aUserDirectoryURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/test1")); + ::rtl::OUString aUStrUpBase = aUserDirectoryURL + ::rtl::OUString("/test1"); createTestDirectory( aUStrUpBase ); - ::rtl::OUString aUStrBase = aUserDirectoryURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/test1/dir1")); + ::rtl::OUString aUStrBase = aUserDirectoryURL + ::rtl::OUString("/test1/dir1"); createTestDirectory( aUStrBase ); - ::rtl::OUString suAssume = aUserDirectoryURL.concat( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/mytestfile")) ); + ::rtl::OUString suAssume = aUserDirectoryURL.concat( ::rtl::OUString("/mytestfile") ); check_getAbsoluteFileURL( aUStrBase, "../../mytestfile" , ::osl::FileBase::E_None, suAssume ); deleteTestDirectory( aUStrBase ); deleteTestDirectory( aUStrUpBase ); @@ -2588,8 +2588,8 @@ namespace osl_FileStatus sal_Int32 fd; ::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys ); - ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpdir/link.file")); - ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpdir/tmpname")); + ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/tmpdir/link.file"); + ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/tmpdir/tmpname"); rtl::OString strLinkFileName; rtl::OString strSrcFileName; @@ -2603,7 +2603,7 @@ namespace osl_FileStatus // testDirectory is "/tmp/PID/tmpdir/" ::osl::Directory testDirectory( aTmpName3 ); ::osl::FileBase::RC nError1 = testDirectory.open(); - ::rtl::OUString aFileName (RTL_CONSTASCII_USTRINGPARAM("link.file")); + ::rtl::OUString aFileName ("link.file"); sal_Bool bOk = sal_False; while (1) { nError1 = testDirectory.getNextItem( rItem_link, 4 ); @@ -2904,7 +2904,7 @@ namespace osl_FileStatus #else //Windows version void getAttributes_004() { - ::rtl::OUString aUserHiddenFileURL (RTL_CONSTASCII_USTRINGPARAM("file:///c:/AUTOEXEC.BAT")); + ::rtl::OUString aUserHiddenFileURL ("file:///c:/AUTOEXEC.BAT"); nError = ::osl::DirectoryItem::get( aUserHiddenFileURL, rItem_hidden ); CPPUNIT_ASSERT_MESSAGE("get item fail", nError == FileBase::E_None ); ::osl::FileStatus rFileStatus( osl_FileStatus_Mask_Attributes ); @@ -3212,8 +3212,8 @@ namespace osl_FileStatus { //create a link file; ::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys ); - ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/link.file")); - ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpname")); + ( ( aUStr_LnkFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/link.file"); + ( ( aUStr_SrcFileSys += aSlashURL ) += getCurrentPID() ) += ::rtl::OUString("/tmpname"); rtl::OString strLinkFileName, strSrcFileName; strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US ); @@ -4400,9 +4400,9 @@ namespace osl_File //create directory $TEMP/tmpname/tmpdir createTestDirectory( aTmpName8 ); //move directory $TEMP/tmpname to $TEMP/tmpname/tmpdir/tmpname - rtl::OUString newName = aTmpName8 + OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpname")); + rtl::OUString newName = aTmpName8 + OUString("/tmpname"); nError1 = ::osl::File::move( aTmpName3, newName ); - //deleteTestDirectory( newName + OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpname")) ); + //deleteTestDirectory( newName + OUString("/tmpname") ); //deleteTestDirectory( newName ); deleteTestDirectory( aTmpName8 ); deleteTestDirectory( aTmpName6 ); @@ -5595,8 +5595,8 @@ namespace osl_Directory sal_Bool bFoundOK = sal_False; ::rtl::OUString aUStr_LnkFileSys( aTempDirectorySys ), aUStr_SrcFileSys( aTempDirectorySys ); - ( aUStr_LnkFileSys += aSlashURL ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpdir/link.file")); - ( aUStr_SrcFileSys += aSlashURL ) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmpdir/tmpname")); + ( aUStr_LnkFileSys += aSlashURL ) += ::rtl::OUString("/tmpdir/link.file"); + ( aUStr_SrcFileSys += aSlashURL ) += ::rtl::OUString("/tmpdir/tmpname"); ::rtl::OString strLinkFileName, strSrcFileName; strLinkFileName = OUStringToOString( aUStr_LnkFileSys, RTL_TEXTENCODING_ASCII_US ); @@ -5610,7 +5610,7 @@ namespace osl_Directory //open a directory nError1 = testDirectory.open(); CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 ); - ::rtl::OUString aFileName (RTL_CONSTASCII_USTRINGPARAM("link.file")); + ::rtl::OUString aFileName ("link.file"); while (1) { nError1 = testDirectory.getNextItem( rItem, 4 ); @@ -5871,7 +5871,7 @@ namespace osl_Directory osl_setFileAttributes(aTmpDir.pData, 0); //no access allowed now //Shouldn't be possible now to create a dir underneath it - rtl::OUString aTmpSubLevel = aTmpDir + OUString(RTL_CONSTASCII_USTRINGPARAM("/notallowedhere")); + rtl::OUString aTmpSubLevel = aTmpDir + OUString("/notallowedhere"); nError1 = ::osl::Directory::create(aTmpSubLevel); //allow removal @@ -6114,7 +6114,7 @@ namespace osl_Directory void with_relative_path() { FileBase::RC rc = Directory::createPath( - OUString(RTL_CONSTASCII_USTRINGPARAM(TEST_PATH_POSTFIX))); + OUString(TEST_PATH_POSTFIX)); CPPUNIT_ASSERT_MESSAGE ( diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx index 8580ab2aaed8..87bd664b8d38 100644 --- a/sal/qa/osl/process/osl_process.cxx +++ b/sal/qa/osl/process/osl_process.cxx @@ -75,9 +75,9 @@ #endif #if defined(WNT) - const rtl::OUString EXECUTABLE_NAME (RTL_CONSTASCII_USTRINGPARAM("osl_process_child.exe")); + const rtl::OUString EXECUTABLE_NAME ("osl_process_child.exe"); #else - const rtl::OUString EXECUTABLE_NAME (RTL_CONSTASCII_USTRINGPARAM("osl_process_child")); + const rtl::OUString EXECUTABLE_NAME ("osl_process_child"); #endif //######################################## @@ -106,7 +106,7 @@ inline ::rtl::OUString getExecutablePath( void ) osl::Module::getUrlFromAddress( ( void* ) &getExecutablePath, dirPath ); dirPath = dirPath.copy( 0, dirPath.lastIndexOf('/') ); dirPath = dirPath.copy( 0, dirPath.lastIndexOf('/') + 1); - dirPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Executable")); + dirPath += rtl::OUString("Executable"); return dirPath; } @@ -126,15 +126,15 @@ class Test_osl_joinProcess : public CppUnit::TestFixture public: Test_osl_joinProcess() : - join_param_(OUString(RTL_CONSTASCII_USTRINGPARAM("-join"))), - wait_time_(OUString(RTL_CONSTASCII_USTRINGPARAM("1"))), + join_param_(OUString("-join")), + wait_time_(OUString("1")), parameters_count_(2) { parameters_[0] = join_param_.pData; parameters_[1] = wait_time_.pData; suCWD = getExecutablePath(); suExecutableFileURL = suCWD; - suExecutableFileURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + suExecutableFileURL += rtl::OUString("/"); suExecutableFileURL += EXECUTABLE_NAME; } @@ -424,13 +424,13 @@ public: //------------------------------------------------ // ctor Test_osl_executeProcess() : - env_param_(OUString(RTL_CONSTASCII_USTRINGPARAM("-env"))), + env_param_(OUString("-env")), parameters_count_(2) { parameters_[0] = env_param_.pData; suCWD = getExecutablePath(); suExecutableFileURL = suCWD; - suExecutableFileURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + suExecutableFileURL += rtl::OUString("/"); suExecutableFileURL += EXECUTABLE_NAME; } @@ -616,10 +616,10 @@ public: void osl_execProc_merged_child_environment() { rtl_uString* child_env[4]; - OUString env1(RTL_CONSTASCII_USTRINGPARAM(ENV1)); - OUString env2(RTL_CONSTASCII_USTRINGPARAM(ENV2)); - OUString env3(RTL_CONSTASCII_USTRINGPARAM(ENV3)); - OUString env4(RTL_CONSTASCII_USTRINGPARAM(ENV4)); + OUString env1(ENV1); + OUString env2(ENV2); + OUString env3(ENV3); + OUString env4(ENV4); child_env[0] = env1.pData; child_env[1] = env2.pData; @@ -670,9 +670,9 @@ public: { oslProcess process; #if defined(WNT) - rtl::OUString suBatch = suCWD + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("batch.bat")); + rtl::OUString suBatch = suCWD + rtl::OUString("/") + rtl::OUString("batch.bat"); #else - rtl::OUString suBatch = suCWD + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("batch.sh")); + rtl::OUString suBatch = suCWD + rtl::OUString("/") + rtl::OUString("batch.sh"); #endif oslProcessError osl_error = osl_executeProcess( suBatch.pData, |