From c372302f990b29cd745feeb975157903f1f6da34 Mon Sep 17 00:00:00 2001 From: Wilhelm Pflueger Date: Fri, 11 Mar 2011 14:47:06 +0100 Subject: EasyHacks: Reanimated tests in ure/cppuhelper/qa. I had to deactivate the test 'test_weak.cxx' in prj/build.lst. This test failed with 'error 139' - this is typically a segfault during test execution, oops. --- cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx | 10 ++++++---- cppuhelper/qa/ifcontainer/export.map | 2 +- cppuhelper/qa/unourl/cppu_unourl.cxx | 27 +++++++++++++------------- cppuhelper/qa/unourl/export.map | 2 +- cppuhelper/qa/weak/test_weak.cxx | 9 ++++++--- cppuhelper/qa/weak/version.map | 2 +- 6 files changed, 29 insertions(+), 23 deletions(-) (limited to 'cppuhelper/qa') diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx index 039586462ba2..09ec884d46c2 100644 --- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx +++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx @@ -26,7 +26,10 @@ * ************************************************************************/ -#include +#include +#include +#include +#include #include "com/sun/star/lang/XEventListener.hpp" #include "cppuhelper/interfacecontainer.hxx" @@ -278,9 +281,8 @@ namespace cppu_ifcontainer }; } // namespace cppu_ifcontainer -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(cppu_ifcontainer::IfTest, - "cppu_ifcontainer"); +CPPUNIT_TEST_SUITE_REGISTRATION(cppu_ifcontainer::IfTest); -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/qa/ifcontainer/export.map b/cppuhelper/qa/ifcontainer/export.map index 879fa8953788..117caf43a63e 100644 --- a/cppuhelper/qa/ifcontainer/export.map +++ b/cppuhelper/qa/ifcontainer/export.map @@ -1,6 +1,6 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx index be2626910534..df6c63e15d2c 100644 --- a/cppuhelper/qa/unourl/cppu_unourl.cxx +++ b/cppuhelper/qa/unourl/cppu_unourl.cxx @@ -26,7 +26,9 @@ * ************************************************************************/ -#include +#include +#include +#include #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -77,7 +79,7 @@ namespace cppu_unourl { "abc,def=%22", true }, { "abc,def=\"", true }, { "abc,def=%ed%a0%80", true } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; try @@ -126,7 +128,7 @@ namespace cppu_unourl { "abc,def=%22", "abc,def=%22" }, { "abc,def=\"", "abc,def=\"" }, { "abc,def=%ed%a0%80", "abc,def=%ed%a0%80" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aDescriptor; @@ -174,7 +176,7 @@ namespace cppu_unourl { "abc,def=%22", "abc" }, { "abc,def=\"", "abc" }, { "abc,def=%ed%a0%80", "abc" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aName; @@ -219,7 +221,7 @@ namespace cppu_unourl { "abc,def=xxx,ghi=xxx", "def", true }, { "abc,def=xxx,ghi=xxx", "ghi", true }, { "abc,def=xxx,ghi=xxx", "jkl", false } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; bool bPresent = false; @@ -289,7 +291,7 @@ namespace cppu_unourl { "abc,abc=,def=Abc", "def", "Abc" }, { "abc,abc=,def=aBC", "def", "aBC" }, { "abc,abc=,def=ABC", "def", "ABC" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aValue; @@ -332,7 +334,7 @@ namespace cppu_unourl { "uno:abc;def;1", true }, { "uno:abc;def;$&+,/:=?@", true }, { "uno:abc;def;%24&+,/:=?@", false } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; try @@ -369,7 +371,7 @@ namespace cppu_unourl { "uno:ABC;def;ghi", "ABC" }, { "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi", "abc,def=xxx,ghi=xxx" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aConnection; @@ -403,7 +405,7 @@ namespace cppu_unourl { "uno:abc;DEF;ghi", "DEF" }, { "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi", "def,ghi=xxx,jkl=xxx" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aProtocol; @@ -440,7 +442,7 @@ namespace cppu_unourl { "uno:abc;def;A", "A" }, { "uno:abc;def;1", "1" }, { "uno:abc;def;$&+,/:=?@", "$&+,/:=?@" } }; - for (int i = 0; i < sizeof aTests / sizeof (Test); ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) { bool bValid = false; rtl::OUString aObjectName; @@ -474,9 +476,8 @@ namespace cppu_unourl }; } // namespace cppu_ifcontainer -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(cppu_unourl::UrlTest, - "cppu_unourl"); +CPPUNIT_TEST_SUITE_REGISTRATION(cppu_unourl::UrlTest); -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/qa/unourl/export.map b/cppuhelper/qa/unourl/export.map index 879fa8953788..117caf43a63e 100644 --- a/cppuhelper/qa/unourl/export.map +++ b/cppuhelper/qa/unourl/export.map @@ -1,6 +1,6 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/cppuhelper/qa/weak/test_weak.cxx b/cppuhelper/qa/weak/test_weak.cxx index eb93659e1e64..0a0cae46a8fb 100644 --- a/cppuhelper/qa/weak/test_weak.cxx +++ b/cppuhelper/qa/weak/test_weak.cxx @@ -29,6 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppuhelper.hxx" +#include +#include +#include + #include "sal/config.h" #include "com/sun/star/lang/DisposedException.hpp" @@ -39,7 +43,6 @@ #include "com/sun/star/uno/XWeak.hpp" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/weak.hxx" -#include "testshl/simpleheader.hxx" #include "rtl/ref.hxx" #include "sal/types.h" @@ -103,10 +106,10 @@ void Test::testReferenceDispose() { CPPUNIT_ASSERT(r3->isDisposed()); } -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/cppuhelper/qa/weak/version.map b/cppuhelper/qa/weak/version.map index 7321bbca16ad..3308588ef6f8 100644 --- a/cppuhelper/qa/weak/version.map +++ b/cppuhelper/qa/weak/version.map @@ -27,7 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; -- cgit