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 ...@@ -129,12 +129,12 @@ namespace osl_Security
SAL_CPPUNIT_TEST_SUITE( logonUser ); 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 /// if user name and passwd are forwarded
{ {
CPPUNIT_TEST( logonUser_user_pwd ); 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 /// if user name and passwd and file server are forwarded
{ {
CPPUNIT_TEST( logonUser_user_pwd_server ); CPPUNIT_TEST( logonUser_user_pwd_server );
...@@ -597,31 +597,31 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *, ...@@ -597,31 +597,31 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
t_print("#\n#Retrived system information is below:\n"); t_print("#\n#Retrived system information is below:\n");
t_print("Computer Name: "); t_print("Computer Name: ");
if ( strComputerName == aNullUrl ) if ( strComputerName.isEmpty())
t_print("Not retrived\n" ); t_print("Not retrived\n" );
else else
printUString( strComputerName ); printUString( strComputerName );
t_print("Current User Name: "); t_print("Current User Name: ");
if ( strUserName == aNullUrl ) if ( strUserName.isEmpty())
t_print("Not retrived\n" ); t_print("Not retrived\n" );
else else
printUString( strUserName ); printUString( strUserName );
t_print("Current User Home Directory:"); t_print("Current User Home Directory:");
if ( strHomeDirectory == aNullUrl ) if ( strHomeDirectory.isEmpty())
t_print("Not retrived\n" ); t_print("Not retrived\n" );
else else
printUString( strHomeDirectory ); printUString( strHomeDirectory );
t_print("Current Config Directory: "); t_print("Current Config Directory: ");
if ( strConfigDirectory == aNullUrl ) if ( strConfigDirectory.isEmpty())
t_print("Not retrived\n" ); t_print("Not retrived\n" );
else else
printUString( strConfigDirectory ); printUString( strConfigDirectory );
t_print("Current UserID: "); t_print("Current UserID: ");
if ( strUserID == aNullUrl ) if ( strUserID.isEmpty())
t_print("Not retrived\n" ); t_print("Not retrived\n" );
else else
printUString( strUserID ); printUString( strUserID );
...@@ -634,7 +634,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *, ...@@ -634,7 +634,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
/// get and display forwarded text if available. /// get and display forwarded text if available.
aStringForward = ::rtl::OUString::createFromAscii( parameters.getCommandLine().c_str() ); 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 nFirstSpacePoint = aStringForward.indexOf( (sal_Unicode)' ' );;
sal_Int32 nLastSpacePoint = aStringForward.lastIndexOf( (sal_Unicode)' ' );; sal_Int32 nLastSpacePoint = aStringForward.lastIndexOf( (sal_Unicode)' ' );;
......
...@@ -59,22 +59,9 @@ ...@@ -59,22 +59,9 @@
#define BUFSIZE 1024 #define BUFSIZE 1024
const char pTestString[17] = "Sun Microsystems"; const char pTestString[17] = "Sun Microsystems";
::rtl::OUString aLogonUser, aLogonPasswd, aFileServer, aStringForward;
#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \ ::rtl::OUString strUserName, strComputerName, strHomeDirectory;
::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value ) ::rtl::OUString strConfigDirectory, strUserID;
//------------------------------------------------------------------------
// 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 );
sal_Bool isAdmin = sal_False; 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