summaryrefslogtreecommitdiff
path: root/unotest/source
diff options
context:
space:
mode:
Diffstat (limited to 'unotest/source')
-rw-r--r--unotest/source/embindtest/embindtest.cxx19
-rw-r--r--unotest/source/embindtest/embindtest.js10
2 files changed, 29 insertions, 0 deletions
diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx
index 166fa9650b8a..3883c031755c 100644
--- a/unotest/source/embindtest/embindtest.cxx
+++ b/unotest/source/embindtest/embindtest.cxx
@@ -30,6 +30,7 @@
#include <org/libreoffice/embindtest/Struct.hpp>
#include <org/libreoffice/embindtest/StructLong.hpp>
#include <org/libreoffice/embindtest/StructString.hpp>
+#include <org/libreoffice/embindtest/Template.hpp>
#include <org/libreoffice/embindtest/Test.hpp>
#include <org/libreoffice/embindtest/XTest.hpp>
#include <rtl/ustring.hxx>
@@ -146,6 +147,24 @@ class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest>
return value.m == u"hä";
}
+ org::libreoffice::embindtest::Template<css::uno::Any,
+ org::libreoffice::embindtest::StructString>
+ SAL_CALL getTemplate() override
+ {
+ return { { u"foo"_ustr }, -123456, css::uno::Any(sal_Int32(-123456)), { u"barr"_ustr } };
+ }
+
+ sal_Bool SAL_CALL
+ isTemplate(org::libreoffice::embindtest::Template<
+ css::uno::Any, org::libreoffice::embindtest::StructString> const& value) override
+ {
+ return value
+ == org::libreoffice::embindtest::Template<
+ css::uno::Any, org::libreoffice::embindtest::StructString>{
+ { u"foo"_ustr }, -123456, css::uno::Any(sal_Int32(-123456)), { u"barr"_ustr }
+ };
+ }
+
css::uno::Any SAL_CALL getAnyVoid() override { return {}; }
sal_Bool SAL_CALL isAnyVoid(css::uno::Any const& value) override
diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js
index 42da2ee51b4e..57720b6baaa6 100644
--- a/unotest/source/embindtest/embindtest.js
+++ b/unotest/source/embindtest/embindtest.js
@@ -110,6 +110,16 @@ Module.uno_init.then(function() {
v.m4.delete();
}
{
+ let v = test.getTemplate();
+ console.log(v);
+ console.assert(v.m1.m === 'foo');
+ console.assert(v.m2 === -123456);
+ console.assert(v.m3.get() === -123456);
+ console.assert(v.m4.m === 'barr');
+ console.assert(test.isTemplate(v));
+ v.m3.delete();
+ }
+ {
let v = test.getAnyVoid();
console.log(v);
console.assert(v.get() === undefined);