diff options
author | Wilhelm Pflueger <Wilhelm.Pflueger@web.de> | 2011-02-05 22:56:20 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-02-07 10:01:03 +0100 |
commit | c51592268380d7b8b1bae8358165f79e8540b496 (patch) | |
tree | bde7902cafbde2a2807eb7d8eb89336dda00c08a /comphelper/qa | |
parent | little cleanup of comments (diff) | |
download | core-c51592268380d7b8b1bae8358165f79e8540b496.tar.gz core-c51592268380d7b8b1bae8358165f79e8540b496.zip |
Re-animated tests that were based on deprecated testshl.
Diffstat (limited to 'comphelper/qa')
-rw-r--r-- | comphelper/qa/makefile.mk | 10 | ||||
-rw-r--r-- | comphelper/qa/test_string.cxx | 20 | ||||
-rw-r--r-- | comphelper/qa/test_weakbag.cxx | 8 | ||||
-rw-r--r-- | comphelper/qa/version.map | 3 |
4 files changed, 20 insertions, 21 deletions
diff --git a/comphelper/qa/makefile.mk b/comphelper/qa/makefile.mk index 0360d308529e..9d68caa549ee 100644 --- a/comphelper/qa/makefile.mk +++ b/comphelper/qa/makefile.mk @@ -40,8 +40,8 @@ DLLPRE = # no leading "lib" on .so files INCPRE += $(MISC)$/$(TARGET)$/inc SHL1TARGET = $(TARGET)_weakbag -SHL1OBJS = $(SLO)$/test_weakbag.obj -SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) +SHL1OBJS = $(SLO)$/test_weakbag.obj $(SLO)$/test_string.obj +SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) $(COMPHELPERLIB) SHL1VERSIONMAP = version.map SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) @@ -49,8 +49,4 @@ DEF1NAME = $(SHL1TARGET) SLOFILES = $(SHL1OBJS) .INCLUDE: target.mk - -ALLTAR: test - -test .PHONY: $(SHL1TARGETN) - $(TESTSHL2) $(SHL1TARGETN) +.INCLUDE: _cppunit.mk diff --git a/comphelper/qa/test_string.cxx b/comphelper/qa/test_string.cxx index 9e355a5c9528..3a631d96790a 100644 --- a/comphelper/qa/test_string.cxx +++ b/comphelper/qa/test_string.cxx @@ -30,7 +30,9 @@ #include "sal/config.h" #include "comphelper/string.hxx" -#include "testshl/simpleheader.hxx" +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> #include "rtl/string.h" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -38,20 +40,20 @@ namespace { -class Test: public CppUnit::TestFixture { +class TestString: public CppUnit::TestFixture { public: void test(); - CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST_SUITE(TestString); CPPUNIT_TEST(test); CPPUNIT_TEST_SUITE_END(); }; -void Test::test() { +void TestString::test() { rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("foobarbar")); sal_Int32 n1; rtl::OUString s2( - comphelper::string::searchAndReplace( + comphelper::string::searchAndReplaceAsciiL( s1, RTL_CONSTASCII_STRINGPARAM("bar"), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("baaz")), 0, &n1)); CPPUNIT_ASSERT( @@ -59,7 +61,7 @@ void Test::test() { CPPUNIT_ASSERT(n1 == 3); sal_Int32 n2; rtl::OUString s3( - comphelper::string::searchAndReplace( + comphelper::string::searchAndReplaceAsciiL( s2, RTL_CONSTASCII_STRINGPARAM("bar"), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bz")), n1 + RTL_CONSTASCII_LENGTH("baaz"), &n2)); @@ -68,7 +70,7 @@ void Test::test() { CPPUNIT_ASSERT(n2 == 7); sal_Int32 n3; rtl::OUString s4( - comphelper::string::searchAndReplace( + comphelper::string::searchAndReplaceAsciiL( s3, RTL_CONSTASCII_STRINGPARAM("bar"), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("baz")), n2 + RTL_CONSTASCII_LENGTH("bz"), &n3)); @@ -76,10 +78,10 @@ void Test::test() { CPPUNIT_ASSERT(n3 == -1); } -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(TestString); } -NOADDITIONAL; +//NOADDITIONAL; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/qa/test_weakbag.cxx b/comphelper/qa/test_weakbag.cxx index 9c60f11dd925..774260e104b9 100644 --- a/comphelper/qa/test_weakbag.cxx +++ b/comphelper/qa/test_weakbag.cxx @@ -33,7 +33,9 @@ #include "com/sun/star/uno/XInterface.hpp" #include "comphelper/weakbag.hxx" #include "cppuhelper/weak.hxx" -#include "testshl/simpleheader.hxx" +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> namespace { @@ -64,10 +66,10 @@ public: CPPUNIT_TEST_SUITE_END(); }; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/qa/version.map b/comphelper/qa/version.map index 7321bbca16ad..5e95a1532f8a 100644 --- a/comphelper/qa/version.map +++ b/comphelper/qa/version.map @@ -27,8 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; - + cppunitTestPlugIn; local: *; }; |