Files
Manish Bera f38bf2917b Add unit tests for cppumaker
Change-Id: I4f53f7ee2d7f5147d09e0ff3bbde9f48f10ff85a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203324
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2026-10-04 13:32:46 +02:00

51 lines
2.5 KiB
C++

#pragma once
#include "sal/config.h"
#include <cassert>
#include "com/sun/star/uno/DeploymentException.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XNamingService.hpp"
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/Reference.hxx"
#include "cppu/unotype.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#if defined ANDROID || defined IOS //TODO
#include <com/sun/star/lang/XInitialization.hpp>
#include <osl/detail/component-defines.h>
#endif
#if defined LO_URE_CURRENT_ENV && defined LO_URE_CTOR_ENV_test_dot_codemaker_dot_codemakertests_dot_throws && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_test_dot_codemaker_dot_codemakertests_dot_throws) && defined LO_URE_CTOR_FUN_test_dot_codemaker_dot_codemakertests_dot_throws
extern "C" ::css::uno::XInterface * SAL_CALL LO_URE_CTOR_FUN_test_dot_codemaker_dot_codemakertests_dot_throws(::css::uno::XComponentContext *, ::css::uno::Sequence< ::css::uno::Any > const &);
#endif
namespace test { namespace codemaker { namespace codemakertests {
class throws {
public:
static ::css::uno::Reference< ::css::uno::XNamingService > get(::css::uno::Reference< ::css::uno::XComponentContext > const & the_context) {
assert(the_context.is());
::css::uno::Reference< ::css::uno::XNamingService > instance;
#if defined LO_URE_CURRENT_ENV && defined LO_URE_CTOR_ENV_test_dot_codemaker_dot_codemakertests_dot_throws && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_test_dot_codemaker_dot_codemakertests_dot_throws) && defined LO_URE_CTOR_FUN_test_dot_codemaker_dot_codemakertests_dot_throws
instance = ::css::uno::Reference< ::css::uno::XNamingService >(::css::uno::Reference< ::css::uno::XInterface >(static_cast< ::css::uno::XInterface * >((*LO_URE_CTOR_FUN_test_dot_codemaker_dot_codemakertests_dot_throws)(the_context.get(), ::css::uno::Sequence< ::css::uno::Any >())), ::SAL_NO_ACQUIRE), ::css::uno::UNO_QUERY);
#else
the_context->getValueByName(::rtl::OUString( "/singletons/test.codemaker.codemakertests.throws" )) >>= instance;
#endif
if (!instance.is()) {
throw ::css::uno::DeploymentException(::rtl::OUString( "component context fails to supply singleton test.codemaker.codemakertests.throws of type com.sun.star.uno.XNamingService" ), the_context);
}
return instance;
}
private:
throws(); // not implemented
throws(throws &); // not implemented
~throws(); // not implemented
void operator =(throws); // not implemented
};
} } }