diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-06-27 12:36:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-27 12:36:28 +0200 |
commit | f474952b9e0e85ea71d26c18351d27b00711ff84 (patch) | |
tree | b31c39264f7d1e1ddead7f5ffc204fae47f7ab51 /testtools | |
parent | a48aefcae40663b63005d49a04fc7b89a473d613 (diff) |
Clean up uses of Any::getValue() in testtools
Change-Id: I3440328371abfc223f39c6bd2994423bb9b38cf0
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 8 | ||||
-rw-r--r-- | testtools/source/bridgetest/constructors.cxx | 33 |
2 files changed, 11 insertions, 30 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 207e1e398c3b..e9a56413a0f3 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -20,6 +20,7 @@ #include <stdio.h> #include <string.h> +#include <o3tl/any.hxx> #include <osl/diagnose.h> #include "osl/diagnose.hxx" #include <osl/time.h> @@ -592,12 +593,9 @@ static bool performTest( xLBT->getNullPolyType().member == Type(), "getNullPolyType"); Any nullAny(xLBT->getNullPolyAny().member); + auto ifc = o3tl::tryAccess<Reference<XInterface>>(nullAny); bRet &= check( - (((nullAny.getValueTypeName() == - "com.sun.star.uno.XInterface") && - !static_cast< Reference< XInterface > const * >( - nullAny.getValue())->is()) - || nullAny == Any()), + !nullAny.hasValue() || (ifc && !ifc->is()), "getNullPolyAny"); bRet &= check( xLBT->getNullPolySequence().member.getLength() == 0, diff --git a/testtools/source/bridgetest/constructors.cxx b/testtools/source/bridgetest/constructors.cxx index 17ab92e8ebab..7653b8ab2625 100644 --- a/testtools/source/bridgetest/constructors.cxx +++ b/testtools/source/bridgetest/constructors.cxx @@ -77,6 +77,7 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) ::sal_uInt64 arg7 = sal_uInt64(); float arg8 = float(); double arg9 = double(); + sal_Unicode arg10 = sal_Unicode(); OUString arg11; css::uno::Type arg12; bool arg13; @@ -90,6 +91,7 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) css::uno::Sequence< ::sal_uInt64 > arg21; css::uno::Sequence< float > arg22; css::uno::Sequence< double > arg23; + css::uno::Sequence< sal_Unicode > arg24; css::uno::Sequence< OUString > arg25; css::uno::Sequence< css::uno::Type > arg26; css::uno::Sequence< css::uno::Any > arg27; @@ -115,8 +117,6 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && (arguments[0] >>= arg0) && arg0 && (arguments[1] >>= arg1) && arg1 == SAL_MIN_INT8 && (arguments[2] >>= arg2) && arg2 == SAL_MIN_INT16 - && (arguments[3].getValueType() - == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) && (arguments[3] >>= arg3) && arg3 == SAL_MAX_UINT16 && (arguments[4] >>= arg4) && arg4 == SAL_MIN_INT32 && (arguments[5] >>= arg5) && arg5 == SAL_MAX_UINT32 @@ -124,10 +124,7 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && (arguments[7] >>= arg7) && arg7 == SAL_MAX_UINT64 && (arguments[8] >>= arg8) && arg8 == 0.123f && (arguments[9] >>= arg9) && arg9 == 0.456 - && (arguments[10].getValueType() - == ::cppu::UnoType< ::cppu::UnoCharType >::get()) - && (*static_cast< ::sal_Unicode const * >(arguments[10].getValue()) - == 'X') + && (arguments[10] >>= arg10) && arg10 == 'X' && (arguments[11] >>= arg11) && arg11 == "test" && (arguments[12] >>= arg12) @@ -138,10 +135,6 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && arg15[0] == SAL_MIN_INT8 && (arguments[16] >>= arg16) && arg16.getLength() == 1 && arg16[0] == SAL_MIN_INT16 - && (arguments[17].getValueType() - == ::cppu::UnoType< - ::cppu::UnoSequenceType < - ::cppu::UnoUnsignedShortType > >::get()) && (arguments[17] >>= arg17) && arg17.getLength() == 1 && arg17[0] == SAL_MAX_UINT16 && (arguments[18] >>= arg18) && arg18.getLength() == 1 @@ -156,15 +149,8 @@ void Impl::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && arg22[0] == 0.123f && (arguments[23] >>= arg23) && arg23.getLength() == 1 && arg23[0] == 0.456 - && (arguments[24].getValueType() - == ::cppu::UnoType< - ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get()) - && (static_cast< css::uno::Sequence< ::sal_Unicode > const * >( - arguments[24].getValue())->getLength() - == 1) - && ((*static_cast< css::uno::Sequence< ::sal_Unicode > const * >( - arguments[24].getValue()))[0] - == 'X') + && (arguments[24] >>= arg24) && arg24.getLength() == 1 + && arg24[0] == 'X' && (arguments[25] >>= arg25) && arg25.getLength() == 1 && arg25[0] == "test" && (arguments[26] >>= arg26) && arg26.getLength() == 1 @@ -258,7 +244,7 @@ void Impl2::initialize(css::uno::Sequence< css::uno::Any > const & arguments) ttb::TestPolyStruct<css::uno::Sequence< ::sal_Int16 > > arg22; ttb::TestPolyStruct<css::uno::Sequence< ::sal_Int32 > > arg23; ttb::TestPolyStruct<css::uno::Sequence< ::sal_Int64 > > arg24; -// ttb::TestPolyStruct<css::uno::Sequence<::sal_Unicode> > arg25; + ttb::TestPolyStruct<css::uno::Sequence< sal_Unicode> > arg25; ttb::TestPolyStruct<css::uno::Sequence< OUString > > arg26; ttb::TestPolyStruct<css::uno::Sequence<float> > arg27; ttb::TestPolyStruct<css::uno::Sequence<double> > arg28; @@ -328,11 +314,8 @@ void Impl2::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && arg23.member[0] == SAL_MIN_INT32 && (arguments[24] >>= arg24) && arg24.member.getLength() == 1 && arg24.member[0] == SAL_MIN_INT64 - && (arguments[25].getValueType() - == ::cppu::UnoType< ttb::TestPolyStruct< ::cppu::UnoSequenceType< - ::cppu::UnoCharType> > >::get()) - && (static_cast< ttb::TestPolyStruct<css::uno::Sequence< - ::sal_Unicode> > const *>(arguments[25].getValue())->member[0]) == 'X' + && (arguments[25] >>= arg25) && arg25.member.getLength() == 1 + && arg25.member[0] == 'X' && (arguments[26] >>= arg26) && arg26.member.getLength() == 1 && arg26.member[0] == "test" && (arguments[27] >>= arg27) && arg27.member.getLength() == 1 |