diff options
51 files changed, 467 insertions, 1038 deletions
diff --git a/bridges/test/java_uno/acquire/makefile.mk b/bridges/test/java_uno/acquire/makefile.mk index d027c067dad7..dc4ad8658db1 100644 --- a/bridges/test/java_uno/acquire/makefile.mk +++ b/bridges/test/java_uno/acquire/makefile.mk @@ -56,10 +56,10 @@ JARFILES = OOoRunner.jar juh.jar jurt.jar ridl.jar .INCLUDE: target.mk ALLTAR: \ - $(BIN)$/testacquire-java-client$(SCRIPTEXT) \ - $(BIN)$/testacquire-java-server$(SCRIPTEXT) \ - $(BIN)$/testacquire-native-client$(SCRIPTEXT) \ - $(BIN)$/testacquire-native-server$(SCRIPTEXT) + $(BIN)$/testacquire-java-client \ + $(BIN)$/testacquire-java-server \ + $(BIN)$/testacquire-native-client \ + $(BIN)$/testacquire-native-server .IF "$(GUI)" == "WNT" GIVE_EXEC_RIGHTS = @echo @@ -90,7 +90,7 @@ $(SLOFILES) $(JAVACLASSFILES): $(BIN)$/$(TARGET).rdb TEST_JAVAUNO_ACQUIRE_UNO_URL := \ \"'uno:socket,host=127.0.0.1,port=2002;urp;test'\" -$(BIN)$/testacquire-java-client$(SCRIPTEXT): +$(BIN)$/testacquire-java-client: echo java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ @@ -98,7 +98,7 @@ $(BIN)$/testacquire-java-client$(SCRIPTEXT): $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-java-server$(SCRIPTEXT): +$(BIN)$/testacquire-java-server: echo java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ @@ -106,14 +106,14 @@ $(BIN)$/testacquire-java-server$(SCRIPTEXT): $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-native-client$(SCRIPTEXT): +$(BIN)$/testacquire-native-client: echo '$(AUGMENT_LIBRARY_PATH)' uno \ -c com.sun.star.test.bridges.testacquire.impl \ -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb -- \ $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@ $(GIVE_EXEC_RIGHTS) $@ -$(BIN)$/testacquire-native-server$(SCRIPTEXT): +$(BIN)$/testacquire-native-server: echo '$(AUGMENT_LIBRARY_PATH)' uno \ -c com.sun.star.test.bridges.testacquire.impl \ -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb \ diff --git a/bridges/test/java_uno/any/makefile.mk b/bridges/test/java_uno/any/makefile.mk index 1957194f856a..b649c609d5e8 100644 --- a/bridges/test/java_uno/any/makefile.mk +++ b/bridges/test/java_uno/any/makefile.mk @@ -104,16 +104,16 @@ $(SLOFILES) : $(MISC)$/gen_files.flag $(JAVACLASSFILES) : $(MISC)$/gen_files.flag ALLTAR : \ - $(OUT)$/bin$/TestRemote$(SCRIPTEXT) \ - $(OUT)$/bin$/TestJni$(SCRIPTEXT) + $(OUT)$/bin$/TestRemote \ + $(OUT)$/bin$/TestJni -$(OUT)$/bin$/TestRemote$(SCRIPTEXT) : $(JAVACLASSFILES) +$(OUT)$/bin$/TestRemote : $(JAVACLASSFILES) -rm -f $@ echo java -classpath ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ test.java_uno.anytest.TestRemote > $@ $(GIVE_EXEC_RIGHTS) $@ -$(OUT)$/bin$/TestJni$(SCRIPTEXT) : $(JAVACLASSFILES) +$(OUT)$/bin$/TestJni : $(JAVACLASSFILES) -rm -f $@ echo '$(AUGMENT_LIBRARY_PATH)' java -classpath \ .$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ diff --git a/bridges/test/java_uno/equals/makefile.mk b/bridges/test/java_uno/equals/makefile.mk index 4064b5e48f09..f95f1c0adb14 100644 --- a/bridges/test/java_uno/equals/makefile.mk +++ b/bridges/test/java_uno/equals/makefile.mk @@ -62,7 +62,7 @@ JARFILES = juh.jar jurt.jar ridl.jar .INCLUDE: target.mk -ALLTAR: $(BIN)$/testequals$(SCRIPTEXT) +ALLTAR: $(BIN)$/testequals .IF "$(GUI)" == "WNT" GIVE_EXEC_RIGHTS = @echo @@ -85,7 +85,7 @@ $(MISC)$/$(TARGET).rdb: types.idl $(SLOFILES) $(JAVACLASSFILES): $(MISC)$/$(TARGET).rdb -$(BIN)$/testequals$(SCRIPTEXT): $(BIN)$/testequals_services.rdb +$(BIN)$/testequals: $(BIN)$/testequals_services.rdb echo '$(AUGMENT_LIBRARY_PATH)' java -classpath \ ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\ ..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \ diff --git a/bridges/test/java_uno/nativethreadpool/makefile.mk b/bridges/test/java_uno/nativethreadpool/makefile.mk index c8f7a778f051..76f66031bdab 100644 --- a/bridges/test/java_uno/nativethreadpool/makefile.mk +++ b/bridges/test/java_uno/nativethreadpool/makefile.mk @@ -101,7 +101,7 @@ $(BIN)$/$(TARGET).rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ $(REGCOMP) -register -r $(MISC)$/$(TARGET)$/bootstrap.rdb \ -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST) \ -c stocservices.uno$(DLLPOST) -.IF "$(GUI)" == "WNT" || "$(USE_SHELL)" != "bash" +.IF "$(GUI)" == "WNT" ERROR -- missing platform .ELSE # GUI, WNT + export OO_JAVA_PROPERTIES='RuntimeLib=$(JVM_LIB_URL)' && \ @@ -111,7 +111,7 @@ $(BIN)$/$(TARGET).rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ .ENDIF # GUI, WNT test .PHONY: $(SHL1TARGETN) $(BIN)$/$(TARGET).uno.jar $(BIN)$/$(TARGET).rdb -.IF "$(GUI)" == "WNT" || "$(USE_SHELL)" != "bash" +.IF "$(GUI)" == "WNT" ERROR -- missing platform .ELSE # GUI, WNT $(AUGMENT_LIBRARY_PATH) uno -c test.javauno.nativethreadpool.server \ diff --git a/cli_ure/source/basetypes/makefile.mk b/cli_ure/source/basetypes/makefile.mk index 3e2e199b52fa..7ee254cb4e80 100644 --- a/cli_ure/source/basetypes/makefile.mk +++ b/cli_ure/source/basetypes/makefile.mk @@ -41,13 +41,6 @@ TARGET = basetypes .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - .IF "$(BUILD_FOR_CLI)" != "" .INCLUDE : $(BIN)$/cliureversion.mk @@ -77,15 +70,15 @@ CSFILES = \ .IF "$(CCNUMVER)" <= "001399999999" $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")] \ - [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")] \ + [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]' \ >> $@ .ELSE $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)")]' \ >> $@ .ENDIF diff --git a/cli_ure/source/climaker/makefile.mk b/cli_ure/source/climaker/makefile.mk index dd67d2600c84..3983875c8786 100644 --- a/cli_ure/source/climaker/makefile.mk +++ b/cli_ure/source/climaker/makefile.mk @@ -126,9 +126,7 @@ ALLTAR: \ #Create the config file that is used with the policy assembly $(CLIMAKER_CONFIG): climaker.exe.config $(COPY) $< $@ -.IF "$(USE_SHELL)"!="4nt" chmod +x $@ -.ENDIF # "$(USE_SHELL)"!="4nt" .IF "$(BUILD_FOR_CLI)" != "" diff --git a/cli_ure/source/native/makefile.mk b/cli_ure/source/native/makefile.mk index 16eeedb25c31..2de874e645cf 100644 --- a/cli_ure/source/native/makefile.mk +++ b/cli_ure/source/native/makefile.mk @@ -48,13 +48,6 @@ CCACHE_DISABLE=TRUE use_shl_versions= -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - - .IF "$(BUILD_FOR_CLI)" == "" #do not even build the cxx files because they contain cli cpp all: @@ -146,11 +139,11 @@ CFLAGSCXX += -clr:oldSyntax $(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk @echo $(ASSEMBLY_KEY_X) $(GNUCOPY) -p assembly.cxx $@ - echo $(ECHOQUOTE) \ - [assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )]; $(ECHOQUOTE) \ + echo \ + '[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' \ >> $(OUT)$/misc$/assembly_cppuhelper.cxx - echo $(ECHOQUOTE) \ - [assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))]; $(ECHOQUOTE) \ + echo \ + '[assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))];' \ >> $(OUT)$/misc$/assembly_cppuhelper.cxx diff --git a/cli_ure/source/ure/makefile.mk b/cli_ure/source/ure/makefile.mk index 1bdbadadcaf2..2109e3c61fce 100644 --- a/cli_ure/source/ure/makefile.mk +++ b/cli_ure/source/ure/makefile.mk @@ -41,13 +41,6 @@ TARGET = ure .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - .IF "$(BUILD_FOR_CLI)" != "" .INCLUDE : $(BIN)$/cliureversion.mk @@ -73,15 +66,15 @@ CSFILES = \ .IF "$(CCNUMVER)" <= "001399999999" $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")] \ - [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")] \ + [assembly:System.Reflection.AssemblyKeyFile(@"$(BIN)$/cliuno.snk")]' \ >> $@ .ELSE $(ASSEMBLY_ATTRIBUTES) : assembly.cs makefile.mk $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk $(GNUCOPY) -p assembly.cs $@ - echo $(ECHOQUOTE) \ - [assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")]$(ECHOQUOTE) \ + echo \ + '[assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)")]' \ >> $@ .ENDIF diff --git a/cli_ure/version/makefile.mk b/cli_ure/version/makefile.mk index 1f64f0f8b31d..4a81ea17aaa5 100644 --- a/cli_ure/version/makefile.mk +++ b/cli_ure/version/makefile.mk @@ -41,15 +41,6 @@ TARGET = cliureversion.mk .INCLUDE : $(PRJ)$/util$/target.pmk .INCLUDE : target.mk - -.IF "$(USE_SHELL)"!="4nt" -ECHOQUOTE=' -.ELSE -ECHOQUOTE= -.ENDIF - - - ALLTAR : \ $(BIN)$/cliureversion.mk diff --git a/cppuhelper/prj/build.lst b/cppuhelper/prj/build.lst index db8ddcaae6c8..de66b2d61a4b 100644 --- a/cppuhelper/prj/build.lst +++ b/cppuhelper/prj/build.lst @@ -3,3 +3,4 @@ ch cppuhelper usr1 - all ch_mkout NULL ch cppuhelper\inc nmake - all ch_include NULL ch cppuhelper\source nmake - all ch_source ch_unotypes ch_include NULL ch cppuhelper\unotypes nmake - all ch_unotypes NULL +ch cppuhelper\qa\propertysetmixin nmake - all ch_qa_propertysetmixin ch_source NULL diff --git a/cppuhelper/qa/propertysetmixin/makefile.mk b/cppuhelper/qa/propertysetmixin/makefile.mk index 2ad56c05ff1c..fa3db612928b 100644 --- a/cppuhelper/qa/propertysetmixin/makefile.mk +++ b/cppuhelper/qa/propertysetmixin/makefile.mk @@ -29,33 +29,34 @@ # #************************************************************************* -PRJ := ..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ := ../.. PRJNAME := cppuhelper TARGET := qa_propertysetmixin -PACKAGE = test$/cppuhelper$/propertysetmixin$/comp +PACKAGE = test/cppuhelper/propertysetmixin/comp ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk -.IF "$(GUI)" == "WNT" -FILEURLPREFIX = file:/// -MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR)))) +.IF "$(OS)" == "WNT" +my_file = file:/// .ELSE -FILEURLPREFIX = file:// -MY_URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR) -.ENDIF - - +my_file = file:// +.END DLLPRE = # no leading "lib" on .so files -INCPRE += -I$(MISC)$/$(TARGET)$/inc +INCPRE += -I$(MISC)/$(TARGET)/inc SHL1TARGET = $(TARGET) -SHL1OBJS = $(SLO)$/test_propertysetmixin.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) +SHL1OBJS = $(SLO)/test_propertysetmixin.obj +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) SHL1IMPLIB = i$(SHL1TARGET) +SHL1RPATH = NONE DEF1NAME = $(SHL1TARGET) .IF "$(COMNAME)" == "gcc3" @@ -65,10 +66,11 @@ SHL1VERSIONMAP = test.map .ENDIF SHL2TARGET = $(TARGET).uno -SHL2OBJS = $(SLO)$/comp_propertysetmixin.obj +SHL2OBJS = $(SLO)/comp_propertysetmixin.obj SHL2VERSIONMAP = comp.map SHL2STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) SHL2IMPLIB = i$(SHL2TARGET) +SH21RPATH = NONE DEF2NAME = $(SHL2TARGET) SLOFILES = $(SHL1OBJS) $(SHL2OBJS) @@ -80,63 +82,54 @@ JARFILES = java_uno.jar juh.jar jurt.jar ridl.jar ALLTAR: test -$(MISC)$/$(TARGET)$/types.urd: types.idl +$(MISC)/$(TARGET)/types.urd: types.idl - $(MKDIR) $(@:d) $(IDLC) -O$(@:d) -I$(SOLARIDLDIR) -cid -we $< -$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.urd +$(MISC)/$(TARGET)/types.rdb: $(MISC)/$(TARGET)/types.urd - $(RM) $@ $(REGMERGE) $@ /UCR $< -$(MISC)$/$(TARGET)$/uno.rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \ - $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST) \ - $(MISC)$/$(TARGET)$/$(TARGET).uno.jar $(MISC)$/$(TARGET)$/bootstrap.rdb +$(MISC)/$(TARGET)/uno.rdb: $(MISC)/$(TARGET)/types.rdb $(SHL2TARGETN) \ + $(MISC)/$(TARGET)/$(TARGET).uno.jar $(MISC)/$(TARGET)/bootstrap.rdb - $(MKDIR) $(@:d) - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - $(REGMERGE) $@ / $(MISC)$/$(TARGET)$/types.rdb - $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \ - -c javavm.uno$(DLLPOST) -c reflection.uno$(DLLPOST) \ - -c stocservices.uno$(DLLPOST) - $(REGCOMP) -register -r $@ \ - -c $(subst,$/,/ $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST)) - $(REGCOMP) -register -br $(MISC)$/$(TARGET)$/bootstrap.rdb -r $@ \ - -c \ - $(subst,$/,/ $(FILEURLPREFIX)$(PWD)$/$(MISC)$/$(TARGET)$/$(TARGET).uno.jar) \ - -classpath $(CLASSPATH) \ - -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) - -$(MISC)$/$(TARGET)$/bootstrap.rdb .ERRREMOVE: + $(COPY) $(SOLARBINDIR)/types.rdb $@ + $(REGMERGE) $@ / $(MISC)/$(TARGET)/types.rdb + $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \ + -c reflection.uno -c stocservices.uno -c $(SHL2TARGETN) + $(REGCOMP) -register -br $(MISC)/$(TARGET)/bootstrap.rdb -r $@ \ + -c $(my_file)$(PWD)/$(MISC)/$(TARGET)/$(TARGET).uno.jar \ + -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR) + +$(MISC)/$(TARGET)/bootstrap.rdb: - $(MKDIR) $(@:d) - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \ - -c javavm.uno$(DLLPOST) -c stocservices.uno$(DLLPOST) + $(COPY) $(SOLARBINDIR)/types.rdb $@ + $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \ + -c stocservices.uno -$(MISC)$/$(TARGET)$/cppumaker.flag: $(MISC)$/$(TARGET)$/types.rdb - $(CPPUMAKER) -O$(MISC)$/$(TARGET)$/inc -BUCR -Gc \ - -X$(SOLARBINDIR)$/types.rdb $< +$(MISC)/$(TARGET)/cppumaker.flag: $(MISC)/$(TARGET)/types.rdb + $(CPPUMAKER) -O$(MISC)/$(TARGET)/inc -BUCR -Gc \ + -X$(SOLARBINDIR)/types.rdb $< $(TOUCH) $@ -$(SLOFILES): $(MISC)$/$(TARGET)$/cppumaker.flag +$(SLOFILES): $(MISC)/$(TARGET)/cppumaker.flag -$(MISC)$/$(TARGET)$/javamaker.flag: $(MISC)$/$(TARGET)$/types.rdb - $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)$/types.rdb $< +$(MISC)/$(TARGET)/javamaker.flag: $(MISC)/$(TARGET)/types.rdb + $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)/types.rdb $< $(TOUCH) $@ # The following dependency (to execute javac whenever javamaker has run) does # not work reliably, see #i28827#: -$(JAVAFILES) $(JAVACLASSFILES): $(MISC)$/$(TARGET)$/javamaker.flag +$(JAVAFILES) $(JAVACLASSFILES): $(MISC)/$(TARGET)/javamaker.flag -$(MISC)$/$(TARGET)$/$(TARGET).uno.jar: $(JAVACLASSFILES) \ - $(MISC)$/$(TARGET)$/javamaker.flag manifest +$(MISC)/$(TARGET)/$(TARGET).uno.jar: $(JAVACLASSFILES) \ + $(MISC)/$(TARGET)/javamaker.flag manifest jar cfm $@ manifest -C $(CLASSDIR) test/cppuhelper/propertysetmixin -test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET)$/uno.rdb -.IF "$(GUI)" == "WNT" - set CLASSPATH=$(CLASSPATH) && \ - set URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) && \ - testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET)$/uno.rdb#$(SOLARBINDIR)" -.ELSE - setenv CLASSPATH $(CLASSPATH) && \ - setenv URE_INTERNAL_JAVA_DIR $(MY_URE_INTERNAL_JAVA_DIR) && \ - testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET)$/uno.rdb#$(SOLARLIBDIR)" -.ENDIF +test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/uno.rdb + $(CPPUNITTESTER) $(SHL1TARGETN) \ + -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR) \ + -env:URE_INTERNAL_LIB_DIR=$(my_file)$(SOLARSHAREDBIN) \ + -env:arg-reg=$(MISC)/$(TARGET)/uno.rdb -env:arg-path=$(SOLARSHAREDBIN) + +.END diff --git a/cppuhelper/qa/propertysetmixin/test.gcc3.map b/cppuhelper/qa/propertysetmixin/test.gcc3.map index 33f2f055d40b..246034ea6792 100644 --- a/cppuhelper/qa/propertysetmixin/test.gcc3.map +++ b/cppuhelper/qa/propertysetmixin/test.gcc3.map @@ -35,7 +35,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; _ZN4_STL7num_put*; # STLport diff --git a/cppuhelper/qa/propertysetmixin/test.map b/cppuhelper/qa/propertysetmixin/test.map index 0c63a62b369f..44c3590ab6cb 100644 --- a/cppuhelper/qa/propertysetmixin/test.map +++ b/cppuhelper/qa/propertysetmixin/test.map @@ -31,7 +31,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx index ecb7220d110d..e60df48312d9 100644 --- a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx +++ b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx @@ -64,9 +64,12 @@ #include "com/sun/star/uno/XComponentContext.hpp" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/servicefactory.hxx" -#include "testshl/simpleheader.hxx" +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include "osl/mutex.hxx" -#include "osl/thread.h" +#include "rtl/bootstrap.hxx" #include "rtl/ref.hxx" #include "rtl/string.h" #include "rtl/textenc.h" @@ -98,6 +101,14 @@ std::ostream & operator <<(std::ostream & out, css::uno::Any const & value) { out << "com::sun::star::uno::Any[" << value.getValueType() << ", ...]"; } +rtl::OUString getArgument(rtl::OUString const & name) { + rtl::OUString val; + CPPUNIT_ASSERT( + rtl::Bootstrap::get( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("arg-")) + name, val)); + return val; +} + class BoundListener: public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener > { @@ -222,17 +233,12 @@ void Test::setUp() { // single component context is used for all tests and destroyed in the last // pseudo-test "finish": if (!m_context.is()) { - char const * fw = getForwardString(); - rtl::OUString forward(fw, rtl_str_getLength(fw), - osl_getThreadTextEncoding()); - //TODO: check for string conversion failure - sal_Int32 index = forward.indexOf('#'); - rtl::OUString registry = forward.copy(0, index); - rtl::OUString bootstrappath = forward.copy(index+1); - css::uno::Reference< css::lang::XMultiComponentFactory > factory( cppu::createRegistryServiceFactory( - registry, sal_False, bootstrappath), + getArgument(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("reg"))), + sal_False, + getArgument( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("path")))), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::beans::XPropertySet >( factory, css::uno::UNO_QUERY_THROW)->getPropertyValue( @@ -670,8 +676,8 @@ void Test::testFull( css::uno::Reference< css::uno::XComponentContext > Test::m_context; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/idlc/source/makefile.mk b/idlc/source/makefile.mk index 5f7b1d12ade6..d2afe87a9aa8 100644 --- a/idlc/source/makefile.mk +++ b/idlc/source/makefile.mk @@ -124,11 +124,7 @@ YACCFLAGS+=-v .INCLUDE : target.mk $(MISC)$/stripped_scanner.ll : scanner.ll -.IF "$(GUI)"=="UNX" || "$(USE_SHELL)" != "4nt" tr -d "\015" < scanner.ll > $(MISC)$/stripped_scanner.ll -.ELSE - cat scanner.ll > $(MISC)$/stripped_scanner.ll -.ENDIF $(MISC)$/scanner.cxx: $(MISC)$/stripped_scanner.ll flex -o$(MISC)$/scanner.cxx $(MISC)$/stripped_scanner.ll diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx new file mode 100644 index 000000000000..ad3ff5a98a72 --- /dev/null +++ b/sal/cppunittester/cppunittester.cxx @@ -0,0 +1,63 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2010 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_sal.hxx" +#include "sal/config.h" + +#include <cstdlib> +#include <iostream> + +#include "cppunit/CompilerOutputter.h" +#include "cppunit/TestResult.h" +#include "cppunit/TestResultCollector.h" +#include "cppunit/TestRunner.h" +#include "cppunit/extensions/TestFactoryRegistry.h" +#include "cppunit/plugin/PlugInManager.h" +#include "cppunit/portability/Stream.h" +#include "osl/thread.h" +#include "rtl/process.h" +#include "rtl/string.hxx" +#include "rtl/ustring.hxx" +#include "sal/main.h" + +SAL_IMPLEMENT_MAIN() { + if (rtl_getAppCommandArgCount() != 1) { + std::cerr << "Usage: cppunittester <shared-library-path>" << std::endl; + return EXIT_FAILURE; + } + rtl::OUString path; + rtl_getAppCommandArg(0, &path.pData); + CppUnit::PlugInManager manager; + manager.load( + rtl::OUStringToOString(path, osl_getThreadTextEncoding()).getStr()); + CppUnit::TestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + CppUnit::TestResult result; + CppUnit::TestResultCollector collector; + result.addListener(&collector); + runner.run(result); + CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write(); + return collector.wasSuccessful() ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/sal/qa/osl/semaphore/makefile.mk b/sal/cppunittester/makefile.mk index a8918dcfb12b..a87d1b182c68 100644 --- a/sal/qa/osl/semaphore/makefile.mk +++ b/sal/cppunittester/makefile.mk @@ -1,14 +1,13 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# $RCSfile: makefile,v $ # -# $Revision: 1.10 $ +# $Revision: 1.4 $ # # This file is part of OpenOffice.org. # @@ -26,40 +25,21 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=sal -TARGET=qa_osl_semaphore - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -CFLAGS+= $(LFS_CFLAGS) -CXXFLAGS+= $(LFS_CFLAGS) - -# BEGIN ---------------------------------------------------------------- -# auto generated Target:Semaphore by codegen.pl -SHL1OBJS= \ - $(SLO)$/osl_Semaphore.obj +#***********************************************************************/ -SHL1TARGET= osl_Semaphore -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +PRJ = .. +PRJNAME = sal +TARGET = cppunittester -SHL1IMPLIB= i$(SHL1TARGET) +ENABLE_EXCEPTIONS = TRUE -DEF1NAME =$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +.INCLUDE: settings.mk -# auto generated Target:Semaphore -# END ------------------------------------------------------------------ +OBJFILES = $(APP1OBJS) -# --- Targets ------------------------------------------------------ +APP1OBJS = $(OBJ)/cppunittester.obj +APP1RPATH = NONE +APP1STDLIBS = $(CPPUNITLIB) $(SALLIB) +APP1TARGET = cppunittester -.INCLUDE : target.mk -.INCLUDE : _cppunit.mk +.INCLUDE: target.mk diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h index 7c85f9ab431e..aee455ca1b7c 100644 --- a/sal/inc/osl/semaphor.h +++ b/sal/inc/osl/semaphor.h @@ -40,6 +40,10 @@ extern "C" { typedef void* oslSemaphore; /** Creates a semaphore.<BR> + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @param InitialCount denotes the starting value the semaphore. If you set it to zero, the first acquire() blocks. Otherwise InitialCount acquire()s are immedeatly successfull. @@ -48,12 +52,20 @@ typedef void* oslSemaphore; oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount); /** Release the OS-structures and free semaphore data-structure + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return fbbb */ void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore); /** acquire() decreases the count. It will block if it tries to decrease below zero. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return False if the system-call failed. */ sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore); @@ -62,10 +74,17 @@ sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore); return with False if it would decrease the count below zero. (When acquire() would block.) If it could successfully decrease the count, it will return True. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. */ sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore); /** release() increases the count. + + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + @return False if the system-call failed. */ sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore); diff --git a/sal/inc/osl/semaphor.hxx b/sal/inc/osl/semaphor.hxx index 4a08c92550aa..ba104a6a8760 100644 --- a/sal/inc/osl/semaphor.hxx +++ b/sal/inc/osl/semaphor.hxx @@ -38,7 +38,11 @@ namespace osl { + /** C++ wrapper class around C semaphore functions. + @deprecated + Must not be used, as unnamed semaphores are not supported on Mac OS X. + */ class Semaphore { public: diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index e3f78ff2f2b4..afffc639c92e 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -492,7 +492,16 @@ static void ChildStatusProc(void *pData) { int i; for (i = 0; data.m_pszEnv[i] != NULL; i++) - putenv(data.m_pszEnv[i]); + { + if (strchr(data.m_pszEnv[i], '=') == NULL) + { + unsetenv(data.m_pszEnv[i]); /*TODO: check error return*/ + } + else + { + putenv(data.m_pszEnv[i]); /*TODO: check error return*/ + } + } OSL_TRACE("ChildStatusProc : starting '%s'",data.m_pszArgs[0]); diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c index f4f893bf58c6..3a111cb01ab8 100644 --- a/sal/osl/w32/pipe.c +++ b/sal/osl/w32/pipe.c @@ -632,7 +632,7 @@ oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe) pPipe->m_Error = osl_Pipe_E_None; } else - Error = osl_Pipe_E_None; + Error = osl_Pipe_E_NotFound; return (Error); } diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index 379caeb5affc..5339e539e291 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -172,8 +172,7 @@ namespace /* private */ { rtl::OUString env_var = rtl::OUString(env_vars[i]); - if ((env_var.getLength() == 0) || - (env_var.indexOf(NAME_VALUE_SEPARATOR) == -1)) + if (env_var.getLength() == 0) return false; iterator_pair_t iter_pair = std::equal_range( @@ -182,10 +181,17 @@ namespace /* private */ env_var, less_environment_variable()); - if (iter_pair.first != iter_pair.second) // found - *iter_pair.first = env_var; - else // not found - merged_env->insert(iter_pair.first, env_var); + if (env_var.indexOf(NAME_VALUE_SEPARATOR) == -1) + { + merged_env->erase(iter_pair.first, iter_pair.second); + } + else + { + if (iter_pair.first != iter_pair.second) // found + *iter_pair.first = env_var; + else // not found + merged_env->insert(iter_pair.first, env_var); + } } return true; } diff --git a/sal/prj/build.lst b/sal/prj/build.lst index 5622d80edeef..838384f76152 100644 --- a/sal/prj/build.lst +++ b/sal/prj/build.lst @@ -1,4 +1,4 @@ -sa sal : xml2cmp stlport external BOOST:boost NULL +sa sal : xml2cmp stlport external BOOST:boost cppunit NULL sa sal usr1 - all sa_mkout NULL sa sal\inc nmake - all sa_inc NULL sa sal\typesconfig nmake - u sa_tc sa_inc NULL @@ -14,3 +14,9 @@ sa sal\qa nmake - all sa_qa sa_util NULL sa sal\osl\unx nmake - u sa_oslu sa_tc.u sa_inc NULL sa sal\osl\all nmake - all sa_oslall sa_tc.u sa_inc NULL sa sal\util nmake - all sa_util sa_tc.u sa_oslall sa_uwinapi.n sa_kill.n sa_onlineupdate.n sa_osln.n sa_oslp.p sa_oslu.u sa_rtl sa_textenc NULL +sa sal\cppunittester nmake - all sa_cppunittester sa_cpprt.u sa_util NULL +sa sal\qa\ByteSequence nmake - all sa_qa_ByteSequence sa_cppunittester sa_util NULL +sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util NULL +sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL +sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL +sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL diff --git a/sal/prj/d.lst b/sal/prj/d.lst index bcd9c0e2c95a..3ce270bbbfc4 100644 --- a/sal/prj/d.lst +++ b/sal/prj/d.lst @@ -34,3 +34,5 @@ symlink: %_DEST%\lib%_EXT%\libuno_sal.dylib.3 %_DEST%\lib%_EXT%\libuno_sal.dylib ..\%__SRC%\inc\udkversion.h %_DEST%\inc%_EXT%\sal\udkversion.h +..\%__SRC%\bin\cppunittester %_DEST%\bin%_EXT%\cppunittester +..\%__SRC%\bin\cppunittester.exe %_DEST%\bin%_EXT%\cppunittester.exe diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx index f1105298deaf..98e24eb51dd9 100644 --- a/sal/qa/ByteSequence/ByteSequence.cxx +++ b/sal/qa/ByteSequence/ByteSequence.cxx @@ -36,7 +36,10 @@ #include <rtl/byteseq.hxx> -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" using namespace rtl; @@ -593,18 +596,13 @@ public: }; // class getData // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::ctor, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::assign, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::equal, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::notequal, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::getArray, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::realloc, "rtl_ByteSequence"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::getData, "rtl_ByteSequence"); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::ctor); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::assign); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::equal); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::notequal); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::getArray); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::realloc); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_ByteSequence::getData); } // namespace ByteSequence - -// ----------------------------------------------------------------------------- - -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/ByteSequence/export.exp b/sal/qa/ByteSequence/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/ByteSequence/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/qa/ByteSequence/makefile.mk index 0f1b88ac6e6a..d3009cc4d451 100644 --- a/sal/qa/ByteSequence/makefile.mk +++ b/sal/qa/ByteSequence/makefile.mk @@ -28,6 +28,11 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/.. PRJNAME=sal @@ -50,25 +55,26 @@ SHL1OBJS= \ $(SLO)$/ByteSequence.obj SHL1TARGET= rtl_ByteSequence -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1RPATH = NONE # --- BEGIN -------------------------------------------------------- SHL2OBJS= \ $(SLO)$/rtl_old_testbyteseq.obj SHL2TARGET= rtl_old_testbyteseq -SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL2IMPLIB= i$(SHL2TARGET) DEF2NAME =$(SHL2TARGET) SHL2VERSIONMAP = $(PRJ)$/qa$/export.map +SHL2RPATH = NONE # END -------------------------------------------------------------- #------------------------------- All object files ------------------------------- @@ -80,3 +86,4 @@ SLOFILES=$(SHL1OBJS) .INCLUDE : target.mk .INCLUDE : _cppunit.mk +.END diff --git a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx index 2cea6fa3a878..f8f83953ce3b 100644 --- a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx +++ b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx @@ -37,13 +37,15 @@ #include <stdio.h> -// #include <osl/diagnose.h> +#include <osl/diagnose.h> #include <rtl/byteseq.hxx> using namespace ::rtl; -#include <testshl/simpleheader.hxx> - +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" namespace rtl_testbyteseq { @@ -129,7 +131,7 @@ void oldbyteseq::test_bytesequence_001() } // namespace osl_test_file // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_testbyteseq::oldbyteseq, "rtl_ByteSequence" ); +CPPUNIT_TEST_SUITE_REGISTRATION( rtl_testbyteseq::oldbyteseq ); // ----------------------------------------------------------------------------- -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/OStringBuffer/export.exp b/sal/qa/OStringBuffer/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/OStringBuffer/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk index d20c011a552e..2cabed7dedd3 100644 --- a/sal/qa/OStringBuffer/makefile.mk +++ b/sal/qa/OStringBuffer/makefile.mk @@ -28,6 +28,11 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/.. PRJNAME=sal @@ -56,15 +61,14 @@ SHL1OBJS= \ $(SLO)$/rtl_String_Utils.obj SHL1TARGET= rtl_OStringBuffer -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp SHL1VERSIONMAP = $(PRJ)$/qa$/export.map - +SHL1RPATH = NONE #------------------------------- All object files ------------------------------- # do this here, so we get right dependencies @@ -75,3 +79,4 @@ SLOFILES=$(SHL1OBJS) .INCLUDE : target.mk .INCLUDE : _cppunit.mk +.END diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index 2b3bbfd6caa3..7166bb431b82 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -38,7 +38,10 @@ #include <rtl/strbuf.hxx> -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" using namespace rtl; @@ -18407,67 +18410,34 @@ t_print("\n"); // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ctors, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::makeStringAndClear, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getLength, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getCapacity, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::ensureCapacity, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setLength, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::charAt, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::csuc, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::getStr, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::setCharAt, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_001, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_002, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_003, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_004, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_005, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_float, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_double, - "rtl_OStringBuffer"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative, - "rtl_OStringBuffer"); - -// ----------------------------------------------------------------------------- - -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::ctors); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::makeStringAndClear); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getLength); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getCapacity); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::ensureCapacity); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::setLength); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::charAt); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::csuc); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::getStr); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::setCharAt); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_001); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_002); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_003); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_004); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_005); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Bounderies); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_WrongRadix); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_006_Int32_defaultParam); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Bounderies); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_WrongRadix); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_007_Int64_defaultParam); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_float); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_double); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative); + +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/OStringBuffer/rtl_String_Utils.cxx b/sal/qa/OStringBuffer/rtl_String_Utils.cxx index a8698ff1bbc8..83399bb6f481 100644 --- a/sal/qa/OStringBuffer/rtl_String_Utils.cxx +++ b/sal/qa/OStringBuffer/rtl_String_Utils.cxx @@ -91,7 +91,7 @@ sal_Char* cpystr( sal_Char* dst, const sal_Char* src ) const sal_Char* psrc = src; sal_Char* pdst = dst; - while( *pdst++ = *psrc++ ); + while( (*pdst++ = *psrc++) ); return ( dst ); } diff --git a/sal/qa/export.map b/sal/qa/export.map index ab2e7cd007b0..9e347a81a1c3 100755 --- a/sal/qa/export.map +++ b/sal/qa/export.map @@ -31,7 +31,7 @@ UDK_3.0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/sal/qa/osl/mutex/makefile.mk b/sal/qa/osl/mutex/makefile.mk index 7c8cfeb39037..7fdc72ff8b45 100755 --- a/sal/qa/osl/mutex/makefile.mk +++ b/sal/qa/osl/mutex/makefile.mk @@ -29,6 +29,10 @@ # #************************************************************************* +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -49,19 +53,16 @@ SHL1OBJS= \ $(SLO)$/osl_Mutex.obj SHL1TARGET= osl_Mutex -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) .IF "$(GUI)" == "WNT" SHL1STDLIBS += $(WS2_32LIB) .ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS += -ldl -lnsl -.ENDIF - SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1RPATH = NONE # auto generated Target:Socket # END ------------------------------------------------------------------ @@ -70,3 +71,5 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map .INCLUDE : target.mk .INCLUDE : _cppunit.mk + +.END diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx index a615bb3ce0dc..3d01a5892fe8 100755 --- a/sal/qa/osl/mutex/osl_Mutex.cxx +++ b/sal/qa/osl/mutex/osl_Mutex.cxx @@ -34,6 +34,10 @@ //------------------------------------------------------------------------ // include files //------------------------------------------------------------------------ +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include <osl_Mutex_Const.h> using namespace osl; @@ -49,17 +53,17 @@ inline void printUString( const ::rtl::OUString & str ) { rtl::OString aString; - t_print("#printUString_u# " ); + printf("#printUString_u# " ); aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); + printf("%s\n", aString.getStr( ) ); } /** print Boolean value. */ inline void printBool( sal_Bool bOk ) { - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); + printf("#printBool# " ); + ( sal_True == bOk ) ? printf("YES!\n" ): printf("NO!\n" ); } /** pause nSec seconds helper function. @@ -78,7 +82,7 @@ namespace ThreadHelper #if ( defined UNX ) || ( defined OS2 ) //Unix sleep( _nSec ); #endif - // t_print("# done\n" ); + // printf("# done\n" ); } void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) { @@ -230,7 +234,7 @@ protected: { // block here if the mutex has been acquired pMyMutex->acquire( ); - t_print("# Mutex acquired. \n" ); + printf("# Mutex acquired. \n" ); pMyMutex->release( ); } }; @@ -276,7 +280,7 @@ protected: Mutex* pGlobalMutex; pGlobalMutex = pGlobalMutex->getGlobalMutex( ); pGlobalMutex->acquire( ); - t_print("# Global Mutex acquired. \n" ); + printf("# Global Mutex acquired. \n" ); pGlobalMutex->release( ); } }; @@ -341,7 +345,7 @@ namespace osl_Mutex bRes = sal_True; /*for (sal_Int8 i=0; i<BUFFER_SIZE; i++) - t_print("#data in buffer is %d\n", m_Data.buffer[i]); + printf("#data in buffer is %d\n", m_Data.buffer[i]); */ CPPUNIT_ASSERT_MESSAGE("Mutex ctor", bRes == sal_True); @@ -695,7 +699,7 @@ protected: void SAL_CALL run( ) { // acquire the mutex - // t_print("# ClearGuardThread" ); + // printf("# ClearGuardThread" ); ClearableMutexGuard aGuard( pMyMutex ); ThreadHelper::thread_sleep( 5 ); @@ -771,7 +775,7 @@ namespace osl_ClearableGuard TimeValue aTimeVal_after; osl_getSystemTime( &aTimeVal_after ); sal_Int32 nSec = aTimeVal_after.Seconds - aTimeVal_befor.Seconds; - t_print("nSec is %d\n", nSec); + printf("nSec is %"SAL_PRIdINT32"\n", nSec); myThread.join(); @@ -837,7 +841,7 @@ protected: void SAL_CALL run( ) { // acquire the mutex - t_print("# ResettableGuard" ); + printf("# ResettableGuard" ); ResettableMutexGuard aGuard( pMyMutex ); // release the mutex aGuard.clear( ); @@ -936,13 +940,11 @@ namespace osl_ResettableGuard }; // class reset // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ResettableGuard::ctor, "osl_ResettableGuard"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_ResettableGuard::reset, "osl_ResettableGuard"); +CPPUNIT_TEST_SUITE_REGISTRATION(osl_ResettableGuard::ctor); +CPPUNIT_TEST_SUITE_REGISTRATION(osl_ResettableGuard::reset); } // namespace osl_ResettableGuard -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); // The following sets variables for GNU EMACS // Local Variables: diff --git a/sal/qa/osl/mutex/osl_Mutex_Const.h b/sal/qa/osl/mutex/osl_Mutex_Const.h index a13f40ab9605..336cd0aa649e 100755 --- a/sal/qa/osl/mutex/osl_Mutex_Const.h +++ b/sal/qa/osl/mutex/osl_Mutex_Const.h @@ -1,5 +1,5 @@ /************************************************************************* -* + * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. @@ -49,8 +49,6 @@ #endif #include <osl/time.h> -#include <testshl/simpleheader.hxx> - #ifdef UNX #include <unistd.h> #endif diff --git a/sal/qa/osl/pipe/export.exp b/sal/qa/osl/pipe/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/osl/pipe/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/osl/pipe/makefile.mk b/sal/qa/osl/pipe/makefile.mk index 3d0df14bbd69..194c602c4785 100644 --- a/sal/qa/osl/pipe/makefile.mk +++ b/sal/qa/osl/pipe/makefile.mk @@ -29,6 +29,10 @@ # #************************************************************************* +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -49,14 +53,14 @@ SHL1OBJS= \ $(SLO)$/osl_Pipe.obj SHL1TARGET= osl_Pipe -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map -# DEF1EXPORTFILE= export.exp +SHL1RPATH = NONE # auto generated Target:Pipe # END ------------------------------------------------------------------ @@ -64,3 +68,5 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map .INCLUDE : target.mk .INCLUDE : _cppunit.mk + +.END diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index c2b2ae740527..63db7222f1a3 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -35,7 +35,10 @@ // include files //------------------------------------------------------------------------ -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include <sal/types.h> #include <rtl/ustring.hxx> @@ -67,8 +70,8 @@ using namespace rtl; */ inline void printBool( sal_Bool bOk ) { - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); + printf("#printBool# " ); + ( sal_True == bOk ) ? printf("YES!\n" ): printf("NO!\n" ); } /** print a UNI_CODE String. @@ -77,9 +80,9 @@ inline void printUString( const ::rtl::OUString & str ) { rtl::OString aString; - t_print("#printUString_u# " ); + printf("#printUString_u# " ); aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); + printf("%s\n", aString.getStr( ) ); } /** print last error of pipe system. @@ -87,43 +90,43 @@ inline void printUString( const ::rtl::OUString & str ) inline void printPipeError( ::osl::Pipe aPipe ) { oslPipeError nError = aPipe.getError( ); - t_print("#printPipeError# " ); + printf("#printPipeError# " ); switch ( nError ) { case osl_Pipe_E_None: - t_print("Success!\n" ); + printf("Success!\n" ); break; case osl_Pipe_E_NotFound: - t_print("The returned error is: Not found!\n" ); + printf("The returned error is: Not found!\n" ); break; case osl_Pipe_E_AlreadyExists: - t_print("The returned error is: Already exist!\n" ); + printf("The returned error is: Already exist!\n" ); break; case osl_Pipe_E_NoProtocol: - t_print("The returned error is: No protocol!\n" ); + printf("The returned error is: No protocol!\n" ); break; case osl_Pipe_E_NetworkReset: - t_print("The returned error is: Network reset!\n" ); + printf("The returned error is: Network reset!\n" ); break; case osl_Pipe_E_ConnectionAbort: - t_print("The returned error is: Connection aborted!\n" ); + printf("The returned error is: Connection aborted!\n" ); break; case osl_Pipe_E_ConnectionReset: - t_print("The returned error is: Connection reset!\n" ); + printf("The returned error is: Connection reset!\n" ); break; case osl_Pipe_E_NoBufferSpace: - t_print("The returned error is: No buffer space!\n" ); + printf("The returned error is: No buffer space!\n" ); break; case osl_Pipe_E_TimedOut: - t_print("The returned error is: Timeout!\n" ); + printf("The returned error is: Timeout!\n" ); break; case osl_Pipe_E_ConnectionRefused: - t_print("The returned error is: Connection refused!\n" ); + printf("The returned error is: Connection refused!\n" ); break; case osl_Pipe_E_invalidError: - t_print("The returned error is: Invalid error!\n" ); + printf("The returned error is: Invalid error!\n" ); break; default: - t_print("The returned error is: Number %d, Unknown Error\n", nError ); + printf("The returned error is: Number %d, Unknown Error\n", nError ); break; } } @@ -628,8 +631,8 @@ namespace osl_Pipe printPipeError( aPipe ); aPipe.clear( ); - CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe. not passed in (W32)(LINUX)(UNX).", - osl_Pipe_E_invalidError == nError ); + CPPUNIT_ASSERT_MESSAGE( "#test comment#: open a non-exist pipe.", + nError != osl_Pipe_E_None ); } void getError_002( ) @@ -641,8 +644,8 @@ namespace osl_Pipe aPipe.clear( ); aPipe1.clear( ); - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.not passed in (W32)(LINUX)(UNX).", - osl_Pipe_E_invalidError == nError ); + CPPUNIT_ASSERT_MESSAGE( "#test comment#: create an already exist pipe.", + nError != osl_Pipe_E_None ); } CPPUNIT_TEST_SUITE( getError ); @@ -690,17 +693,17 @@ namespace osl_Pipe // ----------------------------------------------------------------------------- - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::ctors, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::is, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::create, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::clear, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::assign, "osl_Pipe"); -//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::isValid, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::isEqual, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::close, "osl_Pipe"); - //CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::accept, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getError, "osl_Pipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Pipe::getHandle, "osl_Pipe"); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::ctors); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::is); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::create); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::clear); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::assign); +//CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isValid); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::isEqual); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::close); + //CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::accept); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getError); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_Pipe::getHandle); // ----------------------------------------------------------------------------- } // namespace osl_Pipe @@ -884,7 +887,7 @@ namespace osl_StreamPipe void thread_sleep( sal_Int32 _nSec ) { /// print statement in thread process must use fflush() to force display. - // t_print("wait %d seconds. ", _nSec ); + // printf("wait %d seconds. ", _nSec ); fflush(stdout); #ifdef WNT //Windows @@ -893,7 +896,7 @@ namespace osl_StreamPipe #if ( defined UNX ) || ( defined OS2 ) //Unix sleep( _nSec ); #endif - // t_print("done\n" ); + // printf("done\n" ); } // test read/write & send/recv data to pipe // ----------------------------------------------------------------------------- @@ -912,27 +915,27 @@ namespace osl_StreamPipe { sal_Int32 nChars = 0; - t_print("open pipe\n"); + printf("open pipe\n"); ::osl::StreamPipe aSenderPipe( aTestPipeName, osl_Pipe_OPEN ); // aTestPipeName is a string = "TestPipe" if ( aSenderPipe.is() == sal_False ) { - t_print("pipe open failed! \n"); + printf("pipe open failed! \n"); } else { - t_print("read\n"); + printf("read\n"); nChars = aSenderPipe.read( buf, m_pTestString1.getLength() + 1 ); if ( nChars < 0 ) { - t_print("read failed! \n"); + printf("read failed! \n"); return; } - t_print("buffer is %s \n", buf); - t_print("send\n"); + printf("buffer is %s \n", buf); + printf("send\n"); nChars = aSenderPipe.send( m_pTestString2.getStr(), m_pTestString2.getLength() + 1 ); if ( nChars < 0 ) { - t_print("client send failed! \n"); + printf("client send failed! \n"); return; } } @@ -951,7 +954,7 @@ namespace osl_StreamPipe ::osl::StreamPipe aConnectionPipe; Pipe_DataSource_Thread( ) { - t_print("create pipe\n"); + printf("create pipe\n"); aListenPipe.create( aTestPipeName, osl_Pipe_CREATE ); } ~Pipe_DataSource_Thread( ) @@ -964,40 +967,40 @@ namespace osl_StreamPipe //create pipe. sal_Int32 nChars; //::osl::StreamPipe aListenPipe( aTestPipeName, osl_Pipe_CREATE ); - t_print("listen\n"); + printf("listen\n"); if ( aListenPipe.is() == sal_False ) { - t_print("pipe create failed! \n"); + printf("pipe create failed! \n"); } else { //::osl::StreamPipe aConnectionPipe; //start server and wait for connection. - t_print("accept\n"); + printf("accept\n"); if ( osl_Pipe_E_None != aListenPipe.accept( aConnectionPipe ) ) { - t_print("pipe accept failed!"); + printf("pipe accept failed!"); return; } - t_print("write\n"); + printf("write\n"); // write to pipe nChars = aConnectionPipe.write( m_pTestString1.getStr(), m_pTestString1.getLength() + 1 ); if ( nChars < 0) { - t_print("server write failed! \n"); + printf("server write failed! \n"); return; } - t_print("recv\n"); + printf("recv\n"); nChars = aConnectionPipe.recv( buf, 256 ); if ( nChars < 0) { - t_print("server receive failed! \n"); + printf("server receive failed! \n"); return; } //thread_sleep( 2 ); - t_print("received message is: %s\n", buf ); + printf("received message is: %s\n", buf ); //aConnectionPipe.close(); } } @@ -1048,16 +1051,11 @@ namespace osl_StreamPipe }; // class recv // ----------------------------------------------------------------------------- - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::ctors, "osl_StreamPipe"); -//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::assign, "osl_StreamPipe"); - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_StreamPipe::recv, "osl_StreamPipe"); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::ctors); +//CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::assign); + CPPUNIT_TEST_SUITE_REGISTRATION(osl_StreamPipe::recv); // ----------------------------------------------------------------------------- } // namespace osl_StreamPipe - -// ----------------------------------------------------------------------------- - -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/osl/pipe/osl_Pipe.xsce b/sal/qa/osl/pipe/osl_Pipe.xsce deleted file mode 100644 index d96a915d8ab9..000000000000 --- a/sal/qa/osl/pipe/osl_Pipe.xsce +++ /dev/null @@ -1,9 +0,0 @@ -#i23307# -osl_Pipe.getError.getError_001 wntmsci -osl_Pipe.getError.getError_002 wntmsci - -osl_StreamPipe.recv.recv_002 wntmsci unxsols -# osl_Pipe.ctors.ctors_acquire wntmsci - -#i27889# -osl_Pipe.ctors.ctors_no_acquire wntmsci diff --git a/sal/qa/osl/pipe/osl_Pipe_Const.h b/sal/qa/osl/pipe/osl_Pipe_Const.h deleted file mode 100644 index 0b70655eabc0..000000000000 --- a/sal/qa/osl/pipe/osl_Pipe_Const.h +++ /dev/null @@ -1 +0,0 @@ -// no longer used diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk index 482bc69276a2..8e9c0412e401 100644 --- a/sal/qa/osl/profile/makefile.mk +++ b/sal/qa/osl/profile/makefile.mk @@ -28,6 +28,11 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + PRJ=..$/..$/.. PRJNAME=sal @@ -48,11 +53,12 @@ SHL1OBJS= \ $(SLO)$/osl_old_testprofile.obj SHL1TARGET= osl_old_testprofile -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) +SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) SHL1IMPLIB= i$(SHL1TARGET) DEF1NAME =$(SHL1TARGET) SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +SHL1RPATH = NONE # END ------------------------------------------------------------------ @@ -66,4 +72,4 @@ SLOFILES=\ .INCLUDE : target.mk .INCLUDE : _cppunit.mk - +.END diff --git a/sal/qa/osl/profile/osl_old_testprofile.cxx b/sal/qa/osl/profile/osl_old_testprofile.cxx index 27e4cbe6b35b..abbd59f76a65 100644 --- a/sal/qa/osl/profile/osl_old_testprofile.cxx +++ b/sal/qa/osl/profile/osl_old_testprofile.cxx @@ -40,7 +40,10 @@ #include <stdio.h> #include <osl/profile.h> -#include <testshl/simpleheader.hxx> +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" //================================================================================================== // ----------------------------------------------------------------------------- @@ -67,7 +70,8 @@ void oldtests::test_profile(void) // successful write - if (hProfile = osl_openProfile( ustrProfileName, 0 )) + hProfile = osl_openProfile( ustrProfileName, 0 ); + if (hProfile != 0) { if (! osl_writeProfileBool( hProfile, "testsection", "testbool", 1 )) printf( "### cannot write into init file!\n" ); @@ -76,7 +80,8 @@ void oldtests::test_profile(void) } // unsuccessful write - if (hProfile = osl_openProfile( ustrProfileName2, 0 )) + hProfile = osl_openProfile( ustrProfileName2, 0 ); + if (hProfile != 0) { if (osl_writeProfileBool( hProfile, "testsection", "testbool", 1 )) printf( "### unexpected success writing into test2.ini!\n" ); @@ -91,7 +96,7 @@ void oldtests::test_profile(void) } // namespace osl_Profile // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_Profile::oldtests, "osl_Profile" ); +CPPUNIT_TEST_SUITE_REGISTRATION( osl_Profile::oldtests ); // ----------------------------------------------------------------------------- -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/osl/semaphore/osl_Semaphore.cxx b/sal/qa/osl/semaphore/osl_Semaphore.cxx deleted file mode 100644 index 5769c0b52a86..000000000000 --- a/sal/qa/osl/semaphore/osl_Semaphore.cxx +++ /dev/null @@ -1,528 +0,0 @@ - /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: osl_Semaphore.cxx,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" - -//------------------------------------------------------------------------ -// include files -//------------------------------------------------------------------------ -#include <osl_Semaphore_Const.h> - -using namespace osl; -using namespace rtl; - - -//------------------------------------------------------------------------ -// helper functions and classes -//------------------------------------------------------------------------ - -/** print Boolean value. -*/ -inline void printBool( sal_Bool bOk ) -{ - t_print("#printBool# " ); - ( sal_True == bOk ) ? t_print("YES!\n" ): t_print("NO!\n" ); -} - -/** print a UNI_CODE String. -*/ -inline void printUString( const ::rtl::OUString & str ) -{ - rtl::OString aString; - - t_print("#printUString_u# " ); - aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", aString.getStr( ) ); -} - -/** wait _nSec seconds. -*/ -void thread_sleep( sal_Int32 _nSec ) -{ - /// print statement in thread process must use fflush() to force display. - // t_print("wait %d seconds. ", _nSec ); - // fflush( stdout ); - -#ifdef WNT //Windows - Sleep( _nSec * 1000 ); -#endif -#if ( defined UNX ) || ( defined OS2 ) //Unix - sleep( _nSec ); -#endif -} - - void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) - { -#ifdef WNT //Windows - Sleep(_nTenthSec * 100 ); -#endif -#if ( defined UNX ) || ( defined OS2 ) //Unix - TimeValue nTV; - nTV.Seconds = static_cast<sal_uInt32>( _nTenthSec/10 ); - nTV.Nanosec = ( (_nTenthSec%10 ) * 100000000 ); - osl_waitThread(&nTV); -#endif -} - -/** thread for testing Semaphore acquire. - */ -class HoldThread : public Thread -{ -public: - //get the Semaphores to operate - HoldThread( ::osl::Semaphore& Sem ): MySem( Sem ) { } - - ~HoldThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "#HoldThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - ::osl::Semaphore& MySem; - - void SAL_CALL run() - { - // block here if it tries to decrease below zero. - MySem.acquire( ); - t_print("Semaphore acquired. \n" ); - MySem.release( ); - } -}; - -/** thread for testing Semaphore release and tryToAcquire. - */ -class WaitThread : public Thread -{ -public: - //get the Semaphore pointer to operate - WaitThread( ::osl::Semaphore& Sem ): MySem( Sem ) { } - - ~WaitThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "WaitThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - Semaphore& MySem; - - void SAL_CALL run( ) - { - // block here if the semaphore has been acquired - MySem.acquire( ); - thread_sleep_tenth_sec( 2 ); - MySem.release( ); - } -}; - -/** thread for producer-consumer model. - */ -#define BSIZE 50 -class SemBuffer -{ -public: - sal_Int32 Buf[BSIZE]; - ::osl::Semaphore& aSemOccupied; - ::osl::Semaphore& aSemEmpty; - ::osl::Mutex& aMutex; - - SemBuffer( ::osl::Semaphore& Sem, ::osl::Semaphore& Sem1, ::osl::Mutex& Mut ) - :aSemOccupied( Sem ), aSemEmpty( Sem1 ), aMutex( Mut ) - { - for ( sal_Int8 iCount=0; iCount < BSIZE; iCount++ ) - Buf[iCount] = 0; - } -}; - -class WriterThread : public Thread -{ -public: - //get the Semaphores to operate - WriterThread( SemBuffer& aSemBuffer ): MySemBuffer( aSemBuffer ){ } - - ~WriterThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "WriterThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } -protected: - SemBuffer& MySemBuffer; - - void SAL_CALL run( ) - { - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - { - MySemBuffer.aSemEmpty.acquire( ) ; - MySemBuffer.aMutex.acquire( ) ; - MySemBuffer.Buf[iCount] = iCount; - MySemBuffer.aMutex.release( ) ; - MySemBuffer.aSemOccupied.release( ) ; - } - } -}; - -class ReaderThread : public Thread -{ -public: - //get the Semaphores to operate - ReaderThread( SemBuffer& aSemBuffer ): MySemBuffer( aSemBuffer ){ } - - ~ReaderThread( ) - { - CPPUNIT_ASSERT_MESSAGE( "ReaderThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); - } - -protected: - SemBuffer& MySemBuffer; - - void SAL_CALL run( ) - { - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - { - MySemBuffer.aSemOccupied.acquire( ) ; - MySemBuffer.aMutex.acquire( ) ; - MySemBuffer.Buf[iCount] *= MySemBuffer.Buf[iCount]; - MySemBuffer.aMutex.release( ) ; - MySemBuffer.aSemEmpty.release( ) ; - } - } -}; - - - -//------------------------------------------------------------------------ -// test code start here -//------------------------------------------------------------------------ - -namespace osl_Semaphore -{ - - /** testing the method: - Semaphore(sal_uInt32 initialCount); - */ - class ctors : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1; - - void ctors_001( ) - { - ::osl::Semaphore aSem(sal_uInt32(0)); - bRes = aSem.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 0. the first acquire will block.", - sal_False == bRes ); - } - - void ctors_002( ) - { - ::osl::Semaphore aSem(sal_uInt32(1)); - bRes = aSem.tryToAcquire( ); - if ( sal_True == bRes ) - aSem.release( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 1. the first acquire will not block.", - sal_True == bRes ); - } - - void ctors_003( ) - { - ::osl::Semaphore aSem(sal_uInt32(1)); - bRes = aSem.tryToAcquire( ); - bRes1 = aSem.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 1. acquire twice will cause block.", - sal_True == bRes && sal_False == bRes1); - } - - void ctors_004( ) - { - oslSemaphore hSem = new ::osl::Semaphore(sal_uInt32(1)); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test return value of the constructor, it should not be NULL.", - NULL != hSem ); - } - - void ctors_005( ) - { - ::osl::Semaphore aSemaphore(sal_uInt32(2)); - bRes = aSemaphore.tryToAcquire( )&& - aSemaphore.tryToAcquire( )&& - !aSemaphore.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: create semaphore with initialCount = 2. guess what behaviour will the semaphore act like.", - sal_True == bRes ); - } - - CPPUNIT_TEST_SUITE( ctors ); - CPPUNIT_TEST( ctors_001 ); - CPPUNIT_TEST( ctors_002 ); - CPPUNIT_TEST( ctors_003 ); - CPPUNIT_TEST( ctors_004 ); - CPPUNIT_TEST( ctors_005 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class ctors - - - /** testing the method: - sal_Bool acquire(); - */ - class acquire : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2; - - /** tester comment: - acquire semaphore in main thread, and then call acquire again in myThread, - the child thread should block, wait 2 secs, it still block. Then release - semaphore in main thread, the child thread could return from acquire, and - go to exec next statement, so could terminate quickly. - */ - - void acquire_001( ) - { - // launch the child thread - ::osl::Semaphore aSemaphore(1); - bRes = aSemaphore.acquire( ); - HoldThread myThread( aSemaphore ); - myThread.create( ); - - // if acquire in myThread does not work, 2 secs is long enough, - // myThread should terminate now, and bRes1 should be sal_False - thread_sleep_tenth_sec( 2 ); - bRes1 = myThread.isRunning( ); - - // after release semaphore, myThread stops blocking and will terminate immediately - aSemaphore.release( ); - thread_sleep_tenth_sec( 1 ); - bRes2 = myThread.isRunning( ); - myThread.join( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore.", - bRes == sal_True && bRes1 == sal_True && bRes2 == sal_False ); - } - - /** tester comment: - launch 3 thread for testing acquirement inter-process. - */ - - void acquire_002( ) - { - // launch three child threads - ::osl::Semaphore aSemaphore(1); - bRes = aSemaphore.acquire( ); - HoldThread myThread1( aSemaphore ); - myThread1.create( ); - HoldThread myThread2( aSemaphore ); - myThread2.create( ); - HoldThread myThread3( aSemaphore ); - myThread3.create( ); - - // if acquire in myThread does not work, 2 secs is long enough, - thread_sleep_tenth_sec( 2 ); - bRes1 = myThread1.isRunning( ) && myThread2.isRunning( ) && myThread3.isRunning( ); - - // after release semaphore, myThread stops blocking and will terminate immediately - aSemaphore.release( ); - thread_sleep_tenth_sec( 1 ); - bRes2 = myThread1.isRunning( ) || myThread2.isRunning( ) || myThread3.isRunning( ); - myThread1.join( ); - myThread2.join( ); - myThread3.join( ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore in multithreaded environment.", - bRes == sal_True && bRes1 == sal_True && bRes2 == sal_False ); - } - - - - /** tester comment: - launch 3 thread for testing acquirement inter-process. in this test, - we use two threads as producer and consumer, operate together on an - array which is initialized to 0 for every item. producer takes action - as follow: - p(A), p(M), Buf[i]=i, v(M), v(B). - consumer's action is like: - p(B), p(M), Buf[i]=Buf[i]*Buf[i], v(M), v(A). - consumer must operate on the array after producer does sequetially, - otherwise, the array will contain items remain zero after all threads - terminate. array will be filled with index^2 in the end. - */ - - void acquire_003( ) - { - // initialization. - ::osl::Semaphore aSemOccupied( sal_uInt32(0) ); - ::osl::Semaphore aSemEmpty( BSIZE ); - ::osl::Mutex aMutex; - - // launch two threads. - SemBuffer aBuffer( aSemOccupied, aSemEmpty, aMutex ); - WriterThread myThread1( aBuffer ); - ReaderThread myThread2( aBuffer ); - myThread1.create( ); - myThread2.create( ); - - myThread1.join( ); - myThread2.join( ); - - bRes = sal_True; - for ( sal_Int32 iCount = 0; iCount < BSIZE; iCount++ ) - bRes = bRes && ( aBuffer.Buf[iCount] == iCount*iCount ); - - CPPUNIT_ASSERT_MESSAGE( "#test comment#: test acquire of Semaphore using Producer-Consumer model.", - sal_True == bRes ); - } - - CPPUNIT_TEST_SUITE( acquire ); - CPPUNIT_TEST( acquire_001 ); - CPPUNIT_TEST( acquire_002 ); - CPPUNIT_TEST( acquire_003 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class acquire - - - /** testing the method: - sal_Bool tryToAcquire(); - */ - class tryToAcquire : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2; - /** tester comment: - First let child thread acquire the semaphore, and wait 2 secs, during the 2 secs, - in main thread, tryToAcquire semaphore should return False, then after the - child thread terminated, tryToAcquire should return True - */ - void tryToAcquire_001() - { - ::osl::Semaphore aSemaphore(1); - WaitThread myThread( aSemaphore ); - myThread.create(); - - // ensure the child thread acquire the semaphore - thread_sleep_tenth_sec(1); - bRes1 = aSemaphore.tryToAcquire(); - - if (bRes1 == sal_True) - aSemaphore.release(); - // wait the child thread terminate - myThread.join(); - - bRes2 = aSemaphore.tryToAcquire(); - if (bRes2 == sal_True) - aSemaphore.release(); - - CPPUNIT_ASSERT_MESSAGE("#test comment#: Try to acquire Semaphore", - bRes1 == sal_False && bRes2 == sal_True); - } - - void tryToAcquire_002() - { - ::osl::Semaphore aSem(1); - bRes = aSem.tryToAcquire( ); - bRes1 = aSem.tryToAcquire( ); - - - CPPUNIT_ASSERT_MESSAGE("#test comment#: Try to acquire Semaphore twice should block.", - sal_True == bRes && sal_False == bRes1); - } - - CPPUNIT_TEST_SUITE( tryToAcquire ); - CPPUNIT_TEST( tryToAcquire_001 ); - CPPUNIT_TEST( tryToAcquire_002 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class tryToAcquire - - - /** testing the method: - sal_Bool release(); - */ - class release : public CppUnit::TestFixture - { - public: - sal_Bool bRes, bRes1, bRes2, bRunning; - sal_Int32 nCount; - /** acquire/release are not used in pairs: after child thread acquired semaphore, - the main thread release it, then any thread could acquire it. - */ - void release_001() - { - Semaphore aSemaphore(1); - WaitThread myThread( aSemaphore ); - myThread.create( ); - - // ensure the child thread acquire the mutex - thread_sleep_tenth_sec( 1 ); - - bRunning = myThread.isRunning( ); - bRes1 = aSemaphore.tryToAcquire( ); - // wait the child thread terminate - myThread.join( ); - - bRes2 = aSemaphore.tryToAcquire( ); - if ( bRes2 == sal_True ) - aSemaphore.release( ); - - CPPUNIT_ASSERT_MESSAGE( "release Semaphore: try to aquire before and after the semaphore has been released", - bRes1 == sal_False && bRes2 == sal_True && bRunning == sal_True ); - - } - - void release_002() - { - Semaphore aSemaphore(sal_uInt32(0)); - bRes1 = sal_True; - for ( nCount = 0; nCount < 10; nCount++, aSemaphore.release( ) ) { } - for ( nCount = 0; nCount < 10; nCount++, bRes1 = bRes1 && aSemaphore.tryToAcquire( ) ) { } - bRes = aSemaphore.tryToAcquire( ); - - CPPUNIT_ASSERT_MESSAGE( "release Semaphore: release ten times and acquire eleven times.", - sal_False == bRes && sal_True == bRes1); - } - - CPPUNIT_TEST_SUITE( release ); - CPPUNIT_TEST( release_001 ); - CPPUNIT_TEST( release_002 ); - CPPUNIT_TEST_SUITE_END( ); - }; // class release - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::ctors, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::acquire, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::tryToAcquire, "osl_Semaphore"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Semaphore::release, "osl_Semaphore"); -// ----------------------------------------------------------------------------- - -} // namespace osl_Semaphore - - -// ----------------------------------------------------------------------------- - -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; diff --git a/sal/qa/osl/semaphore/osl_Semaphore_Const.h b/sal/qa/osl/semaphore/osl_Semaphore_Const.h deleted file mode 100644 index c9f1149674f4..000000000000 --- a/sal/qa/osl/semaphore/osl_Semaphore_Const.h +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: osl_Semaphore_Const.h,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#ifndef _OSL_SEMAPHORE_CONST_H_ -#define _OSL_SEMAPHORE_CONST_H_ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -#include <sal/types.h> -#include <rtl/ustring.hxx> - -#ifndef _OSL_THREAD_HXX_ -#include <osl/thread.hxx> -#endif -#include <osl/mutex.hxx> -#include <osl/pipe.hxx> - -#ifndef _OSL_SEMAPHOR_HXX_ -#include <osl/semaphor.hxx> -#endif -#include <osl/time.h> - -#include <testshl/simpleheader.hxx> - -#ifdef UNX -#include <unistd.h> -#endif - -//------------------------------------------------------------------------ -// most return value -1 denote a fail of operation. -//------------------------------------------------------------------------ -#define OSL_PIPE_FAIL -1 - -#define OSLTEST_DECLARE_USTRING( str_name, str_value ) \ - ::rtl::OUString a##str_name = rtl::OUString::createFromAscii( str_value ) - -//------------------------------------------------------------------------ -// semaphre names -//------------------------------------------------------------------------ -OSLTEST_DECLARE_USTRING( TestSem, "testsem" ); - -const char pTestString[17] = "Sun Microsystems"; - - -#endif /* _OSL_SEMAPHORE_CONST_H_ */ diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index 3247be8774de..9cd1b0f9671a 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -234,8 +234,6 @@ SHL1STDLIBS+=-lgcc $(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h .ENDIF # "$(SHL1TARGETN)" != "" -.IF "$(GUI)"=="UNX" || "$(USE_SHELL)"!="4nt" - $(OUT)$/inc$/udkversion.h: echo '#ifndef _SAL_UDKVERSION_H_' > $@ echo '#define _SAL_UDKVERSION_H_' >> $@ @@ -245,17 +243,3 @@ $(OUT)$/inc$/udkversion.h: echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@ echo '' >> $@ echo '#endif' >> $@ - -.ELSE - -$(OUT)$/inc$/udkversion.h: - echo #ifndef _SAL_UDKVERSION_H_ > $@ - echo #define _SAL_UDKVERSION_H_ >> $@ - echo. >> $@ - echo #define SAL_UDK_MAJOR "$(UDK_MAJOR)" >> $@ - echo #define SAL_UDK_MINOR "$(UDK_MINOR)" >> $@ - echo #define SAL_UDK_MICRO "$(UDK_MICRO)" >> $@ - echo. >> $@ - echo #endif >> $@ - -.ENDIF diff --git a/salhelper/inc/salhelper/queue.hxx b/salhelper/inc/salhelper/queue.hxx index eb0f080b2cd1..273c4b9e7e0e 100644 --- a/salhelper/inc/salhelper/queue.hxx +++ b/salhelper/inc/salhelper/queue.hxx @@ -96,6 +96,12 @@ public: //---------------------------------------------------------------------------- +/** Queue. + + @deprecated + Must not be used, as it internally uses unnamed semaphores, which are not + supported on Mac OS X. +*/ template<class element_type> class Queue : protected QueueBase<element_type> { @@ -133,6 +139,12 @@ public: //---------------------------------------------------------------------------- +/** Bounded queue. + + @deprecated + Must not be used, as it internally uses unnamed semaphores, which are not + supported on Mac OS X. +*/ template<class element_type> class BoundedQueue : protected Queue<element_type> { diff --git a/stoc/prj/build.lst b/stoc/prj/build.lst index 2550563c8c34..1fb7d34eeb32 100644 --- a/stoc/prj/build.lst +++ b/stoc/prj/build.lst @@ -22,3 +22,4 @@ tc stoc\source\javavm nmake - all tc_jvm tc_inc NULL tc stoc\source\javaloader nmake - all tc_jvload tc_inc NULL tc stoc\source\uriproc nmake - all tc_uriproc tc_stserv tc_inc NULL tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng tc_sec NULL +tc stoc\test\uriproc nmake - all tc_test_uriproc tc_util NULL diff --git a/stoc/test/uriproc/makefile.mk b/stoc/test/uriproc/makefile.mk index 78b54bb2a5a2..6ab41afacd6c 100644 --- a/stoc/test/uriproc/makefile.mk +++ b/stoc/test/uriproc/makefile.mk @@ -29,7 +29,11 @@ # #************************************************************************* -PRJ := ..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ := ../.. PRJNAME := stoc TARGET := test_uriproc @@ -39,25 +43,11 @@ ENABLE_EXCEPTIONS := TRUE DLLPRE = # no leading "lib" on .so files -UNOTYPES = \ - com.sun.star.beans.XPropertySet \ - com.sun.star.lang.XComponent \ - com.sun.star.lang.XMultiComponentFactory \ - com.sun.star.uno.XComponentContext \ - com.sun.star.uri.ExternalUriReferenceTranslator \ - com.sun.star.uri.UriReferenceFactory \ - com.sun.star.uri.VndSunStarPkgUrlReferenceFactory \ - com.sun.star.uri.XExternalUriReferenceTranslator \ - com.sun.star.uri.XUriReference \ - com.sun.star.uri.XUriReferenceFactory \ - com.sun.star.uri.XVndSunStarPkgUrlReferenceFactory \ - com.sun.star.uri.XVndSunStarScriptUrlReference \ - com.sun.star.util.XMacroExpander - SHL1TARGET = $(TARGET) -SHL1OBJS = $(SLO)$/test_uriproc.obj -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB) +SHL1OBJS = $(SLO)/test_uriproc.obj +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB) SHL1VERSIONMAP = version.map +SHL1RPATH = NONE SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) @@ -65,11 +55,24 @@ SLOFILES = $(SHL1OBJS) .INCLUDE: target.mk +.IF "$(OS)" == "WNT" +my_file = file:/// +.ELSE +my_file = file:// +.END + ALLTAR: test -$(BIN)$/$(TARGET).rdb .ERRREMOVE: - $(COPY) $(SOLARBINDIR)$/types.rdb $@ - regcomp -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/stocservices.uno$(DLLPOST)) +test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb + $(CPPUNITTESTER) $(SHL1TARGETN) \ + -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \ + -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb \ + -env:OOO_TEST_PREFIX=$(my_file)$(PWD)/$(DLLDEST)/ + +$(MISC)/$(TARGET)/services.rdb: + $(MKDIRHIER) $(@:d) + $(RM) $@ + $(REGCOMP) -register -r $@ -wop=vnd.sun.star.expand:\$${{OOO_TEST_PREFIX}} \ + -c $(DLLDEST)/stocservices.uno$(DLLPOST) -test .PHONY: $(SHL1TARGETN) $(BIN)$/$(TARGET).rdb - testshl2 $(SHL1TARGETN) -forward $(BIN)$/$(TARGET).rdb +.END diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx index 71f92e504d64..6575259b69fb 100644 --- a/stoc/test/uriproc/test_uriproc.cxx +++ b/stoc/test/uriproc/test_uriproc.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_stoc.hxx" -#include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/uno/Reference.hxx" @@ -46,10 +45,12 @@ #include "com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp" #include "com/sun/star/uri/XVndSunStarScriptUrlReference.hpp" #include "com/sun/star/util/XMacroExpander.hpp" -#include "cppuhelper/servicefactory.hxx" -#include "testshl/simpleheader.hxx" +#include "cppuhelper/bootstrap.hxx" +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include "osl/diagnose.h" -#include "osl/thread.h" #include "rtl/string.h" #include "rtl/string.hxx" #include "rtl/textenc.h" @@ -151,20 +152,12 @@ private: }; void Test::setUp() { - char const * registry = getForwardString(); - css::uno::Reference< css::lang::XMultiServiceFactory > factory( - cppu::createRegistryServiceFactory( - rtl::OUString( - registry, rtl_str_getLength(registry), - osl_getThreadTextEncoding()))); - //TODO: check for string conversion failure - css::uno::Reference< css::beans::XPropertySet >( - factory, css::uno::UNO_QUERY_THROW)->getPropertyValue( - rtl::OUString::createFromAscii("DefaultContext")) >>= m_context; + m_context = cppu::defaultBootstrap_InitialComponentContext(); m_uriFactory = css::uri::UriReferenceFactory::create(m_context); } void Test::tearDown() { + m_uriFactory.clear(); css::uno::Reference< css::lang::XComponent >( m_context, css::uno::UNO_QUERY_THROW)->dispose(); } @@ -1007,8 +1000,8 @@ void Test::testPkgUrlFactory() { } } -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/stoc/test/uriproc/version.map b/stoc/test/uriproc/version.map index 1bc00f407b81..7914837bd079 100644 --- a/stoc/test/uriproc/version.map +++ b/stoc/test/uriproc/version.map @@ -31,7 +31,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; |