Kaydet (Commit) de529f32 authored tarafından Jens Carl's avatar Jens Carl

Enable testing of multiple service names

Enable testing of multiple service names of the object supports this, by
storing all possible names in a vector.

Change-Id: Iff2c974cc30a0729cb26b07002582e0786a4de44
Reviewed-on: https://gerrit.libreoffice.org/71713
Tested-by: Jenkins
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 15c39bb2
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX #ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX
#define INCLUDED_TEST_LANG_XSERVICEINFO_HXX #define INCLUDED_TEST_LANG_XSERVICEINFO_HXX
#include <vector>
#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
...@@ -24,7 +26,12 @@ class OOO_DLLPUBLIC_TEST XServiceInfo ...@@ -24,7 +26,12 @@ class OOO_DLLPUBLIC_TEST XServiceInfo
public: public:
XServiceInfo(const OUString& rImplName, const OUString& rServiceName) XServiceInfo(const OUString& rImplName, const OUString& rServiceName)
: m_aImplName(rImplName) : m_aImplName(rImplName)
, m_aServiceName(rServiceName) {
m_aServiceNames.push_back(rServiceName);
}
XServiceInfo(const OUString& rImplName, const std::vector<OUString> rServiceNames)
: m_aImplName(rImplName)
, m_aServiceNames(rServiceNames)
{ {
} }
...@@ -39,7 +46,7 @@ protected: ...@@ -39,7 +46,7 @@ protected:
private: private:
OUString const m_aImplName; OUString const m_aImplName;
OUString const m_aServiceName; std::vector<OUString> m_aServiceNames;
}; };
} // namespace apitest } // namespace apitest
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace css; using namespace css;
using namespace css::uno;
namespace apitest namespace apitest
{ {
...@@ -41,7 +40,8 @@ void XServiceInfo::testSupportsService() ...@@ -41,7 +40,8 @@ void XServiceInfo::testSupportsService()
{ {
uno::Reference<lang::XServiceInfo> xSI(init(), uno::UNO_QUERY_THROW); uno::Reference<lang::XServiceInfo> xSI(init(), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xSI->supportsService(m_aServiceName)); for (const auto& aServiceName : m_aServiceNames)
CPPUNIT_ASSERT(xSI->supportsService(aServiceName));
} }
} // namespace apitest } // namespace apitest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment