diff options
author | Kay Ramme <kr@openoffice.org> | 2002-01-07 15:17:15 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2002-01-07 15:17:15 +0000 |
commit | 8280c91072eb10faf045251bf62565dc6a7abd6e (patch) | |
tree | 3d92cce48bdfe79d47f5568f0e828a80e92fae37 /sal/test/testbootstrap.cxx | |
parent | 90a7e5b07df01a4ab4e99a2b40b529a07aa78b7a (diff) |
added result check (#96291#)
Diffstat (limited to 'sal/test/testbootstrap.cxx')
-rw-r--r-- | sal/test/testbootstrap.cxx | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/sal/test/testbootstrap.cxx b/sal/test/testbootstrap.cxx index 2b6ef7676f32..4ec396611dd8 100644 --- a/sal/test/testbootstrap.cxx +++ b/sal/test/testbootstrap.cxx @@ -13,6 +13,8 @@ using namespace ::rtl; int main( int argc, char *argv[] ) { sal_Int32 nCount = rtl_getAppCommandArgCount(); + +#ifdef DEBUG fprintf( stdout, "rtl-commandargs (%d) real args:%i ", nCount, argc); for( sal_Int32 i = 0 ; i < nCount ; i ++ ) { @@ -22,6 +24,7 @@ int main( int argc, char *argv[] ) fprintf( stdout, " %s", o.getStr() ); } fprintf( stdout, "\n" ); +#endif if( nCount == 0 ) { @@ -33,11 +36,13 @@ int main( int argc, char *argv[] ) OUString iniName; Bootstrap::get(OUString(RTL_CONSTASCII_USTRINGPARAM("iniName")), iniName, OUString()); +#ifdef DEBUG if(iniName.getLength()) { OString tmp_iniName = OUStringToOString(iniName, RTL_TEXTENCODING_ASCII_US); fprintf(stderr, "using ini: %s\n", tmp_iniName.getStr()); } +#endif Bootstrap bootstrap(iniName); @@ -46,21 +51,35 @@ int main( int argc, char *argv[] ) OUString myDefault( RTL_CONSTASCII_USTRINGPARAM("$Default")); OUString value; + sal_Bool useDefault; + + useDefault = bootstrap.getFrom(OUString(RTL_CONSTASCII_USTRINGPARAM("USEDEFAULT")), OUString()); - bootstrap.getFrom( name, value, myDefault ); + sal_Bool result = sal_False; + sal_Bool found = sal_True; - sal_Bool result = sal_True; + if(useDefault) + bootstrap.getFrom(name, value, myDefault); - OUString para(OUString::createFromAscii( argv[1] )); - if(para != value) + else + found = bootstrap.getFrom(name, value); + + if(found) { - OString para_tmp = OUStringToOString(para, RTL_TEXTENCODING_ASCII_US); - OString value_tmp = OUStringToOString(value, RTL_TEXTENCODING_ASCII_US); + OUString para(OUString::createFromAscii( argv[1] )); + + result = para == value; - fprintf(stderr, "para(%s) != value(%s)\n", para_tmp.getStr(), value_tmp.getStr()); + if(!result) + { + OString para_tmp = OUStringToOString(para, RTL_TEXTENCODING_ASCII_US); + OString value_tmp = OUStringToOString(value, RTL_TEXTENCODING_ASCII_US); - result = sal_False; + fprintf(stderr, "para(%s) != value(%s)\n", para_tmp.getStr(), value_tmp.getStr()); + } } + else + fprintf(stderr, "bootstrap parameter couldn't be found\n"); // test the default case name = OUString( RTL_CONSTASCII_USTRINGPARAM( "no_one_has_set_this_name" ) ); |