From 13b7aa8e3833476344710edf65536ded9bec4f8b Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 13 Jan 2010 18:58:37 +0100 Subject: sb118: adpated some sal unit tests to new CppUnit framework --- sal/qa/ByteSequence/ByteSequence.cxx | 26 ++++++++++++-------------- sal/qa/ByteSequence/export.exp | 1 - sal/qa/ByteSequence/makefile.mk | 7 ++++++- sal/qa/ByteSequence/rtl_old_testbyteseq.cxx | 12 +++++++----- 4 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 sal/qa/ByteSequence/export.exp (limited to 'sal/qa/ByteSequence') diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx index f1105298d..98e24eb51 100644 --- a/sal/qa/ByteSequence/ByteSequence.cxx +++ b/sal/qa/ByteSequence/ByteSequence.cxx @@ -36,7 +36,10 @@ #include -#include +#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 a13529da5..000000000 --- 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 0f1b88ac6..a198d7987 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 @@ -56,7 +61,6 @@ SHL1IMPLIB= i$(SHL1TARGET) # SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp SHL1VERSIONMAP = $(PRJ)$/qa$/export.map # --- BEGIN -------------------------------------------------------- @@ -80,3 +84,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 2cea6fa3a..f8f83953c 100644 --- a/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx +++ b/sal/qa/ByteSequence/rtl_old_testbyteseq.cxx @@ -37,13 +37,15 @@ #include -// #include +#include #include using namespace ::rtl; -#include - +#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(); -- cgit v1.2.3