From 13635ebf534ce42313908deedbc8d4112cbdf791 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 12 Jul 2017 21:57:12 +0100 Subject: Roll up testOptions into a single lib for an empty, but otherwise realistic testService class --- icetray/unittests/Jamfile.jam | 8 +++++--- icetray/unittests/testIceTrayLogger.cpp | 8 +------- icetray/unittests/testIceTrayOptions.cpp | 12 +++--------- icetray/unittests/testService.cpp | 12 ++++++++++++ icetray/unittests/testService.h | 7 +++++++ 5 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 icetray/unittests/testService.cpp create mode 100644 icetray/unittests/testService.h diff --git a/icetray/unittests/Jamfile.jam b/icetray/unittests/Jamfile.jam index 91c9085..8fd034a 100644 --- a/icetray/unittests/Jamfile.jam +++ b/icetray/unittests/Jamfile.jam @@ -87,10 +87,12 @@ run testIceTrayLogger.cpp : : : testCommon + testService ; -lib testOptions +lib testService : + testService.cpp testOptions.cpp : : testCommon @@ -100,13 +102,13 @@ run testIceTrayOptions.cpp : : : testCommon - testOptions + testService ; run ../tool/icetrayDoc.cpp : : - testOptions + testService : ..//adhocutil ..//icetray diff --git a/icetray/unittests/testIceTrayLogger.cpp b/icetray/unittests/testIceTrayLogger.cpp index 81f0023..68e8ccc 100644 --- a/icetray/unittests/testIceTrayLogger.cpp +++ b/icetray/unittests/testIceTrayLogger.cpp @@ -10,6 +10,7 @@ #include #include #include +#include "testService.h" using namespace IceTray::Logging; @@ -295,13 +296,6 @@ BOOST_AUTO_TEST_CASE( domains_fromProperties_badLevel ) BOOST_AUTO_TEST_SUITE_END(); -class TestService : public IceTray::Service { - public: - void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &) - { - } -}; - BOOST_FIXTURE_TEST_SUITE( ts, TestService ); BOOST_AUTO_TEST_CASE( getLogger ) diff --git a/icetray/unittests/testIceTrayOptions.cpp b/icetray/unittests/testIceTrayOptions.cpp index 22776b9..09497be 100644 --- a/icetray/unittests/testIceTrayOptions.cpp +++ b/icetray/unittests/testIceTrayOptions.cpp @@ -8,15 +8,9 @@ #include "icetrayService.h" #include "dryice.h" -class TestService : public IceTray::Service { - public: - void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &) - { - // Verifies option resolution is available for addObjects. - IceTray::OptionsResolver myOpts; - } -}; -NAMEDFACTORY("default", TestService, IceTray::ServiceFactory); +// +// TestService is pulled in from libtestService.so +// class DI : public IceTray::DryIce { public: diff --git a/icetray/unittests/testService.cpp b/icetray/unittests/testService.cpp new file mode 100644 index 0000000..88a61e9 --- /dev/null +++ b/icetray/unittests/testService.cpp @@ -0,0 +1,12 @@ +#include "testService.h" +#include "testOptions.h" + +void +TestService::addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &) +{ + // Verifies option resolution is available for addObjects. + IceTray::OptionsResolver myOpts; +} + +NAMEDFACTORY("default", TestService, IceTray::ServiceFactory); + diff --git a/icetray/unittests/testService.h b/icetray/unittests/testService.h new file mode 100644 index 0000000..7c5a0ae --- /dev/null +++ b/icetray/unittests/testService.h @@ -0,0 +1,7 @@ +#include + +class DLL_PUBLIC TestService : public IceTray::Service { + public: + void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &) override; +}; + -- cgit v1.2.3