diff options
author | Kay Ramme <kr@openoffice.org> | 2001-08-30 10:51:36 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-08-30 10:51:36 +0000 |
commit | 8dda258088d3a9ecf287caf71442a4ab0959be53 (patch) | |
tree | 82e744f04d82dbc42679ab013a0878fc34c1a7c6 /sal/test | |
parent | 182c0091117db5d86fc5046b892552fb8e4b4087 (diff) |
bootstrapping now supports local ini files (#88338#)
Diffstat (limited to 'sal/test')
-rw-r--r-- | sal/test/makefile.mk | 44 | ||||
-rw-r--r-- | sal/test/testbootstrap.cxx | 40 |
2 files changed, 61 insertions, 23 deletions
diff --git a/sal/test/makefile.mk b/sal/test/makefile.mk index aa4de097ec84..9b5cd3b6b343 100644 --- a/sal/test/makefile.mk +++ b/sal/test/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.8 $ +# $Revision: 1.9 $ # -# last change: $Author: jbu $ $Date: 2001-08-17 12:52:47 $ +# last change: $Author: kr $ $Date: 2001-08-30 11:51:36 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -94,9 +94,7 @@ APP1OBJS= \ $(OBJ)$/testbyteseq.obj \ $(OBJ)$/testuri.obj \ $(OBJ)$/test.obj \ - $(OBJ)$/testlogfile.obj \ - $(OBJ)$/test_file.obj - + $(OBJ)$/testlogfile.obj OBJFILES= \ $(APP1OBJS) \ $(APP2OBJS) @@ -114,25 +112,41 @@ ALL : ALLTAR \ $(BIN)$/$(BOOTSTRAPSCRIPT) \ $(BIN)$/$(BOOTSTRAPINI) \ $(BIN)$/bootstraptest.ini \ - $(BIN)$/testbootstrap.bin \ - $(BIN)$/testbootstrap.Bin \ - $(BIN)$/testbootstrap.Exe + $(BIN)$/$(APP2TARGET).bin \ + $(BIN)$/$(APP2TARGET).Bin \ + $(BIN)$/$(APP2TARGET).Exe \ + $(BIN)$/bootstrap.pl + .IF "$(GUI)"=="UNX" -ALL: $(BIN)$/testbootstrap.exe +ALL: $(BIN)$/$(APP2TARGET).exe \ + $(BIN)$/inirc -$(BIN)$/testbootstrap.exe : $(APP2TARGETN) +$(BIN)$/$(APP2TARGET).exe : $(APP2TARGETN) cp $(APP2TARGETN) $@ +$(BIN)$/inirc: + echo "MYBOOTSTRAPTESTVALUE=auxaux" > $@ + +.ELSE + +ALL: $(BIN)$/ini.ini + +$(BIN)$/ini.ini: + echo MYBOOTSTRAPTESTVALUE=auxaux > $@ + .ENDIF -$(BIN)$/testbootstrap.bin : $(APP2TARGETN) +$(BIN)$/bootstrap.pl: + cp bootstrap.pl $@ + +$(BIN)$/$(APP2TARGET).bin : $(APP2TARGETN) cp $(APP2TARGETN) $@ -$(BIN)$/testbootstrap.Bin : $(APP2TARGETN) +$(BIN)$/$(APP2TARGET).Bin : $(APP2TARGETN) cp $(APP2TARGETN) $@ -$(BIN)$/testbootstrap.Exe : $(APP2TARGETN) +$(BIN)$/$(APP2TARGET).Exe : $(APP2TARGETN) cp $(APP2TARGETN) $@ .ELSE @@ -148,8 +162,8 @@ $(BIN)$/$(BOOTSTRAPSCRIPT) : $(BOOTSTRAPSCRIPT) chmod ug+x $@ .ENDIF -$(BIN)$/$(BOOTSTRAPINI) : testbootstrap.ini - $(MY_SCRIPTCAT) testbootstrap.ini > $@ +$(BIN)$/$(BOOTSTRAPINI) : $(APP2TARGET).ini + $(MY_SCRIPTCAT) $(APP2TARGET).ini > $@ $(BIN)$/bootstraptest.ini : bootstraptest.ini $(MY_SCRIPTCAT) bootstraptest.ini > $@ 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; } |