summaryrefslogtreecommitdiff
path: root/sal/test/testbootstrap.cxx
diff options
context:
space:
mode:
authorKay Ramme <kr@openoffice.org>2001-08-30 10:51:36 +0000
committerKay Ramme <kr@openoffice.org>2001-08-30 10:51:36 +0000
commit8dda258088d3a9ecf287caf71442a4ab0959be53 (patch)
tree82e744f04d82dbc42679ab013a0878fc34c1a7c6 /sal/test/testbootstrap.cxx
parent182c0091117db5d86fc5046b892552fb8e4b4087 (diff)
bootstrapping now supports local ini files (#88338#)
Diffstat (limited to 'sal/test/testbootstrap.cxx')
-rw-r--r--sal/test/testbootstrap.cxx40
1 files changed, 32 insertions, 8 deletions
diff --git a/sal/test/testbootstrap.cxx b/sal/test/testbootstrap.cxx
index c8d899f434c8..e36a89d4f238 100644
--- a/sal/test/testbootstrap.cxx
+++ b/sal/test/testbootstrap.cxx
@@ -10,7 +10,7 @@
using namespace ::rtl;
-void main( int argc, char *argv[] )
+int main( int argc, char *argv[] )
{
sal_Int32 nCount = rtl_getAppCommandArgCount();
fprintf( stdout, "rtl-commandargs (%d) real args:%i ", nCount, argc);
@@ -26,14 +26,30 @@ void main( int argc, char *argv[] )
if( nCount == 0 )
{
printf( "usage : testbootstrap <checkedValueOfMyBootstrapValue>\n" );
- exit( 1 );
+ exit( 1 );
}
+
+ OUString iniName;
+ Bootstrap::get(OUString(RTL_CONSTASCII_USTRINGPARAM("iniName")), iniName, OUString());
+
+ if(iniName.getLength())
+ {
+ OString tmp_iniName = OUStringToOString(iniName, RTL_TEXTENCODING_ASCII_US);
+ fprintf(stderr, "using ini: %s\n", tmp_iniName.getStr());
+ }
+
+ Bootstrap bootstrap(iniName);
+
+
OUString name( RTL_CONSTASCII_USTRINGPARAM( "MYBOOTSTRAPTESTVALUE" ));
OUString myDefault( RTL_CONSTASCII_USTRINGPARAM( "default" ));
OUString value;
- Bootstrap::get( name, value, myDefault );
+
+ bootstrap.getFrom( name, value, myDefault );
+
+ sal_Bool result = sal_True;
OUString para(OUString::createFromAscii( argv[1] ));
if(para != value)
@@ -42,17 +58,25 @@ void main( int argc, char *argv[] )
OString value_tmp = OUStringToOString(value, RTL_TEXTENCODING_ASCII_US);
fprintf(stderr, "para(%s) != value(%s)\n", para_tmp.getStr(), value_tmp.getStr());
+
+ result = sal_False;
}
// test the default case
name = OUString( RTL_CONSTASCII_USTRINGPARAM( "no_one_has_set_this_name" ) );
- OSL_ASSERT( ! Bootstrap::get( name, value ) );
+ OSL_ASSERT( ! bootstrap.getFrom( name, value ) );
+ result = result && !bootstrap.getFrom( name, value );
myDefault = OUString( RTL_CONSTASCII_USTRINGPARAM( "1" ) );
OUString myDefault2 = OUString( RTL_CONSTASCII_USTRINGPARAM( "2" ) );
- Bootstrap::get( name, value, myDefault );
- OSL_ASSERT( value == myDefault );
- Bootstrap::get( name, value, myDefault2 );
- OSL_ASSERT( value == myDefault2 );
+ bootstrap.getFrom( name, value, myDefault );
+ OSL_ASSERT( value == myDefault );
+ result = result && (value == myDefault);
+
+ bootstrap.getFrom( name, value, myDefault2 );
+ OSL_ASSERT( value == myDefault2 );
+ result = result && (value == myDefault2);
+
+ return result;
}