unotest/source/embindtest/embindtest.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
New commits: commit a6c5e17177f8ad4783bf621ca8d14cafb4cbc307 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Mon Jun 16 12:48:06 2025 +0200 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Mon Jun 16 15:12:50 2025 +0200 Implement XServiceInfo for (Emscripten-only) embindtest.Test ...so that CppunitTest_services wouldn't fail with > postprocess/qa/services.cxx:341:(anonymous namespace)::Test::test > assertion failed > - Expression: info.is() > - instantiating "org.libreoffice.comp.embindtest.Test" via "org.libreoffice.embindtest.Test" does not provide XServiceInfo Change-Id: I83721006bfd8b71b488b15c41e81df9c5d0d755e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186559 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx index 1460825ecbbf..e667df16480f 100644 --- a/unotest/source/embindtest/embindtest.cxx +++ b/unotest/source/embindtest/embindtest.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/task/XJob.hpp> #include <com/sun/star/task/XJobExecutor.hpp> #include <com/sun/star/uno/Any.hxx> @@ -25,6 +26,7 @@ #include <com/sun/star/uno/XInterface.hpp> #include <cppu/unotype.hxx> #include <cppuhelper/implbase.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weak.hxx> #include <o3tl/any.hxx> #include <org/libreoffice/embindtest/Enum.hpp> @@ -96,8 +98,24 @@ private: css::uno::Reference<css::task::XJobExecutor> object_; }; -class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest> +class Test + : public cppu::WeakImplHelper<css::lang::XServiceInfo, org::libreoffice::embindtest::XTest> { + OUString SAL_CALL getImplementationName() override + { + return u"org.libreoffice.comp.embindtest.Test"_ustr; + } + + sal_Bool SAL_CALL supportsService(OUString const& ServiceName) override + { + return cppu::supportsService(this, ServiceName); + } + + css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override + { + return { u"org.libreoffice.embindtest.Test"_ustr }; + } + sal_Bool SAL_CALL getBoolean() override { return true; } sal_Bool SAL_CALL isBoolean(sal_Bool value) override { return value; }