Kaydet (Commit) 174a1d3c authored tarafından Luboš Luňák's avatar Luboš Luňák

fix very ... uhm ... inventive and confusing use of empty string

üst 0c08a84c
......@@ -129,12 +129,12 @@ namespace osl_Security
SAL_CPPUNIT_TEST_SUITE( logonUser );
if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) == aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
if ( !aStringForward.isEmpty() && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) == aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
/// if user name and passwd are forwarded
{
CPPUNIT_TEST( logonUser_user_pwd );
}
if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) != aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
if ( !aStringForward.isEmpty() && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) != aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
/// if user name and passwd and file server are forwarded
{
CPPUNIT_TEST( logonUser_user_pwd_server );
......@@ -597,31 +597,31 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
t_print("#\n#Retrived system information is below:\n");
t_print("Computer Name: ");
if ( strComputerName == aNullUrl )
if ( strComputerName.isEmpty())
t_print("Not retrived\n" );
else
printUString( strComputerName );
t_print("Current User Name: ");
if ( strUserName == aNullUrl )
if ( strUserName.isEmpty())
t_print("Not retrived\n" );
else
printUString( strUserName );
t_print("Current User Home Directory:");
if ( strHomeDirectory == aNullUrl )
if ( strHomeDirectory.isEmpty())
t_print("Not retrived\n" );
else
printUString( strHomeDirectory );
t_print("Current Config Directory: ");
if ( strConfigDirectory == aNullUrl )
if ( strConfigDirectory.isEmpty())
t_print("Not retrived\n" );
else
printUString( strConfigDirectory );
t_print("Current UserID: ");
if ( strUserID == aNullUrl )
if ( strUserID.isEmpty())
t_print("Not retrived\n" );
else
printUString( strUserID );
......@@ -634,7 +634,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
/// get and display forwarded text if available.
aStringForward = ::rtl::OUString::createFromAscii( parameters.getCommandLine().c_str() );
if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
if ( !aStringForward.isEmpty() && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
{
sal_Int32 nFirstSpacePoint = aStringForward.indexOf( (sal_Unicode)' ' );;
sal_Int32 nLastSpacePoint = aStringForward.lastIndexOf( (sal_Unicode)' ' );;
......
......@@ -59,22 +59,9 @@
#define BUFSIZE 1024
const char pTestString[17] = "Sun Microsystems";
#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \
::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value )
//------------------------------------------------------------------------
// condition names
//------------------------------------------------------------------------
// Intentionally different from the aNullURL in osl_File_Const.h to avoid
// duplicate symbols as all the unit tests here get linked together for iOS...
OSLTEST_DECLARE_USTRING( NullUrl, "" );
::rtl::OUString aLogonUser( aNullUrl ), aLogonPasswd( aNullUrl ), aFileServer( aNullUrl ), aStringForward( aNullUrl );
::rtl::OUString strUserName( aNullUrl ) , strComputerName( aNullUrl ) , strHomeDirectory( aNullUrl );
::rtl::OUString strConfigDirectory( aNullUrl ), strUserID( aNullUrl );
::rtl::OUString aLogonUser, aLogonPasswd, aFileServer, aStringForward;
::rtl::OUString strUserName, strComputerName, strHomeDirectory;
::rtl::OUString strConfigDirectory, strUserID;
sal_Bool isAdmin = sal_False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment